From 93face25db7222e5c0e4950caaa8acbf6d9bc2dc Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 23 Apr 2010 10:51:35 +0200 Subject: asn1ct: Make formatting of errors and warnings consistent Consistently format warning and error reports. Warning and error options from erlc now also work in asnc1ct. Signed-off-by: Tuncer Ayaz --- lib/asn1/src/asn1ct.erl | 115 ++++++++++++++++++++---------- lib/asn1/src/asn1ct_check.erl | 125 ++++++++++++++++----------------- lib/asn1/src/asn1ct_gen.erl | 8 +-- lib/asn1/test/test_compile_options.erl | 2 +- 4 files changed, 143 insertions(+), 107 deletions(-) diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl index ae681a4a78..12c56268d9 100644 --- a/lib/asn1/src/asn1ct.erl +++ b/lib/asn1/src/asn1ct.erl @@ -39,7 +39,7 @@ add_tobe_refed_func/1,add_generated_refed_func/1, maybe_rename_function/3,latest_sindex/0,current_sindex/0, set_current_sindex/1,next_sindex/0,maybe_saved_sindex/2, - parse_and_save/2,report_verbose/3]). + parse_and_save/2,verbose/3,warning/3,error/3]). -include("asn1_records.hrl"). -include_lib("stdlib/include/erl_compile.hrl"). @@ -103,8 +103,8 @@ compile(File,Options) when is_list(Options) -> compile1(File,Options) when is_list(Options) -> - report_verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,File],Options), - report_verbose("Compiler Options: ~p~n",[Options],Options), + verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,File],Options), + verbose("Compiler Options: ~p~n",[Options],Options), Ext = filename:extension(File), Base = filename:basename(File,Ext), OutFile = outfile(Base,"",Options), @@ -152,14 +152,14 @@ inline(true,Name,Module,Options) -> IgorName = filename:rootname(filename:basename(Name)), % io:format("*****~nName: ~p~nModules: ~p~nIgorOptions: ~p~n*****~n", % [IgorName,Modules++RTmodule,IgorOptions]), - report_verbose("Inlining modules: ~p in ~p~n",[[Module]++RTmodule,IgorName],Options), + verbose("Inlining modules: ~p in ~p~n",[[Module]++RTmodule,IgorName],Options), case catch igor:merge(IgorName,[Module]++RTmodule,[{preprocess,true},{stubs,false},{backups,false}]++IgorOptions) of {'EXIT',{undef,Reason}} -> %% module igor first in R10B - io:format("Module igor in syntax_tools must be available:~n~p~n", - [Reason]), + error("Module igor in syntax_tools must be available:~n~p~n", + [Reason],Options), {error,'no_compilation'}; {'EXIT',Reason} -> - io:format("Merge by igor module failed due to ~p~n",[Reason]), + error("Merge by igor module failed due to ~p~n",[Reason],Options), {error,'no_compilation'}; _ -> %% io:format("compiling output module: ~p~n",[generated_file(Name,IgorOptions)]), @@ -173,8 +173,8 @@ inline(_,_,_,_) -> compile_set(SetBase,Files,Options) when is_list(hd(Files)),is_list(Options) -> %% case when there are several input files in a list - report_verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,Files],Options), - report_verbose("Compiler Options: ~p~n",[Options],Options), + verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,Files],Options), + verbose("Compiler Options: ~p~n",[Options],Options), OutFile = outfile(SetBase,"",Options), DbFile = outfile(SetBase,"asn1db",Options), Includes = [I || {i,I} <- Options], @@ -728,7 +728,7 @@ parse_set(ScanRes,Options) -> scan(File,Options) -> case asn1ct_tok:file(File) of {error,Reason} -> - io:format("~p~n",[Reason]), + error("~p~n",[Reason],Options), {false,{error,Reason}}; Tokens -> case lists:member(ss,Options) of @@ -753,16 +753,17 @@ parse({true,Tokens},File,Options) -> if is_integer(Line) -> BaseName = filename:basename(File), - io:format("syntax error at line ~p in module ~s:~n", - [Line,BaseName]); + error("syntax error at line ~p in module ~s:~n", + [Line,BaseName],Options); true -> - io:format("syntax error in module ~p:~n",[File]) + error("syntax error in module ~p:~n", + [File],Options) end, print_error_message(Message), {false,{error,Message}}; {error,{Line,_Mod,[Message,Token]}} -> - io:format("syntax error: ~p ~p at line ~p~n", - [Message,Token,Line]), + error("syntax error: ~p ~p at line ~p~n", + [Message,Token,Line],Options), {false,{error,{Line,[Message,Token]}}}; {ok,M} -> case lists:member(sp,Options) of @@ -772,7 +773,7 @@ parse({true,Tokens},File,Options) -> {true,M} end; OtherError -> - io:format("~p~n",[OtherError]) + error("~p~n",[OtherError],Options) end; parse({false,Tokens},_,_) -> {false,Tokens}. @@ -802,7 +803,7 @@ check({true,M},File,OutFile,Includes,EncodingRule,DbFile,Options,InputMods) -> NewM = Module#module{typeorval=NewTypeOrVal}, asn1_db:dbput(NewM#module.name,'MODULE',NewM), asn1_db:dbsave(DbFile,M#module.name), - report_verbose("--~p--~n",[{generated,DbFile}],Options), + verbose("--~p--~n",[{generated,DbFile}],Options), {true,{M,NewM,GenTypeOrVal}} end end; @@ -823,11 +824,11 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) -> % io:format("Options: ~p~n",[Options]), case catch specialized_decode_prepare(EncodingRule,M,GenTOrV,Options) of {error, enoent} -> ok; - {error, Reason} -> io:format("WARNING: Error in configuration" - "file: ~n~p~n",[Reason]); - {'EXIT',Reason} -> io:format("WARNING: Internal error when " - "analyzing configuration" - "file: ~n~p~n",[Reason]); + {error, Reason} -> warning("Error in configuration " + "file: ~n~p~n",[Reason],Options); + {'EXIT',Reason} -> warning("Internal error when " + "analyzing configuration " + "file: ~n~p~n",[Reason],Options); _ -> ok end, @@ -835,7 +836,7 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) -> case (catch asn1ct_gen:pgen(OutFile,EncodingRule, M#module.name,GenTOrV,Options)) of {'EXIT',Reason2} -> - io:format("ERROR: ~p~n",[Reason2]), + error("~p~n",[Reason2],Options), {error,Reason2}; _ -> ok @@ -878,7 +879,8 @@ parse_and_save(Module,S) -> _ -> ok end; Err -> - io:format("Warning: could not do a consistency check of the ~p file: no asn1 source file was found.~n",[lists:concat([Module,".asn1db"])]), + warning("could not do a consistency check of the ~p file: no asn1 source file was found.~n", + [lists:concat([Module,".asn1db"])],Options), {error,{asn1,input_file_error,Err}} end. parse_and_save1(S,File,Options,Includes) -> @@ -1207,7 +1209,7 @@ compile_py(File,OutFile,Options) -> compile(File, _OutFile, Options) -> case catch compile(File, make_erl_options(Options)) of Exit = {'EXIT',_Reason} -> - io:format("~p~n~s~n",[Exit,"error"]), + error("~p~n~s~n",[Exit,"error"],Options), error; {error,_Reason} -> %% case occurs due to error in asn1ct_parser2,asn1ct_check @@ -1223,7 +1225,7 @@ compile(File, _OutFile, Options) -> io:format("~p~n",[ScanRes]), ok; Unknown -> - io:format("~p~n~s~n",[Unknown,"error"]), + error("~p~n~s~n",[Unknown,"error"],Options), error end. @@ -1237,7 +1239,7 @@ make_erl_options(Opts) -> Includes = Opts#options.includes, Defines = Opts#options.defines, Outdir = Opts#options.outdir, -%% Warning = Opts#options.warning, + Warning = Opts#options.warning, Verbose = Opts#options.verbose, Specific = Opts#options.specific, Optimize = Opts#options.optimize, @@ -1249,10 +1251,10 @@ make_erl_options(Opts) -> true -> [verbose]; false -> [] end ++ -%%% case Warning of -%%% 0 -> []; -%%% _ -> [report_warnings] -%%% end ++ + case Warning of + 0 -> []; + _ -> [warnings] + end ++ [] ++ case Optimize of 1 -> [optimize]; @@ -1276,7 +1278,7 @@ make_erl_options(Opts) -> uper_bin -> [uper_bin] end, - Options++[report_errors, {cwd, Cwd}, {outdir, Outdir}| + Options++[errors, {cwd, Cwd}, {outdir, Outdir}| lists:map(fun(Dir) -> {i, Dir} end, Includes)]++Specific. pretty2(Module,AbsFile) -> @@ -2518,13 +2520,48 @@ type_check(#'Externaltypereference'{}) -> make_suffix(_) -> "". -report_verbose(Format, Args, S) -> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Report functions. +%% +%% Errors messages are controlled with the 'errors' compiler option +%% Warning messages are controlled with the 'warnings' compiler option +%% Verbose messages are controlled with the 'verbose' compiler option + +error(Format, Args, S) -> + case is_error(S) of + true -> + io:format("Error: " ++ Format, Args); + false -> + ok + end. + +warning(Format, Args, S) -> + case is_warning(S) of + true -> + io:format("Warning: " ++ Format, Args); + false -> + ok + end. + +verbose(Format, Args, S) -> case is_verbose(S) of - true -> - io:format(Format, Args); - false -> - ok + true -> + io:format(Format, Args); + false -> + ok end. -is_verbose(S) -> - lists:member(verbose, S). +is_error(S) when is_record(S, state) -> + is_error(S#state.options); +is_error(O) -> + lists:member(errors, O) orelse is_verbose(O). + +is_warning(S) when is_record(S, state) -> + is_warning(S#state.options); +is_warning(O) -> + lists:member(warnings, O) orelse is_verbose(O). + +is_verbose(S) when is_record(S, state) -> + is_verbose(S#state.options); +is_verbose(O) -> + lists:member(verbose, O). diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 54a5c7e727..b788a79cd8 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -2027,8 +2027,9 @@ get_objectset_def2(_S,Set,CField) when is_list(Set) -> set=Set}}; get_objectset_def2(_S,T = #typedef{typespec=#'ObjectSet'{}},_CField) -> T; -get_objectset_def2(_S,T,_CField) -> - io:format("Warning get_objectset_def2: uncontrolled object set structure:~n~p~n",[T]). +get_objectset_def2(S,T,_CField) -> + asn1ct:warning("get_objectset_def2: uncontrolled object set structure:~n~p~n", + [T],S). type_name(S,#type{def=Def}) -> CurrMod = S#state.mname, @@ -2685,7 +2686,7 @@ normalize_value(S,Type,{'DEFAULT',Value},NameList) -> {'REAL',_,_} -> normalize_real(Value); {'ENUMERATED',CType,_} -> - normalize_enumerated(Value,CType); + normalize_enumerated(S,Value,CType); {'CHOICE',CType,NewNameList} -> normalize_choice(S,Value,CType,NewNameList); {'SEQUENCE',CType,NewNameList} -> @@ -2701,7 +2702,8 @@ normalize_value(S,Type,{'DEFAULT',Value},NameList) -> {'ASN1_OPEN_TYPE',{typefield,_TF},NL} -> %an open type normalize_objectclassfieldvalue(S,Value,NL); Err -> - io:format("WARNING: could not check default value ~p~nType:~n~p~nNameList:~n~p~n",[Value,Type,Err]), + asn1ct:warning("could not check default value ~p~nType:~n~p~nNameList:~n~p~n", + [Value,Type,Err],S), Value end; normalize_value(S,Type,Val,NameList) -> @@ -2786,23 +2788,23 @@ normalize_bitstring(S,Value,Type)-> end, case catch lists:map(F,RecList) of {error,Reason} -> - io:format("WARNING: default value not " + asn1ct:warning("default value not " "compatible with type definition ~p~n", - [Reason]), + [Reason],S), Value; NewList -> NewList end; _ -> - io:format("WARNING: default value not " + asn1ct:warning("default value not " "compatible with type definition ~p~n", - [RecList]), + [RecList],S), Value end; {Name,String} when is_atom(Name) -> normalize_bitstring(S,String,Type); Other -> - io:format("WARNING: illegal default value ~p~n",[Other]), + asn1ct:warning("illegal default value ~p~n",[Other],S), Value end. @@ -2841,12 +2843,13 @@ normalize_octetstring(S,Value,CType) -> %% check if list elements are valid octet values lists:map(fun([])-> ok; (H)when H > 255-> - io:format("WARNING: not legal octet value ~p in OCTET STRING, ~p~n",[H,List]); + asn1ct:warning("not legal octet value ~p in OCTET STRING, ~p~n", + [H,List],S); (_)-> ok end, List), List; Other -> - io:format("WARNING: unknown default value ~p~n",[Other]), + asn1ct:warning("unknown default value ~p~n",[Other],S), Value end. @@ -2893,23 +2896,23 @@ normalize_objectdescriptor(Value) -> normalize_real(Value) -> Value. -normalize_enumerated(#'Externalvaluereference'{value=V},CType) +normalize_enumerated(S,#'Externalvaluereference'{value=V},CType) when is_list(CType) -> - normalize_enumerated2(V,CType); -normalize_enumerated(Value,CType) when is_atom(Value),is_list(CType) -> - normalize_enumerated2(Value,CType); -normalize_enumerated({Name,EnumV},CType) when is_atom(Name) -> - normalize_enumerated(EnumV,CType); -normalize_enumerated(Value,{CType1,CType2}) when is_list(CType1), is_list(CType2)-> - normalize_enumerated(Value,CType1++CType2); -normalize_enumerated(V,CType) -> - io:format("WARNING: Enumerated unknown type ~p~n",[CType]), + normalize_enumerated2(S,V,CType); +normalize_enumerated(S,Value,CType) when is_atom(Value),is_list(CType) -> + normalize_enumerated2(S,Value,CType); +normalize_enumerated(S,{Name,EnumV},CType) when is_atom(Name) -> + normalize_enumerated(S,EnumV,CType); +normalize_enumerated(S,Value,{CType1,CType2}) when is_list(CType1), is_list(CType2)-> + normalize_enumerated(S,Value,CType1++CType2); +normalize_enumerated(S,V,CType) -> + asn1ct:warning("Enumerated unknown type ~p~n",[CType],S), V. -normalize_enumerated2(V,Enum) -> +normalize_enumerated2(S,V,Enum) -> case lists:keysearch(V,1,Enum) of {value,{Val,_}} -> Val; _ -> - io:format("WARNING: Enumerated value is not correct ~p~n",[V]), + asn1ct:warning("Enumerated value is not correct ~p~n",[V],S), V end. @@ -2920,8 +2923,7 @@ normalize_choice(S,{'CHOICE',{C,V}},CType,NameList) when is_atom(C) -> {C,normalize_value(S,CT,{'DEFAULT',V}, [Name|NameList])}; Other -> - io:format("WARNING: Wrong format of type/value ~p/~p~n", - [Other,V]), + asn1ct:warning("Wrong format of type/value ~p/~p~n",[Other,V],S), {C,V} end; normalize_choice(S,{'DEFAULT',ValueList},CType,NameList) when is_list(ValueList) -> @@ -3097,8 +3099,7 @@ normalize_s_of(SorS,S,Value,Type,NameList) when is_list(Value) -> List when is_list(List) -> List; _ -> - io:format("WARNING: ~p could not handle value ~p~n", - [SorS,Value]), + asn1ct:warning("~p could not handle value ~p~n",[SorS,Value],S), Value end; normalize_s_of(SorS,S,Value,Type,NameList) @@ -3150,15 +3151,13 @@ get_normalized_value(S,Val,Type,Func,AddArg) -> V2 = sort_val_if_set(AddArg,V,Type), call_Func(update_state(S,ExtM),V2,Type,Func,AddArg); {error,_} -> - io:format("WARNING: default value not " - "comparable ~p~n",[Val]), + asn1ct:warning("default value not comparable ~p~n",[Val],S), Val; {ExtM,NewVal} -> V2 = sort_val_if_set(AddArg,NewVal,Type), call_Func(update_state(S,ExtM),V2,Type,Func,AddArg); _ -> - io:format("WARNING: default value not " - "comparable ~p~n",[Val]), + asn1ct:warning("default value not comparable ~p~n",[Val],S), Val end. @@ -4106,7 +4105,7 @@ resolve_namednumber(S,#typedef{typespec=Type},Name) -> case Type#type.def of {'ENUMERATED',NameList} -> NamedNumberList=check_enumerated(S,NameList,Type#type.constraint), - N = normalize_enumerated(Name,NamedNumberList), + N = normalize_enumerated(S,Name,NamedNumberList), {value,{_,V}} = lists:keysearch(N,1,NamedNumberList), V; {'INTEGER',NameList} -> @@ -5676,9 +5675,9 @@ sort_components(der,S=#state{tname=TypeName},Components) -> end, case {untagged_choice(S,CompsList),Ext} of {false,noext} -> - {true,sort_components1(TypeName,CompsList,[],[],[],[])}; + {true,sort_components1(S,TypeName,CompsList,[],[],[],[])}; {false,_} -> - {true,{sort_components1(TypeName,CompsList,[],[],[],[]), []}}; + {true,{sort_components1(S,TypeName,CompsList,[],[],[],[]), []}}; {true,noext} -> %% sort in run-time {dynamic,R1}; @@ -5690,57 +5689,57 @@ sort_components(per,S=#state{tname=TypeName},Components) -> Root = tag_untagged_choice(S,R1++R2), case Ext of noext -> - {true,sort_components1(TypeName,Root,[],[],[],[])}; + {true,sort_components1(S,TypeName,Root,[],[],[],[])}; _ -> - {true,{sort_components1(TypeName,Root,[],[],[],[]), + {true,{sort_components1(S,TypeName,Root,[],[],[],[]), Ext}} end. -sort_components1(TypeName,[C=#'ComponentType'{tags=[{'UNIVERSAL',_}|_R]}|Cs], +sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'UNIVERSAL',_}|_R]}|Cs], UnivAcc,ApplAcc,ContAcc,PrivAcc) -> - sort_components1(TypeName,Cs,[C|UnivAcc],ApplAcc,ContAcc,PrivAcc); -sort_components1(TypeName,[C=#'ComponentType'{tags=[{'APPLICATION',_}|_R]}|Cs], + sort_components1(S,TypeName,Cs,[C|UnivAcc],ApplAcc,ContAcc,PrivAcc); +sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'APPLICATION',_}|_R]}|Cs], UnivAcc,ApplAcc,ContAcc,PrivAcc) -> - sort_components1(TypeName,Cs,UnivAcc,[C|ApplAcc],ContAcc,PrivAcc); -sort_components1(TypeName,[C=#'ComponentType'{tags=[{'CONTEXT',_}|_R]}|Cs], + sort_components1(S,TypeName,Cs,UnivAcc,[C|ApplAcc],ContAcc,PrivAcc); +sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'CONTEXT',_}|_R]}|Cs], UnivAcc,ApplAcc,ContAcc,PrivAcc) -> - sort_components1(TypeName,Cs,UnivAcc,ApplAcc,[C|ContAcc],PrivAcc); -sort_components1(TypeName,[C=#'ComponentType'{tags=[{'PRIVATE',_}|_R]}|Cs], + sort_components1(S,TypeName,Cs,UnivAcc,ApplAcc,[C|ContAcc],PrivAcc); +sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'PRIVATE',_}|_R]}|Cs], UnivAcc,ApplAcc,ContAcc,PrivAcc) -> - sort_components1(TypeName,Cs,UnivAcc,ApplAcc,ContAcc,[C|PrivAcc]); -sort_components1(TypeName,[],UnivAcc,ApplAcc,ContAcc,PrivAcc) -> + sort_components1(S,TypeName,Cs,UnivAcc,ApplAcc,ContAcc,[C|PrivAcc]); +sort_components1(S,TypeName,[],UnivAcc,ApplAcc,ContAcc,PrivAcc) -> I = #'ComponentType'.tags, - ascending_order_check(TypeName,sort_universal_type(UnivAcc)) ++ - ascending_order_check(TypeName,lists:keysort(I,ApplAcc)) ++ - ascending_order_check(TypeName,lists:keysort(I,ContAcc)) ++ - ascending_order_check(TypeName,lists:keysort(I,PrivAcc)). + ascending_order_check(S,TypeName,sort_universal_type(UnivAcc)) ++ + ascending_order_check(S,TypeName,lists:keysort(I,ApplAcc)) ++ + ascending_order_check(S,TypeName,lists:keysort(I,ContAcc)) ++ + ascending_order_check(S,TypeName,lists:keysort(I,PrivAcc)). -ascending_order_check(TypeName,Components) -> - ascending_order_check1(TypeName,Components), +ascending_order_check(S,TypeName,Components) -> + ascending_order_check1(S,TypeName,Components), Components. -ascending_order_check1(TypeName, +ascending_order_check1(S,TypeName, [C1 = #'ComponentType'{tags=[{_,T}|_]}, C2 = #'ComponentType'{tags=[{_,T}|_]}|Rest]) -> - io:format("WARNING: Indistinct tag ~p in SET ~p, components ~p and ~p~n", - [T,TypeName,C1#'ComponentType'.name,C2#'ComponentType'.name]), - ascending_order_check1(TypeName,[C2|Rest]); -ascending_order_check1(TypeName, + asn1ct:warning("Indistinct tag ~p in SET ~p, components ~p and ~p~n", + [T,TypeName,C1#'ComponentType'.name,C2#'ComponentType'.name],S), + ascending_order_check1(S,TypeName,[C2|Rest]); +ascending_order_check1(S,TypeName, [C1 = #'ComponentType'{tags=[{'UNIVERSAL',T1}|_]}, C2 = #'ComponentType'{tags=[{'UNIVERSAL',T2}|_]}|Rest]) -> case (decode_type(T1) == decode_type(T2)) of true -> - io:format("WARNING: Indistinct tags ~p and ~p in" + asn1ct:warning("Indistinct tags ~p and ~p in" " SET ~p, components ~p and ~p~n", [T1,T2,TypeName,C1#'ComponentType'.name, - C2#'ComponentType'.name]), - ascending_order_check1(TypeName,[C2|Rest]); + C2#'ComponentType'.name],S), + ascending_order_check1(S,TypeName,[C2|Rest]); _ -> - ascending_order_check1(TypeName,[C2|Rest]) + ascending_order_check1(S,TypeName,[C2|Rest]) end; -ascending_order_check1(N,[_|Rest]) -> - ascending_order_check1(N,Rest); -ascending_order_check1(_,[]) -> +ascending_order_check1(S,N,[_|Rest]) -> + ascending_order_check1(S,N,Rest); +ascending_order_check1(_,_,[]) -> ok. sort_universal_type(Components) -> diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl index eab5fb4a2a..8c8b9b3b4d 100644 --- a/lib/asn1/src/asn1ct_gen.erl +++ b/lib/asn1/src/asn1ct_gen.erl @@ -87,7 +87,7 @@ pgen_module(OutFile,Erules,Module, % gen_vars(asn1_db:mod_to_vars(Module)), % gen_tag_table(AllTypes), file:close(Fid), - asn1ct:report_verbose("--~p--~n",[{generated,ErlFile}],Options). + asn1ct:verbose("--~p--~n",[{generated,ErlFile}],Options). pgen_typeorval(Erules,Module,N2nConvEnums,{Types,Values,_Ptypes,_Classes,Objects,ObjectSets}) -> @@ -1335,9 +1335,9 @@ pgen_hrl(Erules,Module,TypeOrVal,Options,_Indent) -> Y -> Fid = get(gen_file_out), file:close(Fid), - asn1ct:report_verbose("--~p--~n", - [{generated,lists:concat([get(outfile),".hrl"])}], - Options), + asn1ct:verbose("--~p--~n", + [{generated,lists:concat([get(outfile),".hrl"])}], + Options), Y end. diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl index 83f38c5e6d..5e027cdedb 100644 --- a/lib/asn1/test/test_compile_options.erl +++ b/lib/asn1/test/test_compile_options.erl @@ -132,7 +132,7 @@ verbose(Config) when is_list(Config) -> ?line ok = asn1ct:compile(Asn1File, [{i,DataDir},{outdir,OutDir},noobj,verbose]), ?line test_server:capture_stop(), ?line [Line0|_] = test_server:capture_get(), - ?line lists:prefix("Erlang ASN.1 version", Line0), + ?line true = lists:prefix("Erlang ASN.1 version", Line0), %% Test non-verbose compile ?line test_server:capture_start(), -- cgit v1.2.3 From ad4911ae7cf3f9af4a3eac18ddfee4277db8a047 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 23 Sep 2010 13:54:49 +0200 Subject: Added partial support for recursive IDL types. --- lib/ic/src/ic_forms.erl | 6 ++++- lib/ic/src/ic_pragma.erl | 27 +++++++++++++++++++-- lib/ic/src/ic_symtab.erl | 4 +++- lib/ic/src/icforms.hrl | 3 ++- lib/ic/src/icparse.yrl | 22 ++++++++++------- lib/ic/src/ictype.erl | 41 ++++++++++++++++--------------- lib/orber/src/cdr_decode.erl | 57 +++++++++++++++++++++++++++++++++++++------- lib/orber/src/cdr_encode.erl | 30 +++++++++++++++++++---- 8 files changed, 144 insertions(+), 46 deletions(-) diff --git a/lib/ic/src/ic_forms.erl b/lib/ic/src/ic_forms.erl index 7409ddeb7b..fc46a2ed40 100644 --- a/lib/ic/src/ic_forms.erl +++ b/lib/ic/src/ic_forms.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -65,6 +65,7 @@ get_line(X) when is_record(X, scoped_id) -> X#scoped_id.line; get_line(X) when is_record(X, module) -> get_line(X#module.id); get_line(X) when is_record(X, interface) -> get_line(X#interface.id); get_line(X) when is_record(X, forward) -> get_line(X#forward.id); +get_line(X) when is_record(X, constr_forward) -> get_line(X#constr_forward.id); get_line(X) when is_record(X, const) -> get_line(X#const.id); get_line(X) when is_record(X, typedef) -> get_line(X#typedef.id); get_line(X) when is_record(X, struct) -> get_line(X#struct.id); @@ -114,6 +115,7 @@ get_line(_) -> -1. get_id2(X) when is_record(X, module) -> get_id(X#module.id); get_id2(X) when is_record(X, interface) -> get_id(X#interface.id); get_id2(X) when is_record(X, forward) -> get_id(X#forward.id); +get_id2(X) when is_record(X, constr_forward) -> get_id(X#constr_forward.id); get_id2(X) when is_record(X, const) -> get_id(X#const.id); get_id2(X) when is_record(X, typedef) -> get_id(hd(X#typedef.id)); get_id2(X) when is_record(X, struct) -> get_id(X#struct.id); @@ -156,6 +158,7 @@ get_type(X) when is_record(X, param) -> X#param.type. %% Temporary place get_tk(X) when is_record(X, interface) -> X#interface.tk; get_tk(X) when is_record(X, forward) -> X#forward.tk; +get_tk(X) when is_record(X, constr_forward) -> X#constr_forward.tk; get_tk(X) when is_record(X, const) -> X#const.tk; get_tk(X) when is_record(X, type_dcl) -> X#type_dcl.tk; get_tk(X) when is_record(X, typedef) -> X#typedef.tk; @@ -228,6 +231,7 @@ clean_up_scope([N|Ns],Found) -> get_type_code2(_, _, X) when is_record(X, interface) -> X#interface.tk; get_type_code2(_, _, X) when is_record(X, forward) -> X#forward.tk; +get_type_code2(_, _, X) when is_record(X, constr_forward) -> X#constr_forward.tk; get_type_code2(_, _, X) when is_record(X, const) -> X#const.tk; get_type_code2(_, _, X) when is_record(X, type_dcl) -> X#type_dcl.tk; get_type_code2(_, _, X) when is_record(X, typedef) -> diff --git a/lib/ic/src/ic_pragma.erl b/lib/ic/src/ic_pragma.erl index 9165e3b03b..e60774f1ab 100644 --- a/lib/ic/src/ic_pragma.erl +++ b/lib/ic/src/ic_pragma.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -65,6 +65,23 @@ pragma_reg(G,X) -> true -> %% Remove ugly pragmas from form PragmaCleanForm = cleanup(X), +%% PragmaCleanForm = [{preproc,line_nr, +%% {'',1, +%% "/home/nick/trash/recursive/b.idl"}, +%% []}, +%% {struct,{'',2,"Foo"},[],undefined}, +%% {typedef, +%% {sequence,{scoped_id,local,3,["Foo"]},0}, +%% [{'',3,"FooSeq"}], +%% undefined}, +%% {struct, +%% {'',4,"Foo"}, +%% [{member,{long,5},[{'',5,"value"}]}, +%% {member, +%% {scoped_id,local,6,["FooSeq"]}, +%% [{'',6,"chain"}]}], +%% undefined}], + {ok,PragmaCleanForm}; false -> ErrorNr = get_pragma_error_nr(S), @@ -132,6 +149,7 @@ applyCodeOpt(G) -> %% This removes all pragma records from the form. %% When debugged, it can be enbodied in pragma_reg_all. +cleanup(undefined,C) -> C; cleanup([],C) -> C; cleanup([X|Xs],CSF) -> cleanup(Xs, CSF++cleanup(X)). @@ -279,7 +297,12 @@ pragma_reg(G, S, N, X) when is_record(X, union) -> pragma_reg(G, S, N, X) when is_record(X, struct) -> mk_ref(G,[get_id2(X) | N],struct_ref), mk_file_data(G,X,N,struct), - pragma_reg_all(G, S, N, X#struct.body); + case X#struct.body of + undefined -> + ok; + _ -> + pragma_reg_all(G, S, N, X#struct.body) + end; pragma_reg(G, _S, N, X) when is_record(X, attr) -> XX = #id_of{type=X}, diff --git a/lib/ic/src/ic_symtab.erl b/lib/ic/src/ic_symtab.erl index 889c75e3a2..d710154a5d 100644 --- a/lib/ic/src/ic_symtab.erl +++ b/lib/ic/src/ic_symtab.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -69,6 +69,8 @@ store(G, N, X) -> ets:insert(G#genobj.symtab, {Name, X}); {ok, Y} when is_record(Y, forward) -> ets:insert(G#genobj.symtab, {Name, X}); + {ok, Y} when is_record(Y, constr_forward) -> + ets:insert(G#genobj.symtab, {Name, X}); {ok, _Y} -> ic_error:error(G, {multiply_defined, X}) end. diff --git a/lib/ic/src/icforms.hrl b/lib/ic/src/icforms.hrl index d1869e6330..1b394a11b4 100644 --- a/lib/ic/src/icforms.hrl +++ b/lib/ic/src/icforms.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,6 +34,7 @@ -record(module, {id, body}). -record(interface, {id, inherit, body, inherit_body, tk}). -record(forward, {id, tk}). +-record(constr_forward, {id, tk}). -record(const, {type, id, val, tk}). -record(type_dcl, {type, tk}). -record(typedef, {type, id, tk}). diff --git a/lib/ic/src/icparse.yrl b/lib/ic/src/icparse.yrl index 25b0f452e7..d0dd6cde4c 100644 --- a/lib/ic/src/icparse.yrl +++ b/lib/ic/src/icparse.yrl @@ -1,21 +1,20 @@ -%% -%% 1997-2007 -%% Ericsson AB, All Rights Reserved -%% -%% +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% -%% The Initial Developer of the Original Code is Ericsson AB. -%% +%% +%% %CopyrightEnd% %% %%------------------------------------------------------------ %% Yecc spec for IDL @@ -150,6 +149,7 @@ Nonterminals 'ZorM_' '' '' + '' . @@ -473,6 +473,7 @@ OE_preproc -> '#' '' '' '' -> '' : '$1' . '' -> '' : '$1' . '' -> '' : '$1' . +'' -> '' : '$1' . %% (28) NIY multiple declarators (FIXED) '' -> '' '' @@ -832,6 +833,9 @@ OE_preproc -> '#' '' '' '' -> 'fixed' '<' '' ',' '' '>' : #fixed{digits='$3',scale='$5'} . +%% (99) +'' -> 'struct' '' : #constr_forward{id='$2', tk=tk_struct} . +'' -> 'union' '' : #constr_forward{id='$2', tk=tk_union} . %% Added clause 'ZorM_' -> '$empty' : [] . diff --git a/lib/ic/src/ictype.erl b/lib/ic/src/ictype.erl index 4704191bee..9e20801464 100644 --- a/lib/ic/src/ictype.erl +++ b/lib/ic/src/ictype.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -407,6 +407,18 @@ check(G, S, N, X) when is_record(X, forward) -> tktab_add(G, S, N, X, {tk_objref, ictk:get_IR_ID(G, N, X), ic_forms:get_id2(X)}), X; +check(G, S, N, #constr_forward{tk = tk_struct} = X) -> + ?STDDBG, + ID = ic_forms:get_id2(X), + Module = list_to_atom(string:join(lists:reverse([ID|N]), "_")), + tktab_add(G, S, N, X, {tk_struct, ictk:get_IR_ID(G, N, X), ID, Module}), + X; +check(G, S, N, #constr_forward{tk = tk_union} = X) -> + ?STDDBG, + ID = ic_forms:get_id2(X), + Module = list_to_atom(string:join(lists:reverse([ID|N]), "_")), + tktab_add(G, S, N, X, {tk_union, ictk:get_IR_ID(G, N, X), ID, [], [], Module}), + X; check(G, S, N, X) when is_record(X, const) -> ?STDDBG, @@ -427,21 +439,6 @@ check(G, S, N, X) when is_record(X, const) -> end end; -check(G, S, N, X) when is_record(X, const) -> - ?STDDBG, - case tk_base(G, S, N, ic_forms:get_type(X)) of - Err when element(1, Err) == error -> X; - TK -> - check_const_tk(G, S, N, X, TK), - case iceval:eval_const(G, S, N, TK, X#const.val) of - Err when element(1, Err) == error -> X; - Val -> - V = iceval:get_val(Val), - tktab_add(G, S, N, X, TK, V), - X#const{val=V, tk=TK} - end - end; - check(G, S, N, X) when is_record(X, except) -> ?STDDBG, TK = tk(G, S, N, X), @@ -795,9 +792,15 @@ tktab_add_id(G, S, N, X, Id, TK, Aux) -> Name = [Id | N], UName = mk_uppercase(Name), case ets:lookup(S, Name) of - [{_, forward, _, _}] when is_record(X, interface) -> ok; - [XX] when is_record(X, forward) andalso element(2, XX)==interface -> ok; - [_] -> ic_error:error(G, {multiply_defined, X}); + [{_, forward, _, _}] when is_record(X, interface) -> + ok; + [{_, constr_forward, _, _}] when is_record(X, union) orelse + is_record(X, struct) -> + ok; + [XX] when is_record(X, forward) andalso element(2, XX)==interface -> + ok; + [_] -> + ic_error:error(G, {multiply_defined, X}); [] -> case ets:lookup(S, UName) of [] -> ok; diff --git a/lib/orber/src/cdr_decode.erl b/lib/orber/src/cdr_decode.erl index 9d30098940..68f248364b 100644 --- a/lib/orber/src/cdr_decode.erl +++ b/lib/orber/src/cdr_decode.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -898,9 +898,13 @@ dec_sequence_struct(Version, Message, N, TypeCodeList, Len, ByteOrder, Buff, C, {Seq, Rest2, Len2, NewC2} = dec_sequence_struct(Version, Rest1, N - 1, TypeCodeList, Len1, ByteOrder, Buff, NewC, Name), {[list_to_tuple([Name |Struct]) | Seq], Rest2, Len2, NewC2}. -dec_sequence_union(_, Message, 0, _DiscrTC, _Default, _ElementList, Len, _ByteOrder, _Buff, C, _Name) -> + + +dec_sequence_union(_, Message, 0, _DiscrTC, _Default, _ElementList, + Len, _ByteOrder, _Buff, C, _Name) -> {[], Message, Len, C}; -dec_sequence_union(Version, Message, N, DiscrTC, Default, ElementList, Len, ByteOrder, Buff, C, Name) -> +dec_sequence_union(Version, Message, N, DiscrTC, Default, ElementList, + Len, ByteOrder, Buff, C, Name) when is_list(ElementList) -> {Label, Rest1, Len1, NewC} = dec_type(DiscrTC, Version, Message, Len, ByteOrder, Buff, C), Result = dec_union(Version, stringify_enum(DiscrTC, Label), ElementList, Default, @@ -916,7 +920,20 @@ dec_sequence_union(Version, Message, N, DiscrTC, Default, ElementList, Len, Byte DiscrTC, Default, ElementList, Len2, ByteOrder, Buff, NewC3, Name), - {[{Name, Label, Value} | Seq], Rest3, Len3, NewC4}. + {[{Name, Label, Value} | Seq], Rest3, Len3, NewC4}; +dec_sequence_union(Version, Message, N, _DiscrTC, _Default, Module, + Len, ByteOrder, Buff, C, Name) when is_atom(Module) -> + case catch Module:tc() of + {tk_union, _, _, DiscrTC, Default, ElementList} -> + dec_sequence_union(Version, Message, N, DiscrTC, Default, ElementList, + Len, ByteOrder, Buff, C, Name); + What -> + orber:dbg("[~p] ~p:dec_sequence_union(~p). Union module doesn't exist or incorrect.", + [?LINE, ?MODULE, What], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}) + end. + + %% A special case; when something is encapsulated (i.e. sent as octet-sequence) %% we sometimes don not want the result to be converted to a list. @@ -993,14 +1010,16 @@ dec_wstring(Version, Message, Len, ByteOrder, Buff, C) -> %% Func: dec_union/9 %%----------------------------------------------------------------- %% ## NEW IIOP 1.2 ## -dec_union(Version, ?SYSTEM_TYPE, Name, DiscrTC, Default, ElementList, Bytes, Len, ByteOrder, Buff, C) -> +dec_union(Version, ?SYSTEM_TYPE, Name, DiscrTC, Default, ElementList, Bytes, + Len, ByteOrder, Buff, C) -> {Label, Rest1, Len1, NewC} = dec_type(DiscrTC, Version, Bytes, Len, ByteOrder, Buff, C), {Value, Rest2, Len2, NewC3} = dec_union(Version, Label, ElementList, Default, Rest1, Len1, ByteOrder, Buff, NewC), {{Name, Label, Value}, Rest2, Len2, NewC3}; -dec_union(Version, IFRId, _, DiscrTC, Default, ElementList, Bytes, Len, ByteOrder, Buff, C) -> +dec_union(Version, IFRId, _, DiscrTC, Default, ElementList, Bytes, Len, + ByteOrder, Buff, C) when is_list(ElementList) -> {Label, Rest1, Len1, NewC} = dec_type(DiscrTC, Version, Bytes, Len, ByteOrder, Buff, C), Result = dec_union(Version, stringify_enum(DiscrTC, Label), ElementList, Default, Rest1, Len1, ByteOrder, Buff, NewC), @@ -1012,7 +1031,20 @@ dec_union(Version, IFRId, _, DiscrTC, Default, ElementList, Bytes, Len, ByteOrde X end, Name = ifrid_to_name(IFRId, ?IFR_UnionDef), - {{Name, Label, Value}, Rest2, Len2, NewC3}. + {{Name, Label, Value}, Rest2, Len2, NewC3}; +dec_union(Version, IFRId, _, _DiscrTC, _Default, Module, Bytes, Len, + ByteOrder, Buff, C) when is_atom(Module) -> + case catch Module:tc() of + {tk_union, _, Name, DiscrTC, Default, ElementList} -> + dec_union(Version, IFRId, Name, DiscrTC, Default, ElementList, Bytes, Len, + ByteOrder, Buff, C); + What -> + orber:dbg("[~p] ~p:dec_union(~p). Union module doesn't exist or incorrect.", + [?LINE, ?MODULE, What], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}) + end. + + dec_union(_, _, [], Default, Message, Len, _, _Buff, C) when Default < 0 -> {undefined, Message, Len, C}; @@ -1047,7 +1079,16 @@ dec_struct1(_, [], Message, Len, _ByteOrder, _, C) -> dec_struct1(Version, [{_ElemName, ElemType} | TypeCodeList], Message, Len, ByteOrder, Buff, C) -> {Element, Rest, Len1, NewC} = dec_type(ElemType, Version, Message, Len, ByteOrder, Buff, C), {Struct, Rest1, Len2, NewC2} = dec_struct1(Version, TypeCodeList, Rest, Len1, ByteOrder, Buff, NewC), - {[Element |Struct], Rest1, Len2, NewC2}. + {[Element |Struct], Rest1, Len2, NewC2}; +dec_struct1(Version, Module, Message, Len, ByteOrder, Buff, C) -> + case catch Module:tc() of + {tk_struct, _, _, TypeCodeList} -> + dec_struct1(Version, TypeCodeList, Message, Len, ByteOrder, Buff, C); + What -> + orber:dbg("[~p] ~p:dec_struct1(~p). Struct module doesn't exist or incorrect.", + [?LINE, ?MODULE, What], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}) + end. ifrid_to_name([], Type) -> orber:dbg("[~p] ~p:ifrid_to_name([], ~p). No Id supplied.", diff --git a/lib/orber/src/cdr_encode.erl b/lib/orber/src/cdr_encode.erl index 3ecb8833f5..eaf3c5b7dc 100644 --- a/lib/orber/src/cdr_encode.erl +++ b/lib/orber/src/cdr_encode.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -815,11 +815,21 @@ enc_wstring(Env, String, MaxLength, Bytes, Len) -> %%----------------------------------------------------------------- %% Func: enc_union/5 %%----------------------------------------------------------------- -enc_union(Env, {_, Label, Value}, DiscrTC, Default, TypeCodeList, Bytes, Len) -> +enc_union(Env, {_, Label, Value}, DiscrTC, Default, TypeCodeList, + Bytes, Len) when is_list(TypeCodeList) -> {ByteSequence, Len1} = enc_type(DiscrTC, Env, Label, Bytes, Len), Label2 = stringify_enum(DiscrTC,Label), enc_union2(Env, {Label2, Value},TypeCodeList, Default, - ByteSequence, Len1, undefined). + ByteSequence, Len1, undefined); +enc_union(Env, Value, _DiscrTC, _Default, Module, Bytes, Len) when is_atom(Module) -> + case catch Module:tc() of + {tk_union, _, _, DiscrTC, Default, ElementList} -> + enc_union(Env, Value, DiscrTC, Default, ElementList, Bytes, Len); + What -> + orber:dbg("[~p] ~p:enc_union(~p). Union module doesn't exist or incorrect.", + [?LINE, ?MODULE, What], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}) + end. enc_union2(_Env, _What, [], Default, Bytes, Len, _) when Default < 0 -> {Bytes, Len}; @@ -840,9 +850,19 @@ stringify_enum(_, Label) -> %%----------------------------------------------------------------- %% Func: enc_struct/4 %%----------------------------------------------------------------- -enc_struct(Env, Struct, TypeCodeList, Bytes, Len) -> +enc_struct(Env, Struct, TypeCodeList, Bytes, Len) when is_list(TypeCodeList) -> [_Name | StructList] = tuple_to_list(Struct), - enc_struct1(Env, StructList, TypeCodeList, Bytes, Len). + enc_struct1(Env, StructList, TypeCodeList, Bytes, Len); +enc_struct(Env, Struct, Module, Bytes, Len) -> + [Module | StructList] = tuple_to_list(Struct), + case catch Module:tc() of + {tk_struct, _, _, TypeCodeList} -> + enc_struct1(Env, StructList, TypeCodeList, Bytes, Len); + What -> + orber:dbg("[~p] ~p:enc_struct([], ~p). Struct module doesn't exist or incorrect.", + [?LINE, ?MODULE, What], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE}) + end. enc_struct1(_Env, [], [], Bytes, Len) -> {Bytes, Len}; -- cgit v1.2.3 From 2261f2a35a758133d3694816bb9bc35f22cc2d46 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 23 Sep 2010 13:58:40 +0200 Subject: Removed test code. --- lib/ic/src/ic_pragma.erl | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/lib/ic/src/ic_pragma.erl b/lib/ic/src/ic_pragma.erl index e60774f1ab..45cb64c9c8 100644 --- a/lib/ic/src/ic_pragma.erl +++ b/lib/ic/src/ic_pragma.erl @@ -60,28 +60,11 @@ pragma_reg(G,X) -> init_pragma_status(S), registerOptions(G,S), pragma_reg_all(G, S, [], X), - denote_specific_code_opts(G), %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + denote_specific_code_opts(G), case get_pragma_compilation_status(S) of true -> %% Remove ugly pragmas from form PragmaCleanForm = cleanup(X), -%% PragmaCleanForm = [{preproc,line_nr, -%% {'',1, -%% "/home/nick/trash/recursive/b.idl"}, -%% []}, -%% {struct,{'',2,"Foo"},[],undefined}, -%% {typedef, -%% {sequence,{scoped_id,local,3,["Foo"]},0}, -%% [{'',3,"FooSeq"}], -%% undefined}, -%% {struct, -%% {'',4,"Foo"}, -%% [{member,{long,5},[{'',5,"value"}]}, -%% {member, -%% {scoped_id,local,6,["FooSeq"]}, -%% [{'',6,"chain"}]}], -%% undefined}], - {ok,PragmaCleanForm}; false -> ErrorNr = get_pragma_error_nr(S), -- cgit v1.2.3 From 3cf40cefd44ab6383bd16319c7c6941fd0d0f13c Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 23 Sep 2010 16:06:49 +0200 Subject: Added basic tests for recursive uinions and structs. --- lib/orber/test/Makefile | 6 +++++- lib/orber/test/orber_test_lib.erl | 16 ++++++++++++++++ lib/orber/test/orber_test_server.idl | 25 ++++++++++++++++++++++++- lib/orber/test/orber_test_server_impl.erl | 15 ++++++++++++++- 4 files changed, 59 insertions(+), 3 deletions(-) diff --git a/lib/orber/test/Makefile b/lib/orber/test/Makefile index 4601e84d2c..5495735318 100644 --- a/lib/orber/test/Makefile +++ b/lib/orber/test/Makefile @@ -120,7 +120,11 @@ GEN_MOD_TEST_SERVER = \ orber_test_server_uni \ orber_test_server_uni_d \ orber_test_timeout_server \ - orber_parent_inherrit + orber_parent_inherrit \ + orber_test_server_rec_struct \ + orber_test_server_rec_struct_seq \ + orber_test_server_rec_union \ + orber_test_server_rec_union_seq GEN_HRL_TEST_SERVER = \ oe_orber_test_server.hrl \ diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl index a694dc58c4..b95cf4b0ec 100644 --- a/lib/orber/test/orber_test_lib.erl +++ b/lib/orber/test/orber_test_lib.erl @@ -1280,6 +1280,22 @@ test_coding(Obj, Local) -> ?match({'EXCEPTION',{'MARSHAL',_,_,_}}, orber_test_server: testing_iiop_server_marshal(Obj, "string")), + + RecS = #orber_test_server_rec_struct{chain = [#orber_test_server_rec_struct{chain = []}]}, + ?match(RecS, orber_test_server:testing_iiop_rec_struct(Obj, RecS)), + + RecU = #orber_test_server_rec_union{label = 'RecursiveType', + value = [#orber_test_server_rec_union{label = 'RecursiveType', + value = []}]}, + ?match(RecU, orber_test_server:testing_iiop_rec_union(Obj, RecU)), + +%% RecA1 = #any{typecode = unsupported, value = RecS}, +%% RecA2 = #any{typecode = unsupported, value = RecU}, +%% ?match(RecA1, +%% orber_test_server:testing_iiop_rec_any(Obj, RecA1)), +%% ?match(RecA2, +%% orber_test_server:testing_iiop_rec_any(Obj, RecA2)), + ok. %%--------------- Testing Post- & Pre-cond ------------------- diff --git a/lib/orber/test/orber_test_server.idl b/lib/orber/test/orber_test_server.idl index a88211c941..438c10e19b 100644 --- a/lib/orber/test/orber_test_server.idl +++ b/lib/orber/test/orber_test_server.idl @@ -28,7 +28,7 @@ module orber_parent { }; module orber_test { - + // interface server interface server : orber_parent::inherrit { typedef string array[2]; @@ -89,6 +89,23 @@ module orber_test { const fixed52 fixed52negconst2 = -123.00d; const fixed52 fixed52negconst3 = -023.00d; + struct rec_struct; // Forward declaration + typedef sequence rec_struct_seq; + struct rec_struct { + rec_struct_seq chain; + }; + + + union rec_union; // Forward declaration + typedef sequencerec_union_seq; + + enum MyEnum {RecursiveType, NameType}; + + union rec_union switch (MyEnum) { + case RecursiveType : rec_union_seq chain; + case NameType : string aName; + }; + void stop_normal(); void stop_brutal(); @@ -123,6 +140,12 @@ module orber_test { void testing_iiop_context(); void testing_iiop_server_marshal(inout StrLength6 Str); + // Recursive types + any testing_iiop_rec_any(in any RecType); + rec_struct testing_iiop_rec_struct(in rec_struct RecS); + rec_union testing_iiop_rec_union(in rec_union RecU); + + oneway void testing_iiop_oneway_delay(in long Time); void testing_iiop_twoway_delay(in long Time); diff --git a/lib/orber/test/orber_test_server_impl.erl b/lib/orber/test/orber_test_server_impl.erl index 35296cb619..10a9caf242 100644 --- a/lib/orber/test/orber_test_server_impl.erl +++ b/lib/orber/test/orber_test_server_impl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -55,6 +55,9 @@ testing_iiop_void/2, testing_iiop_context/2, testing_iiop_server_marshal/3, + testing_iiop_rec_any/3, + testing_iiop_rec_struct/3, + testing_iiop_rec_union/3, relay_call/3, relay_cast/3, %% Testing pseudo calls. @@ -197,6 +200,16 @@ testing_iiop_context(_Self, State) -> testing_iiop_server_marshal(_Self, State, _String) -> {reply, {ok, false}, State}. +testing_iiop_rec_any(_Self, State, RAny) -> + {reply, RAny, State}. + +testing_iiop_rec_struct(_Self, State, RecS) -> + {reply, RecS, State}. + +testing_iiop_rec_union(_Self, State, RecU) -> + {reply, RecU, State}. + + testing_iiop_oneway_delay(_Self, State, Time) -> timer:sleep(Time), {noreply, State}. -- cgit v1.2.3 From 508a6d2a69e5d3395816fa353d813adb61aa835f Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Thu, 18 Nov 2010 17:30:26 +0200 Subject: Shut off some dialyzer warnings --- lib/asn1/src/asn1ct.erl | 3 ++- lib/asn1/src/asn1ct_constructed_per.erl | 6 ++---- lib/asn1/src/asn1rt_ber_bin.erl | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl index 968468cb7f..fb2614aa2c 100644 --- a/lib/asn1/src/asn1ct.erl +++ b/lib/asn1/src/asn1ct.erl @@ -149,7 +149,7 @@ compile1(File,Options) when is_list(Options) -> inline(true,Name,Module,Options) -> RTmodule = get_runtime_mod(Options), IgorOptions = igorify_options(remove_asn_flags(Options)), - IgorName = filename:rootname(filename:basename(Name)), + IgorName = list_to_atom(filename:rootname(filename:basename(Name))), % io:format("*****~nName: ~p~nModules: ~p~nIgorOptions: ~p~n*****~n", % [IgorName,Modules++RTmodule,IgorOptions]), report_verbose("Inlining modules: ~p in ~p~n",[[Module]++RTmodule,IgorName],Options), @@ -1183,6 +1183,7 @@ is_inline(Options) -> _ -> lists:keymember(inline,1,Options) end. + inline_output(Options,Default) -> case [X||{inline,X}<-Options] of [OutputName] -> diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl index cce6eb9831..d6f23aca06 100644 --- a/lib/asn1/src/asn1ct_constructed_per.erl +++ b/lib/asn1/src/asn1ct_constructed_per.erl @@ -326,16 +326,14 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) -> textual_order([#'ComponentType'{textual_order=undefined}|_],TermList) -> TermList; textual_order(CompList,TermList) when is_list(CompList) -> - OrderList = [Ix||#'ComponentType'{textual_order=Ix} <- CompList], + OrderList = [Ix||#'ComponentType'{textual_order=Ix} <- CompList], [Term||{_,Term}<- lists:sort(lists:zip(OrderList, lists:sublist(TermList,length(OrderList))))]; %% sublist is just because Termlist can sometimes be longer than %% OrderList, which it really shouldn't textual_order({Root,Ext},TermList) -> - textual_order(Root ++ Ext,TermList); -textual_order({Root1,Ext,Root2},TermList) -> - textual_order(Root1 ++ Ext ++ Root2, TermList). + textual_order(Root ++ Ext,TermList). to_textual_order({Root,Ext}) -> {to_textual_order(Root),Ext}; diff --git a/lib/asn1/src/asn1rt_ber_bin.erl b/lib/asn1/src/asn1rt_ber_bin.erl index ab04d981b0..22f9f2ecfd 100644 --- a/lib/asn1/src/asn1rt_ber_bin.erl +++ b/lib/asn1/src/asn1rt_ber_bin.erl @@ -2192,12 +2192,12 @@ decode_tag_and_length(Buffer) -> %% Check if valid tag %% %% check_if_valid_tag(Tag, List_of_valid_tags, OptOrMand) -> name of the tag -%%=============================================================================== +%%============================================================================ check_if_valid_tag(<<0,0,_/binary>>,_,_) -> asn1_EOC; check_if_valid_tag(<<>>, _, OptOrMand) -> - check_if_valid_tag2(false,[],[],OptOrMand); + check_if_valid_tag2_error([], OptOrMand); check_if_valid_tag(Bytes, ListOfTags, OptOrMand) when is_binary(Bytes) -> {Tag, _, _} = decode_tag(Bytes), check_if_valid_tag(Tag, ListOfTags, OptOrMand); @@ -2217,7 +2217,6 @@ check_if_valid_tag(Tag, ListOfTags, OptOrMand) -> check_if_valid_tag2(_Class_TagNo, [], Tag, MandOrOpt) -> check_if_valid_tag2_error(Tag,MandOrOpt); - check_if_valid_tag2(Class_TagNo, [{TagName,TagList}|T], Tag, OptOrMand) -> case check_if_valid_tag_loop(Class_TagNo, TagList) of true -> @@ -2226,7 +2225,7 @@ check_if_valid_tag2(Class_TagNo, [{TagName,TagList}|T], Tag, OptOrMand) -> check_if_valid_tag2(Class_TagNo, T, Tag, OptOrMand) end. --spec(check_if_valid_tag2_error/2 :: (term(),atom()) -> no_return()). +-spec check_if_valid_tag2_error(term(), atom()) -> no_return(). check_if_valid_tag2_error(Tag,mandatory) -> exit({error,{asn1,{invalid_tag,Tag}}}); -- cgit v1.2.3 From 7a6607d6326d93a92d701d0b505a48f32ed68d10 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Sep 2010 10:46:02 +0200 Subject: Fix so that groups can return external test cases, i.e. groups() -> [{test, [sequence], [{other_suite, all}]}]. --- lib/common_test/src/ct_framework.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index f2ca023cff..3bbb338121 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -770,6 +770,11 @@ find(Mod, Name, TCs, [TC | Gs], Known, Defs, false) when is_atom(TC) -> find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; +find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, true) + when is_atom(ExternalTC), + is_atom(Case) -> + [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> Where = if length(Known) == 0 -> atom_to_list(Mod)++":groups/0"; -- cgit v1.2.3 From 6a05b2c05f0e83ad9a98d8b3d09740f564d64f89 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 1 Oct 2010 17:27:49 +0200 Subject: Update so that when asking for os and we are in the test_server_ctrl process, just use os:type(). --- lib/test_server/src/test_server_ctrl.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 1dc5646184..2ab7b799fc 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -533,6 +533,8 @@ get_target_os_type() -> undefined -> %% This is probably called on the target node os:type(); + Pid when Pid =:= self() -> + os:type(); _pid -> %% This is called on the controller, e.g. from a %% specification clause of a test case -- cgit v1.2.3 From 0c86f27f70a46e2c28bd70ac8d4406fb8ceaf5dd Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 14:27:25 +0100 Subject: Added print operations for tables vacmSecurityToGroupTable and vacmViewTreeFamilyTable. There is still vacmAccessTable and vacmContextTable. --- lib/snmp/src/agent/snmp_target_mib.erl | 9 +-- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 86 ++++++++++++++++++++++++++ lib/snmp/vsn.mk | 2 +- 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl index 3c32d1f59f..033dfdd92e 100644 --- a/lib/snmp/src/agent/snmp_target_mib.erl +++ b/lib/snmp/src/agent/snmp_target_mib.erl @@ -591,12 +591,9 @@ snmpTargetAddrTable(print) -> ?'snmpTargetAddrRowStatus_active' -> active; _ -> undefined end, - Prefix, - element(?snmpTargetAddrEngineId, Row), - Prefix, - element(?snmpTargetAddrTMask, Row), - Prefix, - element(?snmpTargetAddrMMS, Row)])) + Prefix, element(?snmpTargetAddrEngineId, Row), + Prefix, element(?snmpTargetAddrTMask, Row), + Prefix, element(?snmpTargetAddrMMS, Row)])) end, snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); %% Op == new | delete diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..9aff0f9810 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -348,6 +348,49 @@ vacmContextTable(Op, Arg1, Arg2) -> snmp_framework_mib:intContextTable(Op, Arg1, Arg2). +vacmSecurityToGroupTable(print) -> + Table = vacmSecurityToGroupTable, + DB = db(Table), + FOI = foi(Table), + PrintRow = + fun(Prefix, Row) -> + lists:flatten( + io_lib:format("~sSecurityModel: ~p (~w)" + "~sSecurityName: ~p" + "~sGroupName: ~p" + "~sStorageType: ~p (~w)" + "~sStatus: ~p (~w)", + [Prefix, element(?vacmSecurityModel, Row), + case element(?vacmSecurityModel, Row) of + ?SEC_ANY -> any; + ?SEC_V1 -> v1; + ?SEC_V2C -> v2c; + ?SEC_USM -> usm; + _ -> undefined + end, + Prefix, element(?vacmSecurityName, Row), + Prefix, element(?vacmGroupName, Row), + Prefix, element(?vacmSecurityToGroupStorageType, Row), + case element(?vacmSecurityToGroupStorageType, Row) of + ?'vacmSecurityToGroupStorageType_readOnly' -> readOnly; + ?'vacmSecurityToGroupStorageType_permanent' -> permanent; + ?'vacmSecurityToGroupStorageType_nonVolatile' -> nonVolatile; + ?'vacmSecurityToGroupStorageType_volatile' -> volatile; + ?'vacmSecurityToGroupStorageType_other' -> other; + _ -> undefined + end, + Prefix, element(?vacmSecurityToGroupStatus, Row), + case element(?vacmSecurityToGroupStatus, Row) of + ?'vacmSecurityToGroupStatus_destroy' -> destroy; + ?'vacmSecurityToGroupStatus_createAndWait' -> createAndWait; + ?'vacmSecurityToGroupStatus_createAndGo' -> createAndGo; + ?'vacmSecurityToGroupStatus_notReady' -> notReady; + ?'vacmSecurityToGroupStatus_notInService' -> notInService; + ?'vacmSecurityToGroupStatus_active' -> active; + _ -> undefined + end])) + end, + snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); vacmSecurityToGroupTable(Op) -> snmp_generic:table_func(Op, db(vacmSecurityToGroupTable)). @@ -719,6 +762,49 @@ vacmViewSpinLock(set, NewVal) -> {vacmViewSpinLock, volatile}). +vacmViewTreeFamilyTable(print) -> + Table = vacmViewTreeFamilyTable, + DB = db(Table), + FOI = foi(Table), + PrintRow = + fun(Prefix, Row) -> + lists:flatten( + io_lib:format("~sViewName: ~p" + "~sSubtree: ~p" + "~sMask: ~p" + "~sType: ~p (~w)" + "~sStorageType: ~p (~w)" + "~sStatus: ~p (~w)", + [Prefix, element(?vacmViewTreeFamilyViewName, Row), + Prefix, element(?vacmViewTreeFamilySubtree, Row), + Prefix, element(?vacmViewTreeFamilyMask, Row), + Prefix, element(?vacmViewTreeFamilyType, Row), + case element(?vacmViewTreeFamilyType, Row) of + ?vacmViewTreeFamilyType_included -> included; + ?vacmViewTreeFamilyType_excluded -> excluded; + _ -> undefined + end, + Prefix, element(?vacmViewTreeFamilyStorageType, Row), + case element(?vacmViewTreeFamilyStorageType, Row) of + ?vacmViewTreeFamilyStorageType_readOnly -> readOnly; + ?vacmViewTreeFamilyStorageType_permanent -> permanent; + ?vacmViewTreeFamilyStorageType_nonVolatile -> nonVolatile; + ?vacmViewTreeFamilyStorageType_volatile -> volatile; + ?vacmViewTreeFamilyStorageType_other -> other; + _ -> undefined + end, + Prefix, element(?vacmViewTreeFamilyStatus, Row), + case element(?vacmViewTreeFamilyStatus, Row) of + ?vacmViewTreeFamilyStatus_destroy -> destroy; + ?vacmViewTreeFamilyStatus_createAndWait -> createAndWait; + ?vacmViewTreeFamilyStatus_createAndGo -> createAndGo; + ?vacmViewTreeFamilyStatus_notReady -> notReady; + ?vacmViewTreeFamilyStatus_notInService -> notInService; + ?vacmViewTreeFamilyStatus_active -> active; + _ -> undefined + end])) + end, + snmpa_mib_lib:print_table(Table, DB, FOI, PrintRow); vacmViewTreeFamilyTable(Op) -> snmp_generic:table_func(Op, db(vacmViewTreeFamilyTable)). vacmViewTreeFamilyTable(get_next, RowIndex, Cols) -> diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..ac9a192f5d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,3 @@ -SNMP_VSN = 4.18 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From fc649b12007a5d9a895c9bbcc4a3ede76085e35d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 16:02:57 +0100 Subject: For the table vacmAccessTable, when performing the is_set_ok and set opteration(s), all values of the vacmAccessSecurityModel column was incorrectly translated to "any". --- lib/.gitignore | 4 ++ lib/snmp/doc/src/notes.xml | 74 ++++++++++++++++++++++---- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 12 ++--- lib/snmp/src/app/snmp.appup.src | 10 ++++ lib/snmp/vsn.mk | 21 +++++++- 5 files changed, 103 insertions(+), 18 deletions(-) diff --git a/lib/.gitignore b/lib/.gitignore index 340baf5269..56b1ed2b84 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -531,6 +531,10 @@ /percept/doc/src/percept_profile.xml /percept/doc/src/percept_ug.xml +# snmp + +snmp/doc/intex.html + # syntax_tools /syntax_tools/doc/src/chapter.xml diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..ae429d0751 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,23 +32,75 @@ notes.xml -
SNMP 4.18 +
+ SNMP Development Toolkit 4.18.1 +

Version 4.18.1 supports code replacement in runtime from/to + version 4.18, 4.17.1 and 4.17.

+ +
+ Improvements and new features +

-

+
+ +
+ Reported Fixed Bugs and Malfunctions + + +

[agent] For the table vacmAccessTable, + when performing a is_set_ok or a set opteration, + all values of the vacmAccessSecurityModel column was + incorrectly translated to any.

+ +

Own Id: OTP-8980

+
+
+
+ +
+ Incompatibilities +

-

+
+
+ + +
+ SNMP Development Toolkit 4.18 +

Version 4.18 supports code replacement in runtime from/to + version 4.17.1 and 4.17.

+ +
+ Improvements and new features + + +

Prepared for R14B release.

+
+
+
Fixed Bugs and Malfunctions - +

-

+ +
+ +
+ Incompatibilities +

-

+
-
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

@@ -62,8 +114,8 @@ Reported Fixed Bugs and Malfunctions -

When the function FilterMod:accept_recv/2 - returned false the SNMP agent stopped collecting messages from UDP.

+

[agent] When the function FilterMod:accept_recv/2 returned false + the SNMP agent stopped collecting messages from UDP.

Own Id: OTP-8761

diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..c0bc727c68 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -402,13 +402,13 @@ verify_vacmSecurityToGroupTable_cols([{Col, Val0}|Cols], Acc) -> verify_vacmSecurityToGroupTable_col(?vacmSecurityModel, Model) -> case Model of any -> ?SEC_ANY; - v1 -> ?SEC_ANY; - v2c -> ?SEC_ANY; - usm -> ?SEC_ANY; + v1 -> ?SEC_V1; + v2c -> ?SEC_V2C; + usm -> ?SEC_USM; ?SEC_ANY -> ?SEC_ANY; - ?SEC_V1 -> ?SEC_ANY; - ?SEC_V2C -> ?SEC_ANY; - ?SEC_USM -> ?SEC_ANY; + ?SEC_V1 -> ?SEC_V1; + ?SEC_V2C -> ?SEC_V2C; + ?SEC_USM -> ?SEC_USM; _ -> ?vlog("verification of vacmSecurityModel(~w) ~p failed", [?vacmSecurityModel, Model]), diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..03a0044908 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,11 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.18", + [ + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, @@ -66,6 +71,11 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.18", + [ + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..67cc05687d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.18.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 5d01e37654bda53b0c81a654936abbaeb0e2f7d9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 16:07:00 +0100 Subject: For the table vacmAccessTable, when performing the is_set_ok and set opteration(s), all values of the vacmAccessSecurityModel column was incorrectly translated to "any". --- lib/snmp/doc/src/notes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index ae429d0751..f3bb9d25ea 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -47,8 +47,8 @@

[agent] For the table vacmAccessTable, - when performing a is_set_ok or a set opteration, - all values of the vacmAccessSecurityModel column was + when performing the is_set_ok and set opteration(s), + all values of the vacmAccessSecurityModel column was incorrectly translated to any.

+ +
SNMP 4.18
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Prepared for R14B.

-
+
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

diff --git a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml index ffea256608..d595f6b93b 100644 --- a/lib/snmp/doc/src/snmp_view_based_acm_mib.xml +++ b/lib/snmp/doc/src/snmp_view_based_acm_mib.xml @@ -4,7 +4,7 @@
- 19992009 + 19992010 Ericsson AB. All Rights Reserved. @@ -38,7 +38,10 @@ SNMP-VIEW-BASED-ACM-MIB, and functions for configuring the database.

The configuration files are described in the SNMP User's Manual.

+ + + configure(ConfDir) -> void() @@ -48,27 +51,24 @@

This function is called from the supervisor at system - start-up. -

+ start-up.

Inserts all data in the configuration files into the - database and destroys all old rows with StorageType - volatile. The rows created from the configuration file - will have StorageType nonVolatile. -

-

All snmp counters are set to zero. -

+ database and destroys all old rows with StorageType + volatile. The rows created from the configuration file + will have StorageType nonVolatile.

+

All snmp counters are set to zero.

If an error is found in the configuration file, it is - reported using the function config_err/2 of the error - report module, and the function fails with the reason - configuration_error. -

+ reported using the function config_err/2 of the error + report module, and the function fails with the reason + configuration_error.

ConfDir is a string which points to the directory - where the configuration files are found. -

-

The configuration file read is: vacm.conf. -

+ where the configuration files are found.

+

The configuration file read is: vacm.conf.

+ +
+ reconfigure(ConfDir) -> void() Configure the SNMP-VIEW-BASED-ACM-MIB @@ -88,18 +88,20 @@

All snmp counters are set to zero.

If an error is found in the configuration file, it is - reported using the function config_err/2 of the error - report module, and the function fails with the reason + reported using the function + config_err/2 + of the error report module, and the function fails with the reason configuration_error.

ConfDir is a string which points to the directory where the configuration files are found.

-

The configuration file read is: vacm.conf. - -

+

The configuration file read is: vacm.conf.

+ +
+ add_sec2group(SecModel, SecName, GroupName) -> Ret Add one security to group definition @@ -113,10 +115,13 @@

Adds a security to group definition to the agent config. - Equivalent to one vacmSecurityToGroup-line in the vacm.conf file.

+ Equivalent to one vacmSecurityToGroup-line in the + vacm.conf file.

+
+ delete_sec2group(Key) -> Ret Delete one security to group definition @@ -127,9 +132,11 @@

Delete a security to group definition from the agent config.

+
+ add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) -> Ret Add one access definition @@ -148,10 +155,12 @@

Adds a access definition to the agent config. - Equivalent to one vacmAccess-line in the vacm.conf file.

- + Equivalent to one vacmAccess-line in the vacm.conf file.

+ +
+ delete_access(Key) -> Ret Delete one access definition @@ -161,10 +170,12 @@ Reason = term() -

Delete a access definition from the agent config.

- +

Delete a access definition from the agent config.

+ +
+ add_view_tree_fam(ViewIndex, SubTree, Status, Mask) -> Ret Add one view tree family definition @@ -178,11 +189,14 @@ Reason = term() -

Adds a view tree family definition to the agent config. - Equivalent to one vacmViewTreeFamily-line in the vacm.conf file.

- +

Adds a view tree family definition to the agent config. + Equivalent to one vacmViewTreeFamily-line in the + vacm.conf file.

+ +
+ delete_view_tree_fam(Key) -> Ret Delete one view tree family definition diff --git a/lib/snmp/doc/src/snmpa_error.xml b/lib/snmp/doc/src/snmpa_error.xml index a7312e8b24..4dbafdfbb7 100644 --- a/lib/snmp/doc/src/snmpa_error.xml +++ b/lib/snmp/doc/src/snmpa_error.xml @@ -4,7 +4,7 @@
- 20022009 + 20022010 Ericsson AB. All Rights Reserved. @@ -51,6 +51,8 @@ error_report_mod, see configuration parameters.

+ + @@ -67,8 +69,11 @@

Format and Args are as in io:format(Format, Args).

+ +
+ user_err(Format, Args) -> void() Called if a user related error occurs diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..5e188c74c5 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -181,6 +181,8 @@ init_tabs(Sec2Group, Access, View) -> snmpa_local_db:table_delete(db(vacmSecurityToGroupTable)), snmpa_local_db:table_create(db(vacmSecurityToGroupTable)), init_sec2group_table(Sec2Group), + ?vdebug("create vacm access table",[]), + snmpa_vacm:cleanup(), init_access_table(Access), ?vdebug("create vacm view-tree-family table",[]), snmpa_local_db:table_delete(db(vacmViewTreeFamilyTable)), diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 2eacea4301..91cecfcd1e 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -export([get_mib_view/5]). -export([init/1, init/2, backup/1]). -export([delete/1, get_row/1, get_next_row/1, insert/1, insert/2, - dump_table/0]). + cleanup/0, dump_table/0]). -include("SNMPv2-TC.hrl"). -include("SNMP-VIEW-BASED-ACM-MIB.hrl"). @@ -256,6 +256,10 @@ delete(Key) -> ets:delete(snmpa_vacm, Key), dump_table(). + +cleanup() -> + ets:delete_all_objects(snmpa_vacm). + dump_table(true) -> dump_table(); dump_table(_) -> diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..fafbf79bb7 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,12 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, @@ -66,6 +72,12 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..67cc05687d 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2010. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.18.1 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From e67b8b37c5aabe83f8872fcf71e865591af5552b Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 8 Dec 2010 16:05:42 +0100 Subject: Added preliminary veariable support. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 6 ++ lib/snmp/src/agent/snmpa.erl | 103 ++++++++++++++++++++----- 2 files changed, 89 insertions(+), 20 deletions(-) diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index f91262ab57..f98b799631 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -781,6 +781,12 @@ split_cols([Col | Cols], PreCols) when Col =< 3 -> split_cols(Cols, PreCols) -> {PreCols, Cols}. +vacmViewSpinLock(print) -> + case vacmViewSpinLock(get) of + {value, Val} -> io:format("vacmViewSpinLock => ~p~n", [Val]); + Error -> io:format("vacmViewSpinLock => ERROR: ~p~n", [Error]) + end; + vacmViewSpinLock(new) -> snmp_generic:variable_func(new, {vacmViewSpinLock, volatile}), {A1,A2,A3} = erlang:now(), diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index f109741759..88417b19fe 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -105,7 +105,7 @@ set_request_limit/1, set_request_limit/2 ]). --export([print_tables/0, print_tables/1]). +-export([print_mib_info/0, print_mib_tables/0, print_mib_variables/0]). -include("snmpa_atl.hrl"). @@ -285,31 +285,94 @@ whereis_mib(Agent, Mib) when is_atom(Mib) -> %% - -print_tables() -> - Tables = [ - {snmp_view_based_acm_mib, [vacmAccessTable, - vacmSecurityToGroupTable, - vacmViewTreeFamilyTable]}, - {snmp_target_mib, [snmpTargetAddrTable, snmpTargetParamsTable]}, - {snmp_community_mib, [snmpCommunityTable]}, - {snmp_notification_mib, [snmpNotifyTable]}, - {snmp_user_based_sm_mib, [usmUserTable]} - ], - print_tables(Tables). - -print_tables([]) -> - ok; -print_tables([{Mod, Tables}|MibTables]) when is_atom(Mod) andalso is_list(Tables) -> +mibs_info() -> + [ + {snmp_view_based_acm_mib, + [ + vacmAccessTable, + vacmSecurityToGroupTable, + vacmViewTreeFamilyTable + ], + [ + vacmViewSpinLock + ]}, + {snmp_target_mib, + [ + snmpTargetAddrTable, + snmpTargetParamsTable + ], + [ + snmpTargetSpinLock + ]}, + {snmp_community_mib, + [ + snmpCommunityTable + ], + []}, + {snmp_notification_mib, + [ + snmpNotifyTable + ], + []}, + {snmp_user_based_sm_mib, + [ + usmUserTable + ], + [ + usmUserSpinLock + ]}]. + +print_mib_info() -> + MibsInfo = mibs_info(), + print_mib_info(MibsInfo). + +print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> + io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_variables(Mod, Variables), print_tables(Mod, Tables), - print_tables(MibTables); -print_tables([_|MibTables]) -> - print_tables(MibTables). + print_mib_info(MibsInfo). -print_tables(Mod, Tables) -> + +print_mib_tables() -> + Tables = [{Mod, Tabs} || {Mod, Tabs, _Vars} <- mibs_info()], + print_mib_tables(Tables). + +print_mib_tables([]) -> + ok; +print_mib_tables([{Mod, Tabs}|MibTabs]) when is_atom(Mod) andalso is_list(Tabs) -> + print_mib_tables(Mod, Tabs), + print_mib_tables(MibTabs); +print_mib_tables([_|MibTabs]) -> + print_mib_tables(MibTabs). + +print_mib_tables(Mod, Tables) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_tables(Mod, Tables). + +print_tables(Mod, Tables) -> [(catch Mod:Table(print)) || Table <- Tables]. +print_mib_variables() -> + Variables = [{Mod, Vars} || {Mod, _Tabs, Vars} <- mibs_info()], + print_mib_variables(Variables). + +print_mib_variables([]) -> + ok; +print_mib_variables([{Mod, Vars}|MibVars]) when is_atom(Mod) andalso is_list(Vars) -> + print_mib_variables(Mod, Vars), + print_mib_variables(MibVars); +print_mib_variables([_|MibVars]) -> + print_mib_variables(MibVars). + +print_mib_variables(Mod, Vars) -> + io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + print_variables(Mod, Vars). + +print_variables(Mod, Variables) -> + [(catch Mod:Variable(print)) || Variable <- Variables]. + + make_pretty_mib(snmp_view_based_acm_mib) -> "SNMP-VIEW-BASED-ACM-MIB"; make_pretty_mib(snmp_target_mib) -> -- cgit v1.2.3 From 9f4d45da9bfa3b1f5d3d345e48447ad89088afc9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 20 Sep 2010 15:40:27 +0200 Subject: Update framework callbacks to use end_tc/4 if available. end_tc/4 can return anything which init_tc/3 can, and also modify the COnfig variable when called from init_per_suite and init_per_group --- lib/common_test/src/ct_suite_callback.erl | 92 +++++++++++++++++++++++++ lib/test_server/src/test_server.erl | 107 ++++++++++++++++-------------- 2 files changed, 151 insertions(+), 48 deletions(-) create mode 100644 lib/common_test/src/ct_suite_callback.erl diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl new file mode 100644 index 0000000000..db4ac9a4ec --- /dev/null +++ b/lib/common_test/src/ct_suite_callback.erl @@ -0,0 +1,92 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Framework test execution control module. +%%% +%%%

This module is a proxy for calling and handling suite callbacks.

+ +-module(ct_suite_callback). + +%% API Exports +-export([init/1]). +-export([init_tc/3]). +-export([end_tc/4]). +-export([terminate/2]). + +-type proplist() :: [{atom(),term()}]. + +-define(config_name, suite_callbacks). + +%% API Functions + +%% @doc Called before any suites are started +-spec init(State :: term()) -> ok | + {error, Reason :: term()}. +init(Opts) -> + add_new_callbacks(Opts), + ok. + +%% @doc Called after all suites are done. +-spec terminate(Config :: proplist(),State :: term()) -> + ok. +terminate(Config, State) -> + ok. + +%% @doc Called as each test case is started. This includes all configuration +%% tests. +-spec init_tc(Mod :: atom(), Func :: atom(), Config :: proplist()) -> + {ok, NewConfig :: proplist()} | + {skip, Reason :: term()} | + {auto_skip, Reason :: term()} | + {error, Reason :: term()}. +init_tc(Mod, init_per_suite, Config) -> + add_new_callbacks(Config), + {ok, Config}; +init_tc(Mod, Func, Config) -> + {ok, Config}. + +%% @doc Called as each test case is completed. This includes all configuration +%% tests. +-spec end_tc(Mod :: atom(), + Func :: atom(), + Config :: proplist(), + Result :: term()) -> + {ok, NewConfig :: proplist()} | + {skip, Reason :: term()} | + {auto_skip, Reason :: term()} | + {error, Reason :: term()} | + ok. +end_tc(Mod, Func, Config, Result) -> + {ok, Config}. + + +%% Iternal Functions +add_new_callbacks(Config) -> + NewCBConfs = lists:flatmap(fun({?config_name, CallbackConfigs}) -> + CallbackConfigs; + (_) -> + [] + end, Config), + CBStates = lists:map(fun call_init/1,NewCBConfs), + ct_util:save_suite_data_async(?config_name, CBStates). + +call_init({Mod, Config}) -> + {Mod, Mod:init(Config)}. + + diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index ee121e5bb6..3d27788b64 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -935,8 +935,7 @@ spawn_fw_call(Mod,{init_per_testcase,Func},Pid,{timetrap_timeout,TVal}=Why, Skip = {skip,{failed,{Mod,init_per_testcase,Why}}}, %% if init_per_testcase fails, the test case %% should be skipped - case catch test_server_sup:framework_call( - end_tc,[?pl2a(Mod),Func,{Pid,Skip,[[]]}]) of + case catch do_end_tc_call(Mod,Func,{Pid,Skip,[[]]},Why) of {'EXIT',FwEndTCErr} -> exit({fw_notify_done,end_tc,FwEndTCErr}); _ -> @@ -955,11 +954,9 @@ spawn_fw_call(Mod,{end_per_testcase,Func},Pid,{timetrap_timeout,TVal}=Why, Conf = [{tc_status,ok}], %% if end_per_testcase fails, the test case should be %% reported successful with a warning printed as comment - case catch test_server_sup:framework_call(end_tc, - [?pl2a(Mod),Func, - {Pid, - {failed,{Mod,end_per_testcase,Why}}, - [Conf]}]) of + case catch do_end_tc_call(Mod,Func,{Pid, + {failed,{Mod,end_per_testcase,Why}}, + [Conf]}, Why) of {'EXIT',FwEndTCErr} -> exit({fw_notify_done,end_tc,FwEndTCErr}); _ -> @@ -1001,9 +998,7 @@ spawn_fw_call(Mod,Func,Pid,Error,Loc,SendTo,Comment) -> ok end, Conf = [{tc_status,{failed,timetrap_timeout}}], - case catch test_server_sup:framework_call(end_tc, - [?pl2a(Mod),Func, - {Pid,Error,[Conf]}]) of + case catch do_end_tc_call(Mod,Func,{Pid,Error,[Conf]},Error) of {'EXIT',FwEndTCErr} -> exit({fw_notify_done,end_tc,FwEndTCErr}); _ -> @@ -1069,26 +1064,23 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit, {{Time,Value},Loc,Opts} = case test_server_sup:framework_call(init_tc,[?pl2a(Mod),Func,Args0], - {ok,Args0}) of + {ok, Args0}) of {ok,Args} -> run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback); Error = {error,_Reason} -> - test_server_sup:framework_call(end_tc,[?pl2a(Mod),Func,{Error,Args0}]), + do_end_tc_call(Mod,Func,{Error,Args0}, Error), {{0,{skip,{failed,Error}}},{Mod,Func},[]}; {fail,Reason} -> [Conf] = Args0, Conf1 = [{tc_status,{failed,Reason}} | Conf], fw_error_notify(Mod, Func, Conf, Reason), - test_server_sup:framework_call(end_tc,[?pl2a(Mod),Func, - {{error,Reason},[Conf1]}]), + do_end_tc_call(Mod,Func, {{error,Reason},[Conf1]},{fail, Reason}), {{0,{failed,Reason}},{Mod,Func},[]}; Skip = {skip,_Reason} -> - test_server_sup:framework_call(end_tc,[?pl2a(Mod),Func,{Skip,Args0}]), + do_end_tc_call(Mod,Func,{Skip,Args0},Skip), {{0,Skip},{Mod,Func},[]}; {auto_skip,Reason} -> - test_server_sup:framework_call(end_tc,[?pl2a(Mod), - Func, - {{skip,Reason},Args0}]), + do_end_tc_call(Mod, Func, {{skip,Reason},Args0}, {auto_skip, Reason}), {{0,{skip,{fw_auto_skip,Reason}}},{Mod,Func},[]} end, exit({Ref,Time,Value,Loc,Opts}). @@ -1103,14 +1095,13 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) -> Skip = {skip,Reason} -> Line = get_loc(), Conf = [{tc_status,{skipped,Reason}}], - test_server_sup:framework_call(end_tc,[?pl2a(Mod),Func,{Skip,[Conf]}]), - {{0,{skip,Reason}},Line,[]}; + NewRes = do_end_tc_call(Mod,Func,{Skip,[Conf]}, skipped), + {{0,NewRes},Line,[]}; {skip_and_save,Reason,SaveCfg} -> Line = get_loc(), Conf = [{tc_status,{skipped,Reason}},{save_config,SaveCfg}], - test_server_sup:framework_call(end_tc,[?pl2a(Mod),Func, - {{skip,Reason},[Conf]}]), - {{0,{skip,Reason}},Line,[]}; + NewRes = do_end_tc_call(Mod, Func, {{skip, Reason}, [Conf]}, skipped_and_saved), + {{0,NewRes},Line,[]}; {ok,NewConf} -> put(test_server_init_or_end_conf,undefined), %% call user callback function if defined @@ -1155,13 +1146,12 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) -> {FWReturn,TSReturn,EndConf1} end, put(test_server_init_or_end_conf,undefined), - case test_server_sup:framework_call(end_tc, [?pl2a(Mod), Func, - {FWReturn1,[EndConf2]}]) of - {fail,Reason} -> - fw_error_notify(Mod, Func, EndConf2, Reason), - {{T,{failed,Reason}},{Mod,Func},[]}; - _ -> - {{T,TSReturn1},Loc,[]} + case do_end_tc_call(Mod, Func, {FWReturn1,[EndConf2]}, TSReturn1) of + {failed,Reason} = NewReturn -> + fw_error_notify(Mod,Func,EndConf2, Reason), + {{T,NewReturn},{Mod,Func},[]}; + NewReturn -> + {{T,NewReturn},Loc,[]} end end; skip_init -> @@ -1179,10 +1169,31 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) -> {{T,Return},Loc} = {ts_tc(Mod, Func, Args2),get_loc()}, %% call user callback function if defined Return1 = user_callback(TCCallback, Mod, Func, 'end', Return), - {Return2,Opts} = process_return_val([Return1], Mod,Func,Args1, Loc, Return1), + {Return2,Opts} = process_return_val([Return1], Mod, Func, + Args1, Loc, Return1), {{T,Return2},Loc,Opts} end. +do_end_tc_call(M,F,Res,Return) -> + Ref = make_ref(), + case test_server_sup:framework_call( + end_tc, [?pl2a(M),F,Res], Ref) of + {fail,FWReason} -> + {failed,FWReason}; + Ref -> + case test_server_sup:framework_call( + end_tc, [?pl2a(M),F,Res, Return], ok) of + {fail,FWReason} -> + {failed,FWReason}; + ok -> + Return; + NewReturn -> + NewReturn + end; + _ -> + Return + end. + %% the return value is a list and we have to check if it contains %% the result of an end conf case or if it's a Config list process_return_val([Return], M,F,A, Loc, Final) when is_list(Return) -> @@ -1197,13 +1208,13 @@ process_return_val([Return], M,F,A, Loc, Final) when is_list(Return) -> end, Return) of true -> % must be return value from end conf case process_return_val1(Return, M,F,A, Loc, Final, []); - false -> % must be Config value from init conf case - case test_server_sup:framework_call(end_tc, [?pl2a(M),F,{ok,A}]) of - {fail,FWReason} -> + false -> % must be Config value from init conf case + case do_end_tc_call(M,F,{ok,A}, Return) of + {failed, FWReason} = Failed -> fw_error_notify(M,F,A, FWReason), - {{failed,FWReason},[]}; - _ -> - {Return,[]} + {Failed, []}; + NewReturn -> + {NewReturn, []} end end; %% the return value is not a list, so it's the return value from an @@ -1211,13 +1222,13 @@ process_return_val([Return], M,F,A, Loc, Final) when is_list(Return) -> process_return_val(Return, M,F,A, Loc, Final) -> process_return_val1(Return, M,F,A, Loc, Final, []). -process_return_val1([Failed={E,TCError}|_], M,F,A=[Args], Loc, _, SaveOpts) when E=='EXIT'; - E==failed -> +process_return_val1([Failed={E,TCError}|_], M,F,A=[Args], Loc, _, SaveOpts) + when E=='EXIT'; + E==failed -> fw_error_notify(M,F,A, TCError, mod_loc(Loc)), - case test_server_sup:framework_call(end_tc, - [?pl2a(M),F,{{error,TCError}, - [[{tc_status,{failed,TCError}}|Args]]}]) of - {fail,FWReason} -> + case do_end_tc_call(M,F,{{error,TCError}, + [[{tc_status,{failed,TCError}}|Args]]}, Failed) of + {failed,FWReason} -> {{failed,FWReason},SaveOpts}; _ -> {Failed,SaveOpts} @@ -1234,8 +1245,8 @@ process_return_val1([RetVal={Tag,_}|Opts], M,F,A, Loc, _, SaveOpts) when Tag==sk process_return_val1([_|Opts], M,F,A, Loc, Final, SaveOpts) -> process_return_val1(Opts, M,F,A, Loc, Final, SaveOpts); process_return_val1([], M,F,A, _Loc, Final, SaveOpts) -> - case test_server_sup:framework_call(end_tc, [?pl2a(M),F,{Final,A}]) of - {fail,FWReason} -> + case do_end_tc_call(M,F,{Final,A}, Final) of + {failed,FWReason} -> {{failed,FWReason},SaveOpts}; _ -> {Final,lists:reverse(SaveOpts)} @@ -1263,7 +1274,7 @@ init_per_testcase(Mod, Func, Args) -> false -> code:load_file(Mod); _ -> ok end, - %% init_per_testcase defined, returns new configuration +%% init_per_testcase defined, returns new configuration case erlang:function_exported(Mod,init_per_testcase,2) of true -> case catch my_apply(Mod, init_per_testcase, [Func|Args]) of @@ -1306,8 +1317,8 @@ init_per_testcase(Mod, Func, Args) -> {skip,{failed,{Mod,init_per_testcase,Other}}} end; false -> - %% Optional init_per_testcase not defined - %% keep quiet. +%% Optional init_per_testcase not defined +%% keep quiet. [Config] = Args, {ok, Config} end. -- cgit v1.2.3 From ec4c840624a9a44d4d7d6b1e51e1f33a291a704b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 20 Sep 2010 15:46:12 +0200 Subject: Add support for suite_callback in spec, command_line and interactive. Start work on suite_callback functionality. --- lib/common_test/src/Makefile | 3 +- lib/common_test/src/ct_framework.erl | 36 +++++++++------ lib/common_test/src/ct_run.erl | 75 ++++++++++++++++++++++++------- lib/common_test/src/ct_suite_callback.erl | 73 +++++++++++++++++++++--------- lib/common_test/src/ct_testspec.erl | 16 +++++++ lib/common_test/src/ct_util.erl | 22 ++++++++- lib/common_test/src/ct_util.hrl | 1 + 7 files changed, 174 insertions(+), 52 deletions(-) diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile index 027667e6b0..14a0a27051 100644 --- a/lib/common_test/src/Makefile +++ b/lib/common_test/src/Makefile @@ -67,7 +67,8 @@ MODULES= \ ct_config \ ct_config_plain \ ct_config_xml \ - ct_slave + ct_slave \ + ct_suite_callback TARGET_MODULES= $(MODULES:%=$(EBIN)/%) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index f2ca023cff..8e6cfb5565 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -24,7 +24,7 @@ -module(ct_framework). --export([init_tc/3, end_tc/3, get_suite/2, report/2, warn/1]). +-export([init_tc/3, end_tc/4, get_suite/2, report/2, warn/1]). -export([error_notification/4]). -export([overview_html_header/1]). @@ -207,7 +207,7 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) -> {skip,{require_failed_in_suite0,Reason}}; {error,Reason} -> {auto_skip,{require_failed,Reason}}; - FinalConfig -> + {ok, FinalConfig} -> case MergeResult of {error,Reason} -> %% suite0 configure finished now, report that @@ -216,13 +216,20 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) -> _ -> case get('$test_server_framework_test') of undefined -> - FinalConfig; + ct_suite_init(Mod, FuncSpec, FinalConfig); Fun -> Fun(init_tc, FinalConfig) end end end. - + +ct_suite_init(Mod, Func, [Config]) when is_list(Config) -> + case ct_suite_callback:init_tc( Mod, Func, Config) of + NewConfig when is_list(NewConfig) -> + {ok, [NewConfig]}; + Else -> + Else + end. add_defaults(Mod,Func,FuncInfo,DoInit) -> case (catch Mod:suite()) of @@ -418,14 +425,14 @@ try_set_default(Name,Key,Info,Where) -> %%% %%% @doc Test server framework callback, called by the test_server %%% when a test case is finished. -end_tc(?MODULE,error_in_suite,_) -> % bad start! +end_tc(?MODULE,error_in_suite,_, _) -> % bad start! ok; -end_tc(Mod,Func,{TCPid,Result,[Args]}) when is_pid(TCPid) -> - end_tc(Mod,Func,TCPid,Result,Args); -end_tc(Mod,Func,{Result,[Args]}) -> - end_tc(Mod,Func,self(),Result,Args). +end_tc(Mod,Func,{TCPid,Result,[Args]}, Return) when is_pid(TCPid) -> + end_tc(Mod,Func,TCPid,Result,Args,Return); +end_tc(Mod,Func,{Result,[Args]}, Return) -> + end_tc(Mod,Func,self(),Result,Args,Return). -end_tc(Mod,Func,TCPid,Result,Args) -> +end_tc(Mod,Func,TCPid,Result,Args,Return) -> case lists:keysearch(watchdog,1,Args) of {value,{watchdog,Dog}} -> test_server:timetrap_cancel(Dog); false -> ok @@ -448,8 +455,10 @@ end_tc(Mod,Func,TCPid,Result,Args) -> {_,GroupName,_Props} = Group -> case lists:keysearch(save_config,1,Args) of {value,{save_config,SaveConfig}} -> - ct_util:save_suite_data(last_saved_config, - {Mod,{group,GroupName}},SaveConfig), + ct_util:save_suite_data( + last_saved_config, + {Mod,{group,GroupName}}, + SaveConfig), Group; false -> Group @@ -492,7 +501,8 @@ end_tc(Mod,Func,TCPid,Result,Args) -> end, case get('$test_server_framework_test') of undefined -> - ok; + ct_suite_callback:end_tc( + Mod, FuncSpec, Args, Return); Fun -> Fun(end_tc, ok) end. diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index d0e6ba5fa6..df7f21a51f 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -54,6 +54,7 @@ logdir, config = [], event_handlers = [], + suite_callbacks = [], include = [], silent_connections, stylesheet, @@ -171,6 +172,9 @@ script_start1(Parent, Args) -> ([]) -> true end, false, Args), EvHandlers = event_handler_args2opts(Args), + SuiteCBs = get_start_opt(suite_callback, + fun(CBs) -> [list_to_atom(CB) || CB <- CBs] end, + [], Args), %% check flags and set corresponding application env variables @@ -234,6 +238,7 @@ script_start1(Parent, Args) -> StartOpts = #opts{label = Label, vts = Vts, shell = Shell, cover = Cover, logdir = LogDir, event_handlers = EvHandlers, + suite_callbacks = SuiteCBs, include = IncludeDirs, silent_connections = SilentConns, stylesheet = Stylesheet, @@ -305,6 +310,10 @@ script_start2(StartOpts = #opts{vts = undefined, SpecStartOpts#opts.scale_timetraps), AllEvHs = merge_vals([StartOpts#opts.event_handlers, SpecStartOpts#opts.event_handlers]), + AllSuiteCBs = merge_vals( + [StartOpts#opts.suite_callbacks, + SpecStartOpts#opts.suite_callbacks]), + AllInclude = merge_vals([StartOpts#opts.include, SpecStartOpts#opts.include]), application:set_env(common_test, include, AllInclude), @@ -315,6 +324,7 @@ script_start2(StartOpts = #opts{vts = undefined, logdir = LogDir, config = SpecStartOpts#opts.config, event_handlers = AllEvHs, + suite_callbacks = AllSuiteCBs, include = AllInclude, multiply_timetraps = MultTT, scale_timetraps = ScaleTT}} @@ -332,7 +342,8 @@ script_start2(StartOpts = #opts{vts = undefined, {error,no_testspec_specified}; {undefined,_} -> % no testspec used case check_and_install_configfiles(InitConfig, TheLogDir, - Opts#opts.event_handlers) of + Opts#opts.event_handlers, + Opts#opts.suite_callbacks) of ok -> % go on read tests from start flags script_start3(Opts#opts{config=InitConfig, logdir=TheLogDir}, Args); @@ -343,7 +354,8 @@ script_start2(StartOpts = #opts{vts = undefined, %% merge config from start flags with config from testspec AllConfig = merge_vals([InitConfig, Opts#opts.config]), case check_and_install_configfiles(AllConfig, TheLogDir, - Opts#opts.event_handlers) of + Opts#opts.event_handlers, + Opts#opts.suite_callbacks) of ok -> % read tests from spec {Run,Skip} = ct_testspec:prepare_tests(Terms, node()), do_run(Run, Skip, Opts#opts{config=AllConfig, @@ -358,7 +370,8 @@ script_start2(StartOpts, Args) -> InitConfig = ct_config:prepare_config_list(Args), LogDir = which(logdir, StartOpts#opts.logdir), case check_and_install_configfiles(InitConfig, LogDir, - StartOpts#opts.event_handlers) of + StartOpts#opts.event_handlers, + StartOpts#opts.suite_callbacks) of ok -> % go on read tests from start flags script_start3(StartOpts#opts{config=InitConfig, logdir=LogDir}, Args); @@ -366,11 +379,12 @@ script_start2(StartOpts, Args) -> Error end. -check_and_install_configfiles(Configs, LogDir, EvHandlers) -> +check_and_install_configfiles(Configs, LogDir, EvHandlers, SuiteCBs) -> case ct_config:check_config_files(Configs) of false -> install([{config,Configs}, - {event_handler,EvHandlers}], LogDir); + {event_handler,EvHandlers}, + {suite_callbacks,SuiteCBs}], LogDir); {value,{error,{nofile,File}}} -> {error,{cant_read_config_file,File}}; {value,{error,{wrong_config,Message}}}-> @@ -438,11 +452,13 @@ script_start4(#opts{vts = true, config = Config, event_handlers = EvHandlers, script_start4(#opts{label = Label, shell = true, config = Config, event_handlers = EvHandlers, + suite_callbacks = SuiteCBs, logdir = LogDir, testspecs = Specs}, _Args) -> %% label - used by ct_logs application:set_env(common_test, test_label, Label), - InstallOpts = [{config,Config},{event_handler,EvHandlers}], + InstallOpts = [{config,Config},{event_handler,EvHandlers}, + {suite_callbacks, SuiteCBs}], if Config == [] -> ok; true -> @@ -508,6 +524,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" + "\n\t[-suite_callback SuiteCB1 SuiteCB2 .. SuiteCBN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" @@ -526,6 +543,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" + "\n\t[-suite_callback SuiteCB1 SuiteCB2 .. SuiteCBN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" @@ -664,6 +682,9 @@ run_test1(StartOpts) -> end, Hs)) end, + %% Suite Callbacks + SuiteCBs = get_start_opt(suite_callbacks, value, [], StartOpts), + %% silent connections SilentConns = get_start_opt(silent_connections, fun(all) -> []; @@ -733,7 +754,9 @@ run_test1(StartOpts) -> Opts = #opts{label = Label, cover = Cover, step = Step, logdir = LogDir, config = CfgFiles, - event_handlers = EvHandlers, include = Include, + event_handlers = EvHandlers, + suite_callbacks = SuiteCBs, + include = Include, silent_connections = SilentConns, stylesheet = Stylesheet, multiply_timetraps = MultiplyTT, @@ -784,11 +807,16 @@ run_spec_file(Relaxed, SpecOpts#opts.event_handlers]), AllInclude = merge_vals([Opts#opts.include, SpecOpts#opts.include]), + + AllSuiteCBs = merge_vals([Opts#opts.suite_callbacks, + SpecOpts#opts.suite_callbacks]), + application:set_env(common_test, include, AllInclude), case check_and_install_configfiles(AllConfig, which(logdir,LogDir), - AllEvHs) of + AllEvHs, + AllSuiteCBs) of ok -> Opts1 = Opts#opts{label = Label, cover = Cover, @@ -798,7 +826,8 @@ run_spec_file(Relaxed, include = AllInclude, testspecs = AbsSpecs, multiply_timetraps = MultTT, - scale_timetraps = ScaleTT}, + scale_timetraps = ScaleTT, + suite_callbacks = AllSuiteCBs}, {Run,Skip} = ct_testspec:prepare_tests(TS, node()), reformat_result(catch do_run(Run, Skip, Opts1, StartOpts)); {error,GCFReason} -> @@ -808,10 +837,12 @@ run_spec_file(Relaxed, run_prepared(Run, Skip, Opts = #opts{logdir = LogDir, config = CfgFiles, - event_handlers = EvHandlers}, + event_handlers = EvHandlers, + suite_callbacks = SuiteCBs}, StartOpts) -> LogDir1 = which(logdir, LogDir), - case check_and_install_configfiles(CfgFiles, LogDir1, EvHandlers) of + case check_and_install_configfiles(CfgFiles, LogDir1, + EvHandlers, SuiteCBs) of ok -> reformat_result(catch do_run(Run, Skip, Opts#opts{logdir = LogDir1}, StartOpts)); @@ -842,7 +873,8 @@ check_config_file(Callback, File)-> run_dir(Opts = #opts{logdir = LogDir, config = CfgFiles, - event_handlers = EvHandlers}, StartOpts) -> + event_handlers = EvHandlers, + suite_callbacks = SuiteCB }, StartOpts) -> LogDir1 = which(logdir, LogDir), Opts1 = Opts#opts{logdir = LogDir1}, AbsCfgFiles = @@ -863,7 +895,9 @@ run_dir(Opts = #opts{logdir = LogDir, check_config_file(Callback, File) end, FileList)} end, CfgFiles), - case install([{config,AbsCfgFiles},{event_handler,EvHandlers}], LogDir1) of + case install([{config,AbsCfgFiles}, + {event_handler,EvHandlers}, + {suite_callbacks, SuiteCB}], LogDir1) of ok -> ok; {error,IReason} -> exit(IReason) end, @@ -968,7 +1002,8 @@ run_testspec1(TestSpec) -> application:set_env(common_test, include, AllInclude), LogDir1 = which(logdir,Opts#opts.logdir), case check_and_install_configfiles(Opts#opts.config, LogDir1, - Opts#opts.event_handlers) of + Opts#opts.event_handlers, + Opts#opts.suite_callbacks) of ok -> Opts1 = Opts#opts{testspecs = [], logdir = LogDir1, @@ -986,6 +1021,7 @@ get_data_for_node(#testspec{label = Labels, config = Cfgs, userconfig = UsrCfgs, event_handler = EvHs, + suite_callbacks = SuCBs, include = Incl, multiply_timetraps = MTs, scale_timetraps = STs}, Node) -> @@ -1000,12 +1036,14 @@ get_data_for_node(#testspec{label = Labels, ConfigFiles = [{?ct_config_txt,F} || {N,F} <- Cfgs, N==Node] ++ [CBF || {N,CBF} <- UsrCfgs, N==Node], EvHandlers = [{H,A} || {N,H,A} <- EvHs, N==Node], + SuiteCBs = [CB || {N,CB} <- SuCBs, N==Node], Include = [I || {N,I} <- Incl, N==Node], #opts{label = Label, logdir = LogDir, cover = Cover, config = ConfigFiles, event_handlers = EvHandlers, + suite_callbacks = SuiteCBs, include = Include, multiply_timetraps = MT, scale_timetraps = ST}. @@ -2263,12 +2301,17 @@ do_trace(Terms) -> dbg:tracer(), dbg:p(self(), [sos,call]), lists:foreach(fun({m,M}) -> - case dbg:tpl(M,[{'_',[],[{return_trace}]}]) of + case dbg:tpl(M,x) of + {error,What} -> exit({error,{tracing_failed,What}}); + _ -> ok + end; + ({me,M}) -> + case dbg:tp(M,x) of {error,What} -> exit({error,{tracing_failed,What}}); _ -> ok end; ({f,M,F}) -> - case dbg:tpl(M,F,[{'_',[],[{return_trace}]}]) of + case dbg:tpl(M,F,x) of {error,What} -> exit({error,{tracing_failed,What}}); _ -> ok end; diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index db4ac9a4ec..52ce5b92d1 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -39,8 +39,8 @@ -spec init(State :: term()) -> ok | {error, Reason :: term()}. init(Opts) -> - add_new_callbacks(Opts), - ok. + call(get_new_callbacks(Opts), fun call_init/2, ok). + %% @doc Called after all suites are done. -spec terminate(Config :: proplist(),State :: term()) -> @@ -51,15 +51,18 @@ terminate(Config, State) -> %% @doc Called as each test case is started. This includes all configuration %% tests. -spec init_tc(Mod :: atom(), Func :: atom(), Config :: proplist()) -> - {ok, NewConfig :: proplist()} | + NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {error, Reason :: term()}. init_tc(Mod, init_per_suite, Config) -> - add_new_callbacks(Config), - {ok, Config}; + NewConfig = call(get_new_callbacks(Config) ++ get_callbacks(), + fun call_init/2, remove(?config_name,Config)), + + Data = ct_util:read_suite_data(?config_name), + [{suitedata, Data} | NewConfig]; init_tc(Mod, Func, Config) -> - {ok, Config}. + Config. %% @doc Called as each test case is completed. This includes all configuration %% tests. @@ -67,26 +70,54 @@ init_tc(Mod, Func, Config) -> Func :: atom(), Config :: proplist(), Result :: term()) -> - {ok, NewConfig :: proplist()} | + NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {error, Reason :: term()} | ok. +end_tc(Mod, init_per_suite, _, Return) -> + NewConfig = call(get_new_callbacks(Return) ++ get_callbacks(), + fun call_init/2, remove(suitedata, remove(?config_name,Return))), + + Data = ct_util:read_suite_data(?config_name), + [{suitedata, Data} | NewConfig]; end_tc(Mod, Func, Config, Result) -> - {ok, Config}. + Result. %% Iternal Functions -add_new_callbacks(Config) -> - NewCBConfs = lists:flatmap(fun({?config_name, CallbackConfigs}) -> - CallbackConfigs; - (_) -> - [] - end, Config), - CBStates = lists:map(fun call_init/1,NewCBConfs), - ct_util:save_suite_data_async(?config_name, CBStates). - -call_init({Mod, Config}) -> - {Mod, Mod:init(Config)}. - - +get_new_callbacks(Config) -> + lists:flatmap(fun({?config_name, CallbackConfigs}) -> + CallbackConfigs; + (_) -> + [] + end, Config). + +get_callbacks() -> + ct_util:read_suite_data(?config_name). + +call_init(Mod, Config) when is_atom(Mod) -> + call_init({Mod, undefined}, Config); +call_init({Mod, State}, Config) -> + {{Mod, running, Mod:init(State)}, Config}; +call_init({Mod, running, State}, Config) -> + {{Mod, running, State}, Config}. + +%% Generic call function +call(Fun, Config) -> + call(get_callbacks(), Fun, Config). + +call(CBs, Fun, Config) -> + call(CBs, Fun, Config, []). + +call([CB | Rest], Fun, Config, NewCBs) -> + {NewCB, NewConf} = Fun(CB,Config), + call(Rest, Fun, NewConf, [NewCB | NewCBs]); +call([], _Fun, Config, NewCBs) -> + ct_util:save_suite_data_async(?config_name, NewCBs), + Config. + + +remove(Key,List) -> + [Conf || Conf <- List, + element(1,Conf) =/= Key]. diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index f5069427a2..942241da6c 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -625,6 +625,20 @@ add_tests([{event_handler,Node,H,Args}|Ts],Spec) when is_atom(H) -> Node1 = ref2node(Node,Spec#testspec.nodes), add_tests(Ts,Spec#testspec{event_handler=[{Node1,H,Args}|EvHs]}); +%% --- suite_callbacks -- +add_tests([{suite_callbacks, all_nodes, CBs} | Ts], Spec) -> + Tests = [{suite_callbacks,N,CBs} || N <- list_nodes(Spec)], + add_tests(Tests ++ Ts, Spec); +add_tests([{suite_callbacks, Node, [CB|CBs]}|Ts], Spec) -> + SuiteCbs = Spec#testspec.suite_callbacks, + Node1 = ref2node(Node,Spec#testspec.nodes), + add_tests([{suite_callbacks, Node, CBs} | Ts], + Spec#testspec{suite_callbacks = [{Node1,CB} | SuiteCbs]}); +add_tests([{suite_callbacks, _Node, []}|Ts], Spec) -> + add_tests(Ts, Spec); +add_tests([{suite_callbacks, CBs}|Ts], Spec) -> + add_tests([{suite_callbacks, all_nodes, CBs}|Ts], Spec); + %% --- include --- add_tests([{include,all_nodes,InclDirs}|Ts],Spec) -> Tests = lists:map(fun(N) -> {include,N,InclDirs} end, list_nodes(Spec)), @@ -1051,6 +1065,8 @@ valid_terms() -> {event_handler,2}, {event_handler,3}, {event_handler,4}, + {suite_callbacks,2}, + {suite_callbacks,3}, {multiply_timetraps,2}, {multiply_timetraps,3}, {scale_timetraps,2}, diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index b5ab4cbb6e..4696b3c954 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -32,7 +32,9 @@ -export([close_connections/0]). --export([save_suite_data/3, save_suite_data/2, read_suite_data/1, +-export([save_suite_data/3, save_suite_data/2, + save_suite_data_async/3, save_suite_data_async/2, + read_suite_data/1, delete_suite_data/0, delete_suite_data/1, match_delete_suite_data/1, delete_testdata/0, delete_testdata/1, set_testdata/1, get_testdata/1, update_testdata/2]). @@ -159,6 +161,11 @@ do_start(Parent,Mode,LogDir) -> ok end, {StartTime,TestLogDir} = ct_logs:init(Mode), + + %% Initiate suite_callbacks + ok = ct_suite_callback:init(Opts), + + ct_event:notify(#event{name=test_start, node=node(), data={StartTime, @@ -182,12 +189,19 @@ read_opts() -> {error,{bad_installation,Error}} end. + save_suite_data(Key, Value) -> call({save_suite_data, {Key, undefined, Value}}). save_suite_data(Key, Name, Value) -> call({save_suite_data, {Key, Name, Value}}). +save_suite_data_async(Key, Value) -> + save_suite_data_async(Key, undefined, Value). + +save_suite_data_async(Key, Name, Value) -> + cast({save_suite_data, {Key, Name, Value}}). + read_suite_data(Key) -> call({read_suite_data, Key}). @@ -308,6 +322,9 @@ loop(Mode,TestData,StartDir) -> ct_config:stop(), file:set_cwd(StartDir), return(From,ok); + {Ref, _Msg} when is_reference(Ref) -> + %% This clause is used when doing cast operations. + loop(Mode,TestData,StartDir); {get_mode,From} -> return(From,Mode), loop(Mode,TestData,StartDir); @@ -713,6 +730,9 @@ call(Msg) -> return({To,Ref},Result) -> To ! {Ref, Result}. +cast(Msg) -> + ct_util_server ! {Msg, {ct_util_server, make_ref()}}. + seconds(T) -> test_server:seconds(T). diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl index ee973f6220..99f029bc0e 100644 --- a/lib/common_test/src/ct_util.hrl +++ b/lib/common_test/src/ct_util.hrl @@ -36,6 +36,7 @@ config=[], userconfig=[], event_handler=[], + suite_callbacks=[], include=[], multiply_timetraps=[], scale_timetraps=[], -- cgit v1.2.3 From 19a4512b95ca20d32cf1eff4dc20eed9dc20510a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 20 Sep 2010 19:10:21 +0200 Subject: Add so that suite_callcacks can be configures in suite/0 --- lib/common_test/src/ct_framework.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 8e6cfb5565..08ee843597 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -369,6 +369,8 @@ configure([{timetrap,off}|Rest],Info,SuiteInfo,Scope,Config) -> configure([{timetrap,Time}|Rest],Info,SuiteInfo,Scope,Config) -> Dog = test_server:timetrap(Time), configure(Rest,Info,SuiteInfo,Scope,[{watchdog,Dog}|Config]); +configure([{suite_callbacks, CB} | Rest], Info, SuiteInfo, Scope, Config) -> + configure(Rest, Info, SuiteInfo, Scope, [{suite_callbacks, CB} | Config]); configure([_|Rest],Info,SuiteInfo,Scope,Config) -> configure(Rest,Info,SuiteInfo,Scope,Config); configure([],_,_,_,Config) -> -- cgit v1.2.3 From 688e2a2506b16d851d1bbbf4f66eadba1feb1b88 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 20 Sep 2010 19:11:11 +0200 Subject: Update ct_trace me to include calling functions --- lib/common_test/src/ct_run.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index df7f21a51f..7869e385c2 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2306,7 +2306,7 @@ do_trace(Terms) -> _ -> ok end; ({me,M}) -> - case dbg:tp(M,x) of + case dbg:tp(M,[{'_',[],[x,{message,{caller}}]}]) of {error,What} -> exit({error,{tracing_failed,What}}); _ -> ok end; -- cgit v1.2.3 From 34a7a606cb09c096623a0fb4237f8c87f307d7ff Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 20 Sep 2010 19:12:21 +0200 Subject: Add so that suite_callbacks can be added by suite_callbacks. Add support for pre/post_init_suite/2 in suite callback --- lib/common_test/src/ct_suite_callback.erl | 84 +++++++++++++++++++------------ 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 52ce5b92d1..e14e5f90f3 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -39,7 +39,9 @@ -spec init(State :: term()) -> ok | {error, Reason :: term()}. init(Opts) -> - call(get_new_callbacks(Opts), fun call_init/2, ok). + call([{CB, call_init, undefined} || CB <- get_new_callbacks(Opts)], + ct_suite_callback_init_dummy, []), + ok. %% @doc Called after all suites are done. @@ -56,42 +58,44 @@ terminate(Config, State) -> {auto_skip, Reason :: term()} | {error, Reason :: term()}. init_tc(Mod, init_per_suite, Config) -> - NewConfig = call(get_new_callbacks(Config) ++ get_callbacks(), - fun call_init/2, remove(?config_name,Config)), - - Data = ct_util:read_suite_data(?config_name), - [{suitedata, Data} | NewConfig]; -init_tc(Mod, Func, Config) -> + call(fun call_pre_init_suite/2, Config); +init_tc(_, _, Config) -> Config. %% @doc Called as each test case is completed. This includes all configuration %% tests. -spec end_tc(Mod :: atom(), Func :: atom(), - Config :: proplist(), + CallConfig :: proplist(), Result :: term()) -> NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {error, Reason :: term()} | ok. -end_tc(Mod, init_per_suite, _, Return) -> - NewConfig = call(get_new_callbacks(Return) ++ get_callbacks(), - fun call_init/2, remove(suitedata, remove(?config_name,Return))), +end_tc(Mod, init_per_suite, _, Result) -> - Data = ct_util:read_suite_data(?config_name), - [{suitedata, Data} | NewConfig]; -end_tc(Mod, Func, Config, Result) -> + NewConfig = call(fun call_post_init_suite/2, Result), + + NewConfig; +end_tc(_, _, _, Result) -> Result. %% Iternal Functions -get_new_callbacks(Config) -> +get_new_callbacks(Config, Fun) -> + lists:foldl(fun(NewCB, Acc) -> + [{NewCB, call_init, Fun} | Acc] + end, [], get_new_callbacks(Config)). + +get_new_callbacks(Config) when is_list(Config) -> lists:flatmap(fun({?config_name, CallbackConfigs}) -> CallbackConfigs; (_) -> [] - end, Config). + end, Config); +get_new_callbacks(_Config) -> + []. get_callbacks() -> ct_util:read_suite_data(?config_name). @@ -99,25 +103,41 @@ get_callbacks() -> call_init(Mod, Config) when is_atom(Mod) -> call_init({Mod, undefined}, Config); call_init({Mod, State}, Config) -> - {{Mod, running, Mod:init(State)}, Config}; -call_init({Mod, running, State}, Config) -> - {{Mod, running, State}, Config}. + {Id, NewState} = Mod:init(State), + {Config, {Id, {Mod, NewState}}}. + +call_pre_init_suite({Mod, State}, Config) -> + {NewConf, NewState} = Mod:pre_init_suite(Config, State), + {NewConf, {Mod, NewState}}. +call_post_init_suite({Mod, State}, Config) -> + {NewConf, NewState} = Mod:post_init_suite(Config, State), + {NewConf, {Mod, NewState}}. %% Generic call function call(Fun, Config) -> - call(get_callbacks(), Fun, Config). - -call(CBs, Fun, Config) -> - call(CBs, Fun, Config, []). - -call([CB | Rest], Fun, Config, NewCBs) -> - {NewCB, NewConf} = Fun(CB,Config), - call(Rest, Fun, NewConf, [NewCB | NewCBs]); -call([], _Fun, Config, NewCBs) -> - ct_util:save_suite_data_async(?config_name, NewCBs), + CBs = get_callbacks(), + call([{CBId,Fun} || {CBId, _} <- CBs] ++ get_new_callbacks(Config, Fun), + remove(?config_name,Config), CBs). + +call([{CB, call_init, NextFun} | Rest], Config, CBs) -> + {Config, {NewId, _} = NewCB} = call_init(CB, Config), + {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of + undefined -> {CBs ++ [NewCB],Rest}; + {NewId, _, _} -> {CBs, Rest}; + Fun -> {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} + end, + call(NewRest, Config, NewCBs); +call([{CBId, Fun} | Rest], Config, CBs) -> + {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), Config), + NewCalls = get_new_callbacks(NewConf, Fun), + call(NewCalls ++ Rest, remove(?config_name, NewConf), + lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})); +call([], Config, CBs) -> + ct_util:save_suite_data_async(?config_name, CBs), Config. - -remove(Key,List) -> +remove(Key,List) when is_list(List) -> [Conf || Conf <- List, - element(1,Conf) =/= Key]. + element(1, Conf) =/= Key]; +remove(_, Else) -> + Else. -- cgit v1.2.3 From 95b6bdd287c5b7c5d3c70290489576bf48449ac1 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 21 Sep 2010 12:15:43 +0200 Subject: Add support for all pre/post init/end functions --- lib/common_test/src/ct_suite_callback.erl | 127 +++++++++++++++++------------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index e14e5f90f3..fcada641d7 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -33,106 +33,105 @@ -define(config_name, suite_callbacks). +%% ------------------------------------------------------------------------- %% API Functions +%% ------------------------------------------------------------------------- %% @doc Called before any suites are started -spec init(State :: term()) -> ok | {error, Reason :: term()}. init(Opts) -> call([{CB, call_init, undefined} || CB <- get_new_callbacks(Opts)], - ct_suite_callback_init_dummy, []), + ct_suite_callback_init_dummy, undefined, []), ok. %% @doc Called after all suites are done. -spec terminate(Config :: proplist(),State :: term()) -> ok. -terminate(Config, State) -> +terminate(_Config, _State) -> ok. %% @doc Called as each test case is started. This includes all configuration %% tests. --spec init_tc(Mod :: atom(), Func :: atom(), Config :: proplist()) -> +-spec init_tc(Mod :: atom(), Func :: atom(), Args :: list()) -> NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | - {error, Reason :: term()}. + {fail, Reason :: term()}. +init_tc(ct_framework, Mod, Args) -> + Args; init_tc(Mod, init_per_suite, Config) -> - call(fun call_pre_init_suite/2, Config); -init_tc(_, _, Config) -> - Config. + call(fun call_generic/3, Config, {pre_init_suite, Mod}); +init_tc(Mod, end_per_suite, Config) -> + call(fun call_generic/3, Config, {pre_end_suite, Mod}); +init_tc(_Mod, {init_per_group, GroupName, _}, Config) -> + call(fun call_generic/3, Config, {pre_init_group, GroupName}); +init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> + call(fun call_generic/3, Config, {pre_end_group, GroupName}); +init_tc(_Mod, TC, Config) -> + call(fun call_generic/3, Config, {pre_init_group, TC}). %% @doc Called as each test case is completed. This includes all configuration %% tests. -spec end_tc(Mod :: atom(), Func :: atom(), - CallConfig :: proplist(), + Args :: list(), Result :: term()) -> NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | - {error, Reason :: term()} | + {fail, Reason :: term()} | ok. -end_tc(Mod, init_per_suite, _, Result) -> - - NewConfig = call(fun call_post_init_suite/2, Result), - - NewConfig; -end_tc(_, _, _, Result) -> - Result. - - -%% Iternal Functions -get_new_callbacks(Config, Fun) -> - lists:foldl(fun(NewCB, Acc) -> - [{NewCB, call_init, Fun} | Acc] - end, [], get_new_callbacks(Config)). - -get_new_callbacks(Config) when is_list(Config) -> - lists:flatmap(fun({?config_name, CallbackConfigs}) -> - CallbackConfigs; - (_) -> - [] - end, Config); -get_new_callbacks(_Config) -> - []. - -get_callbacks() -> - ct_util:read_suite_data(?config_name). - -call_init(Mod, Config) when is_atom(Mod) -> - call_init({Mod, undefined}, Config); -call_init({Mod, State}, Config) -> +end_tc(ct_framework, Mod, _Args, Result) -> + Result; +end_tc(Mod, init_per_suite, _Config, Result) -> + call(fun call_generic/3, Result, {post_init_suite, Mod}); +end_tc(Mod, end_per_suite, _Config, Result) -> + call(fun call_generic/3, Result, {post_end_suite, Mod}); +end_tc(_Mod, {init_per_group, GroupName, _}, _Config, Result) -> + call(fun call_generic/3, Result, {post_init_group, GroupName}); +end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result) -> + call(fun call_generic/3, Result, {post_end_group, GroupName}); +end_tc(_Mod, TC, _Config, Result) -> + call(fun call_generic/3, Result, {post_end_tc, TC}). + +%% ------------------------------------------------------------------------- +%% Internal Functions +%% ------------------------------------------------------------------------- +call_init(Mod, Config, Meta) when is_atom(Mod) -> + call_init({Mod, undefined}, Config, Meta); +call_init({Mod, State}, Config, _) -> {Id, NewState} = Mod:init(State), {Config, {Id, {Mod, NewState}}}. -call_pre_init_suite({Mod, State}, Config) -> - {NewConf, NewState} = Mod:pre_init_suite(Config, State), - {NewConf, {Mod, NewState}}. -call_post_init_suite({Mod, State}, Config) -> - {NewConf, NewState} = Mod:post_init_suite(Config, State), +call_generic({Mod, State}, Config, {Function, undefined}) -> + {NewConf, NewState} = Mod:Function(Config, State), + {NewConf, {Mod, NewState}}; +call_generic({Mod, State}, Config, {Function, Tag}) -> + {NewConf, NewState} = Mod:Function(Tag, Config, State), {NewConf, {Mod, NewState}}. %% Generic call function -call(Fun, Config) -> +call(Fun, Config, Meta) -> CBs = get_callbacks(), call([{CBId,Fun} || {CBId, _} <- CBs] ++ get_new_callbacks(Config, Fun), - remove(?config_name,Config), CBs). - -call([{CB, call_init, NextFun} | Rest], Config, CBs) -> - {Config, {NewId, _} = NewCB} = call_init(CB, Config), + remove(?config_name,Config), Meta, CBs). + +call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> + {Config, {NewId, _} = NewCB} = call_init(CB, Config, Meta), {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of undefined -> {CBs ++ [NewCB],Rest}; - {NewId, _, _} -> {CBs, Rest}; + ExistingCB when is_tuple(ExistingCB) -> {CBs, Rest}; Fun -> {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} end, - call(NewRest, Config, NewCBs); -call([{CBId, Fun} | Rest], Config, CBs) -> - {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), Config), + call(NewRest, Config, Meta, NewCBs); +call([{CBId, Fun} | Rest], Config, Meta, CBs) -> + {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), Config, Meta), NewCalls = get_new_callbacks(NewConf, Fun), - call(NewCalls ++ Rest, remove(?config_name, NewConf), + call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})); -call([], Config, CBs) -> +call([], Config, Meta, CBs) -> ct_util:save_suite_data_async(?config_name, CBs), Config. @@ -141,3 +140,21 @@ remove(Key,List) when is_list(List) -> element(1, Conf) =/= Key]; remove(_, Else) -> Else. + +%% Fetch callback functions +get_new_callbacks(Config, Fun) -> + lists:foldl(fun(NewCB, Acc) -> + [{NewCB, call_init, Fun} | Acc] + end, [], get_new_callbacks(Config)). + +get_new_callbacks(Config) when is_list(Config) -> + lists:flatmap(fun({?config_name, CallbackConfigs}) -> + CallbackConfigs; + (_) -> + [] + end, Config); +get_new_callbacks(_Config) -> + []. + +get_callbacks() -> + ct_util:read_suite_data(?config_name). -- cgit v1.2.3 From 587bceba86718fb935e367a558af9f60bcd2bec8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 27 Sep 2010 16:25:40 +0200 Subject: Remove some compilation warnings --- lib/common_test/src/ct_suite_callback.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index fcada641d7..ab5c005a43 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -59,7 +59,7 @@ terminate(_Config, _State) -> {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {fail, Reason :: term()}. -init_tc(ct_framework, Mod, Args) -> +init_tc(ct_framework, _Func, Args) -> Args; init_tc(Mod, init_per_suite, Config) -> call(fun call_generic/3, Config, {pre_init_suite, Mod}); @@ -83,7 +83,7 @@ init_tc(_Mod, TC, Config) -> {auto_skip, Reason :: term()} | {fail, Reason :: term()} | ok. -end_tc(ct_framework, Mod, _Args, Result) -> +end_tc(ct_framework, _Func, _Args, Result) -> Result; end_tc(Mod, init_per_suite, _Config, Result) -> call(fun call_generic/3, Result, {post_init_suite, Mod}); @@ -123,7 +123,7 @@ call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of undefined -> {CBs ++ [NewCB],Rest}; ExistingCB when is_tuple(ExistingCB) -> {CBs, Rest}; - Fun -> {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} + _ -> {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} end, call(NewRest, Config, Meta, NewCBs); call([{CBId, Fun} | Rest], Config, Meta, CBs) -> @@ -131,7 +131,7 @@ call([{CBId, Fun} | Rest], Config, Meta, CBs) -> NewCalls = get_new_callbacks(NewConf, Fun), call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})); -call([], Config, Meta, CBs) -> +call([], Config, _Meta, CBs) -> ct_util:save_suite_data_async(?config_name, CBs), Config. -- cgit v1.2.3 From 87a24f6a5c9a032baf64b2a3427c899c5e8632e7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 17 Nov 2010 16:55:43 +0100 Subject: Update so that non tuple return values are not filtered out --- lib/common_test/src/ct_suite_callback.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index ab5c005a43..124397b222 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -136,8 +136,8 @@ call([], Config, _Meta, CBs) -> Config. remove(Key,List) when is_list(List) -> - [Conf || Conf <- List, - element(1, Conf) =/= Key]; + [Conf || Conf <- List, is_tuple(Conf) =:= false + orelse element(1, Conf) =/= Key]; remove(_, Else) -> Else. -- cgit v1.2.3 From 1ab0779cd90f5b76bf546b5964e8550f1b68f962 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 17 Nov 2010 16:56:26 +0100 Subject: Expand tracing functions to be more verbose --- lib/common_test/src/ct_run.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 7869e385c2..9b4007026b 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2306,12 +2306,14 @@ do_trace(Terms) -> _ -> ok end; ({me,M}) -> - case dbg:tp(M,[{'_',[],[x,{message,{caller}}]}]) of + case dbg:tp(M,[{'_',[],[{exception_trace}, + {message,{caller}}]}]) of {error,What} -> exit({error,{tracing_failed,What}}); _ -> ok end; ({f,M,F}) -> - case dbg:tpl(M,F,x) of + case dbg:tpl(M,F,[{'_',[],[{exception_trace}, + {message,{caller}}]}]) of {error,What} -> exit({error,{tracing_failed,What}}); _ -> ok end; -- cgit v1.2.3 From 5bf3141144c48a0f560dd2cc9f95981ec0154e11 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 17 Nov 2010 16:58:48 +0100 Subject: Update end_tc fw call to get {skip,Reason} instead of 'skipped' as return value --- lib/test_server/src/test_server.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index 3d27788b64..daee278368 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -1095,12 +1095,13 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) -> Skip = {skip,Reason} -> Line = get_loc(), Conf = [{tc_status,{skipped,Reason}}], - NewRes = do_end_tc_call(Mod,Func,{Skip,[Conf]}, skipped), + NewRes = do_end_tc_call(Mod,Func,{Skip,[Conf]}, Skip), {{0,NewRes},Line,[]}; {skip_and_save,Reason,SaveCfg} -> Line = get_loc(), Conf = [{tc_status,{skipped,Reason}},{save_config,SaveCfg}], - NewRes = do_end_tc_call(Mod, Func, {{skip, Reason}, [Conf]}, skipped_and_saved), + NewRes = do_end_tc_call(Mod, Func, {{skip, Reason}, [Conf]}, + {skip, Reason}), {{0,NewRes},Line,[]}; {ok,NewConf} -> put(test_server_init_or_end_conf,undefined), -- cgit v1.2.3 From dc20d9d2538b60547c3cbfba1772b500a85302b8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 17 Nov 2010 16:59:34 +0100 Subject: Update to be backward compatible with ct framework test funktionality --- lib/common_test/src/ct_framework.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 08ee843597..ac10bddefc 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -218,7 +218,12 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) -> undefined -> ct_suite_init(Mod, FuncSpec, FinalConfig); Fun -> - Fun(init_tc, FinalConfig) + case Fun(init_tc, FinalConfig) of + NewConfig when is_list(NewConfig) -> + {ok,NewConfig}; + Else -> + Else + end end end end. -- cgit v1.2.3 From 6c4801696d6a22d61d2e7b145506f2548ea80547 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:11:23 +0100 Subject: Update input parameter for suite callbacks to be called suite_callbacks when given from both erlang shell and ct_run command --- lib/common_test/src/ct_run.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 9b4007026b..78782d346a 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -172,7 +172,7 @@ script_start1(Parent, Args) -> ([]) -> true end, false, Args), EvHandlers = event_handler_args2opts(Args), - SuiteCBs = get_start_opt(suite_callback, + SuiteCBs = get_start_opt(suite_callbacks, fun(CBs) -> [list_to_atom(CB) || CB <- CBs] end, [], Args), @@ -524,7 +524,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" - "\n\t[-suite_callback SuiteCB1 SuiteCB2 .. SuiteCBN]" + "\n\t[-suite_callbacks SuiteCB1 SuiteCB2 .. SuiteCBN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" @@ -543,7 +543,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" - "\n\t[-suite_callback SuiteCB1 SuiteCB2 .. SuiteCBN]" + "\n\t[-suite_callbacks SuiteCB1 SuiteCB2 .. SuiteCBN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" -- cgit v1.2.3 From 3bacd0466501e872c69fbb89c7e6600395d7854c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:17:27 +0100 Subject: Rename all callback functions to be more inline with the suite callback functions --- lib/common_test/src/ct_suite_callback.erl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 124397b222..702d9a354c 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -62,15 +62,15 @@ terminate(_Config, _State) -> init_tc(ct_framework, _Func, Args) -> Args; init_tc(Mod, init_per_suite, Config) -> - call(fun call_generic/3, Config, {pre_init_suite, Mod}); + call(fun call_generic/3, Config, {pre_init_per_suite, Mod}); init_tc(Mod, end_per_suite, Config) -> - call(fun call_generic/3, Config, {pre_end_suite, Mod}); + call(fun call_generic/3, Config, {pre_end_per_suite, Mod}); init_tc(_Mod, {init_per_group, GroupName, _}, Config) -> - call(fun call_generic/3, Config, {pre_init_group, GroupName}); + call(fun call_generic/3, Config, {pre_init_per_group, GroupName}); init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> - call(fun call_generic/3, Config, {pre_end_group, GroupName}); + call(fun call_generic/3, Config, {pre_end_per_group, GroupName}); init_tc(_Mod, TC, Config) -> - call(fun call_generic/3, Config, {pre_init_group, TC}). + call(fun call_generic/3, Config, {pre_init_per_testcase, TC}). %% @doc Called as each test case is completed. This includes all configuration %% tests. @@ -86,15 +86,15 @@ init_tc(_Mod, TC, Config) -> end_tc(ct_framework, _Func, _Args, Result) -> Result; end_tc(Mod, init_per_suite, _Config, Result) -> - call(fun call_generic/3, Result, {post_init_suite, Mod}); + call(fun call_generic/3, Result, {post_init_per_suite, Mod}); end_tc(Mod, end_per_suite, _Config, Result) -> - call(fun call_generic/3, Result, {post_end_suite, Mod}); + call(fun call_generic/3, Result, {post_end_per_suite, Mod}); end_tc(_Mod, {init_per_group, GroupName, _}, _Config, Result) -> - call(fun call_generic/3, Result, {post_init_group, GroupName}); + call(fun call_generic/3, Result, {post_init_per_group, GroupName}); end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result) -> - call(fun call_generic/3, Result, {post_end_group, GroupName}); + call(fun call_generic/3, Result, {post_end_per_group, GroupName}); end_tc(_Mod, TC, _Config, Result) -> - call(fun call_generic/3, Result, {post_end_tc, TC}). + call(fun call_generic/3, Result, {post_end_per_testcase, TC}). %% ------------------------------------------------------------------------- %% Internal Functions -- cgit v1.2.3 From 18b2dba61c4849fd924ace459d169d263e7e6619 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:15:50 +0100 Subject: Add terminate SCB functionality --- lib/common_test/src/ct_suite_callback.erl | 13 ++++++++++--- lib/common_test/src/ct_util.erl | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 702d9a354c..44e54f3968 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -27,7 +27,7 @@ -export([init/1]). -export([init_tc/3]). -export([end_tc/4]). --export([terminate/2]). +-export([terminate/1]). -type proplist() :: [{atom(),term()}]. @@ -47,9 +47,12 @@ init(Opts) -> %% @doc Called after all suites are done. --spec terminate(Config :: proplist(),State :: term()) -> +-spec terminate(Callbacks :: term()) -> ok. -terminate(_Config, _State) -> +terminate(Callbacks) -> + io:format("Callbacks: ~p",[Callbacks]), + call([{CBId, fun call_terminate/3} || {CBId,_} <- Callbacks], + ct_suite_callback_init_dummy, undefined, Callbacks), ok. %% @doc Called as each test case is started. This includes all configuration @@ -105,6 +108,10 @@ call_init({Mod, State}, Config, _) -> {Id, NewState} = Mod:init(State), {Config, {Id, {Mod, NewState}}}. +call_terminate({Mod, State}, _, _) -> + Mod:terminate(State), + {[],{Mod,State}}. + call_generic({Mod, State}, Config, {Function, undefined}) -> {NewConf, NewState} = Mod:Function(Config, State), {NewConf, {Mod, NewState}}; diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 4696b3c954..fddeff881e 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -313,6 +313,10 @@ loop(Mode,TestData,StartDir) -> ct_event:sync_notify(#event{name=test_done, node=node(), data=Time}), + Callbacks = ets:lookup_element(?suite_table, + suite_callbacks, + #suite_data.value), + ct_suite_callback:terminate(Callbacks), close_connections(ets:tab2list(?conn_table)), ets:delete(?conn_table), ets:delete(?board_table), -- cgit v1.2.3 From 9809d4a71dc48fd52ec8b4d3d2002b2facf323e7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:16:53 +0100 Subject: Change default state to [] instead of undefined --- lib/common_test/src/ct_suite_callback.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 44e54f3968..c92de8ea51 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -103,7 +103,7 @@ end_tc(_Mod, TC, _Config, Result) -> %% Internal Functions %% ------------------------------------------------------------------------- call_init(Mod, Config, Meta) when is_atom(Mod) -> - call_init({Mod, undefined}, Config, Meta); + call_init({Mod, []}, Config, Meta); call_init({Mod, State}, Config, _) -> {Id, NewState} = Mod:init(State), {Config, {Id, {Mod, NewState}}}. -- cgit v1.2.3 From 90dac5ad22aefa725731b637e8128474aa6f7bdc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:10:08 +0100 Subject: Move end_tc call to be made before the tc_done event is generated --- lib/common_test/src/ct_framework.erl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index ac10bddefc..54d0433eef 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -482,12 +482,20 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> end, ct_util:reset_silent_connections(), + FinalResult = case get('$test_server_framework_test') of + undefined -> + ct_suite_callback:end_tc( + Mod, FuncSpec, Args, Return); + Fun -> + Fun(end_tc, ok) + end, + %% send sync notification so that event handlers may print %% in the log file before it gets closed ct_event:sync_notify(#event{name=tc_done, node=node(), - data={Mod,FuncSpec,tag(Result)}}), - case Result of + data={Mod,FuncSpec,tag(FinalResult)}}), + case FinalResult of {skip,{sequence_failed,_,_}} -> %% ct_logs:init_tc is never called for a skipped test case %% in a failing sequence, so neither should end_tc @@ -505,14 +513,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> ct_util:match_delete_suite_data({seq,Mod,'_'}); _ -> ok - end, - case get('$test_server_framework_test') of - undefined -> - ct_suite_callback:end_tc( - Mod, FuncSpec, Args, Return); - Fun -> - Fun(end_tc, ok) - end. + end, FinalResult. %% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} | %% {testcase_aborted,Reason} | testcase_aborted_or_killed | @@ -525,6 +526,8 @@ tag(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; {failed,E}; tag(E = testcase_aborted_or_killed) -> {failed,E}; +tag(Other) when is_list(Other) -> + ok; tag(Other) -> Other. -- cgit v1.2.3 From 118091a805e98fe3d883595ab943891f43a8f92e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 14:08:55 +0100 Subject: Add testcase for SCB which does nothing --- lib/common_test/test/Makefile | 3 +- .../ct_error_SUITE_data/error/test/empty_scb.erl | 187 +++++++++++++++++++++ lib/common_test/test/ct_suite_callback_SUITE.erl | 150 +++++++++++++++++ .../scb/tests/ct_scb_empty_SUITE.erl | 110 ++++++++++++ 4 files changed, 449 insertions(+), 1 deletion(-) create mode 100644 lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile index f2fe3390cf..28be9f56f1 100644 --- a/lib/common_test/test/Makefile +++ b/lib/common_test/test/Makefile @@ -40,7 +40,8 @@ MODULES= \ ct_test_server_if_1_SUITE \ ct_config_SUITE \ ct_master_SUITE \ - ct_misc_1_SUITE + ct_misc_1_SUITE \ + ct_suite_callback_SUITE ERL_FILES= $(MODULES:%=%.erl) diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl new file mode 100644 index 0000000000..41808b4f1d --- /dev/null +++ b/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl @@ -0,0 +1,187 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Example Suite Callback module. +%%% +%%%

This module gives an example of a common test SCB (Suite CallBack). +%%% There are many ways to add a SCB to a test run, you can do it either in +%%% the command line using -suite_callback, in a test spec using +%%% {suite_callback,M} or in the suite it self by returning suite_callback +%%% from either suite/0, init_per_suite/1, init_per_group/2 and +%%% init_per_testcase/2. The scope of the SCB is determined by where is it +%%% started. If it is started in the command line or test spec then it will +%%% be stopped at the end of all tests. If it is started in init_per_suite, +%%% it will be stopped after end_per_suite and so on. See terminate +%%% documentation for a table describing the scoping machanics. +%%% +%%% All of callbacks except init/1 in a SCB are optional.

+ +-module(empty_scb). + +%% Suite Callbacks +-export([init/1]). + +-export([pre_init_suite/3]). +-export([post_init_suite/3]). +-export([pre_end_suite/3]). +-export([post_end_suite/3]). + +-export([pre_init_group/3]). +-export([post_init_group/3]). +-export([pre_end_group/3]). +-export([post_end_group/3]). + +-export([pre_init_tc/3]). +-export([post_end_tc/3]). + +-export([on_tc_fail/3]). + +-export([terminate/2]). + +-type proplist() :: list({atom(),term()}). +-type config() :: proplist(). +-type reason() :: term(). +-type skip_or_fail() :: {skip, reason()} | + {auto_skip, reason()} | + {fail, reason()}. + +-record(state, { id = ?MODULE :: term()}). + +%% @doc Always called before any other callback function. Use this to initiate +%% any common state. It should return an ID for this SCB and a state. The ID +%% is used to uniquly identify an SCB instance, if two SCB's return the same +%% ID the seconds SCB is ignored. This function should NOT have any side +%% effects as it might be called multiple times by common test. +-spec init(Opts :: proplist()) -> + {Id :: term(), State :: #state{}}. +init(Opts) -> + {?MODULE, #state{ }}. + +%% @doc Called before init_per_suite is called. Note that this callback is +%% only called if the SCB is added before init_per_suite is run (eg. in a test +%% specification, suite/0 function etc). +%% You can change the config in the this function. +-spec pre_init_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_suite(Suite,Config,State) -> + {Config, State}. + +%% @doc Called after init_per_suite. +%% you can change the config in this function. +-spec post_init_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_suite(Suite,Config,State) -> + {Config, State}. + +%% @doc Called before end_per_suite. Note that the config cannot be +%% changed here, only the status of the suite. +-spec pre_end_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_suite(Suite,Config,State) -> {Config, State}. + +%% @doc Called after end_per_suite. Note that the config cannot be +%% changed here, only the status of the suite. +-spec post_end_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_suite(Suite,Config,State) -> {Config, State}. + +%% @doc Called before each init_per_group. +%% You can change the config in this function. +-spec pre_init_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_group(Group,Config,State) -> {Config, State}. + +%% @doc Called after each init_per_group. +%% You can change the config in this function. +-spec post_init_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_group(Group,Config,State) -> {Config, State}. + +%% @doc Called after each end_per_group. Note that the config cannot be +%% changed here, only the status of the group. +-spec pre_end_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_group(Group,Config,State) -> {Config, State}. + +%% @doc Called after each end_per_group. Note that the config cannot be +%% changed here, only the status of the group. +-spec post_end_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_group(Group,Config,State) -> {Config, State}. + +%% @doc Called before each test case. +%% You can change the config in this function. +-spec pre_init_tc(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_tc(TC,Config,State) -> {Config, State}. + +%% @doc Called after each test case. Note that the config cannot be +%% changed here, only the status of the test case. +-spec post_end_tc(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_tc(TC,Config,State) -> {Config, State}. + +%% @doc Called after post_init_suite, post_end_suite, post_init_group, +%% post_end_group and post_end_tc if the suite, group or test case failed. +%% This function should be used for extra cleanup which might be needed. +%% It is not possible to modify the config or the status of the test run. +-spec on_tc_fail(TC :: init_per_suite | end_per_suite | + init_per_group | end_per_group | atom(), + Config :: config(), State :: #state{}) -> + ok. +on_tc_fail(_TC, _Config, _State) -> + ok. + +%% @doc Called when the scope of the SCB is done, this depends on +%% when the SCB was specified. This translation table describes when this +%% function is called. +%% +%% | Started in | terminate called | +%% |---------------------|-------------------------| +%% | command_line | after all tests are run | +%% | test spec | after all tests are run | +%% | suite/0 | after SUITE is done | +%% | init_per_suite/1 | after SUITE is done | +%% | init_per_group/2 | after group is done | +%% | init_per_testcase/2 | after test case is done | +%% |-----------------------------------------------| +%% +-spec terminate(Config :: proplist(), State :: #state{}) -> + term(). +terminate(Config,State) -> {Config, State}. diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl new file mode 100644 index 0000000000..7a8ad9a82e --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -0,0 +1,150 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% File: ct_error_SUITE +%%% +%%% Description: +%%% Test various errors in Common Test suites. +%%% +%%% The suites used for the test are located in the data directory. +%%%------------------------------------------------------------------- +-module(ct_suite_callback_SUITE). + +-compile(export_all). + +-include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-define(eh, ct_test_support_eh). + +%%-------------------------------------------------------------------- +%% TEST SERVER CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- + +%%-------------------------------------------------------------------- +%% Description: Since Common Test starts another Test Server +%% instance, the tests need to be performed on a separate node (or +%% there will be clashes with logging processes etc). +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + DataDir = ?config(data_dir, Config), + TestDir = filename:join(DataDir,"scb/tests/"), + SCBs = filelib:wildcard(filename:join(TestDir,"*_scb.erl")), + io:format("SCBs: ~p",[SCBs]), + [io:format("Compiling ~p: ~p", + [FileName,compile:file(FileName,[{outdir,TestDir},debug_info])]) || + FileName <- SCBs], + ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]). + +end_per_suite(Config) -> + ct_test_support:end_per_suite(Config). + +init_per_testcase(TestCase, Config) -> + ct_test_support:init_per_testcase(TestCase, Config). + +end_per_testcase(TestCase, Config) -> + ct_test_support:end_per_testcase(TestCase, Config). + + +suite() -> + [{timetrap,{minutes,1}}]. + +all() -> + all(suite). + +all(suite) -> + [ + empty + ]. + + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- + +%%%----------------------------------------------------------------- +%%% +empty(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + Suites = [filename:join(DataDir,"scb/tests/ct_scb_empty_SUITE.erl")], + {Opts,ERPid} = setup([{suite,Suites}, + {suite_callbacks,[empty_scb]}], Config), + ok = ct_test_support:run(Opts, Config), + Events = ct_test_support:get_events(ERPid, Config), + + ct_test_support:log_events(empty_scb, + reformat(Events, ?eh), + ?config(priv_dir, Config)), + + TestEvents = events_to_check(empty), + ok = ct_test_support:verify_events(TestEvents, Events, Config). + +%%%----------------------------------------------------------------- +%%% HELP FUNCTIONS +%%%----------------------------------------------------------------- + +setup(Test, Config) -> + Opts0 = ct_test_support:get_opts(Config), + Level = ?config(trace_level, Config), + EvHArgs = [{cbm,ct_test_support},{trace_level,Level}], + Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test], + ERPid = ct_test_support:start_event_receiver(Config), + {Opts,ERPid}. + +reformat(Events, EH) -> + ct_test_support:reformat(Events, EH). +%reformat(Events, _EH) -> +% Events. + +%%%----------------------------------------------------------------- +%%% TEST EVENTS +%%%----------------------------------------------------------------- +events_to_check(Test) -> + %% 2 tests (ct:run_test + script_start) is default + events_to_check(Test, 2). + +events_to_check(_, 0) -> + []; +events_to_check(Test, N) -> + test_events(Test) ++ events_to_check(Test, N-1). + +test_events(empty) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,stop_logging,[]} + ]. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl new file mode 100644 index 0000000000..2c62379be3 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl @@ -0,0 +1,110 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scb_empty_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. -- cgit v1.2.3 From 7456eddb172280e480b27d79d20a0140adb54c40 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 16:29:55 +0100 Subject: Add SCB error handling functionality --- lib/common_test/src/ct_suite_callback.erl | 59 +++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index c92de8ea51..503d7a6c9c 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -107,16 +107,18 @@ call_init(Mod, Config, Meta) when is_atom(Mod) -> call_init({Mod, State}, Config, _) -> {Id, NewState} = Mod:init(State), {Config, {Id, {Mod, NewState}}}. - + call_terminate({Mod, State}, _, _) -> Mod:terminate(State), {[],{Mod,State}}. call_generic({Mod, State}, Config, {Function, undefined}) -> - {NewConf, NewState} = Mod:Function(Config, State), + {NewConf, NewState} = catch_apply(Mod,Function,[Config, State], + {Config, State}), {NewConf, {Mod, NewState}}; call_generic({Mod, State}, Config, {Function, Tag}) -> - {NewConf, NewState} = Mod:Function(Tag, Config, State), + {NewConf, NewState} = catch_apply(Mod,Function,[Tag, Config, State], + {Config,State}), {NewConf, {Mod, NewState}}. %% Generic call function @@ -126,18 +128,35 @@ call(Fun, Config, Meta) -> remove(?config_name,Config), Meta, CBs). call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> - {Config, {NewId, _} = NewCB} = call_init(CB, Config, Meta), - {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of - undefined -> {CBs ++ [NewCB],Rest}; - ExistingCB when is_tuple(ExistingCB) -> {CBs, Rest}; - _ -> {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} - end, - call(NewRest, Config, Meta, NewCBs); + try + {Config, {NewId, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta), + {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of + undefined -> {CBs ++ [NewCB],Rest}; + ExistingCB when is_tuple(ExistingCB) -> + {CBs, Rest}; + _ -> + {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} + end, + ct_logs:log("Suite Callback","Started a SCB: Mod: ~p, Id: ~p", + [Mod,NewId]), + call(NewRest, Config, Meta, NewCBs) + catch Error:Reason -> + ct_logs:log("Suite Callback","Failed to start a SCB: ~p:~p", + [Error,{Reason,erlang:get_stacktrace()}]), + call(Rest, Config, Meta, CBs) + end; call([{CBId, Fun} | Rest], Config, Meta, CBs) -> - {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), Config, Meta), - NewCalls = get_new_callbacks(NewConf, Fun), - call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, - lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})); + try + {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), + Config, Meta), + NewCalls = get_new_callbacks(NewConf, Fun), + call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, + lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})) + catch Error:Reason -> + ct_logs:log("Suite Callback","Call to SCB failed: ~p:~p", + [Error,{Reason,erlang:get_stacktrace()}]), + call(Rest, Config, Meta, CBs) + end; call([], Config, _Meta, CBs) -> ct_util:save_suite_data_async(?config_name, CBs), Config. @@ -165,3 +184,15 @@ get_new_callbacks(_Config) -> get_callbacks() -> ct_util:read_suite_data(?config_name). + +catch_apply(M,F,A, Default) -> + try + apply(M,F,A) + catch error:undef -> + case erlang:get_stacktrace() of + [{M,F,A}|_] -> + Default; + _Else -> + error(undef,[M,F,A]) + end + end. -- cgit v1.2.3 From 92ad0e04b09ebe755e60fa0828c5799b3ce1f559 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 16:31:04 +0100 Subject: Add testcases for multiple SCBs and unexisting SCBs --- lib/common_test/test/ct_suite_callback_SUITE.erl | 88 +++++++- .../scb/tests/empty_scb.erl | 248 +++++++++++++++++++++ 2 files changed, 324 insertions(+), 12 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 7a8ad9a82e..f8a111d28c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -71,7 +71,7 @@ all() -> all(suite) -> [ - empty + one_scb, two_scb, faulty_scb_no_init ]. @@ -81,25 +81,38 @@ all(suite) -> %%%----------------------------------------------------------------- %%% -empty(Config) when is_list(Config) -> +one_scb(Config) when is_list(Config) -> + do_test(one_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb], Config). + +two_scb(Config) when is_list(Config) -> + do_test(two_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb,empty_scb], + Config). + +faulty_scb_no_init(Config) when is_list(Config) -> + do_test(faulty_scb_no_init, "ct_scb_empty_SUITE.erl",[askjhdkljashdkaj], + Config). + +%%%----------------------------------------------------------------- +%%% HELP FUNCTIONS +%%%----------------------------------------------------------------- + +do_test(Tag, SuiteWildCard, SCBs, Config) -> + DataDir = ?config(data_dir, Config), - Suites = [filename:join(DataDir,"scb/tests/ct_scb_empty_SUITE.erl")], + Suites = filelib:wildcard( + filename:join([DataDir,"scb/tests",SuiteWildCard])), {Opts,ERPid} = setup([{suite,Suites}, - {suite_callbacks,[empty_scb]}], Config), + {suite_callbacks,SCBs}], Config), ok = ct_test_support:run(Opts, Config), Events = ct_test_support:get_events(ERPid, Config), - ct_test_support:log_events(empty_scb, + ct_test_support:log_events(Tag, reformat(Events, ?eh), ?config(priv_dir, Config)), - TestEvents = events_to_check(empty), + TestEvents = events_to_check(Tag), ok = ct_test_support:verify_events(TestEvents, Events, Config). -%%%----------------------------------------------------------------- -%%% HELP FUNCTIONS -%%%----------------------------------------------------------------- - setup(Test, Config) -> Opts0 = ct_test_support:get_opts(Config), Level = ?config(trace_level, Config), @@ -125,7 +138,7 @@ events_to_check(_, 0) -> events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). -test_events(empty) -> +test_events(one_empty_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,scb,{empty_scb,init,[[]]}}, @@ -147,4 +160,55 @@ test_events(empty) -> {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,scb,{empty_scb,terminate,[[]]}}, {?eh,stop_logging,[]} - ]. + ]; + +test_events(two_empty_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_scb_no_init) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(ok) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl new file mode 100644 index 0000000000..1b8979ee4b --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -0,0 +1,248 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Example Suite Callback module. +%%% +%%%

This module gives an example of a common test SCB (Suite CallBack). +%%% There are many ways to add a SCB to a test run, you can do it either in +%%% the command line using -suite_callback, in a test spec using +%%% {suite_callback,M} or in the suite it self by returning suite_callback +%%% from either suite/0, init_per_suite/1, init_per_group/2 and +%%% init_per_testcase/2. The scope of the SCB is determined by where is it +%%% started. If it is started in the command line or test spec then it will +%%% be stopped at the end of all tests. If it is started in init_per_suite, +%%% it will be stopped after end_per_suite and so on. See terminate +%%% documentation for a table describing the scoping machanics. +%%% +%%% All of callbacks except init/1 in a SCB are optional.

+ +-module(empty_scb). + +%% Suite Callbacks +-export([init/1]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/3]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/3]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/3]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/3]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/3]). + +-export([on_tc_fail/3]). + +-export([terminate/1]). + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-type proplist() :: list({atom(),term()}). +-type config() :: proplist(). +-type reason() :: term(). +-type skip_or_fail() :: {skip, reason()} | + {auto_skip, reason()} | + {fail, reason()}. + +-record(state, { id = ?MODULE :: term()}). + +%% @doc Always called before any other callback function. Use this to initiate +%% any common state. It should return an ID for this SCB and a state. The ID +%% is used to uniquly identify an SCB instance, if two SCB's return the same +%% ID the seconds SCB is ignored. This function should NOT have any side +%% effects as it might be called multiple times by common test. +-spec init(Opts :: proplist()) -> + {Id :: term(), State :: #state{}}. +init(Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, init, [Opts]}}), + {now(), Opts}. + +%% @doc Called before init_per_suite is called. Note that this callback is +%% only called if the SCB is added before init_per_suite is run (eg. in a test +%% specification, suite/0 function etc). +%% You can change the config in the this function. +-spec pre_init_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, pre_init_per_suite, + [Suite,State]}}), + {Config, State}. + +%% @doc Called after init_per_suite. +%% you can change the config in this function. +-spec post_init_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, post_init_per_suite, + [Suite,State]}}), + {Config, State}. + +%% @doc Called before end_per_suite. Note that the config cannot be +%% changed here, only the status of the suite. +-spec pre_end_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, pre_end_per_suite, + [Suite,State]}}), + {Config, State}. + +%% @doc Called after end_per_suite. Note that the config cannot be +%% changed here, only the status of the suite. +-spec post_end_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, post_end_per_suite, + [Suite,State]}}), + {Config, State}. + +%% @doc Called before each init_per_group. +%% You can change the config in this function. +-spec pre_init_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, pre_init_per_group, + [Group,State]}}), + {Config, State}. + +%% @doc Called after each init_per_group. +%% You can change the config in this function. +-spec post_init_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, post_init_per_group, + [Group,State]}}), + {Config, State}. + +%% @doc Called after each end_per_group. Note that the config cannot be +%% changed here, only the status of the group. +-spec pre_end_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, pre_end_per_group, + [Group,State]}}), + {Config, State}. + +%% @doc Called after each end_per_group. Note that the config cannot be +%% changed here, only the status of the group. +-spec post_end_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, post_end_per_group, + [Group,State]}}), + {Config, State}. + +%% @doc Called before each test case. +%% You can change the config in this function. +-spec pre_init_per_testcase(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_testcase(TC,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, pre_init_per_testcase, + [TC,State]}}), + {Config, State}. + +%% @doc Called after each test case. Note that the config cannot be +%% changed here, only the status of the test case. +-spec post_end_per_testcase(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_testcase(TC,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, post_end_per_testcase, + [TC,State]}}), + {Config, State}. + +%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, +%% post_end_per_group and post_end_per_tc if the suite, group or test case failed. +%% This function should be used for extra cleanup which might be needed. +%% It is not possible to modify the config or the status of the test run. +-spec on_tc_fail(TC :: init_per_suite | end_per_suite | + init_per_group | end_per_group | atom(), + Config :: config(), State :: #state{}) -> + ok. +on_tc_fail(TC, Config, State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, on_tc_fail, + [TC,State]}}), + ok. + +%% @doc Called when the scope of the SCB is done, this depends on +%% when the SCB was specified. This translation table describes when this +%% function is called. +%% +%% | Started in | terminate called | +%% |---------------------|-------------------------| +%% | command_line | after all tests are run | +%% | test spec | after all tests are run | +%% | suite/0 | after SUITE is done | +%% | init_per_suite/1 | after SUITE is done | +%% | init_per_group/2 | after group is done | +%% | init_per_testcase/2 | after test case is done | +%% |-----------------------------------------------| +%% +-spec terminate(State :: #state{}) -> + term(). +terminate(State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, terminate, [State]}}), + ok. -- cgit v1.2.3 From f736305327fea94f0e014422f18ca8dcceb62389 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 17:28:24 +0100 Subject: Extend SCB error handling printouts Update error behaviour so that a failing SCB callback results in a failing testcase --- lib/common_test/src/ct_suite_callback.erl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 503d7a6c9c..5b132306a3 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -50,7 +50,6 @@ init(Opts) -> -spec terminate(Callbacks :: term()) -> ok. terminate(Callbacks) -> - io:format("Callbacks: ~p",[Callbacks]), call([{CBId, fun call_terminate/3} || {CBId,_} <- Callbacks], ct_suite_callback_init_dummy, undefined, Callbacks), ok. @@ -109,7 +108,7 @@ call_init({Mod, State}, Config, _) -> {Config, {Id, {Mod, NewState}}}. call_terminate({Mod, State}, _, _) -> - Mod:terminate(State), + catch_apply(Mod,terminate,[State], ok), {[],{Mod,State}}. call_generic({Mod, State}, Config, {Function, undefined}) -> @@ -152,10 +151,8 @@ call([{CBId, Fun} | Rest], Config, Meta, CBs) -> NewCalls = get_new_callbacks(NewConf, Fun), call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})) - catch Error:Reason -> - ct_logs:log("Suite Callback","Call to SCB failed: ~p:~p", - [Error,{Reason,erlang:get_stacktrace()}]), - call(Rest, Config, Meta, CBs) + catch throw:{error_in_scb_call,Reason} -> + call(Rest, {fail, Reason}, Meta, CBs) end; call([], Config, _Meta, CBs) -> ct_util:save_suite_data_async(?config_name, CBs), @@ -188,11 +185,16 @@ get_callbacks() -> catch_apply(M,F,A, Default) -> try apply(M,F,A) - catch error:undef -> + catch error:Reason -> case erlang:get_stacktrace() of - [{M,F,A}|_] -> + [{M,F,A}|_] when Reason == undef -> Default; - _Else -> - error(undef,[M,F,A]) + Trace -> + ct_logs:log("Suite Callback","Call to SCB failed: ~p:~p", + [error,{Reason,Trace}]), + throw({error_in_scb_call, + lists:flatten( + io_lib:format("~p:~p/~p SCB call failed", + [M,F,length(A)]))}) end end. -- cgit v1.2.3 From 990d7e2914529da5028a07b9f3ed54ab6560fd26 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 17:29:14 +0100 Subject: Add tests for minimal_scb, minimal_and_maximal_scb and faulty_scb_undef --- lib/common_test/test/ct_suite_callback_SUITE.erl | 77 +++++++++++++++++++++- .../scb/tests/minimal_scb.erl | 35 ++++++++++ .../scb/tests/undef_scb.erl | 39 +++++++++++ 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index f8a111d28c..b45d395849 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -71,7 +71,8 @@ all() -> all(suite) -> [ - one_scb, two_scb, faulty_scb_no_init + one_scb, two_scb, faulty_scb_no_init, minimal_scb, + minimal_and_maximal_scb, faulty_scb_undef ]. @@ -92,6 +93,18 @@ faulty_scb_no_init(Config) when is_list(Config) -> do_test(faulty_scb_no_init, "ct_scb_empty_SUITE.erl",[askjhdkljashdkaj], Config). +minimal_scb(Config) when is_list(Config) -> + do_test(minimal_scb, "ct_scb_empty_SUITE.erl",[minimal_scb],Config). + +minimal_and_maximal_scb(Config) when is_list(Config) -> + do_test(minimal_and_maximal_scb, "ct_scb_empty_SUITE.erl", + [minimal_scb, empty_scb],Config). + +faulty_scb_undef(Config) when is_list(Config) -> + do_test(faulty_scb_undef, "ct_scb_empty_SUITE.erl", + [undef_scb],Config). + + %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -210,5 +223,67 @@ test_events(faulty_scb_no_init) -> {?eh,stop_logging,[]} ]; +test_events(minimal_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(minimal_and_maximal_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_scb_undef) -> + FailReasonStr = "undef_scb:pre_init_per_suite/3 SCB call failed", + FailReason = {ct_scb_empty_SUITE,init_per_suite, + {failed,FailReasonStr}}, + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{undef_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, + {fail, FailReasonStr}}}, + + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, + {failed, FailReason}}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,end_per_suite, + {failed, FailReason}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + test_events(ok) -> ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl new file mode 100644 index 0000000000..c08f1aba4a --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl @@ -0,0 +1,35 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(minimal_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-export([init/1]). + +init(Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, init, [Opts]}}), + {now(), Opts}. + diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl new file mode 100644 index 0000000000..cc0651d3dd --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl @@ -0,0 +1,39 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(undef_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-export([init/1]). +-export([pre_init_per_suite/3]). + +init(Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, init, [Opts]}}), + {now(), Opts}. + + +pre_init_per_suite(Suite, Config, State) -> + lists:flaten([1,2,[3,4]]). -- cgit v1.2.3 From c9383e50b2df112fc7c5a5e6f4d23ecdc43adfbb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Nov 2010 18:21:26 +0100 Subject: Add scoping test cases --- lib/common_test/test/ct_suite_callback_SUITE.erl | 220 ++++++++++++++++++++- .../scb/tests/ct_scope_group_scb_SUITE.erl | 120 +++++++++++ .../scb/tests/ct_scope_per_group_scb_SUITE.erl | 120 +++++++++++ .../scb/tests/ct_scope_per_suite_scb_SUITE.erl | 110 +++++++++++ .../scb/tests/ct_scope_per_tc_scb_SUITE.erl | 110 +++++++++++ .../scb/tests/ct_scope_suite_scb_SUITE.erl | 112 +++++++++++ .../scb/tests/ct_scope_tc_scb_SUITE.erl | 110 +++++++++++ 7 files changed, 896 insertions(+), 6 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index b45d395849..4de888a79f 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -64,17 +64,19 @@ end_per_testcase(TestCase, Config) -> suite() -> - [{timetrap,{minutes,1}}]. + [{timetrap,{seconds,15}}]. all() -> all(suite). all(suite) -> - [ - one_scb, two_scb, faulty_scb_no_init, minimal_scb, - minimal_and_maximal_scb, faulty_scb_undef - ]. - + lists:reverse( + [ + one_scb, two_scb, faulty_scb_no_init, minimal_scb, + minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, + scope_per_tc_scb, scope_per_group_scb, scope_suite_scb + ]). + %%-------------------------------------------------------------------- %% TEST CASES @@ -104,6 +106,45 @@ faulty_scb_undef(Config) when is_list(Config) -> do_test(faulty_scb_undef, "ct_scb_empty_SUITE.erl", [undef_scb],Config). +scope_per_suite_scb(Config) when is_list(Config) -> + do_test(scope_per_suite_scb, "ct_scope_per_suite_scb_SUITE.erl", + [],Config). + +scope_suite_scb(Config) when is_list(Config) -> + do_test(scope_suite_scb, "ct_scope_suite_scb_SUITE.erl", + [],Config). + +scope_per_tc_scb(Config) when is_list(Config) -> + do_test(scope_per_tc_scb, "ct_scope_per_tc_scb_SUITE.erl", + [],Config). + +scope_per_group_scb(Config) when is_list(Config) -> + do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl", + [],Config). + +fail_pre_suite_scb(Config) -> + do_test(fail_pre_suite_scb, "ct_scb_empty_SUITE.erl", + [fail_pre_suite_scb],Config). + +fail_post_suite_scb(Config) -> + do_test(fail_post_suite_scb, "ct_scb_empty_SUITE.erl", + [fail_post_suite_scb],Config). + +skip_pre_suite_scb(Config) -> + do_test(skip_pre_suite_scb, "ct_scb_empty_SUITE.erl", + [skip_pre_suite_scb],Config). + +skip_post_suite_scb(Config) -> + do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl", + [skip_post_suite_scb],Config). + +scope_tc_scb(Config) when is_list(Config) -> + do_test(scope_tc_scb, "ct_scope_tc_scb_SUITE.erl", + [],Config). + +scope_group_scb(Config) when is_list(Config) -> + do_test(scope_group_scb, "ct_scope_group_scb_SUITE.erl", + [],Config). %%%----------------------------------------------------------------- %%% HELP FUNCTIONS @@ -285,5 +326,172 @@ test_events(faulty_scb_undef) -> {?eh,stop_logging,[]} ]; +test_events(scope_per_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, + {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,end_per_suite}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, + {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_suite_scb_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scope_suite_scb_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_suite_scb_SUITE,end_per_suite}}, + {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,tc_done,{ct_scope_suite_scb_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_per_tc_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,test_case}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_per_group_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_group_scb_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_scb_SUITE,init_per_suite,ok}}, + + [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,post_init_per_group,[group1,[]]}}, + {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_scope_per_group_scb_SUITE,test_case}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,tc_done,{ct_scope_per_group_scb_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]}}}, + {?eh,scb,{empty_scb,pre_end_per_group,[group1,[]]}}, + {?eh,scb,{empty_scb,post_end_per_group,[group1,[]]}}, + {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]},ok}}], + + {?eh,tc_start,{ct_scope_per_group_scb_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_scb_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(fail_pre_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{fail_pre_suite_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, + {fail, "Test failure"}}}, + + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, + {failed, + {ct_scb_empty_SUITE,init_per_suite,{failed,"Test failure"}}}}}, + + {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite, + {failed, {ct_scb_empty_SUITE, init_per_suite, {failed, "Test failure"}}}}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(fail_post_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(skip_pre_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(skip_post_suite_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + test_events(ok) -> ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl new file mode 100644 index 0000000000..70fcea6fea --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl @@ -0,0 +1,120 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_group_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(GroupName, Config) -> + Config. + +end_per_group(GroupName, Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl new file mode 100644 index 0000000000..cbda931f5e --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl @@ -0,0 +1,120 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_group_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(GroupName, Config) -> + [{suite_callbacks,[empty_scb]}|Config]. + +end_per_group(GroupName, Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl new file mode 100644 index 0000000000..fef00ed4f3 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl @@ -0,0 +1,110 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_suite_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + [{suite_callbacks,[empty_scb]}|Config]. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl new file mode 100644 index 0000000000..d99e741553 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl @@ -0,0 +1,110 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_tc_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + [{suite_callbacks,[empty_scb]}|Config]. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl new file mode 100644 index 0000000000..2e32773336 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl @@ -0,0 +1,112 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_suite_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +suite() -> + [{suite_callbacks,[empty_scb]}]. +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + [{suite_callbacks,[empty_scb]}|Config]. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl new file mode 100644 index 0000000000..cb894e49e4 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl @@ -0,0 +1,110 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_tc_scb_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + [{suite_callbacks,[empty_scb]}|Config]. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. -- cgit v1.2.3 From 65ed50867590df76521b1032b91e35fdbd56f3f5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 19 Nov 2010 16:12:07 +0100 Subject: Add scoping for suite and groups --- lib/common_test/src/ct_suite_callback.erl | 57 +++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 5b132306a3..e0822308a2 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -42,7 +42,7 @@ {error, Reason :: term()}. init(Opts) -> call([{CB, call_init, undefined} || CB <- get_new_callbacks(Opts)], - ct_suite_callback_init_dummy, undefined, []), + ct_suite_callback_init_dummy, init, []), ok. @@ -50,8 +50,8 @@ init(Opts) -> -spec terminate(Callbacks :: term()) -> ok. terminate(Callbacks) -> - call([{CBId, fun call_terminate/3} || {CBId,_} <- Callbacks], - ct_suite_callback_init_dummy, undefined, Callbacks), + call([{CBId, fun call_terminate/3} || {CBId,_,_} <- Callbacks], + ct_suite_callback_terminate_dummy, terminate, Callbacks), ok. %% @doc Called as each test case is started. This includes all configuration @@ -103,9 +103,9 @@ end_tc(_Mod, TC, _Config, Result) -> %% ------------------------------------------------------------------------- call_init(Mod, Config, Meta) when is_atom(Mod) -> call_init({Mod, []}, Config, Meta); -call_init({Mod, State}, Config, _) -> +call_init({Mod, State}, Config, Scope) -> {Id, NewState} = Mod:init(State), - {Config, {Id, {Mod, NewState}}}. + {Config, {Id, scope(Scope), {Mod, NewState}}}. call_terminate({Mod, State}, _, _) -> catch_apply(Mod,terminate,[State], ok), @@ -123,12 +123,12 @@ call_generic({Mod, State}, Config, {Function, Tag}) -> %% Generic call function call(Fun, Config, Meta) -> CBs = get_callbacks(), - call([{CBId,Fun} || {CBId, _} <- CBs] ++ get_new_callbacks(Config, Fun), + call([{CBId,Fun} || {CBId,_, _} <- CBs] ++ get_new_callbacks(Config, Fun), remove(?config_name,Config), Meta, CBs). call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> try - {Config, {NewId, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta), + {Config, {NewId, _, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta), {NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of undefined -> {CBs ++ [NewCB],Rest}; ExistingCB when is_tuple(ExistingCB) -> @@ -146,16 +146,18 @@ call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> end; call([{CBId, Fun} | Rest], Config, Meta, CBs) -> try - {NewConf, NewCBInfo} = Fun(proplists:get_value(CBId, CBs), - Config, Meta), - NewCalls = get_new_callbacks(NewConf, Fun), - call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, - lists:keyreplace(CBId, 1, CBs, {CBId, NewCBInfo})) + {_,Scope,ModState} = lists:keyfind(CBId, 1, CBs), + {NewConf, NewCBInfo} = Fun(ModState, Config, Meta), + NewCalls = get_new_callbacks(NewConf, Fun), + NewCBs = lists:keyreplace(CBId, 1, CBs, {CBId, Scope, NewCBInfo}), + call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, + terminate_if_scope_ends(CBId, Meta, NewCBs)) catch throw:{error_in_scb_call,Reason} -> - call(Rest, {fail, Reason}, Meta, CBs) + call(Rest, {fail, Reason}, Meta, + terminate_if_scope_ends(CBId, Meta, CBs)) end; call([], Config, _Meta, CBs) -> - ct_util:save_suite_data_async(?config_name, CBs), + save_suite_data_async(CBs), Config. remove(Key,List) when is_list(List) -> @@ -164,6 +166,29 @@ remove(Key,List) when is_list(List) -> remove(_, Else) -> Else. +%% Translate scopes, i.e. init_per_group,group1 -> end_per_group,group1 etc +scope({pre_init_per_testcase, TC}) -> + {post_end_per_testcase, TC}; +scope({pre_init_per_group, GroupName}) -> + {post_end_per_group, GroupName}; +scope({post_init_per_group, GroupName}) -> + {post_end_per_group, GroupName}; +scope({pre_init_per_suite, SuiteName}) -> + {post_end_per_suite, SuiteName}; +scope({post_init_per_suite, SuiteName}) -> + {post_end_per_suite, SuiteName}; +scope(init) -> + none. + +terminate_if_scope_ends(CBId, Function, CBs) -> + case lists:keyfind(CBId, 1, CBs) of + {CBId, Function, _ModState} = CB -> + terminate([CB]), + lists:keydelete(CBId, 1, CBs); + _ -> + CBs + end. + %% Fetch callback functions get_new_callbacks(Config, Fun) -> lists:foldl(fun(NewCB, Acc) -> @@ -179,6 +204,9 @@ get_new_callbacks(Config) when is_list(Config) -> get_new_callbacks(_Config) -> []. +save_suite_data_async(CBs) -> + ct_util:save_suite_data_async(?config_name, CBs). + get_callbacks() -> ct_util:read_suite_data(?config_name). @@ -187,6 +215,7 @@ catch_apply(M,F,A, Default) -> apply(M,F,A) catch error:Reason -> case erlang:get_stacktrace() of + %% Return the default if it was the SCB module which did not have the function. [{M,F,A}|_] when Reason == undef -> Default; Trace -> -- cgit v1.2.3 From 0655bd3132d42457be62f1f22ba36e9267555047 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 22 Nov 2010 15:29:09 +0100 Subject: Add on_tc_skip function --- .../scb/tests/empty_scb.erl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl index 1b8979ee4b..0d98a8c55a 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -51,6 +51,7 @@ -export([post_end_per_testcase/3]). -export([on_tc_fail/3]). +-export([on_tc_skip/3]). -export([terminate/1]). @@ -216,15 +217,31 @@ post_end_per_testcase(TC,Config,State) -> %% It is not possible to modify the config or the status of the test run. -spec on_tc_fail(TC :: init_per_suite | end_per_suite | init_per_group | end_per_group | atom(), - Config :: config(), State :: #state{}) -> + Reason :: term(), State :: #state{}) -> ok. -on_tc_fail(TC, Config, State) -> +on_tc_fail(TC, Reason, State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, on_tc_fail, [TC,State]}}), ok. +%% @doc Called when a test case is skipped by either user action +%% or due to an init function failing. Test case can be +%% end_per_suite, init_per_group, end_per_group and the actual test cases. +-spec on_tc_skip(TC :: end_per_suite | + init_per_group | end_per_group | atom(), + {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} | + {tc_user_skip, {skipped, Reason :: term()}}, + State :: #state{}) -> + ok. +on_tc_skip(TC, Reason, State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, on_tc_skip, + [TC,State]}}), + ok. + %% @doc Called when the scope of the SCB is done, this depends on %% when the SCB was specified. This translation table describes when this %% function is called. -- cgit v1.2.3 From 07673c7267b222101ab102112eff9f96049cd308 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 22 Nov 2010 15:29:41 +0100 Subject: Add tags to tests --- lib/common_test/test/ct_suite_callback_SUITE.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 4de888a79f..059d76822a 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -73,8 +73,9 @@ all(suite) -> lists:reverse( [ one_scb, two_scb, faulty_scb_no_init, minimal_scb, - minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, - scope_per_tc_scb, scope_per_group_scb, scope_suite_scb + minimal_and_maximal_scb, faulty_scb_undef%, scope_per_suite_scb, +% scope_per_tc_scb, scope_per_group_scb, scope_suite_scb, +% fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, skip_post_suite_scb ]). @@ -156,7 +157,7 @@ do_test(Tag, SuiteWildCard, SCBs, Config) -> Suites = filelib:wildcard( filename:join([DataDir,"scb/tests",SuiteWildCard])), {Opts,ERPid} = setup([{suite,Suites}, - {suite_callbacks,SCBs}], Config), + {suite_callbacks,SCBs},{label,Tag}], Config), ok = ct_test_support:run(Opts, Config), Events = ct_test_support:get_events(ERPid, Config), @@ -316,7 +317,7 @@ test_events(faulty_scb_undef) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, - {fail, FailReasonStr}}}, + {failed, {error,FailReasonStr}}}}, {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, {failed, FailReason}}}, @@ -488,7 +489,6 @@ test_events(skip_post_suite_scb) -> {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} ]; -- cgit v1.2.3 From 25dfebe8122488db306378eefb8d4ede5e4da601 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 22 Nov 2010 15:30:46 +0100 Subject: Update to be compatible with how common_test tests the ct framework --- lib/common_test/src/ct_framework.erl | 43 ++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 54d0433eef..487f093d38 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -482,19 +482,25 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> end, ct_util:reset_silent_connections(), - FinalResult = case get('$test_server_framework_test') of - undefined -> - ct_suite_callback:end_tc( - Mod, FuncSpec, Args, Return); - Fun -> - Fun(end_tc, ok) - end, - - %% send sync notification so that event handlers may print - %% in the log file before it gets closed - ct_event:sync_notify(#event{name=tc_done, - node=node(), - data={Mod,FuncSpec,tag(FinalResult)}}), + case get('$test_server_framework_test') of + undefined -> + FinalResult = ct_suite_callback:end_tc( + Mod, FuncSpec, Args, Result), + % send sync notification so that event handlers may print + % in the log file before it gets closed + ct_event:sync_notify(#event{name=tc_done, + node=node(), + data={Mod,FuncSpec,tag(FinalResult)}}); + Fun -> + % send sync notification so that event handlers may print + % in the log file before it gets closed + ct_event:sync_notify(#event{name=tc_done, + node=node(), + data={Mod,FuncSpec,tag(Result)}}), + FinalResult = Fun(end_tc, ok) + end, + + case FinalResult of {skip,{sequence_failed,_,_}} -> %% ct_logs:init_tc is never called for a skipped test case @@ -513,7 +519,14 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> ct_util:match_delete_suite_data({seq,Mod,'_'}); _ -> ok - end, FinalResult. + end, + case FinalResult of + Result -> + ok; + _Else -> + FinalResult + end. + %% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} | %% {testcase_aborted,Reason} | testcase_aborted_or_killed | @@ -526,8 +539,6 @@ tag(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; {failed,E}; tag(E = testcase_aborted_or_killed) -> {failed,E}; -tag(Other) when is_list(Other) -> - ok; tag(Other) -> Other. -- cgit v1.2.3 From c054d38535e4128e1c5b21980c9e5137a888ec56 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 22 Nov 2010 16:43:44 +0100 Subject: Add special tagging for scb in order for event generation to be backward compatible --- lib/common_test/src/ct_framework.erl | 20 ++++++++++++++++++-- lib/common_test/src/ct_suite_callback.erl | 27 +++++++++++++++++++-------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 487f093d38..9b749523e8 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -485,12 +485,13 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> case get('$test_server_framework_test') of undefined -> FinalResult = ct_suite_callback:end_tc( - Mod, FuncSpec, Args, Result), + Mod, FuncSpec, Args, Result, Return), % send sync notification so that event handlers may print % in the log file before it gets closed ct_event:sync_notify(#event{name=tc_done, node=node(), - data={Mod,FuncSpec,tag(FinalResult)}}); + data={Mod,FuncSpec, + tag_scb(FinalResult)}}); Fun -> % send sync notification so that event handlers may print % in the log file before it gets closed @@ -542,6 +543,21 @@ tag(E = testcase_aborted_or_killed) -> tag(Other) -> Other. +tag_scb({STag,Reason}) when STag == skip; STag == skipped -> + {skipped,Reason}; +tag_scb({fail, Reason}) -> + {failed, Reason}; +tag_scb(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; + ETag == timetrap_timeout; + ETag == testcase_aborted -> + {failed,E}; +tag_scb(E = testcase_aborted_or_killed) -> + {failed,E}; +tag_scb(List) when is_list(List) -> + ok; +tag_scb(Other) -> + Other. + %%%----------------------------------------------------------------- %%% @spec error_notification(Mod,Func,Args,Error) -> ok %%% Mod = atom() diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index e0822308a2..00fbb425a1 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -26,7 +26,7 @@ %% API Exports -export([init/1]). -export([init_tc/3]). --export([end_tc/4]). +-export([end_tc/5]). -export([terminate/1]). -type proplist() :: [{atom(),term()}]. @@ -79,23 +79,34 @@ init_tc(_Mod, TC, Config) -> -spec end_tc(Mod :: atom(), Func :: atom(), Args :: list(), - Result :: term()) -> + Result :: term(), + Resturn :: term()) -> NewConfig :: proplist() | {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {fail, Reason :: term()} | ok. -end_tc(ct_framework, _Func, _Args, Result) -> +end_tc(ct_framework, _Func, _Args, Result, _Return) -> Result; -end_tc(Mod, init_per_suite, _Config, Result) -> + +end_tc(Mod, init_per_suite, _Config, _Result, Return) when is_list(Return) -> + call(fun call_generic/3, Return, {post_init_per_suite, Mod}); +end_tc(Mod, init_per_suite, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_init_per_suite, Mod}); -end_tc(Mod, end_per_suite, _Config, Result) -> + +end_tc(Mod, end_per_suite, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_end_per_suite, Mod}); -end_tc(_Mod, {init_per_group, GroupName, _}, _Config, Result) -> + +end_tc(_Mod, {init_per_group, GroupName, _}, _Config, _Result, Return) + when is_list(Return) -> + call(fun call_generic/3, Return, {post_init_per_group, GroupName}); +end_tc(_Mod, {init_per_group, GroupName, _}, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_init_per_group, GroupName}); -end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result) -> + +end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_end_per_group, GroupName}); -end_tc(_Mod, TC, _Config, Result) -> + +end_tc(_Mod, TC, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_end_per_testcase, TC}). %% ------------------------------------------------------------------------- -- cgit v1.2.3 From 7a86a1a4802ac7ad596519a22377ed85cecfaaf5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 22 Nov 2010 18:21:39 +0100 Subject: Add possibility to use '_' and '$proplist' anywhere in a event spec --- lib/common_test/test/ct_test_support.erl | 36 +++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index 5e9792f02c..d9b9f85ded 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -877,21 +877,33 @@ locate({TEH,tc_done,{undefined,undefined,{testcase_aborted, end; %% matches any event of type Name -locate({TEH,Name,Data}, Node, [Ev|Evs], Config) when Data == '_' -> - case Ev of - {TEH,#event{name=Name, node=Node}} -> - {Config,Evs}; - _ -> +locate({TEH,Name,Data}, Node, [{TEH,#event{name=Name, + data = EvData, + node = Node}}|Evs], + Config) -> + try match_data(Data, EvData) of + match -> + {Config,Evs} + catch _:_ -> nomatch end; -locate({TEH,Name,Data}, Node, [Ev|Evs], Config) -> - case Ev of - {TEH,#event{name=Name, node=Node, data=Data}} -> - {Config,Evs}; - _ -> - nomatch - end. +locate({TEH,Name,Data}, Node, [_|Evs], Config) -> + nomatch. + +match_data([H1|MatchT],[H2|ValT]) -> + match_data(H1,H2), + match_data(MatchT,ValT); +match_data(Tuple1,Tuple2) when is_tuple(Tuple1),is_tuple(Tuple2) -> + match_data(tuple_to_list(Tuple1),tuple_to_list(Tuple2)); +match_data(D,D) -> + match; +match_data('_',_) -> + match; +match_data('$proplist',Proplist) -> + lists:foreach(fun({_,_}) -> ok end,Proplist); +match_data([],[]) -> + match. log_events(TC, Events, PrivDir) -> LogFile = filename:join(PrivDir, atom_to_list(TC)++".events"), -- cgit v1.2.3 From eeb9e92f290a8a9d3431c541c2548bff5ad7c98f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Nov 2010 17:40:10 +0100 Subject: Refactor tests to use '_' and '$proplist' --- lib/common_test/test/ct_suite_callback_SUITE.erl | 119 +++++++++++---------- .../scb/tests/empty_scb.erl | 33 +++--- .../scb/tests/minimal_scb.erl | 4 +- .../scb/tests/undef_scb.erl | 46 ++++++-- 4 files changed, 120 insertions(+), 82 deletions(-) diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 059d76822a..e4bc524162 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -199,18 +199,21 @@ test_events(one_empty_scb) -> {?eh,scb,{empty_scb,init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,pre_init_per_suite, + [ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{empty_scb,post_init_per_suite, + [ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{empty_scb,pre_end_per_suite, + [ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,scb,{empty_scb,terminate,[[]]}}, @@ -220,32 +223,32 @@ test_events(one_empty_scb) -> test_events(two_empty_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,[[]]}}, - {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, {?eh,stop_logging,[]} ]; @@ -268,7 +271,7 @@ test_events(faulty_scb_no_init) -> test_events(minimal_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, @@ -285,25 +288,25 @@ test_events(minimal_scb) -> test_events(minimal_and_maximal_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{minimal_scb,init,[[]]}}, - {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scb_empty_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,[]]}}, + {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, {?eh,stop_logging,[]} ]; @@ -313,16 +316,21 @@ test_events(faulty_scb_undef) -> {failed,FailReasonStr}}, [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{undef_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, {failed, {error,FailReasonStr}}}}, + {?eh,scb,{'_',on_tc_fail,'_'}}, {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, {failed, FailReason}}}, + {?eh,scb,{'_',on_tc_skip,'_'}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,end_per_suite, {failed, FailReason}}}, + {?eh,scb,{'_',on_tc_skip,'_'}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} ]; @@ -332,19 +340,20 @@ test_events(scope_per_suite_scb) -> {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,init,[[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scope_per_suite_scb_SUITE,[]]}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{'_',pre_end_per_suite, + [ct_scope_per_suite_scb_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_scb_SUITE,'_',[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} @@ -355,20 +364,20 @@ test_events(scope_suite_scb) -> {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,init,[[]]}}, - {?eh,scb,{empty_scb,pre_init_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scope_suite_scb_SUITE,[]]}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_scb_SUITE,'_',[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} @@ -401,19 +410,19 @@ test_events(scope_per_group_scb) -> {?eh,tc_done,{ct_scope_per_group_scb_SUITE,init_per_suite,ok}}, [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}}, - {?eh,scb,{empty_scb,init,[[]]}}, - {?eh,scb,{empty_scb,post_init_per_group,[group1,[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',post_init_per_group,[group1,'$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}}, {?eh,tc_start,{ct_scope_per_group_scb_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, + {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]}}}, - {?eh,scb,{empty_scb,pre_end_per_group,[group1,[]]}}, - {?eh,scb,{empty_scb,post_end_per_group,[group1,[]]}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, + {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[]]}}, + {?eh,scb,{'_',post_end_per_group,[group1,'_',[]]}}, + {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]},ok}}], {?eh,tc_start,{ct_scope_per_group_scb_SUITE,end_per_suite}}, diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl index 0d98a8c55a..05f6563c45 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -91,7 +91,7 @@ pre_init_per_suite(Suite,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, pre_init_per_suite, - [Suite,State]}}), + [Suite,Config,State]}}), {Config, State}. %% @doc Called after init_per_suite. @@ -104,7 +104,7 @@ post_init_per_suite(Suite,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_init_per_suite, - [Suite,State]}}), + [Suite,Config,State]}}), {Config, State}. %% @doc Called before end_per_suite. Note that the config cannot be @@ -117,7 +117,7 @@ pre_end_per_suite(Suite,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, pre_end_per_suite, - [Suite,State]}}), + [Suite,Config,State]}}), {Config, State}. %% @doc Called after end_per_suite. Note that the config cannot be @@ -130,7 +130,7 @@ post_end_per_suite(Suite,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_suite, - [Suite,State]}}), + [Suite,Config,State]}}), {Config, State}. %% @doc Called before each init_per_group. @@ -143,7 +143,7 @@ pre_init_per_group(Group,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, pre_init_per_group, - [Group,State]}}), + [Group,Config,State]}}), {Config, State}. %% @doc Called after each init_per_group. @@ -156,7 +156,7 @@ post_init_per_group(Group,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_init_per_group, - [Group,State]}}), + [Group,Config,State]}}), {Config, State}. %% @doc Called after each end_per_group. Note that the config cannot be @@ -169,7 +169,7 @@ pre_end_per_group(Group,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, pre_end_per_group, - [Group,State]}}), + [Group,Config,State]}}), {Config, State}. %% @doc Called after each end_per_group. Note that the config cannot be @@ -182,7 +182,7 @@ post_end_per_group(Group,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_group, - [Group,State]}}), + [Group,Config,State]}}), {Config, State}. %% @doc Called before each test case. @@ -195,7 +195,7 @@ pre_init_per_testcase(TC,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, pre_init_per_testcase, - [TC,State]}}), + [TC,Config,State]}}), {Config, State}. %% @doc Called after each test case. Note that the config cannot be @@ -208,7 +208,7 @@ post_end_per_testcase(TC,Config,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_testcase, - [TC,State]}}), + [TC,Config,State]}}), {Config, State}. %% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, @@ -218,13 +218,13 @@ post_end_per_testcase(TC,Config,State) -> -spec on_tc_fail(TC :: init_per_suite | end_per_suite | init_per_group | end_per_group | atom(), Reason :: term(), State :: #state{}) -> - ok. + NewState :: #state{}. on_tc_fail(TC, Reason, State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, on_tc_fail, - [TC,State]}}), - ok. + [TC,Reason,State]}}), + State. %% @doc Called when a test case is skipped by either user action %% or due to an init function failing. Test case can be @@ -234,13 +234,13 @@ on_tc_fail(TC, Reason, State) -> {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} | {tc_user_skip, {skipped, Reason :: term()}}, State :: #state{}) -> - ok. + NewState :: #state{}. on_tc_skip(TC, Reason, State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, on_tc_skip, - [TC,State]}}), - ok. + [TC,Reason,State]}}), + State. %% @doc Called when the scope of the SCB is done, this depends on %% when the SCB was specified. This translation table describes when this @@ -253,7 +253,6 @@ on_tc_skip(TC, Reason, State) -> %% | suite/0 | after SUITE is done | %% | init_per_suite/1 | after SUITE is done | %% | init_per_group/2 | after group is done | -%% | init_per_testcase/2 | after test case is done | %% |-----------------------------------------------| %% -spec terminate(State :: #state{}) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl index c08f1aba4a..e5fdbfb8a0 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl @@ -29,7 +29,5 @@ -export([init/1]). init(Opts) -> - gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, init, [Opts]}}), - {now(), Opts}. + empty_scb:init(Opts). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl index cc0651d3dd..80d0f10415 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl @@ -26,14 +26,46 @@ %% Suite Callbacks --export([init/1]). --export([pre_init_per_suite/3]). +-compile(export_all). init(Opts) -> - gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, init, [Opts]}}), - {now(), Opts}. + empty_scb:init(Opts). - -pre_init_per_suite(Suite, Config, State) -> +pre_init_per_suite(_Suite, _Config, _State) -> lists:flaten([1,2,[3,4]]). + +post_init_per_suite(Suite,Config,State) -> + empty_scb:post_init_per_suite(Suite,Config,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,State) -> + empty_scb:post_end_per_suite(Suite,Config,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,State) -> + empty_scb:post_init_per_group(Group,Config,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,State) -> + empty_scb:post_end_per_group(Group,Config,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,State) -> + empty_scb:post_end_per_testcase(TC,Config,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). -- cgit v1.2.3 From 53196e4720f316800eedaec2ce4792683cb3c80e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Nov 2010 17:37:40 +0100 Subject: Remove scope_tc test case as it should not be possble to have this scope --- lib/common_test/test/ct_suite_callback_SUITE.erl | 38 +------ .../scb/tests/ct_scope_tc_scb_SUITE.erl | 110 --------------------- 2 files changed, 4 insertions(+), 144 deletions(-) delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index e4bc524162..4e5ecfab76 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -73,9 +73,10 @@ all(suite) -> lists:reverse( [ one_scb, two_scb, faulty_scb_no_init, minimal_scb, - minimal_and_maximal_scb, faulty_scb_undef%, scope_per_suite_scb, -% scope_per_tc_scb, scope_per_group_scb, scope_suite_scb, -% fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, skip_post_suite_scb + minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, + scope_per_group_scb, scope_suite_scb%, +% fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, +% skip_post_suite_scb ]). @@ -115,10 +116,6 @@ scope_suite_scb(Config) when is_list(Config) -> do_test(scope_suite_scb, "ct_scope_suite_scb_SUITE.erl", [],Config). -scope_per_tc_scb(Config) when is_list(Config) -> - do_test(scope_per_tc_scb, "ct_scope_per_tc_scb_SUITE.erl", - [],Config). - scope_per_group_scb(Config) when is_list(Config) -> do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl", [],Config). @@ -139,14 +136,6 @@ skip_post_suite_scb(Config) -> do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl", [skip_post_suite_scb],Config). -scope_tc_scb(Config) when is_list(Config) -> - do_test(scope_tc_scb, "ct_scope_tc_scb_SUITE.erl", - [],Config). - -scope_group_scb(Config) when is_list(Config) -> - do_test(scope_group_scb, "ct_scope_group_scb_SUITE.erl", - [],Config). - %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -383,25 +372,6 @@ test_events(scope_suite_scb) -> {?eh,stop_logging,[]} ]; -test_events(scope_per_tc_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,test_case}}, - {?eh,scb,{empty_scb,init,[[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,[]]}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, - {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_per_tc_scb_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scope_per_tc_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - test_events(scope_per_group_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl deleted file mode 100644 index cb894e49e4..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_tc_scb_SUITE.erl +++ /dev/null @@ -1,110 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_tc_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_suite(Config) -> - Config. - -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_suite(_Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_testcase(_TestCase, Config) -> - [{suite_callbacks,[empty_scb]}|Config]. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_testcase(_TestCase, _Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- -all() -> - [test_case]. - -%% Test cases starts here. -%%-------------------------------------------------------------------- -test_case(Config) when is_list(Config) -> - ok. -- cgit v1.2.3 From 2f95eaaee45add848df49c84bd449f5c52d63000 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Nov 2010 17:42:11 +0100 Subject: Add on_tc_fail and on_tc_skip functionality --- lib/common_test/src/ct_framework.erl | 20 +++++++++++++++++--- lib/common_test/src/ct_suite_callback.erl | 13 +++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 9b749523e8..f7c07a5374 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -546,7 +546,7 @@ tag(Other) -> tag_scb({STag,Reason}) when STag == skip; STag == skipped -> {skipped,Reason}; tag_scb({fail, Reason}) -> - {failed, Reason}; + {failed, {error,Reason}}; tag_scb(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; ETag == timetrap_timeout; ETag == testcase_aborted -> @@ -1184,6 +1184,18 @@ report(What,Data) -> ok; tc_done -> {_Suite,Case,Result} = Data, + case Result of + {failed, _} -> + ct_suite_callback:on_tc_fail(What, Data); + {skipped,{failed,{_,init_per_testcase,_}}} -> + ct_suite_callback:on_tc_skip(tc_auto_skip, Data); + {skipped,{require_failed,_}} -> + ct_suite_callback:on_tc_skip(tc_auto_skip, Data); + {skipped,_} -> + ct_suite_callback:on_tc_skip(tc_user_skip, Data); + _Else -> + ok + end, case {Case,Result} of {init_per_suite,_} -> ok; @@ -1201,8 +1213,8 @@ report(What,Data) -> add_to_stats(auto_skipped); {_,{skipped,_}} -> add_to_stats(user_skipped); - {_,{FailOrSkip,_Reason}} -> - add_to_stats(FailOrSkip) + {_,{SkipOrFail,_Reason}} -> + add_to_stats(SkipOrFail) end; tc_user_skip -> %% test case specified as skipped in testspec @@ -1210,6 +1222,7 @@ report(What,Data) -> ct_event:sync_notify(#event{name=tc_user_skip, node=node(), data=Data}), + ct_suite_callback:on_tc_skip(What, Data), add_to_stats(user_skipped); tc_auto_skip -> %% test case skipped because of error in init_per_suite @@ -1222,6 +1235,7 @@ report(What,Data) -> ct_event:sync_notify(#event{name=tc_auto_skip, node=node(), data=Data}), + ct_suite_callback:on_tc_skip(What, Data), if Case /= end_per_suite, Case /= end_per_group -> add_to_stats(auto_skipped); true -> diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 00fbb425a1..dd4fc76c8b 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -28,6 +28,8 @@ -export([init_tc/3]). -export([end_tc/5]). -export([terminate/1]). +-export([on_tc_skip/2]). +-export([on_tc_fail/2]). -type proplist() :: [{atom(),term()}]. @@ -109,6 +111,12 @@ end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result, _Return) -> end_tc(_Mod, TC, _Config, Result, _Return) -> call(fun call_generic/3, Result, {post_end_per_testcase, TC}). +on_tc_skip(How, {_Suite, Case, Reason}) -> + call(fun call_cleanup/3, {How, Reason}, {on_tc_skip, Case}). + +on_tc_fail(How, {_Suite, Case, Reason}) -> + call(fun call_cleanup/3, Reason, {on_tc_fail, Case}). + %% ------------------------------------------------------------------------- %% Internal Functions %% ------------------------------------------------------------------------- @@ -122,6 +130,11 @@ call_terminate({Mod, State}, _, _) -> catch_apply(Mod,terminate,[State], ok), {[],{Mod,State}}. +call_cleanup({Mod, State}, Reason, {Function, Tag}) -> + NewState = catch_apply(Mod,Function,[Tag, Reason, State], + {Reason,State}), + {Reason, {Mod, NewState}}. + call_generic({Mod, State}, Config, {Function, undefined}) -> {NewConf, NewState} = catch_apply(Mod,Function,[Config, State], {Config, State}), -- cgit v1.2.3 From 21a7ce9d0cb2358e74e302123d1cf45bd865224f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Nov 2010 17:41:06 +0100 Subject: Add init_per_suite skip and fail test cases --- lib/common_test/test/ct_suite_callback_SUITE.erl | 94 ++++++++++++++++------ .../scb/tests/fail_post_suite_scb.erl | 72 +++++++++++++++++ .../scb/tests/fail_pre_suite_scb.erl | 72 +++++++++++++++++ .../scb/tests/skip_post_suite_scb.erl | 72 +++++++++++++++++ .../scb/tests/skip_pre_suite_scb.erl | 73 +++++++++++++++++ 5 files changed, 357 insertions(+), 26 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 4e5ecfab76..b6af8e0c2a 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -74,9 +74,9 @@ all(suite) -> [ one_scb, two_scb, faulty_scb_no_init, minimal_scb, minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, - scope_per_group_scb, scope_suite_scb%, -% fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, -% skip_post_suite_scb + scope_per_group_scb, scope_suite_scb, + fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, + skip_post_suite_scb ]). @@ -404,70 +404,112 @@ test_events(scope_per_group_scb) -> test_events(fail_pre_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{fail_pre_suite_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE, + {error,"Test failure"},[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, - {fail, "Test failure"}}}, + {failed, {error,"Test failure"}}}}, + {?eh,scb,{'_',on_tc_fail, + [init_per_suite,{failed,"Test failure"},[]]}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, - {failed, - {ct_scb_empty_SUITE,init_per_suite,{failed,"Test failure"}}}}}, + {failed,{ct_scb_empty_SUITE,init_per_suite, + {failed,"Test failure"}}}}}, + {?eh,scb,{'_',on_tc_skip, + [test_case, {tc_auto_skip, + {failed, {ct_scb_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}},[]]}}, + {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite, - {failed, {ct_scb_empty_SUITE, init_per_suite, {failed, "Test failure"}}}}}, + {failed, {ct_scb_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}}}, + {?eh,scb,{'_',on_tc_skip, + [end_per_suite, {tc_auto_skip, + {failed, {ct_scb_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}},[]]}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb, {'_',terminate,[[]]}}, {?eh,stop_logging,[]} ]; test_events(fail_post_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, + {failed,{error,"Test failure"}}}}, + {?eh,scb,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, + {failed,{ct_scb_empty_SUITE,init_per_suite, + {failed,"Test failure"}}}}}, + {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,'_'},[]]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite, + {failed, {ct_scb_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}}}, + {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,'_'},[]]}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb, {'_',terminate,[[]]}}, {?eh,stop_logging,[]} ]; test_events(skip_pre_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,{skip,"Test skip"},[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, + {?eh,scb,{'_',on_tc_skip, + [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}}, + {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, + {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}}, + {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb, {'_',terminate,[[]]}}, {?eh,stop_logging,[]} ]; test_events(skip_post_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{minimal_scb,init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, + {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, + {?eh,scb,{'_',on_tc_skip, + [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, + {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}}, + {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, + + {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}}, + {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} ]; diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl new file mode 100644 index 0000000000..2ba5013652 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(fail_post_suite_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,State) -> + empty_scb:post_init_per_suite(Suite,Config,State), + {{fail, "Test failure"}, State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,State) -> + empty_scb:post_end_per_suite(Suite,Config,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,State) -> + empty_scb:post_init_per_group(Group,Config,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,State) -> + empty_scb:post_end_per_group(Group,Config,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,State) -> + empty_scb:post_end_per_testcase(TC,Config,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl new file mode 100644 index 0000000000..f108624836 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(fail_pre_suite_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State), + {{fail, "Test failure"}, State}. + +post_init_per_suite(Suite,Config,State) -> + empty_scb:post_init_per_suite(Suite,Config,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,State) -> + empty_scb:post_end_per_suite(Suite,Config,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,State) -> + empty_scb:post_init_per_group(Group,Config,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,State) -> + empty_scb:post_end_per_group(Group,Config,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,State) -> + empty_scb:post_end_per_testcase(TC,Config,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl new file mode 100644 index 0000000000..5462e34175 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(skip_post_suite_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,State) -> + empty_scb:post_init_per_suite(Suite,Config,State), + {{skip, "Test skip"}, State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,State) -> + empty_scb:post_end_per_suite(Suite,Config,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,State) -> + empty_scb:post_init_per_group(Group,Config,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,State) -> + empty_scb:post_end_per_group(Group,Config,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,State) -> + empty_scb:post_end_per_testcase(TC,Config,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl new file mode 100644 index 0000000000..006ae4a90f --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl @@ -0,0 +1,73 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(skip_pre_suite_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State), + {{skip, "Test skip"}, State}. + +post_init_per_suite(Suite,Config,State) -> + empty_scb:post_init_per_suite(Suite,Config,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,State) -> + empty_scb:post_end_per_suite(Suite,Config,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,State) -> + empty_scb:post_init_per_group(Group,Config,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,State) -> + empty_scb:post_end_per_group(Group,Config,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,State) -> + empty_scb:post_end_per_testcase(TC,Config,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). -- cgit v1.2.3 From e6a27219093c22e6d63025078de9926590816f7c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Nov 2010 17:57:07 +0100 Subject: Remove supurflous comments and _SUITE files --- .../scb/tests/ct_scb_empty_SUITE.erl | 63 ----------- .../scb/tests/ct_scope_group_scb_SUITE.erl | 120 --------------------- .../scb/tests/ct_scope_per_group_scb_SUITE.erl | 64 ----------- .../scb/tests/ct_scope_per_suite_scb_SUITE.erl | 63 ----------- .../scb/tests/ct_scope_suite_scb_SUITE.erl | 68 +----------- 5 files changed, 3 insertions(+), 375 deletions(-) delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl index 2c62379be3..0eb40bce00 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl @@ -27,84 +27,21 @@ -include("ct.hrl"). %% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_suite(Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_suite(_Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_testcase(_TestCase, Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_testcase(_TestCase, _Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- all() -> [test_case]. %% Test cases starts here. -%%-------------------------------------------------------------------- test_case(Config) when is_list(Config) -> ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl deleted file mode 100644 index 70fcea6fea..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_group_scb_SUITE.erl +++ /dev/null @@ -1,120 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_group_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_suite(Config) -> - Config. - -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_suite(_Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_testcase(_TestCase, Config) -> - Config. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_testcase(_TestCase, _Config) -> - ok. - -init_per_group(GroupName, Config) -> - Config. - -end_per_group(GroupName, Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- -all() -> - [{group,group1}]. - -groups() -> - [{group1,[],[test_case]}]. - - -%% Test cases starts here. -%%-------------------------------------------------------------------- -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl index cbda931f5e..8df4a6d522 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl @@ -27,66 +27,15 @@ -include("ct.hrl"). %% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_suite(Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_suite(_Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_testcase(_TestCase, Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_testcase(_TestCase, _Config) -> ok. @@ -96,25 +45,12 @@ init_per_group(GroupName, Config) -> end_per_group(GroupName, Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- all() -> [{group,group1}]. groups() -> [{group1,[],[test_case]}]. - %% Test cases starts here. -%%-------------------------------------------------------------------- test_case(Config) when is_list(Config) -> ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl index fef00ed4f3..5492243b1b 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl @@ -27,84 +27,21 @@ -include("ct.hrl"). %% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_suite(Config) -> [{suite_callbacks,[empty_scb]}|Config]. -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_suite(_Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_testcase(_TestCase, Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_testcase(_TestCase, _Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- all() -> [test_case]. %% Test cases starts here. -%%-------------------------------------------------------------------- test_case(Config) when is_list(Config) -> ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl index 2e32773336..7598c911b1 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl @@ -26,87 +26,25 @@ -include("ct.hrl"). +%% Test server callback functions suite() -> [{suite_callbacks,[empty_scb]}]. -%% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- + init_per_suite(Config) -> - [{suite_callbacks,[empty_scb]}|Config]. + Config. -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_suite(_Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- init_per_testcase(_TestCase, Config) -> Config. -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- end_per_testcase(_TestCase, _Config) -> ok. -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- all() -> [test_case]. %% Test cases starts here. -%%-------------------------------------------------------------------- test_case(Config) when is_list(Config) -> ok. -- cgit v1.2.3 From 0908ef629325d2aed93f654ea78949205060a013 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 24 Nov 2010 14:29:02 +0100 Subject: Update all post_*_per_* to also take the Config argument which the *_per_* was called with as an argument. --- lib/common_test/src/ct_suite_callback.erl | 82 +++++++++++---------- lib/common_test/test/ct_suite_callback_SUITE.erl | 50 ++++++------- .../scb/tests/empty_scb.erl | 83 ++++++++++++---------- .../scb/tests/fail_post_suite_scb.erl | 20 +++--- .../scb/tests/fail_pre_suite_scb.erl | 20 +++--- .../scb/tests/skip_post_suite_scb.erl | 20 +++--- .../scb/tests/skip_pre_suite_scb.erl | 20 +++--- .../scb/tests/undef_scb.erl | 20 +++--- 8 files changed, 159 insertions(+), 156 deletions(-) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index dd4fc76c8b..06c7fc3833 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -66,15 +66,15 @@ terminate(Callbacks) -> init_tc(ct_framework, _Func, Args) -> Args; init_tc(Mod, init_per_suite, Config) -> - call(fun call_generic/3, Config, {pre_init_per_suite, Mod}); + call(fun call_generic/3, Config, [pre_init_per_suite, Mod]); init_tc(Mod, end_per_suite, Config) -> - call(fun call_generic/3, Config, {pre_end_per_suite, Mod}); + call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); init_tc(_Mod, {init_per_group, GroupName, _}, Config) -> - call(fun call_generic/3, Config, {pre_init_per_group, GroupName}); + call(fun call_generic/3, Config, [pre_init_per_group, GroupName]); init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> - call(fun call_generic/3, Config, {pre_end_per_group, GroupName}); + call(fun call_generic/3, Config, [pre_end_per_group, GroupName]); init_tc(_Mod, TC, Config) -> - call(fun call_generic/3, Config, {pre_init_per_testcase, TC}). + call(fun call_generic/3, Config, [pre_init_per_testcase, TC]). %% @doc Called as each test case is completed. This includes all configuration %% tests. @@ -91,31 +91,31 @@ init_tc(_Mod, TC, Config) -> end_tc(ct_framework, _Func, _Args, Result, _Return) -> Result; -end_tc(Mod, init_per_suite, _Config, _Result, Return) when is_list(Return) -> - call(fun call_generic/3, Return, {post_init_per_suite, Mod}); -end_tc(Mod, init_per_suite, _Config, Result, _Return) -> - call(fun call_generic/3, Result, {post_init_per_suite, Mod}); +end_tc(Mod, init_per_suite, Config, _Result, Return) when is_list(Return) -> + call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config]); +end_tc(Mod, init_per_suite, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_init_per_suite, Mod, Config]); -end_tc(Mod, end_per_suite, _Config, Result, _Return) -> - call(fun call_generic/3, Result, {post_end_per_suite, Mod}); +end_tc(Mod, end_per_suite, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config]); -end_tc(_Mod, {init_per_group, GroupName, _}, _Config, _Result, Return) +end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) when is_list(Return) -> - call(fun call_generic/3, Return, {post_init_per_group, GroupName}); -end_tc(_Mod, {init_per_group, GroupName, _}, _Config, Result, _Return) -> - call(fun call_generic/3, Result, {post_init_per_group, GroupName}); + call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config]); +end_tc(_Mod, {init_per_group, GroupName, _}, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_init_per_group, GroupName, Config]); -end_tc(_Mod, {end_per_group, GroupName, _}, _Config, Result, _Return) -> - call(fun call_generic/3, Result, {post_end_per_group, GroupName}); +end_tc(_Mod, {end_per_group, GroupName, _}, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_end_per_group, GroupName, Config]); -end_tc(_Mod, TC, _Config, Result, _Return) -> - call(fun call_generic/3, Result, {post_end_per_testcase, TC}). +end_tc(_Mod, TC, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config]). on_tc_skip(How, {_Suite, Case, Reason}) -> - call(fun call_cleanup/3, {How, Reason}, {on_tc_skip, Case}). + call(fun call_cleanup/3, {How, Reason}, [on_tc_skip, Case]). -on_tc_fail(How, {_Suite, Case, Reason}) -> - call(fun call_cleanup/3, Reason, {on_tc_fail, Case}). +on_tc_fail(_How, {_Suite, Case, Reason}) -> + call(fun call_cleanup/3, Reason, [on_tc_fail, Case]). %% ------------------------------------------------------------------------- %% Internal Functions @@ -130,19 +130,15 @@ call_terminate({Mod, State}, _, _) -> catch_apply(Mod,terminate,[State], ok), {[],{Mod,State}}. -call_cleanup({Mod, State}, Reason, {Function, Tag}) -> - NewState = catch_apply(Mod,Function,[Tag, Reason, State], +call_cleanup({Mod, State}, Reason, [Function | Args]) -> + NewState = catch_apply(Mod,Function, Args ++ [Reason, State], {Reason,State}), {Reason, {Mod, NewState}}. -call_generic({Mod, State}, Config, {Function, undefined}) -> - {NewConf, NewState} = catch_apply(Mod,Function,[Config, State], - {Config, State}), - {NewConf, {Mod, NewState}}; -call_generic({Mod, State}, Config, {Function, Tag}) -> - {NewConf, NewState} = catch_apply(Mod,Function,[Tag, Config, State], - {Config,State}), - {NewConf, {Mod, NewState}}. +call_generic({Mod, State}, Value, [Function | Args]) -> + {NewValue, NewState} = catch_apply(Mod, Function, Args ++ [Value, State], + {Value,State}), + {NewValue, {Mod, NewState}}. %% Generic call function call(Fun, Config, Meta) -> @@ -191,19 +187,21 @@ remove(_, Else) -> Else. %% Translate scopes, i.e. init_per_group,group1 -> end_per_group,group1 etc -scope({pre_init_per_testcase, TC}) -> - {post_end_per_testcase, TC}; -scope({pre_init_per_group, GroupName}) -> - {post_end_per_group, GroupName}; -scope({post_init_per_group, GroupName}) -> - {post_end_per_group, GroupName}; -scope({pre_init_per_suite, SuiteName}) -> - {post_end_per_suite, SuiteName}; -scope({post_init_per_suite, SuiteName}) -> - {post_end_per_suite, SuiteName}; +scope([pre_init_per_testcase, TC|_]) -> + [post_end_per_testcase, TC]; +scope([pre_init_per_group, GroupName|_]) -> + [post_end_per_group, GroupName]; +scope([post_init_per_group, GroupName|_]) -> + [post_end_per_group, GroupName]; +scope([pre_init_per_suite, SuiteName|_]) -> + [post_end_per_suite, SuiteName]; +scope([post_init_per_suite, SuiteName|_]) -> + [post_end_per_suite, SuiteName]; scope(init) -> none. +terminate_if_scope_ends(CBId, [Function,Tag|T], CBs) when T =/= [] -> + terminate_if_scope_ends(CBId,[Function,Tag],CBs); terminate_if_scope_ends(CBId, Function, CBs) -> case lists:keyfind(CBId, 1, CBs) of {CBId, Function, _ModState} = CB -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index b6af8e0c2a..3a7727120d 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -191,18 +191,18 @@ test_events(one_empty_scb) -> {?eh,scb,{empty_scb,pre_init_per_suite, [ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,scb,{empty_scb,post_init_per_suite, - [ct_scb_empty_SUITE,'$proplist',[]]}}, + [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'_',[]]}}, + {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, {?eh,scb,{empty_scb,pre_end_per_suite, [ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, + {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,scb,{empty_scb,terminate,[[]]}}, @@ -218,22 +218,22 @@ test_events(two_empty_scb) -> {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,scb,{'_',terminate,[[]]}}, @@ -282,17 +282,17 @@ test_events(minimal_and_maximal_scb) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,scb,{'_',terminate,[[]]}}, @@ -330,18 +330,18 @@ test_events(scope_per_suite_scb) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}}, {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,test_case}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,end_per_suite}}, {?eh,scb,{'_',pre_end_per_suite, [ct_scope_per_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_scb_SUITE,'_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','_',[]]}}, {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, @@ -355,17 +355,17 @@ test_events(scope_suite_scb) -> {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}}, {?eh,scb,{'_',init,[[]]}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,test_case}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,end_per_suite}}, {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_scb_SUITE,'_',[]]}}, + {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','_',[]]}}, {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, @@ -381,17 +381,17 @@ test_events(scope_per_group_scb) -> [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}}, {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',post_init_per_group,[group1,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}}, {?eh,tc_start,{ct_scope_per_group_scb_SUITE,test_case}}, {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,ok,[]]}}, + {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,test_case,ok}}, {?eh,tc_start,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]}}}, {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_group,[group1,'_',[]]}}, + {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[]]}}, {?eh,scb,{'_',terminate,[[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]},ok}}], @@ -410,7 +410,7 @@ test_events(fail_pre_suite_scb) -> {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist', {error,"Test failure"},[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, {failed, {error,"Test failure"}}}}, @@ -448,7 +448,7 @@ test_events(fail_post_suite_scb) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, {failed,{error,"Test failure"}}}}, {?eh,scb,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}}, @@ -475,7 +475,7 @@ test_events(skip_pre_suite_scb) -> {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,{skip,"Test skip"},[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',{skip,"Test skip"},[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, {?eh,scb,{'_',on_tc_skip, [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, @@ -499,7 +499,7 @@ test_events(skip_post_suite_scb) -> {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, + {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, {?eh,scb,{'_',on_tc_skip, [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl index 05f6563c45..d9aa1e77e4 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -38,17 +38,17 @@ -export([init/1]). -export([pre_init_per_suite/3]). --export([post_init_per_suite/3]). +-export([post_init_per_suite/4]). -export([pre_end_per_suite/3]). --export([post_end_per_suite/3]). +-export([post_end_per_suite/4]). -export([pre_init_per_group/3]). --export([post_init_per_group/3]). +-export([post_init_per_group/4]). -export([pre_end_per_group/3]). --export([post_end_per_group/3]). +-export([post_end_per_group/4]). -export([pre_init_per_testcase/3]). --export([post_end_per_testcase/3]). +-export([post_end_per_testcase/4]). -export([on_tc_fail/3]). -export([on_tc_skip/3]). @@ -95,22 +95,23 @@ pre_init_per_suite(Suite,Config,State) -> {Config, State}. %% @doc Called after init_per_suite. -%% you can change the config in this function. +%% you can change the return value in this function. -spec post_init_per_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_suite(Suite,Config,State) -> +post_init_per_suite(Suite,Config,Return,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_init_per_suite, - [Suite,Config,State]}}), - {Config, State}. + [Suite,Config,Return,State]}}), + {Return, State}. -%% @doc Called before end_per_suite. Note that the config cannot be -%% changed here, only the status of the suite. +%% @doc Called before end_per_suite. The config/state can be changed here, +%% though it will only affect the *end_per_suite function. -spec pre_end_per_suite(Suite :: atom(), - Config :: config(), + Config :: config() | skip_or_fail(), State :: #state{}) -> {ok | skip_or_fail(), NewState :: #state{}}. pre_end_per_suite(Suite,Config,State) -> @@ -123,15 +124,16 @@ pre_end_per_suite(Suite,Config,State) -> %% @doc Called after end_per_suite. Note that the config cannot be %% changed here, only the status of the suite. -spec post_end_per_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config(), + Return :: term(), + State :: #state{}) -> {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_suite(Suite,Config,State) -> +post_end_per_suite(Suite,Config,Return,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_suite, - [Suite,Config,State]}}), - {Config, State}. + [Suite,Config,Return,State]}}), + {Return, State}. %% @doc Called before each init_per_group. %% You can change the config in this function. @@ -147,23 +149,24 @@ pre_init_per_group(Group,Config,State) -> {Config, State}. %% @doc Called after each init_per_group. -%% You can change the config in this function. +%% You can change the return value in this function. -spec post_init_per_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_group(Group,Config,State) -> +post_init_per_group(Group,Config,Return,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_init_per_group, - [Group,Config,State]}}), - {Config, State}. + [Group,Config,Return,State]}}), + {Return, State}. -%% @doc Called after each end_per_group. Note that the config cannot be -%% changed here, only the status of the group. +%% @doc Called after each end_per_group. The config/state can be changed here, +%% though it will only affect the *end_per_group functions. -spec pre_end_per_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config() | skip_or_fail(), + State :: #state{}) -> {ok | skip_or_fail(), NewState :: #state{}}. pre_end_per_group(Group,Config,State) -> gen_event:notify( @@ -175,15 +178,16 @@ pre_end_per_group(Group,Config,State) -> %% @doc Called after each end_per_group. Note that the config cannot be %% changed here, only the status of the group. -spec post_end_per_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config(), + Return :: term(), + State :: #state{}) -> {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_group(Group,Config,State) -> +post_end_per_group(Group,Config,Return,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_group, - [Group,Config,State]}}), - {Config, State}. + [Group,Config,Return,State]}}), + {Return, State}. %% @doc Called before each test case. %% You can change the config in this function. @@ -201,15 +205,16 @@ pre_init_per_testcase(TC,Config,State) -> %% @doc Called after each test case. Note that the config cannot be %% changed here, only the status of the test case. -spec post_end_per_testcase(TC :: atom(), - Config :: config(), - State :: #state{}) -> + Config :: config(), + Return :: term(), + State :: #state{}) -> {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_testcase(TC,Config,State) -> +post_end_per_testcase(TC,Config,Return,State) -> gen_event:notify( ?CT_EVMGR_REF, #event{ name = scb, node = node(), data = {?MODULE, post_end_per_testcase, - [TC,Config,State]}}), - {Config, State}. + [TC,Config,Return,State]}}), + {Return, State}. %% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, %% post_end_per_group and post_end_per_tc if the suite, group or test case failed. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl index 2ba5013652..b3a3a5f94c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl @@ -34,33 +34,33 @@ init(Opts) -> pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). -post_init_per_suite(Suite,Config,State) -> - empty_scb:post_init_per_suite(Suite,Config,State), +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State), {{fail, "Test failure"}, State}. pre_end_per_suite(Suite,Config,State) -> empty_scb:pre_end_per_suite(Suite,Config,State). -post_end_per_suite(Suite,Config,State) -> - empty_scb:post_end_per_suite(Suite,Config,State). +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). pre_init_per_group(Group,Config,State) -> empty_scb:pre_init_per_group(Group,Config,State). -post_init_per_group(Group,Config,State) -> - empty_scb:post_init_per_group(Group,Config,State). +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). pre_end_per_group(Group,Config,State) -> empty_scb:pre_end_per_group(Group,Config,State). -post_end_per_group(Group,Config,State) -> - empty_scb:post_end_per_group(Group,Config,State). +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). pre_init_per_testcase(TC,Config,State) -> empty_scb:pre_init_per_testcase(TC,Config,State). -post_end_per_testcase(TC,Config,State) -> - empty_scb:post_end_per_testcase(TC,Config,State). +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). on_tc_fail(TC, Reason, State) -> empty_scb:on_tc_fail(TC,Reason,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl index f108624836..d49387ff8c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl @@ -35,32 +35,32 @@ pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State), {{fail, "Test failure"}, State}. -post_init_per_suite(Suite,Config,State) -> - empty_scb:post_init_per_suite(Suite,Config,State). +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State). pre_end_per_suite(Suite,Config,State) -> empty_scb:pre_end_per_suite(Suite,Config,State). -post_end_per_suite(Suite,Config,State) -> - empty_scb:post_end_per_suite(Suite,Config,State). +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). pre_init_per_group(Group,Config,State) -> empty_scb:pre_init_per_group(Group,Config,State). -post_init_per_group(Group,Config,State) -> - empty_scb:post_init_per_group(Group,Config,State). +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). pre_end_per_group(Group,Config,State) -> empty_scb:pre_end_per_group(Group,Config,State). -post_end_per_group(Group,Config,State) -> - empty_scb:post_end_per_group(Group,Config,State). +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). pre_init_per_testcase(TC,Config,State) -> empty_scb:pre_init_per_testcase(TC,Config,State). -post_end_per_testcase(TC,Config,State) -> - empty_scb:post_end_per_testcase(TC,Config,State). +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). on_tc_fail(TC, Reason, State) -> empty_scb:on_tc_fail(TC,Reason,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl index 5462e34175..a2e0578814 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl @@ -34,33 +34,33 @@ init(Opts) -> pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). -post_init_per_suite(Suite,Config,State) -> - empty_scb:post_init_per_suite(Suite,Config,State), +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State), {{skip, "Test skip"}, State}. pre_end_per_suite(Suite,Config,State) -> empty_scb:pre_end_per_suite(Suite,Config,State). -post_end_per_suite(Suite,Config,State) -> - empty_scb:post_end_per_suite(Suite,Config,State). +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). pre_init_per_group(Group,Config,State) -> empty_scb:pre_init_per_group(Group,Config,State). -post_init_per_group(Group,Config,State) -> - empty_scb:post_init_per_group(Group,Config,State). +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). pre_end_per_group(Group,Config,State) -> empty_scb:pre_end_per_group(Group,Config,State). -post_end_per_group(Group,Config,State) -> - empty_scb:post_end_per_group(Group,Config,State). +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). pre_init_per_testcase(TC,Config,State) -> empty_scb:pre_init_per_testcase(TC,Config,State). -post_end_per_testcase(TC,Config,State) -> - empty_scb:post_end_per_testcase(TC,Config,State). +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). on_tc_fail(TC, Reason, State) -> empty_scb:on_tc_fail(TC,Reason,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl index 006ae4a90f..4a0725ce2f 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl @@ -36,32 +36,32 @@ pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State), {{skip, "Test skip"}, State}. -post_init_per_suite(Suite,Config,State) -> - empty_scb:post_init_per_suite(Suite,Config,State). +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State). pre_end_per_suite(Suite,Config,State) -> empty_scb:pre_end_per_suite(Suite,Config,State). -post_end_per_suite(Suite,Config,State) -> - empty_scb:post_end_per_suite(Suite,Config,State). +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). pre_init_per_group(Group,Config,State) -> empty_scb:pre_init_per_group(Group,Config,State). -post_init_per_group(Group,Config,State) -> - empty_scb:post_init_per_group(Group,Config,State). +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). pre_end_per_group(Group,Config,State) -> empty_scb:pre_end_per_group(Group,Config,State). -post_end_per_group(Group,Config,State) -> - empty_scb:post_end_per_group(Group,Config,State). +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). pre_init_per_testcase(TC,Config,State) -> empty_scb:pre_init_per_testcase(TC,Config,State). -post_end_per_testcase(TC,Config,State) -> - empty_scb:post_end_per_testcase(TC,Config,State). +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). on_tc_fail(TC, Reason, State) -> empty_scb:on_tc_fail(TC,Reason,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl index 80d0f10415..9479f9d937 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl @@ -34,32 +34,32 @@ init(Opts) -> pre_init_per_suite(_Suite, _Config, _State) -> lists:flaten([1,2,[3,4]]). -post_init_per_suite(Suite,Config,State) -> - empty_scb:post_init_per_suite(Suite,Config,State). +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State). pre_end_per_suite(Suite,Config,State) -> empty_scb:pre_end_per_suite(Suite,Config,State). -post_end_per_suite(Suite,Config,State) -> - empty_scb:post_end_per_suite(Suite,Config,State). +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). pre_init_per_group(Group,Config,State) -> empty_scb:pre_init_per_group(Group,Config,State). -post_init_per_group(Group,Config,State) -> - empty_scb:post_init_per_group(Group,Config,State). +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). pre_end_per_group(Group,Config,State) -> empty_scb:pre_end_per_group(Group,Config,State). -post_end_per_group(Group,Config,State) -> - empty_scb:post_end_per_group(Group,Config,State). +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). pre_init_per_testcase(TC,Config,State) -> empty_scb:pre_init_per_testcase(TC,Config,State). -post_end_per_testcase(TC,Config,State) -> - empty_scb:post_end_per_testcase(TC,Config,State). +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). on_tc_fail(TC, Reason, State) -> empty_scb:on_tc_fail(TC,Reason,State). -- cgit v1.2.3 From 78be3bba07f0311c19e7e63b486bd8616a7f2759 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 24 Nov 2010 15:23:14 +0100 Subject: Add testcase for config updates --- lib/common_test/test/ct_suite_callback_SUITE.erl | 131 ++++++++++++++++++++- .../scb/tests/ct_update_config_SUITE.erl | 56 +++++++++ .../scb/tests/update_config_scb.erl | 82 +++++++++++++ lib/common_test/test/ct_test_support.erl | 17 ++- 4 files changed, 279 insertions(+), 7 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 3a7727120d..ab30ca368c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -76,7 +76,7 @@ all(suite) -> minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, - skip_post_suite_scb + skip_post_suite_scb, update_config_scb ]). @@ -136,6 +136,10 @@ skip_post_suite_scb(Config) -> do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl", [skip_post_suite_scb],Config). +update_config_scb(Config) -> + do_test(update_config_scb, "ct_update_config_SUITE.erl", + [update_config_scb],Config). + %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -511,8 +515,133 @@ test_events(skip_post_suite_scb) -> {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(update_config_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + + {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}}, + {?eh,scb,{'_',pre_init_per_suite, + [ct_update_config_SUITE,contains([]),[]]}}, + {?eh,scb,{'_',post_init_per_suite, + [ct_update_config_SUITE, + '$proplist', + contains( + [init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,tc_done,{ct_update_config_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_update_config_SUITE, {init_per_group,group1,[]}}}, + {?eh,scb,{'_',pre_init_per_group, + [group1,contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,scb,{'_',post_init_per_group, + [group1, + contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + contains( + [init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,tc_done,{ct_update_config_SUITE,{init_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_update_config_SUITE,test_case}}, + {?eh,scb,{'_',pre_init_per_testcase, + [test_case,contains( + [post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,scb,{'_',post_end_per_testcase, + [test_case,contains( + [init_per_testcase, + pre_init_per_testcase, + post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + ok,[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_update_config_SUITE, {end_per_group,group1,[]}}}, + {?eh,scb,{'_',pre_end_per_group, + [group1,contains( + [post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,scb,{'_',post_end_per_group, + [group1, + contains( + [pre_end_per_group, + post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + ok,[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,{end_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_update_config_SUITE,end_per_suite}}, + {?eh,scb,{'_',pre_end_per_suite, + [ct_update_config_SUITE,contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,scb,{'_',post_end_per_suite, + [ct_update_config_SUITE,contains( + [pre_end_per_suite, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + '_',[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{'_',terminate,[contains( + [post_end_per_suite, + pre_end_per_suite, + post_init_per_suite, + init_per_suite, + pre_init_per_suite])]}}, {?eh,stop_logging,[]} ]; test_events(ok) -> ok. + + +%% test events help functions +contains(List) -> + fun(Proplist) when is_list(Proplist) -> + contains(List,Proplist) + end. +contains([Ele|T],[{Ele,_}|T2])-> + contains(T,T2); +contains(List,[_|T]) -> + contains(List,T); +contains([],_) -> + match. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl new file mode 100644 index 0000000000..57fea347f6 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl @@ -0,0 +1,56 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_update_config_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + [{init_per_suite,now()}|Config]. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + [{init_per_testcase,now()}|Config]. + +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(GroupName, Config) -> + [{init_per_group,now()}|Config]. + +end_per_group(GroupName, Config) -> + ok. + +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl new file mode 100644 index 0000000000..6f21e49656 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl @@ -0,0 +1,82 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(update_config_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State), + {[{pre_init_per_suite,now()}|Config],State}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State), + {[{post_init_per_suite,now()}|Return],State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State), + {[{pre_end_per_suite,now()}|Config],State}. + +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State), + NewConfig = [{post_end_per_suite,now()}|Config], + {NewConfig,NewConfig}. + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State), + {[{pre_init_per_group,now()}|Config],State}. + +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State), + {[{post_init_per_group,now()}|Return],State}. + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State), + {[{pre_end_per_group,now()}|Config],State}. + +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State), + {[{post_end_per_group,now()}|Config],State}. + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State), + {[{pre_init_per_testcase,now()}|Config],State}. + +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State), + {[{post_end_per_testcase,now()}|Config],State}. + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl index d9b9f85ded..5009741f59 100644 --- a/lib/common_test/test/ct_test_support.erl +++ b/lib/common_test/test/ct_test_support.erl @@ -891,17 +891,22 @@ locate({TEH,Name,Data}, Node, [{TEH,#event{name=Name, locate({TEH,Name,Data}, Node, [_|Evs], Config) -> nomatch. -match_data([H1|MatchT],[H2|ValT]) -> - match_data(H1,H2), - match_data(MatchT,ValT); -match_data(Tuple1,Tuple2) when is_tuple(Tuple1),is_tuple(Tuple2) -> - match_data(tuple_to_list(Tuple1),tuple_to_list(Tuple2)); match_data(D,D) -> match; match_data('_',_) -> match; +match_data(Fun,Data) when is_function(Fun) -> + Fun(Data); match_data('$proplist',Proplist) -> - lists:foreach(fun({_,_}) -> ok end,Proplist); + match_data( + fun(List) -> + lists:foreach(fun({_,_}) -> ok end,List) + end,Proplist); +match_data([H1|MatchT],[H2|ValT]) -> + match_data(H1,H2), + match_data(MatchT,ValT); +match_data(Tuple1,Tuple2) when is_tuple(Tuple1),is_tuple(Tuple2) -> + match_data(tuple_to_list(Tuple1),tuple_to_list(Tuple2)); match_data([],[]) -> match. -- cgit v1.2.3 From c0c7e05de55b83ed6d53da628cb345fc4f4da864 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 30 Nov 2010 14:48:34 +0100 Subject: Add test case for init_per_suite recover scenario --- lib/common_test/test/ct_suite_callback_SUITE.erl | 52 ++++++++++++++- .../scb/tests/ct_scb_fail_per_suite_SUITE.erl | 47 ++++++++++++++ .../scb/tests/recover_post_suite_scb.erl | 74 ++++++++++++++++++++++ 3 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index ab30ca368c..53087956b9 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -76,7 +76,7 @@ all(suite) -> minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, - skip_post_suite_scb, update_config_scb + skip_post_suite_scb, recover_post_suite_scb, update_config_scb ]). @@ -136,6 +136,10 @@ skip_post_suite_scb(Config) -> do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl", [skip_post_suite_scb],Config). +recover_post_suite_scb(Config) -> + do_test(recover_post_suite_scb, "ct_scb_fail_per_suite_SUITE.erl", + [recover_post_suite_scb],Config). + update_config_scb(Config) -> do_test(update_config_scb, "ct_update_config_SUITE.erl", [update_config_scb],Config). @@ -415,7 +419,7 @@ test_events(fail_pre_suite_scb) -> {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist', - {error,"Test failure"},[]]}}, + {fail,"Test failure"},[]]}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, {failed, {error,"Test failure"}}}}, {?eh,scb,{'_',on_tc_fail, @@ -519,6 +523,36 @@ test_events(skip_post_suite_scb) -> {?eh,stop_logging,[]} ]; +test_events(recover_post_suite_scb) -> + Suite = ct_scb_fail_per_suite_SUITE, + [ + {?eh,start_logging,'_'}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{Suite,init_per_suite}}, + {?eh,scb,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}}, + {?eh,scb,{'_',post_init_per_suite,[Suite,contains([tc_status]), + {'EXIT',{'_','_'}},[]]}}, + {?eh,tc_done,{Suite,init_per_suite,ok}}, + + {?eh,tc_start,{Suite,test_case}}, + {?eh,scb,{'_',pre_init_per_testcase, + [test_case, not_contains([tc_status]),[]]}}, + {?eh,scb,{'_',post_end_per_testcase, + [test_case, contains([tc_status]),'_',[]]}}, + {?eh,tc_done,{Suite,test_case,ok}}, + + {?eh,tc_start,{Suite,end_per_suite}}, + {?eh,scb,{'_',pre_end_per_suite, + [Suite,not_contains([tc_status]),[]]}}, + {?eh,scb,{'_',post_end_per_suite, + [Suite,not_contains([tc_status]),'_',[]]}}, + {?eh,tc_done,{Suite,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + test_events(update_config_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, @@ -639,9 +673,23 @@ contains(List) -> fun(Proplist) when is_list(Proplist) -> contains(List,Proplist) end. +contains([{Ele,Pos}|T] = L,[H|T2]) -> + case element(Pos,H) of + Ele -> + contains(T,T2); + _ -> + contains(L,T2) + end; contains([Ele|T],[{Ele,_}|T2])-> contains(T,T2); contains(List,[_|T]) -> contains(List,T); contains([],_) -> match. + +not_contains(List) -> + fun(Proplist) when is_list(Proplist) -> + [] = [Ele || {Ele,_} <- Proplist, + Test <- List, + Test =:= Ele] + end. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl new file mode 100644 index 0000000000..dfc7c37e8d --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl @@ -0,0 +1,47 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scb_fail_per_suite_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + ok = nok. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl new file mode 100644 index 0000000000..864a09e3d0 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl @@ -0,0 +1,74 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(recover_post_suite_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + empty_scb:init(Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State), + {lists:keydelete(tc_status,1,Config),State}; +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_scb:terminate(State). -- cgit v1.2.3 From b299052f8d69ef4fff19d83d0f75ded72d65e9e3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 30 Nov 2010 18:25:36 +0100 Subject: Update ct_framework calls to allow manipulation of test results in end_tc without breaking backwards compatability (I hope) --- lib/common_test/src/ct_framework.erl | 22 ++++++++++---------- lib/common_test/src/ct_suite_callback.erl | 30 ++++++++++++++++----------- lib/test_server/src/test_server.erl | 34 +++++++++++++++++++------------ lib/test_server/src/test_server_ctrl.erl | 2 +- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index f7c07a5374..dbf367e4d8 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -484,21 +484,27 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> case get('$test_server_framework_test') of undefined -> - FinalResult = ct_suite_callback:end_tc( - Mod, FuncSpec, Args, Result, Return), + {FinalResult,FinalNotify} = + case ct_suite_callback:end_tc( + Mod, FuncSpec, Args, Result, Return) of + '$ct_no_change' -> + {FinalResult = ok,Result}; + FinalResult -> + {FinalResult,FinalResult} + end, % send sync notification so that event handlers may print % in the log file before it gets closed ct_event:sync_notify(#event{name=tc_done, node=node(), data={Mod,FuncSpec, - tag_scb(FinalResult)}}); + tag_scb(FinalNotify)}}); Fun -> % send sync notification so that event handlers may print % in the log file before it gets closed ct_event:sync_notify(#event{name=tc_done, node=node(), data={Mod,FuncSpec,tag(Result)}}), - FinalResult = Fun(end_tc, ok) + FinalResult = Fun(end_tc, Return) end, @@ -521,13 +527,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> _ -> ok end, - case FinalResult of - Result -> - ok; - _Else -> - FinalResult - end. - + FinalResult. %% {error,Reason} | {skip,Reason} | {timetrap_timeout,TVal} | %% {testcase_aborted,Reason} | testcase_aborted_or_killed | diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 06c7fc3833..4973ed685c 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -91,25 +91,25 @@ init_tc(_Mod, TC, Config) -> end_tc(ct_framework, _Func, _Args, Result, _Return) -> Result; -end_tc(Mod, init_per_suite, Config, _Result, Return) when is_list(Return) -> - call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config]); -end_tc(Mod, init_per_suite, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_init_per_suite, Mod, Config]); +end_tc(Mod, init_per_suite, Config, Result, Return) -> + call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config], + '$ct_no_change'); end_tc(Mod, end_per_suite, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config]); + call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config], + '$ct_no_change'); -end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) - when is_list(Return) -> - call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config]); -end_tc(_Mod, {init_per_group, GroupName, _}, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_init_per_group, GroupName, Config]); +end_tc(_Mod, {init_per_group, GroupName, _}, Config, Result, Return) -> + call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config], + '$ct_no_change'); end_tc(_Mod, {end_per_group, GroupName, _}, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_group, GroupName, Config]); + call(fun call_generic/3, Result, [post_end_per_group, GroupName, Config], + '$ct_no_change'); end_tc(_Mod, TC, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config]). + call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config], + '$ct_no_change'). on_tc_skip(How, {_Suite, Case, Reason}) -> call(fun call_cleanup/3, {How, Reason}, [on_tc_skip, Case]). @@ -146,6 +146,12 @@ call(Fun, Config, Meta) -> call([{CBId,Fun} || {CBId,_, _} <- CBs] ++ get_new_callbacks(Config, Fun), remove(?config_name,Config), Meta, CBs). +call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) -> + case call(Fun,Config,Meta) of + Config -> NoChangeRet; + NewReturn -> NewReturn + end; + call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> try {Config, {NewId, _, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta), diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index daee278368..13ff02cc6c 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -1068,20 +1068,23 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit, {ok,Args} -> run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback); Error = {error,_Reason} -> - do_end_tc_call(Mod,Func,{Error,Args0}, Error), - {{0,{skip,{failed,Error}}},{Mod,Func},[]}; + NewResult = do_end_tc_call(Mod,Func,{Error,Args0}, + {skip,{failed,Error}}), + {{0,NewResult},{Mod,Func},[]}; {fail,Reason} -> [Conf] = Args0, Conf1 = [{tc_status,{failed,Reason}} | Conf], fw_error_notify(Mod, Func, Conf, Reason), - do_end_tc_call(Mod,Func, {{error,Reason},[Conf1]},{fail, Reason}), - {{0,{failed,Reason}},{Mod,Func},[]}; + NewResult = do_end_tc_call(Mod,Func, {{error,Reason},[Conf1]}, + {fail, Reason}), + {{0,NewResult},{Mod,Func},[]}; Skip = {skip,_Reason} -> - do_end_tc_call(Mod,Func,{Skip,Args0},Skip), - {{0,Skip},{Mod,Func},[]}; + NewResult = do_end_tc_call(Mod,Func,{Skip,Args0},Skip), + {{0,NewResult},{Mod,Func},[]}; {auto_skip,Reason} -> - do_end_tc_call(Mod, Func, {{skip,Reason},Args0}, {auto_skip, Reason}), - {{0,{skip,{fw_auto_skip,Reason}}},{Mod,Func},[]} + NewResult = do_end_tc_call(Mod, Func, {{skip,Reason},Args0}, + {skip, {fw_auto_skip,Reason}}), + {{0,NewResult},{Mod,Func},[]} end, exit({Ref,Time,Value,Loc,Opts}). @@ -1187,7 +1190,12 @@ do_end_tc_call(M,F,Res,Return) -> {fail,FWReason} -> {failed,FWReason}; ok -> - Return; + case Return of + {fail,Reason} -> + {failed,Reason}; + Return -> + Return + end; NewReturn -> NewReturn end; @@ -1231,8 +1239,8 @@ process_return_val1([Failed={E,TCError}|_], M,F,A=[Args], Loc, _, SaveOpts) [[{tc_status,{failed,TCError}}|Args]]}, Failed) of {failed,FWReason} -> {{failed,FWReason},SaveOpts}; - _ -> - {Failed,SaveOpts} + NewReturn -> + {NewReturn,SaveOpts} end; process_return_val1([SaveCfg={save_config,_}|Opts], M,F,[Args], Loc, Final, SaveOpts) -> process_return_val1(Opts, M,F,[[SaveCfg|Args]], Loc, Final, SaveOpts); @@ -1249,8 +1257,8 @@ process_return_val1([], M,F,A, _Loc, Final, SaveOpts) -> case do_end_tc_call(M,F,{Final,A}, Final) of {failed,FWReason} -> {{failed,FWReason},SaveOpts}; - _ -> - {Final,lists:reverse(SaveOpts)} + NewReturn -> + {NewReturn,lists:reverse(SaveOpts)} end. user_callback(undefined, _, _, _, Args) -> diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 1dc5646184..977a2b1785 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -3552,7 +3552,7 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where, {_,{'EXIT',Reason}} -> progress(failed, Num, Mod, Func, Loc, Reason, Time, Comment, Style); - {_, {failed, Reason}} -> + {_, {Fail, Reason}} when Fail =:= fail; Fail =:= failed -> progress(failed, Num, Mod, Func, Loc, Reason, Time, Comment, Style); {_, {Skip, Reason}} when Skip==skip; Skip==skipped -> -- cgit v1.2.3 From 96f93c7e2a157442f60bb1b16ab0ce76d8b9dbca Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 1 Dec 2010 11:13:29 +0100 Subject: Add state update tests for suite callbacks --- lib/common_test/test/ct_suite_callback_SUITE.erl | 43 ++++++++++- .../scb/tests/ct_scb_fail_one_skip_one_SUITE.erl | 64 +++++++++++++++++ .../scb/tests/state_update_scb.erl | 83 ++++++++++++++++++++++ 3 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 53087956b9..d60d24e237 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -76,7 +76,8 @@ all(suite) -> minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, - skip_post_suite_scb, recover_post_suite_scb, update_config_scb + skip_post_suite_scb, recover_post_suite_scb, update_config_scb, + state_update_scb ]). @@ -144,6 +145,10 @@ update_config_scb(Config) -> do_test(update_config_scb, "ct_update_config_SUITE.erl", [update_config_scb],Config). +state_update_scb(Config) -> + do_test(state_update_scb, "ct_scb_fail_one_skip_one_SUITE.erl", + [state_update_scb,state_update_scb],Config). + %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -664,6 +669,40 @@ test_events(update_config_scb) -> {?eh,stop_logging,[]} ]; +test_events(state_update_scb) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + + {?eh,tc_done,{'_',end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,scb,{'_',terminate,[contains( + [post_end_per_suite,pre_end_per_suite, + post_end_per_group,pre_end_per_group, + post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase, + post_init_per_group,pre_init_per_group, + post_init_per_suite,pre_init_per_suite, + init])]}}, + {?eh,scb,{'_',terminate,[contains( + [post_end_per_suite,pre_end_per_suite, + post_end_per_group,pre_end_per_group, + post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase, + post_init_per_group,pre_init_per_group, + post_init_per_suite,pre_init_per_suite, + init] + )]}}, + {?eh,stop_logging,[]} + ]; + test_events(ok) -> ok. @@ -682,6 +721,8 @@ contains([{Ele,Pos}|T] = L,[H|T2]) -> end; contains([Ele|T],[{Ele,_}|T2])-> contains(T,T2); +contains([Ele|T],[Ele|T2])-> + contains(T,T2); contains(List,[_|T]) -> contains(List,T); contains([],_) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl new file mode 100644 index 0000000000..dfeacfe8b1 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl @@ -0,0 +1,64 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scb_fail_one_skip_one_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_Group,Config) -> + Config. + +end_per_group(_Group,_Config) -> + ok. + +init_per_testcase(test_case2, Config) -> + {skip,"skip it"}; +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +groups() -> + [{group1,[],[test_case1,test_case2,test_case3]}]. + +all() -> + [{group,group1}]. + +%% Test cases starts here. +test_case1(Config) -> + ok = nok. + +test_case2(Config) -> + ok. + +test_case3(Config) -> + ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl new file mode 100644 index 0000000000..1da0f7a6e4 --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl @@ -0,0 +1,83 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(state_update_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +%% Suite Callbacks +-compile(export_all). + +init(Opts) -> + {Id,State} = empty_scb:init(Opts), + {Id,[init|State]}. + +pre_init_per_suite(Suite, Config, State) -> + empty_scb:pre_init_per_suite(Suite,Config,State), + {Config, [pre_init_per_suite|State]}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_scb:post_init_per_suite(Suite,Config,Return,State), + {Config, [post_init_per_suite|State]}. + +pre_end_per_suite(Suite,Config,State) -> + empty_scb:pre_end_per_suite(Suite,Config,State), + {Config, [pre_end_per_suite|State]}. + +post_end_per_suite(Suite,Config,Return,State) -> + empty_scb:post_end_per_suite(Suite,Config,Return,State), + {Return, [post_end_per_suite|State]}. + +pre_init_per_group(Group,Config,State) -> + empty_scb:pre_init_per_group(Group,Config,State), + {Config, [pre_init_per_group|State]}. + +post_init_per_group(Group,Config,Return,State) -> + empty_scb:post_init_per_group(Group,Config,Return,State), + {Return, [post_init_per_group|State]}. + +pre_end_per_group(Group,Config,State) -> + empty_scb:pre_end_per_group(Group,Config,State), + {Config, [pre_end_per_group|State]}. + +post_end_per_group(Group,Config,Return,State) -> + empty_scb:post_end_per_group(Group,Config,Return,State), + {Return, [post_end_per_group|State]}. + +pre_init_per_testcase(TC,Config,State) -> + empty_scb:pre_init_per_testcase(TC,Config,State), + {Config, [pre_init_per_testcase|State]}. + +post_end_per_testcase(TC,Config,Return,State) -> + empty_scb:post_end_per_testcase(TC,Config,Return,State), + {Return, [post_end_per_testcase|State]}. + +on_tc_fail(TC, Reason, State) -> + empty_scb:on_tc_fail(TC,Reason,State), + [on_tc_fail|State]. + +on_tc_skip(TC, Reason, State) -> + empty_scb:on_tc_skip(TC,Reason,State), + [on_tc_skip|State]. + +terminate(State) -> + empty_scb:terminate(State). -- cgit v1.2.3 From 963d9f96452243a31cdcaa793a4bbe221a30a6f5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 1 Dec 2010 15:44:17 +0100 Subject: Add locking mechanism for scb state when using parallel groups --- lib/common_test/src/Makefile | 3 +- lib/common_test/src/ct_suite_callback.erl | 52 ++++++-- lib/common_test/src/ct_suite_callback_lock.erl | 131 +++++++++++++++++++++ lib/common_test/test/ct_suite_callback_SUITE.erl | 30 +++-- .../scb/tests/ct_scb_fail_one_skip_one_SUITE.erl | 2 +- 5 files changed, 200 insertions(+), 18 deletions(-) create mode 100644 lib/common_test/src/ct_suite_callback_lock.erl diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile index 14a0a27051..abf7816a91 100644 --- a/lib/common_test/src/Makefile +++ b/lib/common_test/src/Makefile @@ -68,7 +68,8 @@ MODULES= \ ct_config_plain \ ct_config_xml \ ct_slave \ - ct_suite_callback + ct_suite_callback\ + ct_suite_callback_lock TARGET_MODULES= $(MODULES:%=$(EBIN)/%) diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 4973ed685c..46bc250106 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -34,6 +34,8 @@ -type proplist() :: [{atom(),term()}]. -define(config_name, suite_callbacks). +-define(LOCK_STATE_TIMEOUT, 500). +-define(LOCK_NAME, '$ct_suite_callback_lock'). %% ------------------------------------------------------------------------- %% API Functions @@ -69,7 +71,8 @@ init_tc(Mod, init_per_suite, Config) -> call(fun call_generic/3, Config, [pre_init_per_suite, Mod]); init_tc(Mod, end_per_suite, Config) -> call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); -init_tc(_Mod, {init_per_group, GroupName, _}, Config) -> +init_tc(Mod, {init_per_group, GroupName, Opts}, Config) -> + maybe_start_locker(Mod, GroupName, Opts), call(fun call_generic/3, Config, [pre_init_per_group, GroupName]); init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> call(fun call_generic/3, Config, [pre_end_per_group, GroupName]); @@ -91,7 +94,7 @@ init_tc(_Mod, TC, Config) -> end_tc(ct_framework, _Func, _Args, Result, _Return) -> Result; -end_tc(Mod, init_per_suite, Config, Result, Return) -> +end_tc(Mod, init_per_suite, Config, _Result, Return) -> call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config], '$ct_no_change'); @@ -99,13 +102,15 @@ end_tc(Mod, end_per_suite, Config, Result, _Return) -> call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config], '$ct_no_change'); -end_tc(_Mod, {init_per_group, GroupName, _}, Config, Result, Return) -> +end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) -> call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config], '$ct_no_change'); -end_tc(_Mod, {end_per_group, GroupName, _}, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_group, GroupName, Config], - '$ct_no_change'); +end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) -> + Res = call(fun call_generic/3, Result, + [post_end_per_group, GroupName, Config], '$ct_no_change'), + maybe_stop_locker(Mod, GroupName,Opts), + Res; end_tc(_Mod, TC, Config, Result, _Return) -> call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config], @@ -142,9 +147,13 @@ call_generic({Mod, State}, Value, [Function | Args]) -> %% Generic call function call(Fun, Config, Meta) -> + maybe_lock(), CBs = get_callbacks(), - call([{CBId,Fun} || {CBId,_, _} <- CBs] ++ get_new_callbacks(Config, Fun), - remove(?config_name,Config), Meta, CBs). + Res = call([{CBId,Fun} || {CBId,_, _} <- CBs] ++ + get_new_callbacks(Config, Fun), + remove(?config_name,Config), Meta, CBs), + maybe_unlock(), + Res. call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) -> case call(Fun,Config,Meta) of @@ -255,3 +264,30 @@ catch_apply(M,F,A, Default) -> [M,F,length(A)]))}) end end. + + +%% We need to lock around the state for parallel groups only. This is because +%% we will get several processes reading and writing the state for a single +%% scb at the same time. +maybe_start_locker(Mod,GroupName,Opts) -> + case lists:member(parallel,Opts) of + true -> + {ok, _Pid} = ct_suite_callback_lock:start({Mod,GroupName}); + false -> + ok + end. + +maybe_stop_locker(Mod,GroupName,Opts) -> + case lists:member(parallel,Opts) of + true -> + stopped = ct_suite_callback_lock:stop({Mod,GroupName}); + false -> + ok + end. + + +maybe_lock() -> + locked = ct_suite_callback_lock:request(). + +maybe_unlock() -> + unlocked = ct_suite_callback_lock:release(). diff --git a/lib/common_test/src/ct_suite_callback_lock.erl b/lib/common_test/src/ct_suite_callback_lock.erl new file mode 100644 index 0000000000..84dafd1e42 --- /dev/null +++ b/lib/common_test/src/ct_suite_callback_lock.erl @@ -0,0 +1,131 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Framework test execution control module. +%%% +%%%

This module is a proxy for calling and handling locks in suite callbacks.

+ +-module(ct_suite_callback_lock). + +-behaviour(gen_server). + +%% API +-export([start/1, stop/1, request/0, release/0]). + +%% gen_server callbacks +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, + terminate/2, code_change/3]). + +-define(SERVER, ?MODULE). + +-record(state, { id, locked = false, requests = [] }). + +%%%=================================================================== +%%% API +%%%=================================================================== + +%% @doc Starts the server +start(Id) -> + case gen_server:start({local, ?SERVER}, ?MODULE, Id, []) of + {error,{already_started, Pid}} -> + {ok,Pid}; + Else -> + Else + end. + +stop(Id) -> + try + gen_server:call(?SERVER, {stop,Id}) + catch exit:{noproc,_} -> + stopped + end. + +request() -> + try + gen_server:call(?SERVER,{request,self()},infinity) + catch exit:{noproc,_} -> + locked + end. + +release() -> + try + gen_server:call(?SERVER,{release,self()}) + catch exit:{noproc,_} -> + unlocked + end. + +%%%=================================================================== +%%% gen_server callbacks +%%%=================================================================== + +%% @doc Initiates the server +init(Id) -> + {ok, #state{ id = Id }}. + +%% @doc Handling call messages +handle_call({stop,Id}, _From, #state{ id = Id, requests = Reqs } = State) -> + [gen_server:reply(Req, locker_stopped) || {Req,_ReqId} <- Reqs], + {stop, normal, stopped, State}; +handle_call({stop,_Id}, _From, State) -> + {reply, stopped, State}; +handle_call({request, Pid}, _From, #state{ locked = false, + requests = [] } = State) -> + Ref = monitor(process, Pid), + {reply, locked, State#state{ locked = {true, Pid, Ref}} }; +handle_call({request, Pid}, From, #state{ requests = Reqs } = State) -> + {noreply, State#state{ requests = Reqs ++ [{From,Pid}] }}; +handle_call({release, Pid}, _From, #state{ locked = {true, Pid, Ref}, + requests = []} = State) -> + demonitor(Ref,[flush]), + {reply, unlocked, State#state{ locked = false }}; +handle_call({release, Pid}, _From, + #state{ locked = {true, Pid, Ref}, + requests = [{NextFrom,NextPid}|Rest]} = State) -> + demonitor(Ref,[flush]), + gen_server:reply(NextFrom,locked), + NextRef = monitor(process, NextPid), + {reply,unlocked,State#state{ locked = {true, NextPid, NextRef}, + requests = Rest } }; +handle_call({release, _Pid}, _From, State) -> + {reply, not_locked, State}. + +%% @doc Handling cast messages +handle_cast(_Msg, State) -> + {noreply, State}. + +%% @doc Handling all non call/cast messages +handle_info({'DOWN',Ref,process,Pid,_}, + #state{ locked = {true, Pid, Ref}, + requests = [{NextFrom,NextPid}|Rest] } = State) -> + gen_server:reply(NextFrom, locked), + NextRef = monitor(process, NextPid), + {noreply,State#state{ locked = {true, NextPid, NextRef}, + requests = Rest } }. + +%% @doc This function is called by a gen_server when it is about to terminate. +terminate(_Reason, _State) -> + ok. + +%% @doc Convert process state when code is changed +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%% ------------------------------------------------------------------------- +%% Internal Functions +%% ------------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index d60d24e237..e6e4d5706b 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -682,20 +682,24 @@ test_events(state_update_scb) -> {?eh,scb,{'_',terminate,[contains( [post_end_per_suite,pre_end_per_suite, post_end_per_group,pre_end_per_group, - post_end_per_testcase,pre_init_per_testcase, - on_tc_skip,post_end_per_testcase, - pre_init_per_testcase,on_tc_fail, - post_end_per_testcase,pre_init_per_testcase, + {not_in_order, + [post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase] + }, post_init_per_group,pre_init_per_group, post_init_per_suite,pre_init_per_suite, init])]}}, {?eh,scb,{'_',terminate,[contains( [post_end_per_suite,pre_end_per_suite, post_end_per_group,pre_end_per_group, - post_end_per_testcase,pre_init_per_testcase, - on_tc_skip,post_end_per_testcase, - pre_init_per_testcase,on_tc_fail, - post_end_per_testcase,pre_init_per_testcase, + {not_in_order, + [post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase] + }, post_init_per_group,pre_init_per_group, post_init_per_suite,pre_init_per_suite, init] @@ -712,6 +716,10 @@ contains(List) -> fun(Proplist) when is_list(Proplist) -> contains(List,Proplist) end. + +contains([{not_in_order,List}|T],Rest) -> + contains_parallel(List,Rest), + contains(T,Rest); contains([{Ele,Pos}|T] = L,[H|T2]) -> case element(Pos,H) of Ele -> @@ -728,6 +736,12 @@ contains(List,[_|T]) -> contains([],_) -> match. +contains_parallel([Key | T], Elems) -> + contains([Key],Elems), + contains_parallel(T,Elems); +contains_parallel([],Elems) -> + match. + not_contains(List) -> fun(Proplist) when is_list(Proplist) -> [] = [Ele || {Ele,_} <- Proplist, diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl index dfeacfe8b1..593bd4a534 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl @@ -48,7 +48,7 @@ end_per_testcase(_TestCase, _Config) -> ok. groups() -> - [{group1,[],[test_case1,test_case2,test_case3]}]. + [{group1,[parallel],[{group2,[parallel],[test_case1,test_case2,test_case3]}]}]. all() -> [{group,group1}]. -- cgit v1.2.3 From 6288b704f2ee0699407f645536ad69e0dd07756d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 2 Dec 2010 15:27:10 +0100 Subject: Started work on documenting suite callbacks, this is a partial commit --- lib/common_test/doc/src/Makefile | 2 +- lib/common_test/doc/src/ct_suite_callbacks.xml | 94 ++++++++++++++++++++++++++ lib/common_test/doc/src/ref_man.xml | 1 + 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 lib/common_test/doc/src/ct_suite_callbacks.xml diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile index 1a767a8197..be066143e0 100644 --- a/lib/common_test/doc/src/Makefile +++ b/lib/common_test/doc/src/Makefile @@ -52,7 +52,7 @@ CT_XML_FILES = $(CT_MODULES:=.xml) XML_APPLICATION_FILES = ref_man.xml XML_REF1_FILES = ct_run.xml -XML_REF3_FILES = $(CT_XML_FILES) +XML_REF3_FILES = $(CT_XML_FILES) ct_suite_callbacks.xml XML_REF6_FILES = common_test_app.xml XML_PART_FILES = part.xml diff --git a/lib/common_test/doc/src/ct_suite_callbacks.xml b/lib/common_test/doc/src/ct_suite_callbacks.xml new file mode 100644 index 0000000000..28a496a47b --- /dev/null +++ b/lib/common_test/doc/src/ct_suite_callbacks.xml @@ -0,0 +1,94 @@ + + + + + +
+ + 20102010 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Suite Callbacks + Lukas Larsson + Lukas Larsson + + + + 2010-12-02 + PA1 + suite_callback.sgml +
+ ct_suite_callback + A callback interface on top of common test + + + +

The Suite Callback framework allows extensions of the default + behaviour of Common Test by means of callbacks before and after all + test suite calls.

+ +

In brief, Suite Callbacks allows you to:

+ + + Manipulating the runtime config before each suite configuration calls + Manipulating the return of all suite configuration calls + + +

The following sections describe the mandatory and optional suite callback + functions Common Test will call during test execution. For more details + see Suite Callbacks in the User's Guide.

+ +
+ +
+ CALLBACK FUNCTIONS +

The following functions define the callback interface + for a suite callback.

+
+ + + + Module:init(Opts) -> {Id,State} + asdas + + Opts = term() + Id = term() + GroupName = term() + + + +

MANDATORY

+ +

+ +

If {skip,Reason} is returned, all test cases + in the module will be skipped, and the Reason will + be printed on the HTML result page.

+ +

For details on groups, see + Test case + groups in the User's Guide.

+ +
+
+ + +
+ +
+ + diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml index d5985bb021..100c0fe5d7 100644 --- a/lib/common_test/doc/src/ref_man.xml +++ b/lib/common_test/doc/src/ref_man.xml @@ -76,6 +76,7 @@ + -- cgit v1.2.3 From 8b33f2edabbfd684e619238bbfaa10cc16e2a0a7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 19:14:03 +0100 Subject: Fix bug which caused scb to be added too much when initiated in the suite info function --- lib/common_test/src/ct_framework.erl | 4 +++- lib/common_test/src/ct_suite_callback.erl | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index dbf367e4d8..d05c30f5e1 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -251,7 +251,9 @@ add_defaults(Mod,Func,FuncInfo,DoInit) -> (_) -> false end, SuiteInfo) of true -> - SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfo), + SuiteInfoNoSCB = + lists:keydelete(suite_callbacks,1,SuiteInfo), + SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfoNoSCB), case add_defaults1(Mod,Func,FuncInfo,SuiteInfo1,DoInit) of Error = {error,_} -> {SuiteInfo1,Error}; MergedInfo -> {SuiteInfo1,MergedInfo} diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 46bc250106..4f6bf9942e 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -68,7 +68,13 @@ terminate(Callbacks) -> init_tc(ct_framework, _Func, Args) -> Args; init_tc(Mod, init_per_suite, Config) -> - call(fun call_generic/3, Config, [pre_init_per_suite, Mod]); + Info = case catch proplists:get_value(suite_callbacks, Mod:suite()) of + List when is_list(List) -> + [{suite_callbacks,List}]; + _Else -> + [] + end, + call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]); init_tc(Mod, end_per_suite, Config) -> call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); init_tc(Mod, {init_per_group, GroupName, Opts}, Config) -> -- cgit v1.2.3 From 8ed5c47ca047405b2c00a979a8567412e5283322 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 8 Dec 2010 17:16:49 +0100 Subject: Add so that failures in SCB:init/1 causes the entire scb scope to fail --- lib/common_test/src/ct_run.erl | 2 + lib/common_test/src/ct_suite_callback.erl | 9 +-- lib/common_test/src/ct_util.erl | 10 +++- lib/common_test/test/ct_suite_callback_SUITE.erl | 76 +++++++++++++++++++----- 4 files changed, 76 insertions(+), 21 deletions(-) diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 78782d346a..7d6a2f54d9 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2203,6 +2203,8 @@ opts2args(EnvStartOpts) -> end, EHs), [_LastAnd|StrsR] = lists:reverse(lists:flatten(Strs)), [{event_handler_init,lists:reverse(StrsR)}]; + ({suite_callbacks,[]}) -> + []; ({Opt,As=[A|_]}) when is_atom(A) -> [{Opt,[atom_to_list(Atom) || Atom <- As]}]; ({Opt,Strs=[S|_]}) when is_list(S) -> diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 4f6bf9942e..8372303737 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -46,8 +46,7 @@ {error, Reason :: term()}. init(Opts) -> call([{CB, call_init, undefined} || CB <- get_new_callbacks(Opts)], - ct_suite_callback_init_dummy, init, []), - ok. + ok, init, []). %% @doc Called after all suites are done. @@ -181,9 +180,11 @@ call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> [Mod,NewId]), call(NewRest, Config, Meta, NewCBs) catch Error:Reason -> + Trace = erlang:get_stacktrace(), ct_logs:log("Suite Callback","Failed to start a SCB: ~p:~p", - [Error,{Reason,erlang:get_stacktrace()}]), - call(Rest, Config, Meta, CBs) + [Error,{Reason,Trace}]), + call([], {fail,"Failed to start SCB" + ", see the CT Log for details"}, Meta, CBs) end; call([{CBId, Fun} | Rest], Config, Meta, CBs) -> try diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index fddeff881e..2f5a90a543 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -163,8 +163,14 @@ do_start(Parent,Mode,LogDir) -> {StartTime,TestLogDir} = ct_logs:init(Mode), %% Initiate suite_callbacks - ok = ct_suite_callback:init(Opts), - + case catch ct_suite_callback:init(Opts) of + ok -> + ok; + {_,SCBReason} -> + ct_logs:tc_print('Suite Callback',SCBReason,[]), + Parent ! {self(), SCBReason}, + self() ! {{stop,normal},{self(),make_ref()}} + end, ct_event:notify(#event{name=test_start, node=node(), diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index e6e4d5706b..8d620be7ba 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -70,15 +70,18 @@ all() -> all(suite). all(suite) -> - lists:reverse( + %% lists:reverse( [ - one_scb, two_scb, faulty_scb_no_init, minimal_scb, + one_scb, two_scb, faulty_scb_no_init, faulty_scb_exit_in_init, + faulty_scb_exit_in_init_scope_suite, minimal_scb, minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, skip_post_suite_scb, recover_post_suite_scb, update_config_scb, state_update_scb - ]). + ] + %%) + . %%-------------------------------------------------------------------- @@ -96,7 +99,8 @@ two_scb(Config) when is_list(Config) -> faulty_scb_no_init(Config) when is_list(Config) -> do_test(faulty_scb_no_init, "ct_scb_empty_SUITE.erl",[askjhdkljashdkaj], - Config). + Config,{error,"Failed to start SCB, see the " + "CT Log for details"}). minimal_scb(Config) when is_list(Config) -> do_test(minimal_scb, "ct_scb_empty_SUITE.erl",[minimal_scb],Config). @@ -109,6 +113,17 @@ faulty_scb_undef(Config) when is_list(Config) -> do_test(faulty_scb_undef, "ct_scb_empty_SUITE.erl", [undef_scb],Config). +faulty_scb_exit_in_init_scope_suite(Config) when is_list(Config) -> + do_test(faulty_scb_exit_in_init_scope_suite, + "ct_exit_in_init_scope_suite_scb_SUITE.erl", + [],Config). + +faulty_scb_exit_in_init(Config) when is_list(Config) -> + do_test(faulty_scb_exit_in_init, "ct_scb_empty_SUITE.erl", + [crash_init_scb], Config, + {error,"Failed to start SCB, see the " + "CT Log for details"}). + scope_per_suite_scb(Config) when is_list(Config) -> do_test(scope_per_suite_scb, "ct_scope_per_suite_scb_SUITE.erl", [],Config). @@ -153,21 +168,28 @@ state_update_scb(Config) -> %%% HELP FUNCTIONS %%%----------------------------------------------------------------- -do_test(Tag, SuiteWildCard, SCBs, Config) -> +do_test(Tag, SWC, SCBs, Config) -> + do_test(Tag, SWC, SCBs, Config, ok). +do_test(Tag, SWC, SCBs, Config, {error,_} = Res) -> + do_test(Tag, SWC, SCBs, Config, Res, 1); +do_test(Tag, SWC, SCBs, Config, Res) -> + do_test(Tag, SWC, SCBs, Config, Res, 2). + +do_test(Tag, SuiteWildCard, SCBs, Config, Res, EC) -> DataDir = ?config(data_dir, Config), Suites = filelib:wildcard( filename:join([DataDir,"scb/tests",SuiteWildCard])), {Opts,ERPid} = setup([{suite,Suites}, {suite_callbacks,SCBs},{label,Tag}], Config), - ok = ct_test_support:run(Opts, Config), + Res = ct_test_support:run(Opts, Config), Events = ct_test_support:get_events(ERPid, Config), ct_test_support:log_events(Tag, reformat(Events, ?eh), ?config(priv_dir, Config)), - TestEvents = events_to_check(Tag), + TestEvents = events_to_check(Tag, EC), ok = ct_test_support:verify_events(TestEvents, Events, Config). setup(Test, Config) -> @@ -258,14 +280,6 @@ test_events(faulty_scb_no_init) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} ]; @@ -337,6 +351,38 @@ test_events(faulty_scb_undef) -> {?eh,stop_logging,[]} ]; +test_events(faulty_scb_exit_in_init_scope_suite) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,tc_done, + {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, + {failed, + {error, + "Failed to start SCB, see the CT Log for details"}}}}, + {?eh,tc_auto_skip, + {ct_exit_in_init_scope_suite_scb_SUITE,test_case, + {failed, + {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, + {failed, + "Failed to start SCB, see the CT Log for details"}}}}}, + {?eh,tc_auto_skip, + {ct_exit_in_init_scope_suite_scb_SUITE,end_per_suite, + {failed, + {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, + {failed, + "Failed to start SCB, see the CT Log for details"}}}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]}]; + +test_events(faulty_scb_exit_in_init) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]}]; + test_events(scope_per_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, -- cgit v1.2.3 From 9a5ba00578bd2b2d04d8814f8a228ff7bed1c18f Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 8 Dec 2010 18:42:41 +0100 Subject: Added utility variable print function, and utilized it in view-mib. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 20 ++++++------ lib/snmp/src/agent/snmpa.erl | 18 ++++++----- lib/snmp/src/agent/snmpa_mib_lib.erl | 44 +++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 19 deletions(-) diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index f98b799631..659babaf94 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -782,32 +782,30 @@ split_cols(Cols, PreCols) -> {PreCols, Cols}. vacmViewSpinLock(print) -> - case vacmViewSpinLock(get) of - {value, Val} -> io:format("vacmViewSpinLock => ~p~n", [Val]); - Error -> io:format("vacmViewSpinLock => ERROR: ~p~n", [Error]) - end; + VarAndValue = [{vacmViewSpinLock, vacmViewSpinLock(get)}], + snmpa_mib_lib:print_variables(VarAndValue); vacmViewSpinLock(new) -> - snmp_generic:variable_func(new, {vacmViewSpinLock, volatile}), + snmp_generic:variable_func(new, volatile_db(vacmViewSpinLock)), {A1,A2,A3} = erlang:now(), random:seed(A1,A2,A3), Val = random:uniform(2147483648) - 1, - snmp_generic:variable_func(set, Val, {vacmViewSpinLock, volatile}); + snmp_generic:variable_func(set, Val, volatile_db(vacmViewSpinLock)); vacmViewSpinLock(delete) -> ok; vacmViewSpinLock(get) -> - snmp_generic:variable_func(get, {vacmViewSpinLock, volatile}). + snmp_generic:variable_func(get, volatile_db(vacmViewSpinLock)). vacmViewSpinLock(is_set_ok, NewVal) -> - case snmp_generic:variable_func(get, {vacmViewSpinLock, volatile}) of + case snmp_generic:variable_func(get, volatile_db(vacmViewSpinLock)) of {value, NewVal} -> noError; _ -> inconsistentValue end; vacmViewSpinLock(set, NewVal) -> snmp_generic:variable_func(set, (NewVal + 1) rem 2147483648, - {vacmViewSpinLock, volatile}). + volatile_db(vacmViewSpinLock)). vacmViewTreeFamilyTable(print) -> @@ -942,7 +940,9 @@ do_get_vacmAccessTable(Key0, Acc) -> -db(X) -> snmpa_agent:db(X). +db(X) -> snmpa_agent:db(X). +volatile_db(X) -> {X, volatile}. + fa(vacmSecurityToGroupTable) -> ?vacmGroupName; fa(vacmViewTreeFamilyTable) -> ?vacmViewTreeFamilyMask. diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 88417b19fe..8ad2a83de4 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -328,8 +328,8 @@ print_mib_info() -> print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_variables(Mod, Variables), - print_tables(Mod, Tables), + print_mib_variables2(Mod, Variables), + print_mib_tables2(Mod, Tables), print_mib_info(MibsInfo). @@ -339,7 +339,8 @@ print_mib_tables() -> print_mib_tables([]) -> ok; -print_mib_tables([{Mod, Tabs}|MibTabs]) when is_atom(Mod) andalso is_list(Tabs) -> +print_mib_tables([{Mod, Tabs}|MibTabs]) + when is_atom(Mod) andalso is_list(Tabs) -> print_mib_tables(Mod, Tabs), print_mib_tables(MibTabs); print_mib_tables([_|MibTabs]) -> @@ -347,9 +348,9 @@ print_mib_tables([_|MibTabs]) -> print_mib_tables(Mod, Tables) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_tables(Mod, Tables). + print_mib_tables2(Mod, Tables). -print_tables(Mod, Tables) -> +print_mib_tables2(Mod, Tables) -> [(catch Mod:Table(print)) || Table <- Tables]. @@ -359,7 +360,8 @@ print_mib_variables() -> print_mib_variables([]) -> ok; -print_mib_variables([{Mod, Vars}|MibVars]) when is_atom(Mod) andalso is_list(Vars) -> +print_mib_variables([{Mod, Vars}|MibVars]) + when is_atom(Mod) andalso is_list(Vars) -> print_mib_variables(Mod, Vars), print_mib_variables(MibVars); print_mib_variables([_|MibVars]) -> @@ -367,9 +369,9 @@ print_mib_variables([_|MibVars]) -> print_mib_variables(Mod, Vars) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), - print_variables(Mod, Vars). + print_mib_variables2(Mod, Vars). -print_variables(Mod, Variables) -> +print_mib_variables2(Mod, Variables) -> [(catch Mod:Variable(print)) || Variable <- Variables]. diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl index 441228b9ee..22057b4547 100644 --- a/lib/snmp/src/agent/snmpa_mib_lib.erl +++ b/lib/snmp/src/agent/snmpa_mib_lib.erl @@ -19,7 +19,8 @@ -module(snmpa_mib_lib). -export([table_cre_row/3, table_del_row/2]). --export([get_table/2, print_table/3, print_table/4, print_tables/1]). +-export([get_table/2]). +-export([print_variables/1, print_table/3, print_table/4, print_tables/1]). -export([gc_tab/3, gc_tab/5]). -include("SNMPv2-TC.hrl"). @@ -81,6 +82,47 @@ get_table(NameDb, FOI, Oid, Acc) -> end. +print_variables(Variables) when is_list(Variables) -> + Variables2 = print_variables_prefixify(Variables), + lists:foreach(fun({Variable, ValueResult, Prefix}) -> + print_variable(Variable, ValueResult, Prefix) + end, Variables2), + ok. + +print_variable(Variable, {value, Val}, Prefix) when is_atom(Variable) -> + io:format("~w~s => ~p~n", [Variable, Prefix, Val]); +print_variable(Variable, Error, Prefix) when is_atom(Variable) -> + io:format("~w~s => ERROR: ~p~n", [Variable, Prefix, Error]). + +print_variables_prefixify(Variables) -> + MaxVarLength = print_variables_maxlength(Variables), + print_variables_prefixify(Variables, MaxVarLength, []). + +print_variables_prefixify([], _MaxVarLength, Acc) -> + lists:reverse(Acc); +print_variables_prefixify([{Var, Res}|Variables], MaxVarLength, Acc) -> + Prefix = make_variable_print_prefix(Var, MaxVarLength), + print_variables_prefixify(Variables, MaxVarLength, + [{Var, Res, Prefix}|Acc]). + +make_variable_print_prefix(Var, MaxVarLength) -> + lists:duplicate(MaxVarLength - length(atom_to_list(Var)) + 1, $ ). + +print_variables_maxlength(Variables) -> + print_variables_maxlength(Variables, 0). + +print_variables_maxlength([], MaxLength) -> + MaxLength; +print_variables_maxlength([{Var, _}|Variables], MaxLength) when is_atom(Var) -> + VarLen = length(atom_to_list(Var)), + if + VarLen > MaxLength -> + print_variables_maxlength(Variables, VarLen); + true -> + print_variables_maxlength(Variables, MaxLength) + end. + + print_tables(Tables) when is_list(Tables) -> lists:foreach(fun({Table, DB, FOI, PrintRow}) -> print_table(Table, DB, FOI, PrintRow) -- cgit v1.2.3 From ad5b84bd154e27d9e4db3af12b8b4326c564b2bf Mon Sep 17 00:00:00 2001 From: Vitaliy Batichko Date: Tue, 23 Nov 2010 17:08:01 +0200 Subject: Add char (~c) type parameters to ei_format --- lib/erl_interface/doc/src/ei.xml | 1 + lib/erl_interface/src/misc/ei_format.c | 9 +++++++++ lib/erl_interface/test/ei_format_SUITE.erl | 2 +- lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml index d7af7a1b67..be5d7ebef8 100644 --- a/lib/erl_interface/doc/src/ei.xml +++ b/lib/erl_interface/doc/src/ei.xml @@ -641,6 +641,7 @@ ei_x_encode_empty_list(&x);

 ~a - an atom, char*
+~c - a character, char
 ~s - a string, char*
 ~i - an integer, int
 ~l - a long integer, long int
diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index b35421d4b2..96203a0d15 100644
--- a/lib/erl_interface/src/misc/ei_format.c
+++ b/lib/erl_interface/src/misc/ei_format.c
@@ -47,6 +47,7 @@
  * array of unions.
  */
 union arg {
+  char c;
   char* s;
   long l;
   unsigned long u;
@@ -224,6 +225,7 @@ static int pquotedatom(const char** fmt, ei_x_buff* x)
  /* 
   * The format letters are:
   *   a  -  An atom
+  *   c  -  A character
   *   s  -  A string
   *   i  -  An integer
   *   l  -  A long integer
@@ -240,6 +242,10 @@ static int pformat(const char** fmt, union arg** args, ei_x_buff* x)
 	res = ei_x_encode_atom(x, (*args)->s);
 	(*args)++;
 	break;
+    case 'c':
+	res = ei_x_encode_char(x, (*args)->c);
+	(*args)++;
+	break;
     case 's':
 	res = ei_x_encode_string(x, (*args)->s);
 	(*args)++;
@@ -396,6 +402,9 @@ static int read_args(const char* fmt, va_list ap, union arg **argp)
 	  return -1;	/* Error, string not complete */
 	}
 	switch (*p++) {
+	case 'c':
+	  args[i++].c = (char) va_arg(ap, int);
+	  break;
 	case 'a': 
 	case 's':
 	  args[i++].s = va_arg(ap, char*);
diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl
index cbe9fa52d7..6d44e0adf3 100644
--- a/lib/erl_interface/test/ei_format_SUITE.erl
+++ b/lib/erl_interface/test/ei_format_SUITE.erl
@@ -155,7 +155,7 @@ format_wo_ver(suite) -> [];
 format_wo_ver(Config) when is_list(Config) ->
     ?line P = runner:start(?format_wo_ver),
 
-    ?line {term, [-1, 2, {a, "b"}, {c, 10}]} = get_term(P),
+    ?line {term, [-1, 2, $c, {a, "b"}, {c, 10}]} = get_term(P),
 
     ?line runner:recv_eot(P),
     ok.
diff --git a/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c b/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
index ecdce402f5..a6eeb25abc 100644
--- a/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
+++ b/lib/erl_interface/test/ei_format_SUITE_data/ei_format_test.c
@@ -176,7 +176,7 @@ TESTCASE(format_wo_ver) {
     ei_x_buff x;
     
     ei_x_new (&x);
-    ei_x_format(&x, "[-1, +2, {~a,~s},{~a,~i}]", "a", "b", "c", 10);
+    ei_x_format(&x, "[-1, +2, ~c, {~a,~s},{~a,~i}]", 'c', "a", "b", "c", 10);
     send_bin_term(&x);
 
     free(x.buff);
-- 
cgit v1.2.3


From 95392e693e210189df82173c9bcd345b58b004fe Mon Sep 17 00:00:00 2001
From: Vitaliy Batichko 
Date: Tue, 23 Nov 2010 18:44:24 +0200
Subject: Add PID (~p) type parameters to ei_format

---
 lib/erl_interface/doc/src/ei.xml                   |  1 +
 lib/erl_interface/src/misc/ei_format.c             |  9 +++++++++
 lib/erl_interface/test/ei_connect_SUITE.erl        | 19 ++++++++++++++++++
 .../test/ei_connect_SUITE_data/ei_connect_test.c   | 23 +++++++++++++++++++++-
 4 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index be5d7ebef8..de4e4b4301 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -648,6 +648,7 @@ ei_x_encode_empty_list(&x);
 ~u - a unsigned long integer, unsigned long int
 ~f - a float, float
 ~d - a double float, double float
+~p - an Erlang PID, erlang_pid*
         

For instance, to encode a tuple with some stuff:

diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index 96203a0d15..dbd7a4479a 100644
--- a/lib/erl_interface/src/misc/ei_format.c
+++ b/lib/erl_interface/src/misc/ei_format.c
@@ -52,6 +52,7 @@ union arg {
   long l;
   unsigned long u;
   double d;
+  erlang_pid* pid;
 };
 
 static int eiformat(const char** s, union arg** args, ei_x_buff* x);
@@ -232,6 +233,7 @@ static int pquotedatom(const char** fmt, ei_x_buff* x)
   *   u  -  An unsigned long integer
   *   f  -  A float 
   *   d  -  A double float 
+  *   p  -  An Erlang PID
   */
 static int pformat(const char** fmt, union arg** args, ei_x_buff* x)
 {
@@ -267,6 +269,10 @@ static int pformat(const char** fmt, union arg** args, ei_x_buff* x)
 	res = ei_x_encode_double(x, (*args)->d);
 	(*args)++;
 	break;	
+    case 'p':
+	res = ei_x_encode_pid(x, (*args)->pid);
+	(*args)++;
+	break;
     default:
 	res = -1;
 	break;
@@ -424,6 +430,9 @@ static int read_args(const char* fmt, va_list ap, union arg **argp)
 	case 'd':
 	  args[i++].d = va_arg(ap, double);
 	  break;	
+	case 'p':
+	  args[i++].pid = va_arg(ap, erlang_pid*);
+	  break;
 	default:
 	  ei_free(args);	/* Invalid specifier */
 	  return -1;
diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl
index fe82a73ef9..3c72188e16 100644
--- a/lib/erl_interface/test/ei_connect_SUITE.erl
+++ b/lib/erl_interface/test/ei_connect_SUITE.erl
@@ -30,6 +30,7 @@
 
 	ei_send/1, 
 	ei_reg_send/1, 
+	ei_format_pid/1,
 	ei_rpc/1, 
 	rpc_test/1, 
 	ei_send_funs/1,
@@ -41,6 +42,7 @@
 
 all(suite) -> [ ei_send, 
 		ei_reg_send, 
+		ei_format_pid,
 		ei_rpc, 
 		ei_send_funs, 
 		ei_threaded_send,
@@ -67,6 +69,19 @@ ei_send(Config) when is_list(Config) ->
     ?line runner:recv_eot(P),
     ok.
 
+ei_format_pid(Config) when is_list(Config) ->
+    ?line S = self(),
+    ?line P = runner:start(?interpret),
+    ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
+    ?line {ok,Fd} = ei_connect(P, node()),
+
+    ?line ok = ei_format_pid(P, Fd, S),
+    ?line receive S -> ok end,
+
+    ?line runner:send_eot(P),
+    ?line runner:recv_eot(P),
+    ok.
+
 ei_send_funs(Config) when is_list(Config) ->
     ?line P = runner:start(?interpret),
     ?line 0 = ei_connect_init(P, 42, erlang:get_cookie(), 0),
@@ -189,6 +204,10 @@ ei_send(P, Fd, To, Msg) ->
     send_command(P, ei_send, [Fd,To,Msg]),
     get_send_result(P).
 
+ei_format_pid(P, Fd, To) ->
+    send_command(P, ei_format_pid, [Fd, To]),
+    get_send_result(P).
+
 ei_send_funs(P, Fd, To, Msg) ->
     send_command(P, ei_send_funs, [Fd,To,Msg]),
     get_send_result(P).
diff --git a/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c b/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
index debd3e789b..8183ac9dd8 100644
--- a/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
+++ b/lib/erl_interface/test/ei_connect_SUITE_data/ei_connect_test.c
@@ -35,6 +35,7 @@
 static void cmd_ei_connect_init(char* buf, int len);
 static void cmd_ei_connect(char* buf, int len);
 static void cmd_ei_send(char* buf, int len);
+static void cmd_ei_format_pid(char* buf, int len);
 static void cmd_ei_send_funs(char* buf, int len);
 static void cmd_ei_reg_send(char* buf, int len);
 static void cmd_ei_rpc(char* buf, int len);
@@ -57,6 +58,7 @@ static struct {
     "ei_reg_send", 	     3, cmd_ei_reg_send,
     "ei_rpc",  		     4, cmd_ei_rpc,
     "ei_set_get_tracelevel", 1, cmd_ei_set_get_tracelevel,
+    "ei_format_pid",         2, cmd_ei_format_pid,
 };
 
 
@@ -111,7 +113,7 @@ static void cmd_ei_connect_init(char* buf, int len)
     ei_x_buff res;
     if (ei_decode_long(buf, &index, &l) < 0)
 	fail("expected int");
-    sprintf(b, "c%d", l);
+    sprintf(b, "c%ld", l);
     /* FIXME don't use internal and maybe use skip?! */
     ei_get_type_internal(buf, &index, &type, &size);
     if (ei_decode_atom(buf, &index, cookie) < 0)
@@ -183,6 +185,25 @@ static void cmd_ei_send(char* buf, int len)
     ei_x_free(&x);
 }
 
+static void cmd_ei_format_pid(char* buf, int len)
+{
+    int index = 0;
+    long fd;
+    erlang_pid pid;
+    ei_x_buff x;
+
+    if (ei_decode_long(buf, &index, &fd) < 0)
+	fail("expected long");
+    if (ei_decode_pid(buf, &index, &pid) < 0)
+	fail("expected pid (node)");
+    if (ei_x_new_with_version(&x) < 0)
+	fail("ei_x_new_with_version");
+    if (ei_x_format_wo_ver(&x, "~p", &pid) < 0)
+	fail("ei_x_format_wo_ver");
+    send_errno_result(ei_send(fd, &pid, x.buff, x.index));
+    ei_x_free(&x);
+}
+
 static void cmd_ei_send_funs(char* buf, int len)
 {
     int index = 0, n;
-- 
cgit v1.2.3


From 7f25a132488707b167d1d5b3c59ba58b0600e848 Mon Sep 17 00:00:00 2001
From: Lukas Larsson 
Date: Thu, 9 Dec 2010 11:48:15 +0100
Subject: Added tests for starting SCB's with arguments and fixed a bug with
 how SCB's are parsed from the command line

---
 lib/common_test/src/ct_run.erl                     |  45 ++++++-
 lib/common_test/test/ct_suite_callback_SUITE.erl   | 147 +++++++++++++++++++--
 .../tests/ct_scope_per_group_state_scb_SUITE.erl   |  56 ++++++++
 .../tests/ct_scope_per_suite_state_scb_SUITE.erl   |  47 +++++++
 .../scb/tests/ct_scope_suite_state_scb_SUITE.erl   |  50 +++++++
 5 files changed, 330 insertions(+), 15 deletions(-)
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl

diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 7d6a2f54d9..a12d4d6f18 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -172,9 +172,7 @@ script_start1(Parent, Args) ->
 			       ([]) -> true
 			    end, false, Args),
     EvHandlers = event_handler_args2opts(Args),
-    SuiteCBs = get_start_opt(suite_callbacks,
-			     fun(CBs) -> [list_to_atom(CB) || CB <- CBs] end,
-			     [], Args),
+    SuiteCBs = suite_callbacks_args2opts(Args),
 
     %% check flags and set corresponding application env variables
 
@@ -2076,6 +2074,33 @@ get_start_opt(Key, IfExists, IfNotExists, Args) ->
 	    IfNotExists
     end.
 
+suite_callbacks_args2opts(Args) ->
+    suite_callbacks_args2opts(
+      proplists:get_value(suite_callbacks, Args, []),[]).
+
+suite_callbacks_args2opts([SCB,Arg,"and"| Rest],Acc) ->
+    suite_callbacks_args2opts(Rest,[{list_to_atom(SCB),
+				     parse_scb_args(Arg)}|Acc]);
+suite_callbacks_args2opts([SCB], Acc) ->
+    suite_callbacks_args2opts([SCB,"and"],Acc);
+suite_callbacks_args2opts([SCB, "and" | Rest], Acc) ->
+    suite_callbacks_args2opts(Rest,[list_to_atom(SCB)|Acc]);
+suite_callbacks_args2opts([SCB, Args], Acc) ->
+    suite_callbacks_args2opts([SCB, Args, "and"],Acc);
+suite_callbacks_args2opts([],Acc) ->
+    lists:reverse(Acc).
+
+parse_scb_args(String) ->
+    try
+	true = io_lib:printable_list(String),
+	{ok,Toks,_} = erl_scan:string(String++"."),
+	{ok, Args} = erl_parse:parse_term(Toks),
+	Args
+    catch _:_ ->
+	    String
+    end.
+
+
 event_handler_args2opts(Args) ->
     case proplists:get_value(event_handler, Args) of
 	undefined ->
@@ -2205,6 +2230,20 @@ opts2args(EnvStartOpts) ->
 			  [{event_handler_init,lists:reverse(StrsR)}];
 		     ({suite_callbacks,[]}) ->
 			  [];
+		     ({suite_callbacks,SCBs}) when is_list(SCBs) ->
+			  io:format(user,"suite_callbacks: ~p",[SCBs]),
+			  Strs = lists:flatmap(
+				   fun({SCB,Arg}) ->
+					   [atom_to_list(SCB),
+					    lists:flatten(
+					      io_lib:format("~p",[Arg])),
+					    "and"];
+				      (SCB) when is_atom(SCB) ->
+					   [atom_to_list(SCB),"and"]
+				   end,SCBs),
+			  [_LastAnd|StrsR] = lists:reverse(Strs),
+			  io:format(user,"return: ~p",[lists:reverse(StrsR)]),
+			  [{suite_callbacks,lists:reverse(StrsR)}];
 		     ({Opt,As=[A|_]}) when is_atom(A) ->
 			  [{Opt,[atom_to_list(Atom) || Atom <- As]}];
 		     ({Opt,Strs=[S|_]}) when is_list(S) ->
diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl
index 8d620be7ba..88ce5e0e51 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE.erl
+++ b/lib/common_test/test/ct_suite_callback_SUITE.erl
@@ -70,17 +70,19 @@ all() ->
     all(suite).
 
 all(suite) -> 
-    %%    lists:reverse(
+    lists:reverse(
       [
        one_scb, two_scb, faulty_scb_no_init, faulty_scb_exit_in_init,
        faulty_scb_exit_in_init_scope_suite, minimal_scb, 
-       minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb,
-       scope_per_group_scb, scope_suite_scb,
+       minimal_and_maximal_scb, faulty_scb_undef, 
+       scope_per_suite_scb, scope_per_group_scb, scope_suite_scb,
+       scope_per_suite_state_scb, scope_per_group_state_scb, 
+       scope_suite_state_scb,
        fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb,
        skip_post_suite_scb, recover_post_suite_scb, update_config_scb,
-       state_update_scb
+       state_update_scb, options_scb
       ]
-    %%)
+    )
 	.
 
 
@@ -136,34 +138,51 @@ scope_per_group_scb(Config) when is_list(Config) ->
     do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl",
 	    [],Config).
 
-fail_pre_suite_scb(Config) ->
+scope_per_suite_state_scb(Config) when is_list(Config) ->
+    do_test(scope_per_suite_state_scb, "ct_scope_per_suite_state_scb_SUITE.erl",
+	    [],Config).
+
+scope_suite_state_scb(Config) when is_list(Config) ->
+    do_test(scope_suite_state_scb, "ct_scope_suite_state_scb_SUITE.erl",
+	    [],Config).
+
+scope_per_group_state_scb(Config) when is_list(Config) ->
+    do_test(scope_per_group_state_scb, "ct_scope_per_group_state_scb_SUITE.erl",
+	    [],Config).
+
+fail_pre_suite_scb(Config) when is_list(Config) ->
     do_test(fail_pre_suite_scb, "ct_scb_empty_SUITE.erl",
 	    [fail_pre_suite_scb],Config).
 
-fail_post_suite_scb(Config) ->
+fail_post_suite_scb(Config) when is_list(Config) ->
     do_test(fail_post_suite_scb, "ct_scb_empty_SUITE.erl",
 	    [fail_post_suite_scb],Config).
 
-skip_pre_suite_scb(Config) ->
+skip_pre_suite_scb(Config) when is_list(Config) ->
     do_test(skip_pre_suite_scb, "ct_scb_empty_SUITE.erl",
 	    [skip_pre_suite_scb],Config).
 
-skip_post_suite_scb(Config) ->
+skip_post_suite_scb(Config) when is_list(Config) ->
     do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl",
 	    [skip_post_suite_scb],Config).
 
-recover_post_suite_scb(Config) ->
+recover_post_suite_scb(Config) when is_list(Config) ->
     do_test(recover_post_suite_scb, "ct_scb_fail_per_suite_SUITE.erl",
 	    [recover_post_suite_scb],Config).
 
-update_config_scb(Config) ->
+update_config_scb(Config) when is_list(Config) ->
     do_test(update_config_scb, "ct_update_config_SUITE.erl",
 	    [update_config_scb],Config).
 
-state_update_scb(Config) ->
+state_update_scb(Config) when is_list(Config) ->
     do_test(state_update_scb, "ct_scb_fail_one_skip_one_SUITE.erl",
 	    [state_update_scb,state_update_scb],Config).
 
+options_scb(Config) when is_list(Config) ->
+    do_test(options_scb, "ct_scb_empty_SUITE.erl",
+	    [{empty_scb,[test]}],Config).
+    
+
 %%%-----------------------------------------------------------------
 %%% HELP FUNCTIONS
 %%%-----------------------------------------------------------------
@@ -460,6 +479,83 @@ test_events(scope_per_group_scb) ->
      {?eh,stop_logging,[]}
     ];
 
+test_events(scope_per_suite_state_scb) ->
+    [
+     {?eh,start_logging,{'DEF','RUNDIR'}},
+     {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+     {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,init_per_suite}},
+     {?eh,scb,{'_',init,[[test]]}},
+     {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}},
+     {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,init_per_suite,ok}},
+
+     {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,test_case}},
+     {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+     {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+     {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,test_case,ok}},
+     
+     {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,end_per_suite}},
+     {?eh,scb,{'_',pre_end_per_suite,
+	       [ct_scope_per_suite_state_scb_SUITE,'$proplist',[test]]}},
+     {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','_',[test]]}},
+     {?eh,scb,{'_',terminate,[[test]]}},
+     {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,end_per_suite,ok}},
+     {?eh,test_done,{'DEF','STOP_TIME'}},
+     {?eh,stop_logging,[]}
+    ];
+
+test_events(scope_suite_state_scb) ->
+    [
+     {?eh,start_logging,{'DEF','RUNDIR'}},
+     {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+     {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,init_per_suite}},
+     {?eh,scb,{'_',init,[[test]]}},
+     {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}},
+     {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}},
+     {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,init_per_suite,ok}},
+
+     {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,test_case}},
+     {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+     {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+     {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,test_case,ok}},
+     
+     {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,end_per_suite}},
+     {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}},
+     {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','_',[test]]}},
+     {?eh,scb,{'_',terminate,[[test]]}},
+     {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,end_per_suite,ok}},
+     {?eh,test_done,{'DEF','STOP_TIME'}},
+     {?eh,stop_logging,[]}
+    ];
+
+test_events(scope_per_group_state_scb) ->
+    [
+     {?eh,start_logging,{'DEF','RUNDIR'}},
+     {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+     {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,init_per_suite}},
+     {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,init_per_suite,ok}},
+
+     [{?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]}}},
+      {?eh,scb,{'_',init,[[test]]}},
+      {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}},
+      {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]},ok}},
+      
+      {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,test_case}},
+      {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+      {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}},
+      {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,test_case,ok}},
+      
+      {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]}}},
+      {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[test]]}},
+      {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[test]]}},
+      {?eh,scb,{'_',terminate,[[test]]}},
+      {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]},ok}}],
+     
+     {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,end_per_suite}},
+     {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,end_per_suite,ok}},
+     {?eh,test_done,{'DEF','STOP_TIME'}},
+     {?eh,stop_logging,[]}
+    ];
+
 test_events(fail_pre_suite_scb) ->
     [
      {?eh,start_logging,{'DEF','RUNDIR'}},
@@ -753,6 +849,33 @@ test_events(state_update_scb) ->
      {?eh,stop_logging,[]}
     ];
 
+test_events(options_scb) ->
+    [
+     {?eh,start_logging,{'DEF','RUNDIR'}},
+     {?eh,scb,{empty_scb,init,[[test]]}},
+     {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+     {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
+     {?eh,scb,{empty_scb,pre_init_per_suite,
+	       [ct_scb_empty_SUITE,'$proplist',[test]]}},
+     {?eh,scb,{empty_scb,post_init_per_suite,
+	       [ct_scb_empty_SUITE,'$proplist','$proplist',[test]]}},
+     {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}},
+
+     {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
+     {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[test]]}},
+     {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[test]]}},
+     {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}},
+     
+     {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
+     {?eh,scb,{empty_scb,pre_end_per_suite,
+	       [ct_scb_empty_SUITE,'$proplist',[test]]}},
+     {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[test]]}},
+     {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}},
+     {?eh,test_done,{'DEF','STOP_TIME'}},
+     {?eh,scb,{empty_scb,terminate,[[test]]}},
+     {?eh,stop_logging,[]}
+    ];
+
 test_events(ok) ->
     ok.
 
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl
new file mode 100644
index 0000000000..63dd767b25
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl
@@ -0,0 +1,56 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_per_group_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+init_per_suite(Config) ->
+    Config.
+
+end_per_suite(_Config) ->
+    ok.
+
+init_per_testcase(_TestCase, Config) ->
+    Config.
+
+end_per_testcase(_TestCase, _Config) ->
+    ok.
+
+init_per_group(_GroupName, Config) ->
+    [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+
+end_per_group(_GroupName, _Config) ->
+    ok.
+
+all() ->
+    [{group,group1}].
+
+groups() ->
+    [{group1,[],[test_case]}].
+    
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+    ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl
new file mode 100644
index 0000000000..02a011f91b
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl
@@ -0,0 +1,47 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_per_suite_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+init_per_suite(Config) ->
+    [{suite_callbacks,[{empty_scb,[test]}]}|Config].
+
+end_per_suite(_Config) ->
+    ok.
+
+init_per_testcase(_TestCase, Config) ->
+    Config.
+
+end_per_testcase(_TestCase, _Config) ->
+    ok.
+
+all() ->
+    [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+    ok.
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl
new file mode 100644
index 0000000000..869532f5cd
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl
@@ -0,0 +1,50 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_scope_suite_state_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%% Test server callback functions
+suite() ->
+    [{suite_callbacks,[{empty_scb,[test]}]}].
+
+init_per_suite(Config) ->
+    Config.
+
+end_per_suite(_Config) ->
+    ok.
+
+init_per_testcase(_TestCase, Config) ->
+    Config.
+
+end_per_testcase(_TestCase, _Config) ->
+    ok.
+
+all() ->
+    [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+    ok.
-- 
cgit v1.2.3


From 5f19d44a842ae4d6b1b977273308edb1131cb8d0 Mon Sep 17 00:00:00 2001
From: Lukas Larsson 
Date: Thu, 9 Dec 2010 11:52:58 +0100
Subject: Add test suites for failing in init/1 function

---
 .../scb/tests/crash_init_scb.erl                   | 34 +++++++++++++++
 .../ct_exit_in_init_scope_suite_scb_SUITE.erl      | 50 ++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl

diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl
new file mode 100644
index 0000000000..683459853f
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl
@@ -0,0 +1,34 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(crash_init_scb).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% Suite Callbacks
+-export([init/1]).
+
+init(Opts) ->
+    empty_scb:init(Opts),
+    exit(diediedie).
+
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl
new file mode 100644
index 0000000000..bfaeb7ca3a
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl
@@ -0,0 +1,50 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_exit_in_init_scope_suite_scb_SUITE).
+
+-suite_defaults([{timetrap, {minutes, 10}}]).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%% Test server callback functions
+suite() ->
+    [{suite_callbacks,[crash_init_scb]}].
+
+init_per_suite(Config) ->
+    Config.
+
+end_per_suite(_Config) ->
+    ok.
+
+init_per_testcase(_TestCase, Config) ->
+    Config.
+
+end_per_testcase(_TestCase, _Config) ->
+    ok.
+
+all() ->
+    [test_case].
+
+%% Test cases starts here.
+test_case(Config) when is_list(Config) ->
+    ok.
-- 
cgit v1.2.3


From 9a80a4f0064af1773bf73df86d3534049a61e373 Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Thu, 9 Dec 2010 12:19:36 +0100
Subject: First preliminary addition of the test config (there are still a
 bunch of hard coded paths and stuff). No sed'ing yet...

---
 lib/snmp/test/test_config/Makefile                 | 130 +++++++++++++++++++++
 lib/snmp/test/test_config/agent/agent.conf.src     |  20 ++++
 lib/snmp/test/test_config/agent/community.conf.src |  16 +++
 lib/snmp/test/test_config/agent/context.conf.src   |  15 +++
 lib/snmp/test/test_config/agent/notify.conf.src    |  14 +++
 lib/snmp/test/test_config/agent/standard.conf.src  |  22 ++++
 .../test/test_config/agent/target_addr.conf.src    |  22 ++++
 .../test/test_config/agent/target_params.conf.src  |  12 ++
 lib/snmp/test/test_config/agent/vacm.conf.src      |  28 +++++
 lib/snmp/test/test_config/manager/manager.conf.src |  16 +++
 lib/snmp/test/test_config/manager/usm.conf.src     |   8 ++
 lib/snmp/test/test_config/modules.mk               |  37 ++++++
 lib/snmp/test/test_config/sys-agent.config.src     |  42 +++++++
 lib/snmp/test/test_config/sys-manager.config.src   |  55 +++++++++
 lib/snmp/test/test_config/sys.config.src           |  67 +++++++++++
 15 files changed, 504 insertions(+)
 create mode 100644 lib/snmp/test/test_config/Makefile
 create mode 100644 lib/snmp/test/test_config/agent/agent.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/community.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/context.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/notify.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/standard.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/target_addr.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/target_params.conf.src
 create mode 100644 lib/snmp/test/test_config/agent/vacm.conf.src
 create mode 100644 lib/snmp/test/test_config/manager/manager.conf.src
 create mode 100644 lib/snmp/test/test_config/manager/usm.conf.src
 create mode 100644 lib/snmp/test/test_config/modules.mk
 create mode 100644 lib/snmp/test/test_config/sys-agent.config.src
 create mode 100644 lib/snmp/test/test_config/sys-manager.config.src
 create mode 100644 lib/snmp/test/test_config/sys.config.src

diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
new file mode 100644
index 0000000000..187a0ca901
--- /dev/null
+++ b/lib/snmp/test/test_config/Makefile
@@ -0,0 +1,130 @@
+#-*-makefile-*-   ; force emacs to enter makefile-mode
+
+# %CopyrightBegin%
+# 
+# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# 
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+# 
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+# 
+# %CopyrightEnd%
+
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+
+VSN = $(SNMP_VSN)
+
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+include modules.mk
+
+SYS_CONFIG_SRCS     = $(SYS_CONFIG_FILES:%=%.src)
+AGENT_CONFIG_SRCS   = $(AGENT_CONFIG_FILES:%=%.src)
+MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src)
+
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)
+
+
+# ----------------------------------------------------
+# SNMP FLAGS
+# ----------------------------------------------------
+
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+tests debug opt: $(SYS_CONFIG_FILES) $(AGENT_CONFIG_FILES) $(MANAGER_CONFIG_FILES)
+
+clean:
+	rm -f $(SYS_CONFIG_FILES)
+	rm -f $(AGENT_CONFIG_FILES)
+	rm -f $(MANAGER_CONFIG_FILES)
+	rm -f core
+
+docs:
+
+
+# ----------------------------------------------------
+# Release Target
+# ---------------------------------------------------- 
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec:
+
+release_tests_spec: opt
+	$(INSTALL_DIR)  $(RELSYSDIR)
+	chmod -f -R u+w $(RELSYSDIR)
+	$(INSTALL_DIR)  $(RELSYSDIR)/agent
+	chmod -f -R u+w $(RELSYSDIR)/agent
+	$(INSTALL_DIR)  $(RELSYSDIR)/agent/conf
+	chmod -f -R u+w $(RELSYSDIR)/agent/conf
+	$(INSTALL_DIR)  $(RELSYSDIR)/agent/db
+	chmod -f -R u+w $(RELSYSDIR)/agent/db
+	$(INSTALL_DIR)  $(RELSYSDIR)/agent/log
+	chmod -f -R u+w $(RELSYSDIR)/agent/log
+	$(INSTALL_DIR)  $(RELSYSDIR)/manager
+	chmod -f -R u+w $(RELSYSDIR)/manager
+	$(INSTALL_DIR)  $(RELSYSDIR)/manager/conf
+	chmod -f -R u+w $(RELSYSDIR)/manager/conf
+	$(INSTALL_DIR)  $(RELSYSDIR)/manager/db
+	chmod -f -R u+w $(RELSYSDIR)/manager/db
+	$(INSTALL_DIR)  $(RELSYSDIR)/manager/log
+	chmod -f -R u+w $(RELSYSDIR)/manager/log
+	$(INSTALL_DATA) $(SYS_CONFIG_FILES)     $(RELSYSDIR)
+	$(INSTALL_DATA) $(AGENT_CONFIG_FILES)   $(RELSYSDIR)/agent/conf
+	$(INSTALL_DATA) $(MANAGER_CONFIG_FILES) $(RELSYSDIR)/manager/conf
+
+release_docs_spec:
+
+
+info:
+	@echo "SNMP_DEBUG        = $(SNMP_DEBUG)"
+	@echo "SNMP_FLAGS        = $(SNMP_FLAGS)"
+	@echo ""
+	@echo "SNMP_MIB_DIR      = $(SNMP_MIB_DIR)"
+	@echo "MIB_SOURCE        = $(MIB_SOURCE)"
+	@echo "MIB_TARGETS       = $(MIB_TARGETS)"
+	@echo "SNMP_MIB_FLAGS    = $(SNMP_MIB_FLAGS)"
+	@echo ""
+	@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
+	@echo ""
+	@echo "RELSYSDIR         = $(RELSYSDIR)"
+	@echo ""
+	@echo "SOURCE            = $(SOURCE)"
+	@echo ""
+	@echo "TARGET_FILES      = $(TARGET_FILES)"
+	@echo ""
+	@echo "EMAKEFILE         = $(EMAKEFILE)"
+	@echo "MAKE_EMAKE        = $(MAKE_EMAKE)"
+	@echo "BUILDTARGET       = $(BUILDTARGET)"
+	@echo "RELTEST_FILES     = $(RELTEST_FILES)"
+	@echo ""
+
+
diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src
new file mode 100644
index 0000000000..53830dbc3e
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/agent.conf.src
@@ -0,0 +1,20 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the Agent local configuration info
+%% The data is inserted into the snmpEngine* variables defined
+%% in SNMP-FRAMEWORK-MIB, and the intAgent* variables defined
+%% in OTP-SNMPEA-MIB.
+%% Each row is a 2-tuple:
+%% {AgentVariable, Value}.
+%% For example
+%% {intAgentUDPPort, 4000}.
+%% The ip address for the agent is sent as id in traps.
+%% {intAgentIpAddress, [127,42,17,5]}.
+%% {snmpEngineID, "agentEngine"}.
+%% {snmpEngineMaxMessageSize, 484}.
+%%
+
+
+{intAgentUDPPort, 4000}.
+{intAgentIpAddress, [127,0,0,1]}.
+{snmpEngineID, "foo"}.
+{snmpEngineMaxMessageSize, 484}.
diff --git a/lib/snmp/test/test_config/agent/community.conf.src b/lib/snmp/test/test_config/agent/community.conf.src
new file mode 100644
index 0000000000..4661267950
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/community.conf.src
@@ -0,0 +1,16 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the community info which maps to VACM parameters.
+%% The data is inserted into the snmpCommunityTable defined
+%% in SNMP-COMMUNITY-MIB.
+%% Each row is a 5-tuple:
+%% {CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.
+%% For example
+%% {"1", "public", "initial", "", ""}.
+%% {"2", "secret", "secret_name", "", "tag"}.
+%% {"3", "bridge1", "initial", "bridge1", ""}.
+%%
+
+
+{"public", "public", "initial", "", ""}.
+{"all-rights", "all-rights", "all-rights", "", ""}.
+{"standard trap", "standard trap", "initial", "", ""}.
diff --git a/lib/snmp/test/test_config/agent/context.conf.src b/lib/snmp/test/test_config/agent/context.conf.src
new file mode 100644
index 0000000000..56000d0308
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/context.conf.src
@@ -0,0 +1,15 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the contexts known to the agent.
+%% The data is inserted into the vacmContextTable defined
+%% in SNMP-VIEW-BASED-ACM-MIB.
+%% Each row is a string:
+%% ContextName.
+%%
+%% The empty string is the default context.
+%% For example
+%% "bridge1".
+%% "bridge2".
+%%
+
+
+"".
diff --git a/lib/snmp/test/test_config/agent/notify.conf.src b/lib/snmp/test/test_config/agent/notify.conf.src
new file mode 100644
index 0000000000..b63668f4fd
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/notify.conf.src
@@ -0,0 +1,14 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the notification parameters.
+%% The data is inserted into the snmpNotifyTable defined
+%% in SNMP-NOTIFICATION-MIB.
+%% The Name is used as CommunityString for v1 and v2c.
+%% Each row is a 3-tuple:
+%% {Name, Tag, Type}.
+%% For example
+%% {"standard trap", "std_trap", trap}.
+%% {"standard inform", "std_inform", inform}.
+%%
+
+
+{"stadard_trap", "std_trap", trap}.
diff --git a/lib/snmp/test/test_config/agent/standard.conf.src b/lib/snmp/test/test_config/agent/standard.conf.src
new file mode 100644
index 0000000000..9bcca18b5e
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/standard.conf.src
@@ -0,0 +1,22 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the STANDARD-MIB info.
+%% Each row is a 2-tuple:
+%% {StandardVariable, Value}.
+%% For example
+%% {sysDescr, "Erlang SNMP agent"}.
+%% {sysObjectID, [1,2,3]}.
+%% {sysContact, "{mbj,eklas}@erlang.ericsson.se"}.
+%% {sysName, "test"}.
+%% {sysLocation, "erlang"}.
+%% {sysServices, 72}.
+%% {snmpEnableAuthenTraps, enabled}.
+%%
+
+
+{sysDescr, "Erlang SNMP agent"}.
+{sysObjectID, [1,2,3]}.
+{sysContact, "{mbj,eklas}@erlang.ericsson.se"}.
+{sysLocation, "erlang"}.
+{sysServices, 72}.
+{snmpEnableAuthenTraps, disabled}.
+{sysName, "foo"}.
diff --git a/lib/snmp/test/test_config/agent/target_addr.conf.src b/lib/snmp/test/test_config/agent/target_addr.conf.src
new file mode 100644
index 0000000000..2c7a6a15ad
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/target_addr.conf.src
@@ -0,0 +1,22 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the target address parameters.
+%% The data is inserted into the snmpTargetAddrTable defined
+%% in SNMP-TARGET-MIB, and in the snmpTargetAddrExtTable defined
+%% in SNMP-COMMUNITY-MIB.
+%% Each row is a 10-tuple:
+%% {Name, Ip, Udp, Timeout, RetryCount, TagList, ParamsName, EngineId,
+%%        TMask, MaxMessageSize}.
+%% The EngineId value is only used if Inform-Requests are sent to this
+%% target.  If Informs are not sent, this value is ignored, and can be
+%% e.g. an empty string.  However, if Informs are sent, it is essential
+%% that the value of EngineId matches the value of the target's
+%% actual snmpEngineID.
+%% For example
+%% {"1.2.3.4 v1", [1,2,3,4], 162, 
+%%  1500, 3, "std_inform", "otp_v2", "",
+%%  [127,0,0,0],  2048}.
+%%
+
+
+{"127.0.0.1 v2", [127,0,0,1], 5000, 1500, 3, "std_trap", "target_v2", "", [], 2048}.
+{"127.0.0.1 v2.2", [127,0,0,1], 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}.
diff --git a/lib/snmp/test/test_config/agent/target_params.conf.src b/lib/snmp/test/test_config/agent/target_params.conf.src
new file mode 100644
index 0000000000..8e89b91d81
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/target_params.conf.src
@@ -0,0 +1,12 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the target parameters.
+%% The data is inserted into the snmpTargetParamsTable defined
+%% in SNMP-TARGET-MIB.
+%% Each row is a 5-tuple:
+%% {Name, MPModel, SecurityModel, SecurityName, SecurityLevel}.
+%% For example
+%% {"target_v3", v3, usm, "", noAuthNoPriv}.
+%%
+
+
+{"target_v2", v2c, v2c, "initial", noAuthNoPriv}.
diff --git a/lib/snmp/test/test_config/agent/vacm.conf.src b/lib/snmp/test/test_config/agent/vacm.conf.src
new file mode 100644
index 0000000000..c7dc5170c2
--- /dev/null
+++ b/lib/snmp/test/test_config/agent/vacm.conf.src
@@ -0,0 +1,28 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
+%% This file defines the Mib Views.
+%% The data is inserted into the vacm* tables defined
+%% in SNMP-VIEW-BASED-ACM-MIB.
+%% Each row is one of 3 tuples; one for each table in the MIB:
+%% {vacmSecurityToGroup, SecModel, SecName, GroupName}.
+%% {vacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV}.
+%% {vacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMask}.
+%% For example
+%% {vacmSecurityToGroup, v2c, "initial", "initial"}.
+%% {vacmSecurityToGroup, usm, "initial", "initial"}.
+%%  read/notify access to system
+%% {vacmAccess, "initial", "", any, noAuthNoPriv, exact,
+%%              "system", "", "system"}.
+%% {vacmViewTreeFamily, "system", [1,3,6,1,2,1,1], included, null}.
+%% {vacmViewTreeFamily, "exmib", [1,3,6,1,3], included, null}. % for EX1-MIB
+%% {vacmViewTreeFamily, "internet", [1,3,6,1], included, null}.
+%%
+
+
+{vacmSecurityToGroup, v2c, "initial", "initial"}.
+{vacmSecurityToGroup, v2c, "all-rights", "all-rights"}.
+{vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}.
+{vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}.
+{vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}.
+{vacmAccess, "all-rights", "", any, noAuthNoPriv, exact, "internet", "internet", "internet"}.
+{vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}.
+{vacmViewTreeFamily, "internet", [1,3,6,1], included, null}.
diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src
new file mode 100644
index 0000000000..164e5507c6
--- /dev/null
+++ b/lib/snmp/test/test_config/manager/manager.conf.src
@@ -0,0 +1,16 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:05
+%% This file defines the Manager local configuration info
+%% Each row is a 2-tuple:
+%% {Variable, Value}.
+%% For example
+%% {port,             5000}.
+%% {address,          [127,42,17,5]}.
+%% {engine_id,        "managerEngine"}.
+%% {max_message_size, 484}.
+%%
+
+
+{port, 5000}.
+{address, [127,0,0,1]}.
+{engine_id, "foo"}.
+{max_message_size, 484}.
diff --git a/lib/snmp/test/test_config/manager/usm.conf.src b/lib/snmp/test/test_config/manager/usm.conf.src
new file mode 100644
index 0000000000..39122cab5c
--- /dev/null
+++ b/lib/snmp/test/test_config/manager/usm.conf.src
@@ -0,0 +1,8 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:05
+%% This file defines the usm users the manager handles
+%% Each row is a 6 or 7-tuple:
+%% {EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey}
+%% {EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey}
+%%
+
+
diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk
new file mode 100644
index 0000000000..54e6e22966
--- /dev/null
+++ b/lib/snmp/test/test_config/modules.mk
@@ -0,0 +1,37 @@
+#-*-makefile-*-   ; force emacs to enter makefile-mode
+
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+
+SYS_CONFIG_FILES = \
+	sys.config \
+	sys-agent.config \
+	sys-manager.config
+
+AGENT_CONFIG_FILES = \
+	agent/agent.conf \
+	agent/community.conf \
+	agent/context.conf \
+	agent/notify.conf \
+	agent/standard.conf \
+	agent/target_addr.conf \
+	agent/target_params.conf \
+	agent/vacm.conf
+
+MANAGER_CONFIG_FILES = \
+	manager/manager.conf \
+	manager/usm.conf
diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src
new file mode 100644
index 0000000000..9df2c6a6bc
--- /dev/null
+++ b/lib/snmp/test/test_config/sys-agent.config.src
@@ -0,0 +1,42 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+[{snmp, 
+  [
+   {agent,
+    [
+     {priority, normal}, 
+     {versions, [v2]}, 
+     {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, 
+     {mib_storage, ets}, 
+%%     {agent_mib_storage, volatile},
+     {agent_mib_storage, persistent},
+     {target_cache, [{verbosity,silence}]}, 
+     {symbolic_store, [{verbosity,silence}]}, 
+     {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, 
+     {error_report_module, snmpa_error_logger}, 
+     {agent_type, master}, 
+     {agent_verbosity, trace}, 
+     {audit_trail_log, [{type, read}, 
+                        {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"},
+                        {size, {10240,10}}]},
+     {config, [{dir,        "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, 
+               {force_load, true}, 
+               {verbosity,  trace}]}, 
+     {multi_threaded, true}, 
+     {mib_server, [{mibentry_override,  false},
+                   {trapentry_override, false},
+                   {cache,              true},
+                   {verbosity,          trace}]}, 
+     {note_store, [{timeout,30000}, {verbosity,silence}]}, 
+     {supervisor, [{verbosity,silence}]}, 
+     {net_if, [{module,    snmpa_net_if},
+               {verbosity, silence},
+               {options,   [{bind_to,   true},
+                            {no_reuse,  false},
+                            {req_limit, infinity},
+                            {sndbuf,    32000}, 
+                            {recbuf,    32000}]}]}
+    ]
+   }
+  ]
+ }
+].
diff --git a/lib/snmp/test/test_config/sys-manager.config.src b/lib/snmp/test/test_config/sys-manager.config.src
new file mode 100644
index 0000000000..dc795e31ab
--- /dev/null
+++ b/lib/snmp/test/test_config/sys-manager.config.src
@@ -0,0 +1,55 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+[{snmp, 
+  [
+%%    {agent,
+%%     [
+%%      {priority, normal}, 
+%%      {versions, [v2]}, 
+%%      {db_dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, 
+%%      {mib_storage, ets}, 
+%%      {agent_mib_storage, volatile},
+%%      {target_cache, [{verbosity,silence}]}, 
+%%      {symbolic_store, [{verbosity,silence}]}, 
+%%      {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, 
+%%      {error_report_module, snmpa_error_logger}, 
+%%      {agent_type, master}, 
+%%      {agent_verbosity, silence}, 
+%%      {config, [{dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, {force_load, true}, {verbosity, silence}]}, 
+%%      {multi_threaded, false}, 
+%%      {mib_server, [{mibentry_override,false},{trapentry_override,false},{verbosity,silence}]}, 
+%%      {note_store, [{timeout,30000},{verbosity,silence}]}, 
+%%      {net_if, [{module,snmpa_net_if},{verbosity,silence},{options,[{bind_to,true},{no_reuse,false},{req_limit,infinity}]}]}
+%%     ]
+%%    }, 
+   {manager,
+    [
+     {priority, normal}, 
+     {versions, [v1,v2,v3]}, 
+     {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, 
+               {verbosity, trace}, 
+               {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, 
+               {repair, true}, 
+               {auto_save, 5000}]}, 
+     {inform_request_behaviour, user}, 
+     {mibs, []}, 
+     {server, [{timeout,   30000},
+               {verbosity, trace}]}, 
+     {note_store, [{timeout,30000},
+                   {verbosity,silence}]}, 
+     {audit_trail_log, [{type, read}, 
+                        {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"},
+                        {size, {10240,10}}]},
+     {net_if, [{module,snmpm_net_if},
+               {verbosity, trace},
+               {options, [{bind_to,  true}, 
+                          {no_reuse, false},
+%                          {sndbuf,   32000},
+                          {recbuf,   45000}
+]}]}, 
+     {def_user_mod,  snmpm_user_default}, 
+     {def_user_data, undefined}
+    ]
+   }
+  ]
+ }
+].
diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src
new file mode 100644
index 0000000000..5a0fa0624b
--- /dev/null
+++ b/lib/snmp/test/test_config/sys.config.src
@@ -0,0 +1,67 @@
+%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+[{snmp, 
+  [
+   {agent,
+    [
+     {priority, normal}, 
+     {versions, [v2]}, 
+     {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, 
+     {mib_storage, ets}, 
+     {agent_mib_storage, volatile},
+     {target_cache, [{verbosity,silence}]}, 
+     {symbolic_store, [{verbosity,silence}]}, 
+     {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, 
+     {error_report_module, snmpa_error_logger}, 
+     {agent_type, master}, 
+     {agent_verbosity, silence}, 
+     {audit_trail_log, [{type, read}, 
+                        {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"},
+                        {size, {10240,10}}]},
+     {config, [{dir,        "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, 
+               {force_load, true}, 
+               {verbosity,  silence}]}, 
+     {multi_threaded, false}, 
+     {mib_server, [{mibentry_override,  false},
+                   {trapentry_override, false},
+                   {verbosity,          silence}]}, 
+     {note_store, [{timeout,30000},{verbosity,silence}]}, 
+     {net_if, [{module,    snmpa_net_if},
+               {verbosity, silence},
+               {options,   [{bind_to,   true},
+                            {no_reuse,  false},
+                            {req_limit, infinity},
+                            {sndbuf,    32000}, 
+                            {recbuf,    32000}]}]}
+    ]
+   }, 
+   {manager,
+    [
+     {priority, normal}, 
+     {versions, [v2]}, 
+     {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, 
+               {verbosity, silence}, 
+               {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, 
+               {repair, true}, 
+               {auto_save, 5000}]}, 
+     {inform_request_behaviour, auto}, 
+     {mibs, []}, 
+     {server, [{timeout,   30000},
+               {verbosity, silence}]}, 
+     {note_store, [{timeout,   30000},
+                   {verbosity, silence}]}, 
+     {audit_trail_log, [{type, read}, 
+                        {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"},
+                        {size, {10240,10}}]},
+     {net_if, [{module,snmpm_net_if},
+               {verbosity, silence},
+               {options, [{bind_to,  true}, 
+                          {no_reuse, false},
+                          {recbuf,   33000},
+                          {sndbuf,   34000}]}]},
+     {def_user_mod,  snmpm_user_default}, 
+     {def_user_data, undefined}
+    ]
+   }
+  ]
+ }
+].
-- 
cgit v1.2.3


From add572241ac6085f1dc1062ae6ca351737ec43eb Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Thu, 9 Dec 2010 12:30:02 +0100
Subject: Added preliminary make targets for config file building (sed'ing).

---
 lib/snmp/test/test_config/Makefile | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 187a0ca901..250c594af6 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -70,6 +70,15 @@ clean:
 
 docs:
 
+$(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS)
+	@echo "sys: $< -> $@"
+
+$(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS)
+	@echo "agent: $< -> $@"
+
+$(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS)
+	@echo "manager: $< -> $@"
+
 
 # ----------------------------------------------------
 # Release Target
@@ -105,26 +114,14 @@ release_docs_spec:
 
 
 info:
-	@echo "SNMP_DEBUG        = $(SNMP_DEBUG)"
-	@echo "SNMP_FLAGS        = $(SNMP_FLAGS)"
-	@echo ""
-	@echo "SNMP_MIB_DIR      = $(SNMP_MIB_DIR)"
-	@echo "MIB_SOURCE        = $(MIB_SOURCE)"
-	@echo "MIB_TARGETS       = $(MIB_TARGETS)"
-	@echo "SNMP_MIB_FLAGS    = $(SNMP_MIB_FLAGS)"
-	@echo ""
-	@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
-	@echo ""
-	@echo "RELSYSDIR         = $(RELSYSDIR)"
-	@echo ""
-	@echo "SOURCE            = $(SOURCE)"
+	@echo "SYS_CONFIG_SRCS      = $(SYS_CONFIG_SRCS)"
+	@echo "SYS_CONFIG_FILES     = $(SYS_CONFIG_FILES)"
 	@echo ""
-	@echo "TARGET_FILES      = $(TARGET_FILES)"
+	@echo "AGENT_CONFIG_SRCS    = $(AGENT_CONFIG_SRCS)"
+	@echo "AGENT_CONFIG_FILES   = $(AGENT_CONFIG_FILES)"
 	@echo ""
-	@echo "EMAKEFILE         = $(EMAKEFILE)"
-	@echo "MAKE_EMAKE        = $(MAKE_EMAKE)"
-	@echo "BUILDTARGET       = $(BUILDTARGET)"
-	@echo "RELTEST_FILES     = $(RELTEST_FILES)"
+	@echo "MANAGER_CONFIG_SRCS  = $(MANAGER_CONFIG_SRCS)"
+	@echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)"
 	@echo ""
 
 
-- 
cgit v1.2.3


From 9cedf681e9b3f2144cf44fbb4ae7f4a0e4aa9bf6 Mon Sep 17 00:00:00 2001
From: Lukas Larsson 
Date: Thu, 9 Dec 2010 12:36:15 +0100
Subject: Add tests for SCB's with same id and fixed bug relating to it

---
 lib/common_test/src/ct_suite_callback.erl          |  5 +-
 lib/common_test/test/ct_suite_callback_SUITE.erl   | 46 +++++++++++++-
 .../scb/tests/same_id_scb.erl                      | 72 ++++++++++++++++++++++
 lib/common_test/test/ct_test_support.erl           | 12 +++-
 4 files changed, 131 insertions(+), 4 deletions(-)
 create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl

diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl
index 8372303737..508d3b5bd6 100644
--- a/lib/common_test/src/ct_suite_callback.erl
+++ b/lib/common_test/src/ct_suite_callback.erl
@@ -169,8 +169,9 @@ call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) ->
 call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) ->
     try
 	{Config, {NewId, _, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta),
-	{NewCBs, NewRest} = case proplists:get_value(NewId, CBs, NextFun) of
-				undefined -> {CBs ++ [NewCB],Rest};
+	{NewCBs, NewRest} = case lists:keyfind(NewId, 1, CBs) of
+				false when NextFun == undefined -> 
+				    {CBs ++ [NewCB],Rest};
 				ExistingCB when is_tuple(ExistingCB) ->
 				    {CBs, Rest};
 				_ ->
diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl
index 88ce5e0e51..6d61fbb21d 100644
--- a/lib/common_test/test/ct_suite_callback_SUITE.erl
+++ b/lib/common_test/test/ct_suite_callback_SUITE.erl
@@ -80,7 +80,7 @@ all(suite) ->
        scope_suite_state_scb,
        fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb,
        skip_post_suite_scb, recover_post_suite_scb, update_config_scb,
-       state_update_scb, options_scb
+       state_update_scb, options_scb, same_id_scb
       ]
     )
 	.
@@ -182,6 +182,10 @@ options_scb(Config) when is_list(Config) ->
     do_test(options_scb, "ct_scb_empty_SUITE.erl",
 	    [{empty_scb,[test]}],Config).
     
+same_id_scb(Config) when is_list(Config) ->
+    do_test(same_id_scb, "ct_scb_empty_SUITE.erl",
+	    [same_id_scb,same_id_scb],Config).
+    
 
 %%%-----------------------------------------------------------------
 %%% HELP FUNCTIONS
@@ -876,6 +880,46 @@ test_events(options_scb) ->
      {?eh,stop_logging,[]}
     ];
 
+test_events(same_id_scb) ->
+    [
+     {?eh,start_logging,{'DEF','RUNDIR'}},
+     {?eh,scb,{'_',init,[[]]}},
+     {?eh,scb,{'_',init,[[]]}},
+     {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+     {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}},
+     {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
+     {negative,
+       {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
+      {?eh,scb,{'_',post_init_per_suite,
+		[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}},
+     {negative,
+      {?eh,scb,{'_',post_init_per_suite,
+		[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}},
+      {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}},
+
+     {?eh,tc_start,{ct_scb_empty_SUITE,test_case}},
+     {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+     {negative,
+      {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}},
+      {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}},
+     {negative,
+      {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}},
+      {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}},
+     
+     {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}},
+     {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
+     {negative,
+      {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}},
+      {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}},
+     {negative,
+      {?eh,scb,{'_',post_end_per_suite,
+		[ct_scb_empty_SUITE,'$proplist','_',[]]}},
+      {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}},
+     {?eh,test_done,{'DEF','STOP_TIME'}},
+     {?eh,scb,{'_',terminate,[[]]}},
+     {?eh,stop_logging,[]}
+    ];
+
 test_events(ok) ->
     ok.
 
diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl
new file mode 100644
index 0000000000..6853aa52e8
--- /dev/null
+++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl
@@ -0,0 +1,72 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+
+-module(same_id_scb).
+
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+
+%% Suite Callbacks
+-compile(export_all).
+
+init(Opts) ->
+    {_,State} = empty_scb:init(Opts),
+    {?MODULE,State}.
+
+pre_init_per_suite(Suite, Config, State) ->
+    empty_scb:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+    empty_scb:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+    empty_scb:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+    empty_scb:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+    empty_scb:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+    empty_scb:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+    empty_scb:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+    empty_scb:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+    empty_scb:pre_init_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+    empty_scb:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+    empty_scb:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+    empty_scb:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+    empty_scb:terminate(State).
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 5009741f59..981504b660 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -876,6 +876,16 @@ locate({TEH,tc_done,{undefined,undefined,{testcase_aborted,
 	    nomatch
     end;
 
+%% Negative matching: Given two events, the first should not be present before
+%% the other is matched. 
+locate({negative,NotMatch, Match} = Neg, Node, Evs, Config) ->
+    case locate(NotMatch, Node, Evs, Config) of
+	nomatch ->
+	    locate(Match, Node, Evs, Config);
+	_ ->
+	    exit({found_negative_event,Neg})
+    end;
+
 %% matches any event of type Name
 locate({TEH,Name,Data}, Node, [{TEH,#event{name=Name,
 					   data = EvData,
@@ -888,7 +898,7 @@ locate({TEH,Name,Data}, Node, [{TEH,#event{name=Name,
 	    nomatch
     end;
 
-locate({TEH,Name,Data}, Node, [_|Evs], Config) ->
+locate({_TEH,_Name,_Data}, _Node, [_|_Evs], _Config) ->
     nomatch.
 
 match_data(D,D) ->
-- 
cgit v1.2.3


From 74ee7676df5720c1624d79e5cdb3d6fdf29c78f3 Mon Sep 17 00:00:00 2001
From: Patrik Nyblom 
Date: Thu, 9 Dec 2010 15:11:05 +0100
Subject: Teach win_con.c about scroll wheels

---
 erts/emulator/drivers/win32/win_con.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/erts/emulator/drivers/win32/win_con.c b/erts/emulator/drivers/win32/win_con.c
index 2202ca655f..14f7941643 100644
--- a/erts/emulator/drivers/win32/win_con.c
+++ b/erts/emulator/drivers/win32/win_con.c
@@ -704,6 +704,18 @@ FrameWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 	}
         write_inbuf(&c, 1);
 	return 0;
+    case WM_MOUSEWHEEL:
+      {
+	int delta = GET_WHEEL_DELTA_WPARAM(wParam);
+	if (delta < 0) {
+	  PostMessage(hClientWnd, WM_VSCROLL, MAKELONG(SB_THUMBTRACK,
+						       (iVscrollPos + 5)),0);
+	} else {
+	  WORD pos = ((iVscrollPos - 5) < 0) ? 0 : (iVscrollPos - 5);
+	  PostMessage(hClientWnd, WM_VSCROLL, MAKELONG(SB_THUMBTRACK,pos),0);
+	}
+      return 0;
+      }
     case WM_CHAR:
 	c = (TCHAR)wParam;
         write_inbuf(&c,1);
-- 
cgit v1.2.3


From ec857328b0ece6a676633a3bd647a4ce37703469 Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Thu, 9 Dec 2010 18:44:04 +0100
Subject: First preliminary sedding...

---
 lib/snmp/test/test_config/.gitignore             | 18 ++++++++
 lib/snmp/test/test_config/Makefile               | 56 +++++++++++++++++++-----
 lib/snmp/test/test_config/agent/agent.conf.src   |  2 +-
 lib/snmp/test/test_config/modules.mk             |  3 ++
 lib/snmp/test/test_config/sys-agent.config.src   |  9 ++--
 lib/snmp/test/test_config/sys-manager.config.src | 32 +++-----------
 lib/snmp/test/test_config/sys.config.src         | 15 ++++---
 lib/snmp/test/test_config/test_config.erl        | 27 ++++++++++++
 8 files changed, 112 insertions(+), 50 deletions(-)
 create mode 100644 lib/snmp/test/test_config/.gitignore
 create mode 100644 lib/snmp/test/test_config/test_config.erl

diff --git a/lib/snmp/test/test_config/.gitignore b/lib/snmp/test/test_config/.gitignore
new file mode 100644
index 0000000000..60d564fe4d
--- /dev/null
+++ b/lib/snmp/test/test_config/.gitignore
@@ -0,0 +1,18 @@
+# Sys config files (Generated)
+/sys.config
+/sys-agent.config
+/sys-manager.config
+
+# Agent config files (Generated)
+/agent/agent.conf
+/agent/community.conf
+/agent/context.conf
+/agent/notify.conf
+/agent/standard.conf
+/agent/target_addr.conf
+/agent/target_params.conf
+/agent/vacm.conf
+
+# Manager config files (Generated)
+/manager/manager.conf
+/manager/usm.conf
diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 250c594af6..064c9f4689 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -29,55 +29,82 @@ include ../../vsn.mk
 VSN = $(SNMP_VSN)
 
 
+# ----------------------------------------------------
+# Configured variables
+# ----------------------------------------------------
+# PERL = @PERL@
+PERL = perl
+
+
 # ----------------------------------------------------
 # Target Specs
 # ----------------------------------------------------
 
 include modules.mk
 
+ERL_TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+
 SYS_CONFIG_SRCS     = $(SYS_CONFIG_FILES:%=%.src)
 AGENT_CONFIG_SRCS   = $(AGENT_CONFIG_FILES:%=%.src)
 MANAGER_CONFIG_SRCS = $(MANAGER_CONFIG_FILES:%=%.src)
 
+CONFIG_FILES = \
+	$(SYS_CONFIG_FILES) \
+	$(AGENT_CONFIG_FILES) \
+	$(MANAGER_CONFIG_FILES)
 
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)
+TARGETS = \
+	$(ERL_TARGETS) \
+	$(CONFIG_FILES)
 
 
 # ----------------------------------------------------
-# SNMP FLAGS
+# Release directory specification
 # ----------------------------------------------------
+ifeq ($(TESTROOT),)
+TESTROOT=/tmp
+endif
+RELSYSDIR = $(TESTROOT)
 
 
 # ----------------------------------------------------
 # FLAGS
 # ----------------------------------------------------
 
+EBIN = .
+
+ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \
+                     +'{attribute,insert,app_vsn,$(APP_VSN)}'
+
+ifeq ($(ADDR),)
+ADDR = $(shell erl -noshell -s test_config ip_address -s init stop)
+endif
+
 
 # ----------------------------------------------------
 # Targets
 # ----------------------------------------------------
 
-tests debug opt: $(SYS_CONFIG_FILES) $(AGENT_CONFIG_FILES) $(MANAGER_CONFIG_FILES)
+tests debug opt: $(TARGETS) 
 
 clean:
-	rm -f $(SYS_CONFIG_FILES)
-	rm -f $(AGENT_CONFIG_FILES)
-	rm -f $(MANAGER_CONFIG_FILES)
+	rm -f $(CONFIG_FILES)
+	rm -f $(ERL_TARGETS)
 	rm -f core
 
 docs:
 
 $(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS)
-	@echo "sys: $< -> $@"
+	@echo "$< -> $@"
+	$(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@
 
 $(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS)
-	@echo "agent: $< -> $@"
+	@echo "$< -> $@"
+	$(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
 
 $(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS)
-	@echo "manager: $< -> $@"
+	@echo "$< -> $@"
+	$(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
 
 
 # ----------------------------------------------------
@@ -114,6 +141,9 @@ release_docs_spec:
 
 
 info:
+	@echo ""
+	@echo "RELSYSDIR            = $(RELSYSDIR)"
+	@echo ""
 	@echo "SYS_CONFIG_SRCS      = $(SYS_CONFIG_SRCS)"
 	@echo "SYS_CONFIG_FILES     = $(SYS_CONFIG_FILES)"
 	@echo ""
@@ -123,5 +153,7 @@ info:
 	@echo "MANAGER_CONFIG_SRCS  = $(MANAGER_CONFIG_SRCS)"
 	@echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)"
 	@echo ""
+	@echo "ADDR  = $(ADDR)"
+	@echo ""
 
 
diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src
index 53830dbc3e..900e6a4282 100644
--- a/lib/snmp/test/test_config/agent/agent.conf.src
+++ b/lib/snmp/test/test_config/agent/agent.conf.src
@@ -15,6 +15,6 @@
 
 
 {intAgentUDPPort, 4000}.
-{intAgentIpAddress, [127,0,0,1]}.
+{intAgentIpAddress, %ADDR%}.
 {snmpEngineID, "foo"}.
 {snmpEngineMaxMessageSize, 484}.
diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk
index 54e6e22966..956bb54af3 100644
--- a/lib/snmp/test/test_config/modules.mk
+++ b/lib/snmp/test/test_config/modules.mk
@@ -35,3 +35,6 @@ AGENT_CONFIG_FILES = \
 MANAGER_CONFIG_FILES = \
 	manager/manager.conf \
 	manager/usm.conf
+
+MODULES = \
+	test_config
diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src
index 9df2c6a6bc..eb6b0916ff 100644
--- a/lib/snmp/test/test_config/sys-agent.config.src
+++ b/lib/snmp/test/test_config/sys-agent.config.src
@@ -1,11 +1,12 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+%% This is an example sys config file for starting the snmp application
+%% with only a agent running.
 [{snmp, 
   [
    {agent,
     [
      {priority, normal}, 
      {versions, [v2]}, 
-     {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, 
+     {db_dir, "%DIR%/agent/db"}, 
      {mib_storage, ets}, 
 %%     {agent_mib_storage, volatile},
      {agent_mib_storage, persistent},
@@ -16,9 +17,9 @@
      {agent_type, master}, 
      {agent_verbosity, trace}, 
      {audit_trail_log, [{type, read}, 
-                        {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"},
+                        {dir, "%DIR%/agent/log"},
                         {size, {10240,10}}]},
-     {config, [{dir,        "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, 
+     {config, [{dir,        "%DIR%/agent/conf"}, 
                {force_load, true}, 
                {verbosity,  trace}]}, 
      {multi_threaded, true}, 
diff --git a/lib/snmp/test/test_config/sys-manager.config.src b/lib/snmp/test/test_config/sys-manager.config.src
index dc795e31ab..4366263084 100644
--- a/lib/snmp/test/test_config/sys-manager.config.src
+++ b/lib/snmp/test/test_config/sys-manager.config.src
@@ -1,33 +1,14 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+%% This is an example sys config file for starting the snmp application
+%% with only a manager running.
 [{snmp, 
   [
-%%    {agent,
-%%     [
-%%      {priority, normal}, 
-%%      {versions, [v2]}, 
-%%      {db_dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, 
-%%      {mib_storage, ets}, 
-%%      {agent_mib_storage, volatile},
-%%      {target_cache, [{verbosity,silence}]}, 
-%%      {symbolic_store, [{verbosity,silence}]}, 
-%%      {local_db, [{repair,true},{auto_save,5000},{verbosity,silence}]}, 
-%%      {error_report_module, snmpa_error_logger}, 
-%%      {agent_type, master}, 
-%%      {agent_verbosity, silence}, 
-%%      {config, [{dir, "/home/eklajoh/tmp/snmp-config-2/a/"}, {force_load, true}, {verbosity, silence}]}, 
-%%      {multi_threaded, false}, 
-%%      {mib_server, [{mibentry_override,false},{trapentry_override,false},{verbosity,silence}]}, 
-%%      {note_store, [{timeout,30000},{verbosity,silence}]}, 
-%%      {net_if, [{module,snmpa_net_if},{verbosity,silence},{options,[{bind_to,true},{no_reuse,false},{req_limit,infinity}]}]}
-%%     ]
-%%    }, 
    {manager,
     [
      {priority, normal}, 
      {versions, [v1,v2,v3]}, 
-     {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, 
+     {config, [{dir, "%DIR%/manager/conf"}, 
                {verbosity, trace}, 
-               {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, 
+               {db_dir, "%DIR%/manager/db"}, 
                {repair, true}, 
                {auto_save, 5000}]}, 
      {inform_request_behaviour, user}, 
@@ -37,15 +18,14 @@
      {note_store, [{timeout,30000},
                    {verbosity,silence}]}, 
      {audit_trail_log, [{type, read}, 
-                        {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"},
+                        {dir, "%DIR%/manager/log"},
                         {size, {10240,10}}]},
      {net_if, [{module,snmpm_net_if},
                {verbosity, trace},
                {options, [{bind_to,  true}, 
                           {no_reuse, false},
 %                          {sndbuf,   32000},
-                          {recbuf,   45000}
-]}]}, 
+                          {recbuf,   45000}]}]}, 
      {def_user_mod,  snmpm_user_default}, 
      {def_user_data, undefined}
     ]
diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src
index 5a0fa0624b..7e4e3b0acd 100644
--- a/lib/snmp/test/test_config/sys.config.src
+++ b/lib/snmp/test/test_config/sys.config.src
@@ -1,11 +1,12 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:35:10
+%% This is an example sys config file for starting the snmp application
+%% with both an agent and a manager running.
 [{snmp, 
   [
    {agent,
     [
      {priority, normal}, 
      {versions, [v2]}, 
-     {db_dir, "/ldisk/bmk/tests/snmp/seq10689/a/db"}, 
+     {db_dir, "%DIR%/agent/db"}, 
      {mib_storage, ets}, 
      {agent_mib_storage, volatile},
      {target_cache, [{verbosity,silence}]}, 
@@ -15,9 +16,9 @@
      {agent_type, master}, 
      {agent_verbosity, silence}, 
      {audit_trail_log, [{type, read}, 
-                        {dir, "/ldisk/bmk/tests/snmp/seq10689/a/log"},
+                        {dir, "%DIR%/agent/log"},
                         {size, {10240,10}}]},
-     {config, [{dir,        "/ldisk/bmk/tests/snmp/seq10689/a/conf"}, 
+     {config, [{dir,        "%DIR%/agent/conf"}, 
                {force_load, true}, 
                {verbosity,  silence}]}, 
      {multi_threaded, false}, 
@@ -38,9 +39,9 @@
     [
      {priority, normal}, 
      {versions, [v2]}, 
-     {config, [{dir, "/ldisk/bmk/tests/snmp/seq10689/m/conf"}, 
+     {config, [{dir, "%DIR%/manager/conf"}, 
                {verbosity, silence}, 
-               {db_dir, "/ldisk/bmk/tests/snmp/seq10689/m/db"}, 
+               {db_dir, "%DIR%/manager/db"}, 
                {repair, true}, 
                {auto_save, 5000}]}, 
      {inform_request_behaviour, auto}, 
@@ -50,7 +51,7 @@
      {note_store, [{timeout,   30000},
                    {verbosity, silence}]}, 
      {audit_trail_log, [{type, read}, 
-                        {dir, "/ldisk/bmk/tests/snmp/seq10689/m/log"},
+                        {dir, "%DIR%/manager/log"},
                         {size, {10240,10}}]},
      {net_if, [{module,snmpm_net_if},
                {verbosity, silence},
diff --git a/lib/snmp/test/test_config/test_config.erl b/lib/snmp/test/test_config/test_config.erl
new file mode 100644
index 0000000000..2a94bf5e8d
--- /dev/null
+++ b/lib/snmp/test/test_config/test_config.erl
@@ -0,0 +1,27 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(test_config).
+
+-export([ip_address/0]).
+
+ip_address() ->
+    {ok, Hostname} = inet:gethostname(),
+    {ok, Address}  = inet:getaddr(Hostname, inet),
+    io:format("~w", [tuple_to_list(Address)]).
-- 
cgit v1.2.3


From d49bdb7c372c93d5b8007cbc016a587d91539fe9 Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Fri, 10 Dec 2010 13:41:38 +0100
Subject: "Completed" sed'ing of config files.

---
 lib/snmp/test/test_config/Makefile                 | 36 +++++++++++++++++-----
 lib/snmp/test/test_config/agent/agent.conf.src     |  1 -
 lib/snmp/test/test_config/agent/community.conf.src |  1 -
 lib/snmp/test/test_config/agent/context.conf.src   |  1 -
 lib/snmp/test/test_config/agent/notify.conf.src    |  1 -
 lib/snmp/test/test_config/agent/standard.conf.src  | 15 +++++----
 .../test/test_config/agent/target_addr.conf.src    |  5 ++-
 .../test/test_config/agent/target_params.conf.src  |  1 -
 lib/snmp/test/test_config/agent/vacm.conf.src      |  1 -
 lib/snmp/test/test_config/manager/manager.conf.src |  2 +-
 lib/snmp/test/test_config/snmp_test_config.erl     | 32 +++++++++++++++++++
 lib/snmp/test/test_config/test_config.erl          | 27 ----------------
 12 files changed, 71 insertions(+), 52 deletions(-)
 create mode 100644 lib/snmp/test/test_config/snmp_test_config.erl
 delete mode 100644 lib/snmp/test/test_config/test_config.erl

diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 064c9f4689..446e7d8adf 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -68,7 +68,7 @@ RELSYSDIR = $(TESTROOT)
 
 
 # ----------------------------------------------------
-# FLAGS
+# FLAGS AND VARIABLES
 # ----------------------------------------------------
 
 EBIN = .
@@ -77,9 +77,26 @@ ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \
                      +'{attribute,insert,app_vsn,$(APP_VSN)}'
 
 ifeq ($(ADDR),)
-ADDR = $(shell erl -noshell -s test_config ip_address -s init stop)
+ADDR = $(shell erl -noshell -s snmp_test_config ip_address -s init stop)
 endif
 
+ifeq ($(TARGET_NAME_PRE),)
+TARGET_NAME_PRE = $(shell erl -noshell -s snmp_test_config ip_address2 -s init stop)
+endif
+
+ifeq ($(SYS_CONTACT),)
+SYS_CONTACT = foo@bar.ericsson.se
+endif
+
+ifeq ($(SYS_LOCATION),)
+SYS_LOCATION = Erlang/OTP
+endif
+
+ifeq ($(SYS_NAME),)
+SYS_NAME = FOO
+endif
+
+
 
 # ----------------------------------------------------
 # Targets
@@ -94,15 +111,19 @@ clean:
 
 docs:
 
-$(SYS_CONFIG_FILES): $(SYS_CONFIG_SRCS)
+%.config: %.config.src
 	@echo "$< -> $@"
 	$(PERL) -p -e 's?%DIR%?$(RELSYSDIR)? ' < $< > $@
 
-$(AGENT_CONFIG_FILES): $(AGENT_CONFIG_SRCS)
+agent/%.conf: agent/%.conf.src
 	@echo "$< -> $@"
-	$(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
+	sed -e 's?%ADDR%?$(ADDR)? ' \
+            -e 's?%SYS_CONTACT%?$(SYS_CONTACT)? ' \
+            -e 's?%SYS_LOCATION%?$(SYS_LOCATION)? ' \
+            -e 's?%SYS_NAME%?$(SYS_NAME)? ' \
+            -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' < $< > $@
 
-$(MANAGER_CONFIG_FILES): $(MANAGER_CONFIG_SRCS)
+manager/%.conf: manager/%.conf.src
 	@echo "$< -> $@"
 	$(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@
 
@@ -153,7 +174,8 @@ info:
 	@echo "MANAGER_CONFIG_SRCS  = $(MANAGER_CONFIG_SRCS)"
 	@echo "MANAGER_CONFIG_FILES = $(MANAGER_CONFIG_FILES)"
 	@echo ""
-	@echo "ADDR  = $(ADDR)"
+	@echo "ADDR            = $(ADDR)"
+	@echo "TARGET_NAME_PRE = $(TARGET_NAME_PRE)"
 	@echo ""
 
 
diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src
index 900e6a4282..2977cd49f8 100644
--- a/lib/snmp/test/test_config/agent/agent.conf.src
+++ b/lib/snmp/test/test_config/agent/agent.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the Agent local configuration info
 %% The data is inserted into the snmpEngine* variables defined
 %% in SNMP-FRAMEWORK-MIB, and the intAgent* variables defined
diff --git a/lib/snmp/test/test_config/agent/community.conf.src b/lib/snmp/test/test_config/agent/community.conf.src
index 4661267950..8dccb929c9 100644
--- a/lib/snmp/test/test_config/agent/community.conf.src
+++ b/lib/snmp/test/test_config/agent/community.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the community info which maps to VACM parameters.
 %% The data is inserted into the snmpCommunityTable defined
 %% in SNMP-COMMUNITY-MIB.
diff --git a/lib/snmp/test/test_config/agent/context.conf.src b/lib/snmp/test/test_config/agent/context.conf.src
index 56000d0308..ea8b5a97eb 100644
--- a/lib/snmp/test/test_config/agent/context.conf.src
+++ b/lib/snmp/test/test_config/agent/context.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the contexts known to the agent.
 %% The data is inserted into the vacmContextTable defined
 %% in SNMP-VIEW-BASED-ACM-MIB.
diff --git a/lib/snmp/test/test_config/agent/notify.conf.src b/lib/snmp/test/test_config/agent/notify.conf.src
index b63668f4fd..164fd25b95 100644
--- a/lib/snmp/test/test_config/agent/notify.conf.src
+++ b/lib/snmp/test/test_config/agent/notify.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the notification parameters.
 %% The data is inserted into the snmpNotifyTable defined
 %% in SNMP-NOTIFICATION-MIB.
diff --git a/lib/snmp/test/test_config/agent/standard.conf.src b/lib/snmp/test/test_config/agent/standard.conf.src
index 9bcca18b5e..31e04e7695 100644
--- a/lib/snmp/test/test_config/agent/standard.conf.src
+++ b/lib/snmp/test/test_config/agent/standard.conf.src
@@ -1,11 +1,10 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the STANDARD-MIB info.
 %% Each row is a 2-tuple:
 %% {StandardVariable, Value}.
 %% For example
 %% {sysDescr, "Erlang SNMP agent"}.
 %% {sysObjectID, [1,2,3]}.
-%% {sysContact, "{mbj,eklas}@erlang.ericsson.se"}.
+%% {sysContact, "foo@bar.ericsson.se"}.
 %% {sysName, "test"}.
 %% {sysLocation, "erlang"}.
 %% {sysServices, 72}.
@@ -13,10 +12,10 @@
 %%
 
 
-{sysDescr, "Erlang SNMP agent"}.
-{sysObjectID, [1,2,3]}.
-{sysContact, "{mbj,eklas}@erlang.ericsson.se"}.
-{sysLocation, "erlang"}.
-{sysServices, 72}.
+{sysDescr,              "Erlang SNMP agent"}.
+{sysObjectID,           [1,2,3]}.
+{sysContact,            "%SYS_CONTACT%"}.
+{sysLocation,           "%SYS_LOCATION%"}.
+{sysServices,           72}.
 {snmpEnableAuthenTraps, disabled}.
-{sysName, "foo"}.
+{sysName,               "%SYS_NAME%"}.
diff --git a/lib/snmp/test/test_config/agent/target_addr.conf.src b/lib/snmp/test/test_config/agent/target_addr.conf.src
index 2c7a6a15ad..740df74ecf 100644
--- a/lib/snmp/test/test_config/agent/target_addr.conf.src
+++ b/lib/snmp/test/test_config/agent/target_addr.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the target address parameters.
 %% The data is inserted into the snmpTargetAddrTable defined
 %% in SNMP-TARGET-MIB, and in the snmpTargetAddrExtTable defined
@@ -18,5 +17,5 @@
 %%
 
 
-{"127.0.0.1 v2", [127,0,0,1], 5000, 1500, 3, "std_trap", "target_v2", "", [], 2048}.
-{"127.0.0.1 v2.2", [127,0,0,1], 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}.
+{"%TARGET_NAME_PRE% v2",   %ADDR%, 5000, 1500, 3, "std_trap",   "target_v2", "", [], 2048}.
+{"%TARGET_NAME_PRE% v2.2", %ADDR%, 5000, 1500, 3, "std_inform", "target_v2", "", [], 2048}.
diff --git a/lib/snmp/test/test_config/agent/target_params.conf.src b/lib/snmp/test/test_config/agent/target_params.conf.src
index 8e89b91d81..a4a535baa2 100644
--- a/lib/snmp/test/test_config/agent/target_params.conf.src
+++ b/lib/snmp/test/test_config/agent/target_params.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the target parameters.
 %% The data is inserted into the snmpTargetParamsTable defined
 %% in SNMP-TARGET-MIB.
diff --git a/lib/snmp/test/test_config/agent/vacm.conf.src b/lib/snmp/test/test_config/agent/vacm.conf.src
index c7dc5170c2..86271443ad 100644
--- a/lib/snmp/test/test_config/agent/vacm.conf.src
+++ b/lib/snmp/test/test_config/agent/vacm.conf.src
@@ -1,4 +1,3 @@
-%% This file was generated by snmp_config (version-4.9.3) 2007-06-29 13:32:48
 %% This file defines the Mib Views.
 %% The data is inserted into the vacm* tables defined
 %% in SNMP-VIEW-BASED-ACM-MIB.
diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src
index 164e5507c6..7d4104ded2 100644
--- a/lib/snmp/test/test_config/manager/manager.conf.src
+++ b/lib/snmp/test/test_config/manager/manager.conf.src
@@ -11,6 +11,6 @@
 
 
 {port, 5000}.
-{address, [127,0,0,1]}.
+{address, %ADDR%}.
 {engine_id, "foo"}.
 {max_message_size, 484}.
diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl
new file mode 100644
index 0000000000..8d2005d061
--- /dev/null
+++ b/lib/snmp/test/test_config/snmp_test_config.erl
@@ -0,0 +1,32 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(test_config).
+
+-export([ip_address/0, ip_address2/0]).
+
+ip_address() ->
+    {ok, Hostname} = inet:gethostname(),
+    {ok, Address}  = inet:getaddr(Hostname, inet),
+    io:format("~w", [tuple_to_list(Address)]).
+
+ip_address2() ->
+    {ok, Hostname} = inet:gethostname(),
+    {ok, {A1, A2, A3, A4}}  = inet:getaddr(Hostname, inet),
+    io:format("~w.~w.~w.~w", [A1, A2, A3, A4]).
diff --git a/lib/snmp/test/test_config/test_config.erl b/lib/snmp/test/test_config/test_config.erl
deleted file mode 100644
index 2a94bf5e8d..0000000000
--- a/lib/snmp/test/test_config/test_config.erl
+++ /dev/null
@@ -1,27 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(test_config).
-
--export([ip_address/0]).
-
-ip_address() ->
-    {ok, Hostname} = inet:gethostname(),
-    {ok, Address}  = inet:getaddr(Hostname, inet),
-    io:format("~w", [tuple_to_list(Address)]).
-- 
cgit v1.2.3


From 58620c2052e07490beb44a4bd1a8fbb5ebc028ac Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Fri, 10 Dec 2010 14:17:30 +0100
Subject: Various cosmetic (print) fixes. Wrong module names used for the
 utility module in the test_config dir.

---
 lib/snmp/src/agent/snmp_community_mib.erl      | 4 +++-
 lib/snmp/src/agent/snmpa.erl                   | 7 +++++--
 lib/snmp/src/agent/snmpa_mib_lib.erl           | 9 ++++++---
 lib/snmp/test/test_config/Makefile             | 2 --
 lib/snmp/test/test_config/modules.mk           | 2 +-
 lib/snmp/test/test_config/snmp_test_config.erl | 2 +-
 6 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl
index 8f0f4cad73..5644a43345 100644
--- a/lib/snmp/src/agent/snmp_community_mib.erl
+++ b/lib/snmp/src/agent/snmp_community_mib.erl
@@ -336,6 +336,8 @@ get_target_addr_ext_mms(TDomain, TAddress, Key) ->
 		    get_target_addr_ext_mms(TDomain, TAddress, NextKey)
 	    end
     end.
+
+
 %%-----------------------------------------------------------------
 %% Instrumentation Functions
 %%-----------------------------------------------------------------
@@ -347,7 +349,7 @@ snmpCommunityTable(print) ->
     PrintRow = 
 	fun(Prefix, Row) ->
 		lists:flatten(
-		  io_lib:format("~sIndex:             ~p"
+		  io_lib:format("~sIndex:           ~p"
 				"~n~sName:            ~p"
 				"~n~sSecurityName:    ~p"
 				"~n~sContextEngineID: ~p"
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index 8ad2a83de4..c09435c03b 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -326,6 +326,9 @@ print_mib_info() ->
     MibsInfo = mibs_info(),
     print_mib_info(MibsInfo).
 
+print_mib_info([]) ->
+    io:format("~n", []),
+    ok;
 print_mib_info([{Mod, Tables, Variables} | MibsInfo]) ->
     io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]),
     print_mib_variables2(Mod, Variables),
@@ -379,9 +382,9 @@ make_pretty_mib(snmp_view_based_acm_mib) ->
     "SNMP-VIEW-BASED-ACM-MIB";
 make_pretty_mib(snmp_target_mib) ->
     "SNMP-TARGET-MIB";
-make_pretty_mib(snmp_target_mib) ->
+make_pretty_mib(snmp_community_mib) ->
     "SNMP-COMMUNITY-MIB";
-make_pretty_mib(snmp_target_mib) ->
+make_pretty_mib(snmp_notification_mib) ->
     "SNMP-NOTIFICATION-MIB";
 make_pretty_mib(snmp_target_mib) ->
     "SNMP-USER-BASED-SM-MIB";
diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl
index 22057b4547..700bdd1a6e 100644
--- a/lib/snmp/src/agent/snmpa_mib_lib.erl
+++ b/lib/snmp/src/agent/snmpa_mib_lib.erl
@@ -90,9 +90,9 @@ print_variables(Variables) when is_list(Variables) ->
     ok.
 
 print_variable(Variable, {value, Val}, Prefix) when is_atom(Variable) ->
-    io:format("~w~s => ~p~n", [Variable, Prefix, Val]);
+    io:format("~w~s=> ~p~n", [Variable, Prefix, Val]);
 print_variable(Variable, Error, Prefix) when is_atom(Variable) ->
-    io:format("~w~s => ERROR: ~p~n", [Variable, Prefix, Error]).
+    io:format("~w~s=> [e] ~p~n", [Variable, Prefix, Error]).
 
 print_variables_prefixify(Variables) ->
     MaxVarLength = print_variables_maxlength(Variables),
@@ -139,10 +139,13 @@ print_table(Table, DB, FOI, PrintRow) ->
     print_table(Table, TableInfo, PrintRow).
 
 print_table(Table, TableInfo, PrintRow) when is_function(PrintRow, 2) ->
-    io:format("~w => ~n", [Table]),
+    io:format("~w =>", [Table]),
     do_print_table(TableInfo, PrintRow).
 
+do_print_table({ok, [] = _TableInfo}, _PrintRow) ->
+    io:format(" -~n", []);
 do_print_table({ok, TableInfo}, PrintRow) when is_function(PrintRow, 2) ->
+    io:format("~n", []),
     lists:foreach(fun({RowIdx, Row}) ->
 			  io:format("   ~w => ~n~s~n", 
 				    [RowIdx, PrintRow("      ", Row)])
diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile
index 446e7d8adf..c02bb5c601 100644
--- a/lib/snmp/test/test_config/Makefile
+++ b/lib/snmp/test/test_config/Makefile
@@ -32,8 +32,6 @@ VSN = $(SNMP_VSN)
 # ----------------------------------------------------
 # Configured variables
 # ----------------------------------------------------
-# PERL = @PERL@
-PERL = perl
 
 
 # ----------------------------------------------------
diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk
index 956bb54af3..ee8b68d4eb 100644
--- a/lib/snmp/test/test_config/modules.mk
+++ b/lib/snmp/test/test_config/modules.mk
@@ -37,4 +37,4 @@ MANAGER_CONFIG_FILES = \
 	manager/usm.conf
 
 MODULES = \
-	test_config
+	snmp_test_config
diff --git a/lib/snmp/test/test_config/snmp_test_config.erl b/lib/snmp/test/test_config/snmp_test_config.erl
index 8d2005d061..550a276c4c 100644
--- a/lib/snmp/test/test_config/snmp_test_config.erl
+++ b/lib/snmp/test/test_config/snmp_test_config.erl
@@ -17,7 +17,7 @@
 %% %CopyrightEnd%
 %%
 
--module(test_config).
+-module(snmp_test_config).
 
 -export([ip_address/0, ip_address2/0]).
 
-- 
cgit v1.2.3


From fee3f48c37432c7ea28f2e8c9eb4eacac4422db9 Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Fri, 10 Dec 2010 15:54:25 +0100
Subject: Added variables from STANDARD-MIB (including counters). Also some
 minor fixes.

---
 lib/snmp/src/agent/snmp_standard_mib.erl      | 266 ++++++++++++++++++++++++++
 lib/snmp/src/agent/snmp_target_mib.erl        |   4 +
 lib/snmp/src/agent/snmp_user_based_sm_mib.erl |   5 +
 lib/snmp/src/agent/snmpa.erl                  |  57 +++++-
 4 files changed, 327 insertions(+), 5 deletions(-)

diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index 639172401d..7292d5b98e 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -40,6 +40,28 @@
 	 sys_object_id/1, sys_object_id/2, sys_or_table/3,
 	 variable_func/1, variable_func/2,
 	 inc/1, inc/2]).
+-export([sysDescr/1, sysContact/1, sysName/1, sysLocation/1, 
+	 sysServices/1, sysUpTime/1, snmpEnableAuthenTraps/1, 
+	 sysObjectID/1, 
+	 snmpInPkts/1, snmpOutPkts/1, 
+	 snmpInBadVersions/1, 
+	 snmpInBadCommunityNames/1, snmpInBadCommunityUses/1, 
+	 snmpInASNParseErrs/1, 
+	 snmpInTooBigs/1, 
+	 snmpInNoSuchNames/1, snmpInBadValues/1,
+	 snmpInReadOnlys/1, snmpInGenErrs/1, 
+	 snmpInTotalReqVars/1, snmpInTotalSetVars/1, 
+	 snmpInGetRequests/1, snmpInSetRequests/1, 
+	 snmpInGetNexts/1, 
+	 snmpInGetResponses/1, snmpInTraps/1,
+	 snmpOutTooBigs/1,
+	 snmpOutNoSuchNames/1,
+	 snmpOutBadValues/1, 
+	 snmpOutGenErrs/1,
+	 snmpOutGetRequests/1, snmpOutSetRequests/1, 
+	 snmpOutGetNexts/1,
+	 snmpOutGetResponses/1,
+	 snmpOutTraps/1]).
 -export([dummy/1, snmp_set_serial_no/1, snmp_set_serial_no/2]).
 -export([add_agent_caps/2, del_agent_caps/1, get_agent_caps/0]).
 -export([check_standard/1]).
@@ -202,18 +224,252 @@ variable_func(get, Name) ->
 inc(Name) -> inc(Name, 1).
 inc(Name, N) -> ets:update_counter(snmp_agent_table, Name, N).
 
+
+sysDescr(print) ->
+    VarAndValue = [{sysDescr,  sysDescr(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+    
+sysDescr(get) ->
+    VarDB = db(sysDescr), 
+    snmp_generic:variable_get(VarDB).
+    
+
+sysContact(print) ->
+    VarAndValue = [{sysContact,  sysContact(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
+sysContact(get) ->
+    VarDB = db(sysContact), 
+    snmp_generic:variable_get(VarDB).
+
+
+sysName(print) ->
+    VarAndValue = [{sysName,  sysName(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
+sysName(get) ->
+    VarDB = db(sysName), 
+    snmp_generic:variable_get(VarDB).
+
+
+sysLocation(print) ->
+    VarAndValue = [{sysLocation,  sysLocation(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
+sysLocation(get) ->
+    VarDB = db(sysLocation), 
+    snmp_generic:variable_get(VarDB).
+
+
+sysServices(print) ->
+    VarAndValue = [{sysServices,  sysServices(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
+sysServices(get) ->
+    VarDB = db(sysServices), 
+    snmp_generic:variable_get(VarDB).
+
+
+snmpInPkts(print) ->
+    gen_counter(print, snmpInPkts);
+snmpInPkts(get) ->
+    gen_counter(get, snmpInPkts).
+
+
+snmpOutPkts(print) ->
+    gen_counter(print, snmpOutPkts);
+snmpOutPkts(get) ->
+    gen_counter(get, snmpOutPkts).
+
+
+snmpInASNParseErrs(print) ->
+    gen_counter(print, snmpInASNParseErrs);
+snmpInASNParseErrs(get) ->
+    gen_counter(get, snmpInASNParseErrs).
+    
+
+snmpInBadCommunityNames(print) ->
+    gen_counter(print, snmpInBadCommunityNames);
+snmpInBadCommunityNames(get) ->
+    gen_counter(get, snmpInBadCommunityNames).
+    
+
+snmpInBadCommunityUses(print) ->
+    gen_counter(print, snmpInBadCommunityUses);
+
+snmpInBadCommunityUses(get) ->
+    gen_counter(get, snmpInBadCommunityUses).
+    
+
+snmpInBadVersions(print) ->
+    gen_counter(print, snmpInBadVersions);
+snmpInBadVersions(get) ->
+    gen_counter(get, snmpInBadVersions).
+    
+
+snmpInTooBigs(print) ->
+    gen_counter(print, snmpInTooBigs);
+snmpInTooBigs(get) ->
+    gen_counter(get, snmpInTooBigs).
+    
+
+snmpInNoSuchNames(print) ->
+    gen_counter(print, snmpInNoSuchNames);
+snmpInNoSuchNames(get) ->
+    gen_counter(get, snmpInNoSuchNames).
+    
+
+snmpInBadValues(print) ->
+    gen_counter(print, snmpInBadValues);
+snmpInBadValues(get) ->
+    gen_counter(get, snmpInBadValues).
+    
+
+snmpInReadOnlys(print) ->
+    gen_counter(print, snmpInReadOnlys);
+snmpInReadOnlys(get) ->
+    gen_counter(get, snmpInReadOnlys).
+    
+
+snmpInGenErrs(print) ->
+    gen_counter(print, snmpInGenErrs);
+snmpInGenErrs(get) ->
+    gen_counter(get, snmpInGenErrs).
+    
+
+snmpInTotalReqVars(print) ->
+    gen_counter(print, snmpInTotalReqVars);
+snmpInTotalReqVars(get) ->
+    gen_counter(get, snmpInTotalReqVars).
+    
+
+snmpInTotalSetVars(print) ->
+    gen_counter(print, snmpInTotalSetVars);
+snmpInTotalSetVars(get) ->
+    gen_counter(get, snmpInTotalSetVars).
+    
+
+snmpInGetRequests(print) ->
+    gen_counter(print, snmpInGetRequests);
+snmpInGetRequests(get) ->
+    gen_counter(get, snmpInGetRequests).
+    
+
+snmpInSetRequests(print) ->
+    gen_counter(print, snmpInSetRequests);
+snmpInSetRequests(get) ->
+    gen_counter(get, snmpInSetRequests).
+    
+
+snmpInGetNexts(print) ->
+    gen_counter(print, snmpInGetNexts);
+snmpInGetNexts(get) ->
+    gen_counter(get, snmpInGetNexts).
+    
+
+snmpInGetResponses(print) ->
+    gen_counter(print, snmpInGetResponses);
+snmpInGetResponses(get) ->
+    gen_counter(get, snmpInGetResponses).
+    
+
+snmpInTraps(print) ->
+    gen_counter(print, snmpInTraps);
+snmpInTraps(get) ->
+    gen_counter(get, snmpInTraps).
+    
+
+snmpOutTooBigs(print) ->
+    gen_counter(print, snmpOutTooBigs);
+snmpOutTooBigs(get) ->
+    gen_counter(get, snmpOutTooBigs).
+    
+
+snmpOutNoSuchNames(print) ->
+    gen_counter(print, snmpOutNoSuchNames);
+snmpOutNoSuchNames(get) ->
+    gen_counter(get, snmpOutNoSuchNames).
+    
+
+snmpOutBadValues(print) ->
+    gen_counter(print, snmpOutBadValues);
+snmpOutBadValues(get) ->
+    gen_counter(get, snmpOutBadValues).
+    
+
+snmpOutGenErrs(print) ->
+    gen_counter(print, snmpOutGenErrs);
+snmpOutGenErrs(get) ->
+    gen_counter(get, snmpOutGenErrs).
+    
+
+snmpOutGetRequests(print) ->
+    gen_counter(print, snmpOutGetRequests);
+snmpOutGetRequests(get) ->
+    gen_counter(get, snmpOutGetRequests).
+    
+
+snmpOutSetRequests(print) ->
+    gen_counter(print, snmpOutSetRequests);
+snmpOutSetRequests(get) ->
+    gen_counter(get, snmpOutSetRequests).
+    
+
+snmpOutGetNexts(print) ->
+    gen_counter(print, snmpOutGetNexts);
+snmpOutGetNexts(get) ->
+    gen_counter(get, snmpOutGetNexts).
+    
+
+snmpOutGetResponses(print) ->
+    gen_counter(print, snmpOutGetResponses);
+snmpOutGetResponses(get) ->
+    gen_counter(get, snmpOutGetResponses).
+    
+
+snmpOutTraps(print) ->
+    gen_counter(print, snmpOutTraps);
+snmpOutTraps(get) ->
+    gen_counter(get, snmpOutTraps).
+    
+
+gen_counter(print, Counter) ->
+    Val         = gen_counter(get, Counter), 
+    VarAndValue = [{Counter, Val}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+    
+gen_counter(get, Counter) ->
+    variable_func(get, Counter).
+
+
 %%-----------------------------------------------------------------
 %% This is the instrumentation function for sysUpTime.
 %%-----------------------------------------------------------------
+sysUpTime(print) ->
+    sys_up_time(print).
+
 sys_up_time() ->
     snmpa:sys_up_time().
 
+sys_up_time(print) ->
+    VarAndValue = [{sysUpTime,  sys_up_time(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
 sys_up_time(get) ->
     {value, snmpa:sys_up_time()}.
 
+
 %%-----------------------------------------------------------------
 %% This is the instrumentation function for snmpEnableAuthenTraps
 %%-----------------------------------------------------------------
+
+snmpEnableAuthenTraps(print) ->
+    snmp_enable_authen_traps(print).
+
+snmp_enable_authen_traps(print) ->
+    VarAndValue = [{snmpEnableAuthenTraps,  snmp_enable_authen_traps(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+    
 snmp_enable_authen_traps(new) ->
     snmp_generic:variable_func(new, db(snmpEnableAuthenTraps));
 
@@ -226,9 +482,17 @@ snmp_enable_authen_traps(get) ->
 snmp_enable_authen_traps(set, NewVal) ->
     snmp_generic:variable_func(set, NewVal, db(snmpEnableAuthenTraps)).
 
+
 %%-----------------------------------------------------------------
 %% This is the instrumentation function for sysObjectId
 %%-----------------------------------------------------------------
+sysObjectID(print) ->
+    sys_object_id(print).
+
+sys_object_id(print) ->
+    VarAndValue = [{sysObjectID,  sys_object_id(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+
 sys_object_id(new) ->
     snmp_generic:variable_func(new, db(sysObjectID));
 
@@ -241,6 +505,7 @@ sys_object_id(get) ->
 sys_object_id(set, NewVal) ->
     snmp_generic:variable_func(set, NewVal, db(sysObjectID)).
 
+
 %%-----------------------------------------------------------------
 %% This is a dummy instrumentation function for objects like
 %% snmpTrapOID, that is accessible-for-notify, with different
@@ -249,6 +514,7 @@ sys_object_id(set, NewVal) ->
 %%-----------------------------------------------------------------
 dummy(_Op) -> ok.
 
+
 %%-----------------------------------------------------------------
 %% This is the instrumentation function for snmpSetSerialNo.
 %% It is always volatile.
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl
index 033dfdd92e..270a5fd5b6 100644
--- a/lib/snmp/src/agent/snmp_target_mib.erl
+++ b/lib/snmp/src/agent/snmp_target_mib.erl
@@ -511,6 +511,10 @@ set_target_engine_id(TargetAddrName, EngineId) ->
 %%-----------------------------------------------------------------
 %% Instrumentation Functions
 %%-----------------------------------------------------------------
+snmpTargetSpinLock(print) ->
+    VarAndValue = [{snmpTargetSpinLock, snmpTargetSpinLock(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+    
 snmpTargetSpinLock(new) ->
     snmp_generic:variable_func(new, {snmpTargetSpinLock, volatile}),
     {A1,A2,A3} = erlang:now(),
diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
index f40bb1a5b9..4c3f27c4ef 100644
--- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
+++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
@@ -374,6 +374,11 @@ get_user_from_security_name(EngineID, SecName) ->
 %%-----------------------------------------------------------------
 %% Instrumentation Functions
 %%-----------------------------------------------------------------
+
+usmUserSpinLock(print) ->
+    VarAndValue = [{usmUserSpinLock, usmUserSpinLock(get)}],
+    snmpa_mib_lib:print_variables(VarAndValue);
+    
 usmUserSpinLock(new) ->
     snmp_generic:variable_func(new, {usmUserSpinLock, volatile}),
     {A1,A2,A3} = erlang:now(),
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index c09435c03b..8ca057892c 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -287,6 +287,46 @@ whereis_mib(Agent, Mib) when is_atom(Mib) ->
 
 mibs_info() ->
     [
+     {snmp_standard_mib, 
+      [],
+      [
+       sysDescr, 
+       sysObjectID, 
+       sysContact, 
+       sysName, 
+       sysLocation, 
+       sysServices, 
+       snmpEnableAuthenTraps,
+       sysUpTime,
+       snmpInPkts,
+       snmpOutPkts, 
+       snmpInBadVersions, 
+       snmpInBadCommunityNames, 
+       snmpInBadCommunityUses, 
+       snmpInASNParseErrs, 
+       snmpInTooBigs, 
+       snmpInNoSuchNames, 
+       snmpInBadValues, 
+       snmpInReadOnlys, 
+       snmpInGenErrs, 
+       snmpInTotalReqVars, 
+       snmpInTotalSetVars, 
+       snmpInGetRequests, 
+       snmpInSetRequests, 
+       snmpInGetNexts, 
+       snmpInGetResponses, 
+       snmpInTraps, 
+       snmpOutTooBigs, 
+       snmpOutNoSuchNames, 
+       snmpOutBadValues, 
+       snmpOutGenErrs, 
+       snmpOutGetRequests, 
+       snmpOutSetRequests, 
+       snmpOutGetNexts, 
+       snmpOutGetResponses, 
+       snmpOutTraps
+      ]
+     },
      {snmp_view_based_acm_mib, 
       [
        vacmAccessTable,
@@ -295,7 +335,8 @@ mibs_info() ->
       ],
       [
        vacmViewSpinLock
-      ]},
+      ]
+     },
      {snmp_target_mib, 
       [
        snmpTargetAddrTable,
@@ -303,12 +344,14 @@ mibs_info() ->
       ], 
       [
        snmpTargetSpinLock
-      ]},
+      ]
+     },
      {snmp_community_mib, 
       [
        snmpCommunityTable
       ], 
-      []},
+      []
+     },
      {snmp_notification_mib, 
       [
        snmpNotifyTable
@@ -320,7 +363,9 @@ mibs_info() ->
       ], 
       [
        usmUserSpinLock
-      ]}].
+      ]
+     }
+    ].
 
 print_mib_info() ->
     MibsInfo = mibs_info(),
@@ -386,8 +431,10 @@ make_pretty_mib(snmp_community_mib) ->
     "SNMP-COMMUNITY-MIB";
 make_pretty_mib(snmp_notification_mib) ->
     "SNMP-NOTIFICATION-MIB";
-make_pretty_mib(snmp_target_mib) ->
+make_pretty_mib(snmp_user_based_sm_mib) ->
     "SNMP-USER-BASED-SM-MIB";
+make_pretty_mib(snmp_standard_mib) ->
+    "STANDARD-MIB";
 make_pretty_mib(Mod) ->
     atom_to_list(Mod).
 
-- 
cgit v1.2.3


From 0a5c83dc4cbf10e46ab6afa8c8cad05005406263 Mon Sep 17 00:00:00 2001
From: Lukas Larsson 
Date: Fri, 10 Dec 2010 15:57:24 +0100
Subject: Update test support so that if common test fails to be stopped in a
 suite, the ct node is restarted and the test case fails

---
 lib/common_test/test/ct_test_support.erl | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 981504b660..b4f1a0e71f 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -58,6 +58,10 @@ init_per_suite(Config, Level) ->
 	_ ->
 	    ok
     end,
+    
+    start_slave(Config, Level).
+
+start_slave(Config,Level) ->
     [_,Host] = string:tokens(atom_to_list(node()), "@"),
     
     test_server:format(0, "Trying to start ~s~n", ["ct@"++Host]),
@@ -136,9 +140,16 @@ init_per_testcase(_TestCase, Config) ->
 
 end_per_testcase(_TestCase, Config) ->
     CTNode = ?config(ct_node, Config),
-    wait_for_ct_stop(CTNode),
-    ok.
-
+    case wait_for_ct_stop(CTNode) of
+	%% Common test was not stopped to we restart node.
+	false ->
+	    cover:stop(CTNode),
+	    slave:stop(CTNode),
+	    start_slave(Config,proplists:get_value(trace_level,Config)),
+	    {fail, "Could not stop common_test"};
+	true ->
+	    ok
+    end.
 
 %%%-----------------------------------------------------------------
 %%% 
@@ -229,11 +240,11 @@ wait_for_ct_stop(CTNode) ->
 
 wait_for_ct_stop(0, CTNode) ->
     test_server:format(0, "Giving up! Stopping ~p.", [CTNode]),
-    ok;
+    false;
 wait_for_ct_stop(Retries, CTNode) ->
     case rpc:call(CTNode, erlang, whereis, [ct_util_server]) of
 	undefined ->
-	    ok;
+	    true;
 	Pid ->
 	    test_server:format(0, "Waiting for CT (~p) to finish (~p)...", 
 			       [Pid,Retries]),
-- 
cgit v1.2.3


From a0e4728a5e8e366c83e8229cefc63ba92151a86d Mon Sep 17 00:00:00 2001
From: Micael Karlberg 
Date: Fri, 10 Dec 2010 16:21:08 +0100
Subject: Cosmetic stuff (when to newline, intending, ..).

---
 lib/snmp/src/agent/snmp_standard_mib.erl | 15 +++++++++++----
 lib/snmp/src/agent/snmpa.erl             | 14 +++++++++++---
 lib/snmp/src/agent/snmpa_mib_lib.erl     |  8 +-------
 3 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index 7292d5b98e..b6834d278c 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -446,7 +446,9 @@ gen_counter(get, Counter) ->
 %% This is the instrumentation function for sysUpTime.
 %%-----------------------------------------------------------------
 sysUpTime(print) ->
-    sys_up_time(print).
+    sys_up_time(print);
+sysUpTime(get) ->
+    sys_up_time(get).
 
 sys_up_time() ->
     snmpa:sys_up_time().
@@ -464,7 +466,10 @@ sys_up_time(get) ->
 %%-----------------------------------------------------------------
 
 snmpEnableAuthenTraps(print) ->
-    snmp_enable_authen_traps(print).
+    snmp_enable_authen_traps(print);
+snmpEnableAuthenTraps(get) ->
+    snmp_enable_authen_traps(get).
+
 
 snmp_enable_authen_traps(print) ->
     VarAndValue = [{snmpEnableAuthenTraps,  snmp_enable_authen_traps(get)}],
@@ -484,10 +489,12 @@ snmp_enable_authen_traps(set, NewVal) ->
 
 
 %%-----------------------------------------------------------------
-%% This is the instrumentation function for sysObjectId
+%% This is the instrumentation function for sysObjectID
 %%-----------------------------------------------------------------
 sysObjectID(print) ->
-    sys_object_id(print).
+    sys_object_id(print);
+sysObjectID(get) ->
+    sys_object_id(get).
 
 sys_object_id(print) ->
     VarAndValue = [{sysObjectID,  sys_object_id(get)}],
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index 8ca057892c..3c214874fe 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -378,6 +378,7 @@ print_mib_info([{Mod, Tables, Variables} | MibsInfo]) ->
     io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]),
     print_mib_variables2(Mod, Variables),
     print_mib_tables2(Mod, Tables),
+    io:format("~n", []),
     print_mib_info(MibsInfo).
 
 
@@ -394,9 +395,12 @@ print_mib_tables([{Mod, Tabs}|MibTabs])
 print_mib_tables([_|MibTabs]) ->
     print_mib_tables(MibTabs).
 
+print_mib_tables(_Mod, [] = _Tables) ->
+    ok;
 print_mib_tables(Mod, Tables) ->
     io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]),
-    print_mib_tables2(Mod, Tables).
+    print_mib_tables2(Mod, Tables), 
+    io:format("~n", []).
 
 print_mib_tables2(Mod, Tables) ->
     [(catch Mod:Table(print)) || Table <- Tables].
@@ -415,12 +419,16 @@ print_mib_variables([{Mod, Vars}|MibVars])
 print_mib_variables([_|MibVars]) ->
     print_mib_variables(MibVars).
 
+print_mib_variables(_Mod, [] = _Vars) ->
+    ok;
 print_mib_variables(Mod, Vars) ->
     io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]),
-    print_mib_variables2(Mod, Vars).
+    print_mib_variables2(Mod, Vars), 
+    io:format("~n", []).
 
 print_mib_variables2(Mod, Variables) ->
-    [(catch Mod:Variable(print)) || Variable <- Variables].
+    Vars = [{Var, (catch Mod:Var(get))} || Var <- Variables],
+    snmpa_mib_lib:print_variables(Vars).
 
 
 make_pretty_mib(snmp_view_based_acm_mib) ->
diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl
index 700bdd1a6e..cb96ff8056 100644
--- a/lib/snmp/src/agent/snmpa_mib_lib.erl
+++ b/lib/snmp/src/agent/snmpa_mib_lib.erl
@@ -129,11 +129,6 @@ print_tables(Tables) when is_list(Tables) ->
 		  end, Tables),
     ok.
 
-%% print_table(Table, DB, FOI, PrintRow) ->
-%%     TableInfo = get_table(DB(Table), FOI(Table)),
-%%     print_table(Table, TableInfo, PrintRow),
-%%     ok.
-
 print_table(Table, DB, FOI, PrintRow) ->
     TableInfo = get_table(DB, FOI),
     print_table(Table, TableInfo, PrintRow).
@@ -149,8 +144,7 @@ do_print_table({ok, TableInfo}, PrintRow) when is_function(PrintRow, 2) ->
     lists:foreach(fun({RowIdx, Row}) ->
 			  io:format("   ~w => ~n~s~n", 
 				    [RowIdx, PrintRow("      ", Row)])
-		  end, TableInfo),
-    io:format("~n", []);
+		  end, TableInfo);
 do_print_table({error, {invalid_rowindex, BadRowIndex, []}}, _PrintRow) ->
     io:format("Error: Bad rowindex ~w~n", [BadRowIndex]);
 do_print_table({error, {invalid_rowindex, BadRowIndex, TableInfo}}, PrintRow) ->
-- 
cgit v1.2.3


From 7992d6a6bfa0f460f8663c2d72d07b60755a4857 Mon Sep 17 00:00:00 2001
From: Vitaliy Batichko 
Date: Mon, 29 Nov 2010 20:42:28 +0200
Subject: Correct erl_global{register, unregister} functions

C node needs DFLAG_DIST_MONITOR flag set when connecting,
and support for processing monitoring start/end messages
received from counterpart, to make global registration
actually work.
---
 lib/erl_interface/include/ei.h                     |  29 ++-
 lib/erl_interface/src/connect/ei_connect.c         |   1 +
 lib/erl_interface/src/legacy/global_register.c     |  12 +-
 lib/erl_interface/src/legacy/global_unregister.c   |  12 +-
 lib/erl_interface/test/Makefile                    |   1 +
 lib/erl_interface/test/erl_global_SUITE.erl        | 125 ++++++++++
 .../test/erl_global_SUITE_data/Makefile.first      |  21 ++
 .../test/erl_global_SUITE_data/Makefile.src        |  41 ++++
 .../test/erl_global_SUITE_data/erl_global_test.c   | 263 +++++++++++++++++++++
 9 files changed, 486 insertions(+), 19 deletions(-)
 create mode 100644 lib/erl_interface/test/erl_global_SUITE.erl
 create mode 100644 lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
 create mode 100644 lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
 create mode 100644 lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c

diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h
index 466d84bb99..ae815b414a 100644
--- a/lib/erl_interface/include/ei.h
+++ b/lib/erl_interface/include/ei.h
@@ -80,21 +80,24 @@
 #define ERL_NO_TIMEOUT -1
 
 /* these are the control message types */
-#define ERL_LINK          1
-#define ERL_SEND          2
-#define ERL_EXIT          3
-#define ERL_UNLINK        4
-#define ERL_NODE_LINK     5
-#define ERL_REG_SEND      6
-#define ERL_GROUP_LEADER  7
-#define ERL_EXIT2         8
-#define ERL_PASS_THROUGH      'p'
+#define ERL_LINK           1
+#define ERL_SEND           2
+#define ERL_EXIT           3
+#define ERL_UNLINK         4
+#define ERL_NODE_LINK      5
+#define ERL_REG_SEND       6
+#define ERL_GROUP_LEADER   7
+#define ERL_EXIT2          8
+#define ERL_PASS_THROUGH  'p'
 
 /* new ones for tracing, from Kenneth */
-#define ERL_SEND_TT      12
-#define ERL_EXIT_TT      13
-#define ERL_REG_SEND_TT  16
-#define ERL_EXIT2_TT     18
+#define ERL_SEND_TT        12
+#define ERL_EXIT_TT        13
+#define ERL_REG_SEND_TT    16
+#define ERL_EXIT2_TT       18
+#define ERL_MONITOR_P      19
+#define ERL_DEMONITOR_P    20
+#define ERL_MONITOR_P_EXIT 21
 
 
 /* -------------------------------------------------------------------- */
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 99ccba0686..10824c8a5f 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -1329,6 +1329,7 @@ static int send_name_or_challenge(int fd, char *nodename,
     put8(s, 'n');
     put16be(s, version);
     put32be(s, (DFLAG_EXTENDED_REFERENCES
+		| DFLAG_DIST_MONITOR
 		| DFLAG_EXTENDED_PIDS_PORTS
 		| DFLAG_FUN_TAGS
 		| DFLAG_NEW_FUN_TAGS
diff --git a/lib/erl_interface/src/legacy/global_register.c b/lib/erl_interface/src/legacy/global_register.c
index 3a4de8b08e..f12eb6b448 100644
--- a/lib/erl_interface/src/legacy/global_register.c
+++ b/lib/erl_interface/src/legacy/global_register.c
@@ -31,7 +31,7 @@ int erl_global_register(int fd, const char *name, ETERM *pid)
   int index = 0;
   erlang_pid self;
   erlang_msg msg;
-  int needlink, needatom;
+  int needlink, needatom, needmonitor;
   int arity;
   int version;
   int msglen;
@@ -65,7 +65,7 @@ int erl_global_register(int fd, const char *name, ETERM *pid)
   if (ei_send_reg_encoded(fd,&self,"rex",buf,index)) return -1;
 
   /* get the reply: expect link and an atom, or just an atom */
-  needlink = needatom = 1;
+  needlink = needatom = needmonitor = 1;
   while (1) {
     /* get message */
     while (1) {
@@ -78,9 +78,15 @@ int erl_global_register(int fd, const char *name, ETERM *pid)
     case ERL_LINK:
       /* got link */
       if (!needlink) return -1;
-	needlink = 0;
+      needlink = 0;
       break;
       
+    case ERL_MONITOR_P-10:
+      /* got monitor */
+	if (!needmonitor) { return -1;}
+	needmonitor = 0;
+      break;
+
     case ERL_SEND:
       /* got message - does it contain our atom? */
       if (!needatom) return -1;
diff --git a/lib/erl_interface/src/legacy/global_unregister.c b/lib/erl_interface/src/legacy/global_unregister.c
index 514dbc3c68..97a1c2d03c 100644
--- a/lib/erl_interface/src/legacy/global_unregister.c
+++ b/lib/erl_interface/src/legacy/global_unregister.c
@@ -37,7 +37,7 @@ int erl_global_unregister(int fd, const char *name)
   erlang_msg msg;
   int i;
   int version,arity,msglen;
-  int needunlink, needatom;
+  int needunlink, needatom, needdemonitor;
 
   /* make a self pid */
   self->num = fd;
@@ -57,7 +57,7 @@ int erl_global_unregister(int fd, const char *name)
   if (ei_send_reg_encoded(fd,self,"rex",buf,index)) return -1;
 
   /* get the reply: expect unlink and an atom, or just an atom */
-  needunlink = needatom = 1;
+  needunlink = needatom = needdemonitor = 1;
   while (1) {
     /* get message */
     while (1) {
@@ -68,11 +68,17 @@ int erl_global_unregister(int fd, const char *name)
 
     switch (i) {
     case ERL_UNLINK:
-      /* got link */
+      /* got unlink */
       if (!needunlink) return -1;
       needunlink = 0;
       break;
 
+    case ERL_DEMONITOR_P-10:
+      /* got demonitor */
+      if (!needdemonitor) return -1;
+      needdemonitor = 0;
+      break;
+
     case ERL_SEND:
       /* got message - does it contain our atom? */
       if (!needatom) return -1;
diff --git a/lib/erl_interface/test/Makefile b/lib/erl_interface/test/Makefile
index b7a1a4e4d8..07404fda4d 100644
--- a/lib/erl_interface/test/Makefile
+++ b/lib/erl_interface/test/Makefile
@@ -33,6 +33,7 @@ MODULES= \
 	ei_print_SUITE \
 	ei_tmo_SUITE \
 	erl_connect_SUITE \
+	erl_global_SUITE \
 	erl_eterm_SUITE \
 	erl_ext_SUITE \
 	erl_format_SUITE \
diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl
new file mode 100644
index 0000000000..9826e47d55
--- /dev/null
+++ b/lib/erl_interface/test/erl_global_SUITE.erl
@@ -0,0 +1,125 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(erl_global_SUITE).
+
+-include("test_server.hrl").
+-include("erl_global_SUITE_data/erl_global_test_cases.hrl").
+
+-export([all/1,init_per_testcase/2,fin_per_testcase/2,
+	 erl_global_registration/1, erl_global_whereis/1, erl_global_names/1]).
+
+-import(runner, [get_term/1,send_term/2]).
+
+-define(GLOBAL_NAME, global_register_node_test).
+
+all(suite) ->
+    [erl_global_registration].
+
+init_per_testcase(_Case, Config) ->
+    Dog = ?t:timetrap(?t:minutes(0.25)),
+    [{watchdog, Dog}|Config].
+
+fin_per_testcase(_Case, Config) ->
+    Dog = ?config(watchdog, Config),
+    test_server:timetrap_cancel(Dog),
+    ok.
+
+erl_global_registration(Config) when is_list(Config) ->
+    ?line P = runner:start(?interpret),
+    ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+
+    ?line ok = erl_global_register(P, Fd, ?GLOBAL_NAME),
+    ?line ok = erl_global_unregister(P, Fd, ?GLOBAL_NAME),
+
+    ?line 0 = erl_close_connection(P,Fd),
+    ?line runner:send_eot(P),
+    ?line runner:recv_eot(P),
+    ok.
+
+erl_global_whereis(Config) when is_list(Config) ->
+    ?line P = runner:start(?interpret),
+    ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+
+    ?line Self = self(),
+    ?line global:register_name(?GLOBAL_NAME, Self),
+    ?line Self = erl_global_whereis(P, Fd, ?GLOBAL_NAME),
+    ?line global:unregister_name(?GLOBAL_NAME),
+    ?line 0 = erl_close_connection(P, Fd),
+    ?line runner:send_eot(P),
+    ?line runner:recv_eot(P),
+    ok.
+
+erl_global_names(Config) when is_list(Config) ->
+    ?line P = runner:start(?interpret),
+    ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0),
+
+    ?line Self = self(),
+    ?line global:register_name(?GLOBAL_NAME, Self),
+    ?line {[?GLOBAL_NAME], 1} = erl_global_names(P, Fd),
+    ?line global:unregister_name(?GLOBAL_NAME),
+    ?line 0 = erl_close_connection(P, Fd),
+    ?line runner:send_eot(P),
+    ?line runner:recv_eot(P),
+    ok.
+
+
+%%% Interface functions for erl_interface functions.
+
+erl_connect(P, Node, Num, Cookie, Creation) ->
+    send_command(P, erl_connect, [Num, Node, Cookie, Creation]),
+    case get_term(P) of
+	{term,{Fd,_}} when Fd >= 0 -> {ok,Fd};
+	{term,{-1,Errno}} -> {error,Errno}
+    end.
+
+erl_close_connection(P, FD) ->
+    send_command(P, erl_close_connection, [FD]),
+    case get_term(P) of
+	{term,Int} when is_integer(Int) -> Int
+    end.
+
+erl_global_register(P, Fd, Name) ->
+    send_command(P, erl_global_register, [Fd,Name]),
+    get_send_result(P).
+
+erl_global_whereis(P, Fd, Name) ->
+    send_command(P, erl_global_whereis, [Fd,Name]),
+    get_send_result(P).
+
+erl_global_names(P, Fd) ->
+    send_command(P, erl_global_names, [Fd]),
+    get_send_result(P).
+
+erl_global_unregister(P, Fd, Name) ->
+    send_command(P, erl_global_unregister, [Fd,Name]),
+    get_send_result(P).
+
+get_send_result(P) ->
+    case get_term(P) of
+	{term,{1,_}} -> ok;
+	{term,{0, 0}} -> ok;
+	{term,{-1, Errno}} -> {error,Errno};
+	{term,{_,_}}->
+	    ?t:fail(bad_return_value)
+    end.
+
+send_command(P, Name, Args) ->
+    runner:send_term(P, {Name,list_to_tuple(Args)}).
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
new file mode 100644
index 0000000000..8e3fcb924e
--- /dev/null
+++ b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.first
@@ -0,0 +1,21 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+erl_global_test_decl.c: erl_global_test.c
+	erl -noinput -pa ../all_SUITE_data -s init_tc run erl_global_test -s erlang halt
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..ef846bc440
--- /dev/null
+++ b/lib/erl_interface/test/erl_global_SUITE_data/Makefile.src
@@ -0,0 +1,41 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+include @erl_interface_mk_include@@DS@eidefs.mk
+
+CC0 = @CC@
+CC = ..@DS@all_SUITE_data@DS@gccifier@exe@ -CC"$(CC0)"
+LD = @LD@
+LIBPATH = @erl_interface_libpath@
+LIBERL = $(LIBPATH)/@erl_interface_lib@
+LIBEI = $(LIBPATH)/@erl_interface_eilib@
+LIBFLAGS = ../all_SUITE_data/runner@obj@ \
+	$(LIBERL) $(LIBEI) @LIBS@ @erl_interface_sock_libs@ \
+	@erl_interface_threadlib@
+CFLAGS = @EI_CFLAGS@ $(THR_DEFS) -I@erl_interface_include@ -I../all_SUITE_data
+OBJS = erl_global_test@obj@ erl_global_test_decl@obj@
+
+all: erl_global_test@exe@
+
+erl_global_test@exe@: $(OBJS) $(LIBERL) $(LIBEI)
+	$(LD) @CROSSLDFLAGS@ -o $@ $(OBJS) $(LIBFLAGS)
+
+clean:
+	$(RM) $(OBJS)
+	$(RM) erl_global_test@exe@
diff --git a/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c
new file mode 100644
index 0000000000..fc698ca0c4
--- /dev/null
+++ b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c
@@ -0,0 +1,263 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+/*
+ * Purpose: Tests the functions in erl_global.c.
+ *
+ * See the erl_global_SUITE.erl file for a "table of contents".
+ */
+
+#include 
+#include 
+#include 
+
+#include "runner.h"
+
+static void cmd_erl_connect(ETERM* args);
+static void cmd_erl_global_register(ETERM *args);
+static void cmd_erl_global_whereis(ETERM *args);
+static void cmd_erl_global_names(ETERM *args);
+static void cmd_erl_global_unregister(ETERM *args);
+static void cmd_erl_close_connection(ETERM *args);
+
+static void send_errno_result(int value);
+
+static struct {
+    char* name;
+    int num_args;		/* Number of arguments. */
+    void (*func)(ETERM* args);
+} commands[] = {
+    "erl_connect", 	     4, cmd_erl_connect,
+    "erl_close_connection",  1, cmd_erl_close_connection,
+    "erl_global_register",   2, cmd_erl_global_register,
+    "erl_global_whereis",    1, cmd_erl_global_whereis,
+    "erl_global_names",      0, cmd_erl_global_names,
+    "erl_global_unregister", 2, cmd_erl_global_unregister,
+};
+
+
+/*
+ * Sends a list contaning all data types to the Erlang side.
+ */
+
+TESTCASE(interpret)
+{
+    ETERM* term;
+
+    erl_init(NULL, 0);
+
+    outer_loop:
+
+    term = get_term();
+
+    if (term == NULL) {
+	report(1);
+	return;
+    } else {
+	ETERM* Func;
+	ETERM* Args;
+	int i;
+
+	if (!ERL_IS_TUPLE(term) || ERL_TUPLE_SIZE(term) != 2) {
+	    fail("term should be a tuple of size 2");
+	}
+
+	Func = erl_element(1, term);
+	if (!ERL_IS_ATOM(Func)) {
+	    fail("function name should be an atom");
+	}
+	Args = erl_element(2, term);
+	if (!ERL_IS_TUPLE(Args)) {
+	    fail("function arguments should be a tuple");
+	}
+	erl_free_term(term);
+	for (i = 0; i < sizeof(commands)/sizeof(commands[0]); i++) {
+	    int n = strlen(commands[i].name);
+	    if (ERL_ATOM_SIZE(Func) != n) {
+		continue;
+	    }
+	    if (memcmp(ERL_ATOM_PTR(Func), commands[i].name, n) == 0) {
+		erl_free_term(Func);
+		if (ERL_TUPLE_SIZE(Args) != commands[i].num_args) {
+		    fail("wrong number of arguments");
+		}
+		commands[i].func(Args);
+		erl_free_term(Args);
+		goto outer_loop;
+	    }
+	}
+	fail("bad command");
+    }
+}
+
+#define VERIFY_TYPE(Test, Term)		        \
+if (!Test(Term)) { 				\
+    fail("wrong type for " #Term);		\
+} else {					\
+}
+
+static void
+cmd_erl_connect(ETERM* args)
+{
+    ETERM* number;
+    ETERM* node;
+    ETERM* cookie;
+
+    int res;
+    char buffer[256];
+
+    number = ERL_TUPLE_ELEMENT(args, 0);
+    VERIFY_TYPE(ERL_IS_INTEGER, number);
+    node = ERL_TUPLE_ELEMENT(args, 1);
+    VERIFY_TYPE(ERL_IS_ATOM, node);
+    cookie = ERL_TUPLE_ELEMENT(args, 2);
+    VERIFY_TYPE(ERL_IS_ATOM, cookie);
+
+    if (ERL_ATOM_SIZE(cookie) == 0) {
+	res = erl_connect_init(ERL_INT_VALUE(number), 0, 0);
+    } else {
+	memcpy(buffer, ERL_ATOM_PTR(cookie), ERL_ATOM_SIZE(cookie));
+	buffer[ERL_ATOM_SIZE(cookie)] = '\0';
+	res = erl_connect_init(ERL_INT_VALUE(number), buffer, 0);
+    }
+
+    if(!res) {
+	send_errno_result(res);
+	return;
+    }
+
+    memcpy(buffer, ERL_ATOM_PTR(node), ERL_ATOM_SIZE(node));
+    buffer[ERL_ATOM_SIZE(node)] = '\0';
+    send_errno_result(erl_connect(buffer));
+}
+
+static void
+cmd_erl_close_connection(ETERM* args)
+{
+    ETERM* number;
+    ETERM* res;
+
+    number = ERL_TUPLE_ELEMENT(args, 0);
+    VERIFY_TYPE(ERL_IS_INTEGER, number);
+    res = erl_mk_int(erl_close_connection(ERL_INT_VALUE(number)));
+    send_term(res);
+    erl_free_term(res);
+}
+
+static void
+cmd_erl_global_register(ETERM* args)
+{
+    ETERM* fd_term = ERL_TUPLE_ELEMENT(args, 0);
+    ETERM* name = ERL_TUPLE_ELEMENT(args, 1);
+    ETERM* pid = erl_mk_pid(erl_thisnodename(), 14, 0, 0);
+
+    char buffer[256];
+
+    VERIFY_TYPE(ERL_IS_INTEGER, fd_term);
+    VERIFY_TYPE(ERL_IS_ATOM, name);
+
+    memcpy(buffer, ERL_ATOM_PTR(name), ERL_ATOM_SIZE(name));
+    buffer[ERL_ATOM_SIZE(name)] = '\0';
+
+    send_errno_result(erl_global_register(ERL_INT_VALUE(fd_term), buffer, pid));
+    erl_free_term(pid);
+}
+
+static void
+cmd_erl_global_whereis(ETERM* args)
+{
+    ETERM* fd_term = ERL_TUPLE_ELEMENT(args, 0);
+    ETERM* name = ERL_TUPLE_ELEMENT(args, 1);
+    ETERM* pid = NULL;
+
+    char buffer[256];
+
+    VERIFY_TYPE(ERL_IS_INTEGER, fd_term);
+    VERIFY_TYPE(ERL_IS_ATOM, name);
+
+    memcpy(buffer, ERL_ATOM_PTR(name), ERL_ATOM_SIZE(name));
+    buffer[ERL_ATOM_SIZE(name)] = '\0';
+
+    pid = erl_global_whereis(ERL_INT_VALUE(fd_term), buffer, NULL);
+    send_term(pid);
+    erl_free_term(pid);
+}
+
+static void
+cmd_erl_global_names(ETERM* args)
+{
+    ETERM* fd_term = ERL_TUPLE_ELEMENT(args, 0);
+
+    ETERM* res_array[2], *res_tuple, *name;
+    char** names = NULL;
+    int count = 0, i;
+
+    VERIFY_TYPE(ERL_IS_INTEGER, fd_term);
+
+    names = erl_global_names(ERL_INT_VALUE(fd_term), &count);
+
+    res_array[0] = erl_mk_empty_list();
+    for(i=0; i
Date: Fri, 10 Dec 2010 16:38:13 +0200
Subject: Fix wrong erl_compare_ext result comparing lists

Function erl_compare_ext of erl_interface library returns
1 instead -1 when comparing lists like [0] and [0, 1000].

Credits to: Evgeny Khirin  erlios.com>
---
 lib/erl_interface/src/legacy/erl_marshal.c           | 13 ++++++++-----
 lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c | 12 ++++++++++++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index a6c2f64dd0..70949a7adf 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -1646,11 +1646,14 @@ static int cmp_exe2(unsigned char **e1, unsigned char **e2)
       min = (i < j) ? i : j;
       k = 0;
       while (1) {
-	if (k++ == min)
-	  return compare_top_ext(e1 , e2);
-	if ((ret = compare_top_ext(e1 , e2)) == 0) 
-	  continue;
-	return ret;
+	  if (k++ == min){
+	      if (i == j) return 0;
+	      if (i < j) return -1;
+	      return 1;
+	  }
+	  if ((ret = compare_top_ext(e1 , e2)) == 0)
+	      continue;
+	  return ret;
       }
     case ERL_STRING_EXT:
       i = (**e1 << 8) | ((*e1)[1]);
diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
index ba1a6c66da..59e0e0cce7 100644
--- a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
+++ b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
@@ -82,6 +82,11 @@ TESTCASE(compare_list) {
     // erlang:term_to_binary([34,{a,n},a,erlang])
     unsigned char term2[] = {131,108,0,0,0,4,97,34,104,2,100,0,1,97,100,0,1,110,100,0,1,97,100,0,6,101,114,108,97,110,103,106};
 
+    // erlang:term_to_binary([0])
+    unsigned char term3[] = {131,107,0,1,0};
+    // erlang:term_to_binary([0, 1000])
+    unsigned char term4[] = {131,108,0,0,0,2,97,0,98,0,0,3,232,106};
+
     erl_init(NULL, 0);
     start_a = term1;
     start_b = term2;
@@ -90,6 +95,13 @@ TESTCASE(compare_list) {
     
     test_compare_ext("lists", start_a, end_a, start_b, end_b, 1);
 
+    start_a = term3;
+    start_b = term4;
+    end_a   = term3 + sizeof(term3);
+    end_b   = term4 + sizeof(term4);
+
+    test_compare_ext("lists1", start_a, end_a, start_b, end_b, -1);
+
     report(1);
 }
 
-- 
cgit v1.2.3


From e10e306098b6f331ec683147e34a4a745900c144 Mon Sep 17 00:00:00 2001
From: Niclas Eklund 
Date: Fri, 10 Dec 2010 16:53:50 +0100
Subject: The SSL option {ssl_imp, old} was not used if ssl_generation was set
 to 2. Only R14B was affected by this.

---
 lib/orber/doc/src/notes.xml    | 14 ++++++++++++++
 lib/orber/src/orber_socket.erl | 16 +++-------------
 lib/orber/vsn.mk               | 26 +-------------------------
 3 files changed, 18 insertions(+), 38 deletions(-)

diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index 6eda16a517..64db43921a 100644
--- a/lib/orber/doc/src/notes.xml
+++ b/lib/orber/doc/src/notes.xml
@@ -32,6 +32,20 @@
     notes.xml
   
+
+ Orber 3.6.19 +
+ Fixed Bugs and Malfunctions + + +

The SSL option {ssl_imp, old} was not used if ssl_generation was + set to 2. Only R14B was affected by this.

+

Own Id: OTP-8994 Aux Id: seq11747

+
+
+
+
+
Orber 3.6.18
diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl index af6df01b7d..84ed193ebb 100644 --- a/lib/orber/src/orber_socket.erl +++ b/lib/orber/src/orber_socket.erl @@ -496,27 +496,17 @@ check_port(Port, _, _) -> %%----------------------------------------------------------------- %% Check Options. -%% We need this as a work-around since the SSL-app doesn't allow us -%% to pass 'inet' as an option. Also needed for R9B :-( check_options(normal, Options, _Generation) -> - case orber:ip_version() of - inet -> - Options; - inet6 -> - %% Necessary for R9B. Should be [orber:ip_version()|Options]; - [inet6|Options] - end; + [orber:ip_version()|Options]; check_options(ssl, Options, Generation) -> case orber:ip_version() of inet when Generation > 2 -> [{ssl_imp, new}|Options]; inet -> - Options; + [{ssl_imp, old}|Options]; inet6 when Generation > 2 -> [{ssl_imp, new}, inet6|Options]; inet6 -> - %% Will fail until SSL supports this option. - %% Note, we want this happen! - [inet6|Options] + [{ssl_imp, old}, inet6|Options] end. diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk index c405326e9a..c265db188f 100644 --- a/lib/orber/vsn.mk +++ b/lib/orber/vsn.mk @@ -1,27 +1,3 @@ -ORBER_VSN = 3.6.18 +ORBER_VSN = 3.6.19 -TICKETS = OTP-8900 - -TICKETS_3.6.17 = OTP-8840 - -TICKETS_3.6.16 = OTP-8543 \ - OTP-8489 - -TICKETS_3.6.15 = OTP-8353 \ - OTP-8354 \ - OTP-8374 \ - OTP-8409 \ - OTP-8448 - -TICKETS_3.6.14 = OTP-8201 - -TICKETS_3.6.14 = OTP-8201 - -TICKETS_3.6.13 = OTP-7987 - -TICKETS_3.6.12 = OTP-7906 - -TICKETS_3.6.11 = OTP-7837 - -TICKETS_3.6.10 = OTP-7595 -- cgit v1.2.3 From 8e9ef38dd36c771dff0d477fa7999d34b72e8a7a Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 10 Dec 2010 17:50:38 +0100 Subject: Added counter (variables) for usm. Also added config file for usm. And more sed'ing... --- lib/snmp/src/agent/snmp_framework_mib.erl | 12 +++++ lib/snmp/src/agent/snmp_user_based_sm_mib.erl | 55 ++++++++++++++++++++++ lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 4 ++ lib/snmp/src/agent/snmpa.erl | 22 +++++++-- lib/snmp/test/test_config/.gitignore | 1 + lib/snmp/test/test_config/Makefile | 26 ++++++++-- lib/snmp/test/test_config/agent/agent.conf.src | 2 +- lib/snmp/test/test_config/agent/usm.conf.src | 17 +++++++ lib/snmp/test/test_config/manager/manager.conf.src | 2 +- lib/snmp/test/test_config/manager/usm.conf.src | 1 + lib/snmp/test/test_config/modules.mk | 1 + lib/snmp/test/test_config/sys-agent.config.src | 2 +- lib/snmp/test/test_config/sys.config.src | 4 +- 13 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 lib/snmp/test/test_config/agent/usm.conf.src diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl index d9bf7e8551..0d7866d94d 100644 --- a/lib/snmp/src/agent/snmp_framework_mib.erl +++ b/lib/snmp/src/agent/snmp_framework_mib.erl @@ -373,15 +373,27 @@ intAgentUDPPort(Op) -> intAgentIpAddress(Op) -> snmp_generic:variable_func(Op, db(intAgentIpAddress)). +snmpEngineID(print) -> + VarAndValue = [{snmpEngineID, snmpEngineID(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineID(Op) -> snmp_generic:variable_func(Op, db(snmpEngineID)). +snmpEngineMaxMessageSize(print) -> + VarAndValue = [{snmpEngineMaxMessageSize, snmpEngineMaxMessageSize(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineMaxMessageSize(Op) -> snmp_generic:variable_func(Op, db(snmpEngineMaxMessageSize)). +snmpEngineBoots(print) -> + VarAndValue = [{snmpEngineBoots, snmpEngineBoots(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineBoots(Op) -> snmp_generic:variable_func(Op, db(snmpEngineBoots)). +snmpEngineTime(print) -> + VarAndValue = [{snmpEngineTime, snmpEngineTime(get)}], + snmpa_mib_lib:print_variables(VarAndValue); snmpEngineTime(get) -> {value, get_engine_time()}. diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl index 4c3f27c4ef..69cebc858b 100644 --- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl +++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl @@ -26,6 +26,12 @@ table_next/2, is_engine_id_known/1, get_user/2, get_user_from_security_name/2, mk_key_change/3, mk_key_change/5, extract_new_key/3, mk_random/1]). +-export([usmStatsUnsupportedSecLevels/1, + usmStatsNotInTimeWindows/1, + usmStatsUnknownUserNames/1, + usmStatsUnknownEngineIDs/1, + usmStatsWrongDigests/1, + usmStatsDecryptionErrors/1]). -export([add_user/1, add_user/13, delete_user/1]). %% Internal @@ -303,6 +309,54 @@ gc_tabs() -> %%----------------------------------------------------------------- %% Counter functions %%----------------------------------------------------------------- + +usmStatsUnsupportedSecLevels(print) -> + VarAndValue = [{usmStatsUnsupportedSecLevels, + usmStatsUnsupportedSecLevels(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnsupportedSecLevels(get) -> + get_counter(usmStatsUnsupportedSecLevels). + +usmStatsNotInTimeWindows(print) -> + VarAndValue = [{usmStatsNotInTimeWindows, usmStatsNotInTimeWindows(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsNotInTimeWindows(get) -> + get_counter(usmStatsNotInTimeWindows). + +usmStatsUnknownUserNames(print) -> + VarAndValue = [{usmStatsUnknownUserNames, usmStatsUnknownUserNames(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnknownUserNames(get) -> + get_counter(usmStatsUnknownUserNames). + +usmStatsUnknownEngineIDs(print) -> + VarAndValue = [{usmStatsUnknownEngineIDs, usmStatsUnknownEngineIDs(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsUnknownEngineIDs(get) -> + get_counter(usmStatsUnknownEngineIDs). + +usmStatsWrongDigests(print) -> + VarAndValue = [{usmStatsWrongDigests, usmStatsWrongDigests(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsWrongDigests(get) -> + get_counter(usmStatsWrongDigests). + +usmStatsDecryptionErrors(print) -> + VarAndValue = [{usmStatsDecryptionErrors, usmStatsDecryptionErrors(get)}], + snmpa_mib_lib:print_variables(VarAndValue); +usmStatsDecryptionErrors(get) -> + get_counter(usmStatsDecryptionErrors). + + +get_counter(Name) -> + case (catch ets:lookup(snmp_agent_table, Name)) of + [{_, Val}] -> + {value, Val}; + _ -> + genErr + end. + + init_vars() -> lists:map(fun maybe_create_var/1, vars()). maybe_create_var(Var) -> @@ -323,6 +377,7 @@ vars() -> usmStatsDecryptionErrors ]. + %%----------------------------------------------------------------- %% API functions %%----------------------------------------------------------------- diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 659babaf94..74acda2f21 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -749,6 +749,7 @@ do_get_next(RowIndex, Cols) -> end end. + %%----------------------------------------------------------------- %% Functions to manipulate vacmAccessRows. %%----------------------------------------------------------------- @@ -939,6 +940,9 @@ do_get_vacmAccessTable(Key0, Acc) -> end. +%%----------------------------------------------------------------- +%% Wrappers +%%----------------------------------------------------------------- db(X) -> snmpa_agent:db(X). volatile_db(X) -> {X, volatile}. diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 3c214874fe..22fbd33add 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -327,6 +327,16 @@ mibs_info() -> snmpOutTraps ] }, + {snmp_framework_mib, + [ + ], + [ + snmpEngineID, + snmpEngineBoots, + snmpEngineTime, + snmpEngineMaxMessageSize + ] + }, {snmp_view_based_acm_mib, [ vacmAccessTable, @@ -362,7 +372,13 @@ mibs_info() -> usmUserTable ], [ - usmUserSpinLock + usmUserSpinLock, + usmStatsUnsupportedSecLevels, + usmStatsNotInTimeWindows, + usmStatsUnknownUserNames, + usmStatsUnknownEngineIDs, + usmStatsWrongDigests, + usmStatsDecryptionErrors ] } ]. @@ -441,8 +457,8 @@ make_pretty_mib(snmp_notification_mib) -> "SNMP-NOTIFICATION-MIB"; make_pretty_mib(snmp_user_based_sm_mib) -> "SNMP-USER-BASED-SM-MIB"; -make_pretty_mib(snmp_standard_mib) -> - "STANDARD-MIB"; +make_pretty_mib(snmp_framework_mib) -> + "SNMP-FRAMEWORK-MIB"; make_pretty_mib(Mod) -> atom_to_list(Mod). diff --git a/lib/snmp/test/test_config/.gitignore b/lib/snmp/test/test_config/.gitignore index 60d564fe4d..fc2d5dbadf 100644 --- a/lib/snmp/test/test_config/.gitignore +++ b/lib/snmp/test/test_config/.gitignore @@ -11,6 +11,7 @@ /agent/standard.conf /agent/target_addr.conf /agent/target_params.conf +/agent/usm.conf /agent/vacm.conf # Manager config files (Generated) diff --git a/lib/snmp/test/test_config/Makefile b/lib/snmp/test/test_config/Makefile index c02bb5c601..4953de7fe8 100644 --- a/lib/snmp/test/test_config/Makefile +++ b/lib/snmp/test/test_config/Makefile @@ -94,6 +94,22 @@ ifeq ($(SYS_NAME),) SYS_NAME = FOO endif +ifeq ($(AGENT_ENGINE_ID),) +AGENT_ENGINE_ID = Agent engine of $(USER) +endif + +ifeq ($(AGENT_USM_ENGINE_ID),) +AGENT_USM_ENGINE_ID = $(AGENT_ENGINE_ID) +endif + +ifeq ($(MANAGER_ENGINE_ID),) +MANAGER_ENGINE_ID = Manager engine of $(USER) +endif + +ifeq ($(MANAGER_USM_ENGINE_ID),) +MANAGER_USM_ENGINE_ID = $(MANAGER_ENGINE_ID) +endif + # ---------------------------------------------------- @@ -119,11 +135,15 @@ agent/%.conf: agent/%.conf.src -e 's?%SYS_CONTACT%?$(SYS_CONTACT)? ' \ -e 's?%SYS_LOCATION%?$(SYS_LOCATION)? ' \ -e 's?%SYS_NAME%?$(SYS_NAME)? ' \ - -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' < $< > $@ + -e 's?%TARGET_NAME_PRE%?$(TARGET_NAME_PRE)? ' \ + -e 's?%ENGINE_ID%?\"$(AGENT_ENGINE_ID)\"? ' \ + -e 's?%USM_ENGINE_ID%?\"$(AGENT_USM_ENGINE_ID)\"? ' < $< > $@ manager/%.conf: manager/%.conf.src @echo "$< -> $@" - $(PERL) -p -e 's?%ADDR%?$(ADDR)? ' < $< > $@ + sed -e 's?%ADDR%?$(ADDR)? ' \ + -e 's?%ENGINE_ID%?\"$(MANAGER_ENGINE_ID)\"? ' \ + -e 's?%USM_ENGINE_ID%?\"$(MANAGER_USM_ENGINE_ID)\"? ' < $< > $@ # ---------------------------------------------------- @@ -133,7 +153,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: -release_tests_spec: opt +release_tests_spec: clean opt $(INSTALL_DIR) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) $(INSTALL_DIR) $(RELSYSDIR)/agent diff --git a/lib/snmp/test/test_config/agent/agent.conf.src b/lib/snmp/test/test_config/agent/agent.conf.src index 2977cd49f8..1fe95cc72d 100644 --- a/lib/snmp/test/test_config/agent/agent.conf.src +++ b/lib/snmp/test/test_config/agent/agent.conf.src @@ -15,5 +15,5 @@ {intAgentUDPPort, 4000}. {intAgentIpAddress, %ADDR%}. -{snmpEngineID, "foo"}. +{snmpEngineID, %ENGINE_ID%}. {snmpEngineMaxMessageSize, 484}. diff --git a/lib/snmp/test/test_config/agent/usm.conf.src b/lib/snmp/test/test_config/agent/usm.conf.src new file mode 100644 index 0000000000..0409084048 --- /dev/null +++ b/lib/snmp/test/test_config/agent/usm.conf.src @@ -0,0 +1,17 @@ +%% This file defines the security parameters for the user-based +%% security model. +%% The data is inserted into the usmUserTable defined +%% in SNMP-USER-BASED-SM-MIB. +%% Each row is a 13-tuple: +%% {EngineID, UserName, SecName, Clone, AuthP, AuthKeyC, OwnAuthKeyC, +%% PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey}. +%% For example +%% {"agentEngine", "initial", "initial", zeroDotZero, +%% usmNoAuthProtocol, "", "", usmNoPrivProtocol, "", "", "", +%% "", ""}. +%% + + +{%USM_ENGINE_ID%, "initial", "initial", zeroDotZero, usmHMACMD5AuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [160,66,33,136,178,59,246,214,102,63,131,131,54,14,221,177], ""}. +{%USM_ENGINE_ID%, "templateMD5", "templateMD5", zeroDotZero, usmHMACMD5AuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [160,66,33,136,178,59,246,214,102,63,131,131,54,14,221,177], ""}. +{%USM_ENGINE_ID%, "templateSHA", "templateSHA", zeroDotZero, usmHMACSHAAuthProtocol, "", "", usmNoPrivProtocol, "", "", "", [199,94,239,13,229,135,141,77,124,129,65,189,230,240,115,163,239,15,13,242], ""}. diff --git a/lib/snmp/test/test_config/manager/manager.conf.src b/lib/snmp/test/test_config/manager/manager.conf.src index 7d4104ded2..c38a61b13c 100644 --- a/lib/snmp/test/test_config/manager/manager.conf.src +++ b/lib/snmp/test/test_config/manager/manager.conf.src @@ -12,5 +12,5 @@ {port, 5000}. {address, %ADDR%}. -{engine_id, "foo"}. +{engine_id, %ENGINE_ID%}. {max_message_size, 484}. diff --git a/lib/snmp/test/test_config/manager/usm.conf.src b/lib/snmp/test/test_config/manager/usm.conf.src index 39122cab5c..a558c86710 100644 --- a/lib/snmp/test/test_config/manager/usm.conf.src +++ b/lib/snmp/test/test_config/manager/usm.conf.src @@ -5,4 +5,5 @@ %% {EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey} %% +{%USM_ENGINE_ID%, "initial", usmNoAuthProtocol, "", usmNoPrivProtocol, ""}. diff --git a/lib/snmp/test/test_config/modules.mk b/lib/snmp/test/test_config/modules.mk index ee8b68d4eb..3d084cef01 100644 --- a/lib/snmp/test/test_config/modules.mk +++ b/lib/snmp/test/test_config/modules.mk @@ -30,6 +30,7 @@ AGENT_CONFIG_FILES = \ agent/standard.conf \ agent/target_addr.conf \ agent/target_params.conf \ + agent/usm.conf \ agent/vacm.conf MANAGER_CONFIG_FILES = \ diff --git a/lib/snmp/test/test_config/sys-agent.config.src b/lib/snmp/test/test_config/sys-agent.config.src index eb6b0916ff..46a458203d 100644 --- a/lib/snmp/test/test_config/sys-agent.config.src +++ b/lib/snmp/test/test_config/sys-agent.config.src @@ -5,7 +5,7 @@ {agent, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, %% {agent_mib_storage, volatile}, diff --git a/lib/snmp/test/test_config/sys.config.src b/lib/snmp/test/test_config/sys.config.src index 7e4e3b0acd..b2cd399883 100644 --- a/lib/snmp/test/test_config/sys.config.src +++ b/lib/snmp/test/test_config/sys.config.src @@ -5,7 +5,7 @@ {agent, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {db_dir, "%DIR%/agent/db"}, {mib_storage, ets}, {agent_mib_storage, volatile}, @@ -38,7 +38,7 @@ {manager, [ {priority, normal}, - {versions, [v2]}, + {versions, [v1,v2,v3]}, {config, [{dir, "%DIR%/manager/conf"}, {verbosity, silence}, {db_dir, "%DIR%/manager/db"}, -- cgit v1.2.3 From 8b92ac49d021b4634d660c5b2637c3ebec0f1d9f Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Mon, 13 Dec 2010 15:37:43 +0200 Subject: Fix native code compiler infinite loop and update type info for 're' The introduction of filenames being unicode binaries revealed a problem in the type analysis of the native code compiler which resulted in an infinite loop when compiling the 'filename' module. In addition, the hard-coded type information for the built-in functions of the 're' module was out-of-date, which resulted in erroneous type information for 'filelib' functions being stored in the PLT. --- lib/hipe/cerl/erl_bif_types.erl | 23 ++++++++++++----------- lib/hipe/cerl/erl_types.erl | 28 +++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index ed5bf03804..eba95dc6af 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -48,6 +48,7 @@ t_boolean/0, t_byte/0, t_char/0, + t_charlist/0, t_cons/0, t_cons/2, t_cons_hd/1, @@ -4517,11 +4518,11 @@ arg_types(os, timestamp, 0) -> arg_types(re, compile, 1) -> [t_iodata()]; arg_types(re, compile, 2) -> - [t_iodata(), t_list(t_re_compile_option())]; + [t_sup(t_iodata(), t_charlist()), t_list(t_re_compile_option())]; arg_types(re, run, 2) -> - [t_iodata(), t_re_RE()]; + [t_sup(t_iodata(), t_charlist()), t_re_RE()]; arg_types(re, run, 3) -> - [t_iodata(), t_re_RE(), t_list(t_re_run_option())]; + [t_sup(t_iodata(), t_charlist()), t_re_RE(), t_list(t_re_run_option())]; %%------- string -------------------------------------------------------------- arg_types(string, chars, 2) -> [t_char(), t_non_neg_integer()]; @@ -4978,8 +4979,7 @@ t_ets_info_items() -> %% ===================================================================== t_prim_file_name() -> - t_sup([t_string(), - t_binary()]). + t_sup(t_string(), t_binary()). %% ===================================================================== %% These are used for the built-in functions of 'gen_tcp' @@ -5136,13 +5136,14 @@ t_re_MP() -> %% it's supposed to be an opaque data type t_tuple([t_atom('re_pattern'), t_integer(), t_integer(), t_binary()]). t_re_RE() -> - t_sup(t_re_MP(), t_iodata()). + t_sup([t_re_MP(), t_iodata(), t_charlist()]). t_re_compile_option() -> - t_sup([t_atoms(['anchored', 'caseless', 'dollar_endonly', 'dotall', - 'extended', 'firstline', 'multiline', 'no_auto_capture', - 'dupnames', 'ungreedy']), - t_tuple([t_atom('newline'), t_re_NLSpec()])]). + t_sup([t_atoms(['unicode', 'anchored', 'caseless', 'dollar_endonly', + 'dotall', 'extended', 'firstline', 'multiline', + 'no_auto_capture', 'dupnames', 'ungreedy']), + t_tuple([t_atom('newline'), t_re_NLSpec()]), + t_atoms(['bsr_anycrlf', 'bsr_unicode'])]). t_re_run_option() -> t_sup([t_atoms(['anchored', 'global', 'notbol', 'noteol', 'notempty']), @@ -5159,7 +5160,7 @@ t_re_Type() -> t_atoms(['index', 'list', 'binary']). t_re_NLSpec() -> - t_atoms(['cr', 'crlf', 'lf', 'anycrlf']). + t_atoms(['cr', 'crlf', 'lf', 'anycrlf', 'any']). t_re_ValueSpec() -> t_sup(t_atoms(['all', 'all_but_first', 'first', 'none']), t_re_ValueList()). diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 1ed85af172..c8dc162457 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -62,6 +62,7 @@ t_boolean/0, t_byte/0, t_char/0, + t_charlist/0, t_collect_vars/1, t_cons/0, t_cons/2, @@ -1455,6 +1456,21 @@ t_is_tuple(_) -> false. %% Non-primitive types, including some handy syntactic sugar types %% +-spec t_charlist() -> erl_type(). + +t_charlist() -> + t_charlist(1). + +-spec t_charlist(non_neg_integer()) -> erl_type(). + +t_charlist(N) when N > 0 -> + t_maybe_improper_list(t_sup([t_unicode_char(), + t_unicode_binary(), + t_charlist(N-1)]), + t_sup(t_unicode_binary(), t_nil())); +t_charlist(0) -> + t_maybe_improper_list(t_any(), t_sup(t_unicode_binary(), t_nil())). + -spec t_constant() -> erl_type(). t_constant() -> @@ -1549,6 +1565,16 @@ t_parameterized_module() -> t_timeout() -> t_sup(t_non_neg_integer(), t_atom('infinity')). +-spec t_unicode_binary() -> erl_type(). + +t_unicode_binary() -> + t_binary(). % with characters encoded in UTF-8 coding standard + +-spec t_unicode_char() -> erl_type(). + +t_unicode_char() -> + t_integer(). % representing a valid unicode codepoint + %%----------------------------------------------------------------------------- %% Some built-in opaque types %% @@ -2825,7 +2851,7 @@ t_subtract(?list(Contents1, Termination1, Size1) = T, true -> case {Size1, Size2} of {?nonempty_qual, ?unknown_qual} -> ?none; - {?unknown_qual, ?nonempty_qual} -> Termination1; + {?unknown_qual, ?nonempty_qual} -> ?nil; {S, S} -> ?none end; false -> -- cgit v1.2.3 From c5377779548f706c7c82be38fdd9b16551100c38 Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Mon, 13 Dec 2010 15:12:28 +0000 Subject: Fixes to the dict module documentation Fixed grammar and one inconsistency (Key - Value instead of key/value, since everywhere else the former is used). --- lib/stdlib/doc/src/dict.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/stdlib/doc/src/dict.xml b/lib/stdlib/doc/src/dict.xml index ebcd2eed09..1695e9d14f 100644 --- a/lib/stdlib/doc/src/dict.xml +++ b/lib/stdlib/doc/src/dict.xml @@ -165,8 +165,8 @@ dictionary() Dict = dictionary() -

This function converts the key/value list List to a - dictionary.

+

This function converts the Key - Value list + List to a dictionary.

@@ -270,7 +270,7 @@ merge(Fun, D1, D2) -> Dict1 = Dict2 = dictionary() -

Update the a value in a dictionary by calling Fun on +

Update a value in a dictionary by calling Fun on the value to get a new value. An exception is generated if Key is not present in the dictionary.

@@ -285,7 +285,7 @@ merge(Fun, D1, D2) -> Dict1 = Dict2 = dictionary() -

Update the a value in a dictionary by calling Fun on +

Update a value in a dictionary by calling Fun on the value to get a new value. If Key is not present in the dictionary then Initial will be stored as the first value. For example append/3 could be defined -- cgit v1.2.3 From 18777e8f34979c4bc66ccd6930ed095a7a88891a Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Mon, 13 Dec 2010 18:05:44 +0000 Subject: Fixes to the orddict module documentation Fixed grammar and one inconsistency (Key - Value instead of key/value, since everywhere else the former is used). --- lib/stdlib/doc/src/orddict.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/stdlib/doc/src/orddict.xml b/lib/stdlib/doc/src/orddict.xml index 08c808f822..9d036f0725 100644 --- a/lib/stdlib/doc/src/orddict.xml +++ b/lib/stdlib/doc/src/orddict.xml @@ -172,8 +172,8 @@ ordered_dictionary() Orddict = ordered_dictionary() -

This function converts the key/value list List to a - dictionary.

+

This function converts the Key - Value list + List to a dictionary.

@@ -277,7 +277,7 @@ merge(Fun, D1, D2) -> Orddict1 = Orddict2 = ordered_dictionary() -

Update the a value in a dictionary by calling Fun on +

Update a value in a dictionary by calling Fun on the value to get a new value. An exception is generated if Key is not present in the dictionary.

@@ -292,7 +292,7 @@ merge(Fun, D1, D2) -> Orddict1 = Orddict2 = ordered_dictionary() -

Update the a value in a dictionary by calling Fun on +

Update a value in a dictionary by calling Fun on the value to get a new value. If Key is not present in the dictionary then Initial will be stored as the first value. For example append/3 could be defined -- cgit v1.2.3 From 81bebfd6c46d59ad62784120734c2ff2547184c1 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Tue, 14 Dec 2010 09:40:32 +0100 Subject: Fix segfault for NULL return value fields from getifaddrs() --- erts/emulator/drivers/common/inet_drv.c | 52 ++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 1382d1dfe4..818bc6334e 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -4945,39 +4945,45 @@ static int inet_ctl_getifaddrs(inet_descriptor* desc_p, *buf_p++ = '\0'; *buf_p++ = INET_IFOPT_FLAGS; put_int32(IFGET_FLAGS(ifa_p->ifa_flags), buf_p); buf_p += 4; - if (ifa_p->ifa_addr->sa_family == AF_INET + if (ifa_p->ifa_addr) { + if (ifa_p->ifa_addr->sa_family == AF_INET #if defined(AF_INET6) - || ifa_p->ifa_addr->sa_family == AF_INET6 + || ifa_p->ifa_addr->sa_family == AF_INET6 #endif - ) { - SOCKADDR_TO_BUF(INET_IFOPT_ADDR, ifa_p->ifa_addr); - BUF_ENSURE(1); - SOCKADDR_TO_BUF(INET_IFOPT_NETMASK, ifa_p->ifa_netmask); - if (ifa_p->ifa_flags & IFF_POINTOPOINT) { - BUF_ENSURE(1); - SOCKADDR_TO_BUF(INET_IFOPT_DSTADDR, ifa_p->ifa_dstaddr); - } else if (ifa_p->ifa_flags & IFF_BROADCAST) { - BUF_ENSURE(1); - SOCKADDR_TO_BUF(INET_IFOPT_BROADADDR, ifa_p->ifa_broadaddr); + ) { + SOCKADDR_TO_BUF(INET_IFOPT_ADDR, ifa_p->ifa_addr); + if (ifa_p->ifa_netmask) { + BUF_ENSURE(1); + SOCKADDR_TO_BUF(INET_IFOPT_NETMASK, ifa_p->ifa_netmask); + } + if (ifa_p->ifa_dstaddr && + (ifa_p->ifa_flags & IFF_POINTOPOINT)) { + BUF_ENSURE(1); + SOCKADDR_TO_BUF(INET_IFOPT_DSTADDR, ifa_p->ifa_dstaddr); + } else if (ifa_p->ifa_broadaddr && + (ifa_p->ifa_flags & IFF_BROADCAST)) { + BUF_ENSURE(1); + SOCKADDR_TO_BUF(INET_IFOPT_BROADADDR, ifa_p->ifa_broadaddr); + } } - } #if defined(AF_LINK) || defined(AF_PACKET) - else if ( + else if ( #if defined(AF_LINK) - ifa_p->ifa_addr->sa_family == AF_LINK + ifa_p->ifa_addr->sa_family == AF_LINK #else - 0 + 0 #endif #if defined(AF_PACKET) - || ifa_p->ifa_addr->sa_family == AF_PACKET + || ifa_p->ifa_addr->sa_family == AF_PACKET #endif - ) { - char *bp = buf_p; - BUF_ENSURE(1); - SOCKADDR_TO_BUF(INET_IFOPT_HWADDR, ifa_p->ifa_addr); - if (buf_p - bp < 4) buf_p = bp; /* Empty hwaddr */ - } + ) { + char *bp = buf_p; + BUF_ENSURE(1); + SOCKADDR_TO_BUF(INET_IFOPT_HWADDR, ifa_p->ifa_addr); + if (buf_p - bp < 4) buf_p = bp; /* Empty hwaddr */ + } #endif + } BUF_ENSURE(1); *buf_p++ = '\0'; } -- cgit v1.2.3 From 6bbe383ed4fd8fe4540b27b0b8ba7f7330fcf793 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 14 Dec 2010 15:38:13 +0100 Subject: Teach VM not to dump core on bad dist message structure --- erts/emulator/beam/dist.c | 156 +++++++++++----- erts/emulator/test/distribution_SUITE.erl | 291 ++++++++++++++++++++++++++---- 2 files changed, 358 insertions(+), 89 deletions(-) diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index 694460d702..fc400945b3 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -917,6 +917,7 @@ int erts_net_message(Port *prt, Eterm token_size; ErtsMonitor *mon; ErtsLink *lnk; + Uint tuple_arity; int res; #ifdef ERTS_DIST_MSG_DBG int orig_len = len; @@ -1003,29 +1004,23 @@ int erts_net_message(Port *prt, #endif if (is_not_tuple(arg) || - (tuple = tuple_val(arg), arityval(*tuple) < 1) || + (tuple = tuple_val(arg), (tuple_arity = arityval(*tuple)) < 1) || is_not_small(tuple[1])) { - erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf(); - erts_dsprintf(dsbufp, "Invalid distribution message: %.200T", arg); - erts_send_error_to_logger_nogl(dsbufp); - goto data_error; + goto invalid_message; } token_size = 0; switch (type = unsigned_val(tuple[1])) { case DOP_LINK: + if (tuple_arity != 3) { + goto invalid_message; + } from = tuple[2]; to = tuple[3]; /* local proc to link to */ if (is_not_pid(from) || is_not_pid(to)) { - erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf(); - PURIFY_MSG("data error"); - erts_dsprintf(dsbufp, - "Invalid DOP_LINK distribution message: %.200T", - arg); - erts_send_error_to_logger_nogl(dsbufp); - goto data_error; + goto invalid_message; } rp = erts_pid2proc_opt(NULL, 0, @@ -1064,8 +1059,14 @@ int erts_net_message(Port *prt, case DOP_UNLINK: { ErtsDistLinkData dld; + if (tuple_arity != 3) { + goto invalid_message; + } from = tuple[2]; to = tuple[3]; + if (is_not_pid(from) || is_not_pid(to)) { + goto invalid_message; + } rp = erts_pid2proc_opt(NULL, 0, to, ERTS_PROC_LOCK_LINK, @@ -1092,11 +1093,19 @@ int erts_net_message(Port *prt, /* A remote process wants to monitor us, we get: {DOP_MONITOR_P, Remote pid, local pid or name, ref} */ Eterm name; + + if (tuple_arity != 4) { + goto invalid_message; + } watcher = tuple[2]; watched = tuple[3]; /* local proc to monitor */ ref = tuple[4]; + if (is_not_ref(ref)) { + goto invalid_message; + } + if (is_atom(watched)) { name = watched; rp = erts_whereis_process(NULL, 0, @@ -1138,10 +1147,17 @@ int erts_net_message(Port *prt, We get {DOP_DEMONITOR_P, Remote pid, Local pid or name, ref}, We need only the ref of course */ + if (tuple_arity != 4) { + goto invalid_message; + } /* watcher = tuple[2]; */ /* watched = tuple[3]; May be an atom in case of monitor name */ ref = tuple[4]; + if(is_not_ref(ref)) { + goto invalid_message; + } + erts_smp_de_links_lock(dep); mon = erts_remove_monitor(&(dep->monitors),ref); erts_smp_de_links_unlock(dep); @@ -1170,6 +1186,10 @@ int erts_net_message(Port *prt, break; case DOP_REG_SEND_TT: + if (tuple_arity != 5) { + goto invalid_message; + } + token_size = size_object(tuple[5]); /* Fall through ... */ case DOP_REG_SEND: @@ -1180,12 +1200,19 @@ int erts_net_message(Port *prt, * There is intentionally no testing of the cookie (it is always '') * from R9B and onwards. */ + if (type != DOP_REG_SEND_TT && tuple_arity != 4) { + goto invalid_message; + } + #ifdef ERTS_DIST_MSG_DBG dist_msg_dbg(&ede, "MSG", buf, orig_len); #endif from = tuple[2]; to = tuple[4]; + if (is_not_pid(from) || is_not_atom(to)){ + goto invalid_message; + } rp = erts_whereis_process(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC); if (rp) { Uint xsize = (type == DOP_REG_SEND @@ -1217,6 +1244,10 @@ int erts_net_message(Port *prt, break; case DOP_SEND_TT: + if (tuple_arity != 4) { + goto invalid_message; + } + token_size = size_object(tuple[4]); /* Fall through ... */ case DOP_SEND: @@ -1227,8 +1258,13 @@ int erts_net_message(Port *prt, #ifdef ERTS_DIST_MSG_DBG dist_msg_dbg(&ede, "MSG", buf, orig_len); #endif - + if (type != DOP_SEND_TT && tuple_arity != 3) { + goto invalid_message; + } to = tuple[3]; + if (is_not_pid(to)) { + goto invalid_message; + } rp = erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC); if (rp) { Uint xsize = type == DOP_SEND ? 0 : ERTS_HEAP_FRAG_SIZE(token_size); @@ -1266,11 +1302,19 @@ int erts_net_message(Port *prt, Eterm sysname; ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_MSG_SEND|ERTS_PROC_LOCK_LINK; + if (tuple_arity != 5) { + goto invalid_message; + } + /* watched = tuple[2]; */ /* remote proc which died */ /* watcher = tuple[3]; */ ref = tuple[4]; reason = tuple[5]; + if(is_not_ref(ref)) { + goto invalid_message; + } + erts_smp_de_links_lock(dep); sysname = dep->sysname; mon = erts_remove_monitor(&(dep->monitors), ref); @@ -1317,24 +1361,25 @@ int erts_net_message(Port *prt, ErtsProcLocks rp_locks = ERTS_PROC_LOCK_LINK|ERTS_PROC_LOCKS_XSIG_SEND; /* 'from', which 'to' is linked to, died */ if (type == DOP_EXIT) { - from = tuple[2]; - to = tuple[3]; - reason = tuple[4]; - token = NIL; + if (tuple_arity != 4) { + goto invalid_message; + } + + from = tuple[2]; + to = tuple[3]; + reason = tuple[4]; + token = NIL; } else { - from = tuple[2]; - to = tuple[3]; - token = tuple[4]; - reason = tuple[5]; + if (tuple_arity != 5) { + goto invalid_message; + } + from = tuple[2]; + to = tuple[3]; + token = tuple[4]; + reason = tuple[5]; } - if (is_not_internal_pid(to)) { - erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf(); - PURIFY_MSG("data error"); - erts_dsprintf(dsbufp, - "Invalid DOP_EXIT distribution message: %.200T", - arg); - erts_send_error_to_logger_nogl(dsbufp); - goto data_error; + if (is_not_pid(from) || is_not_internal_pid(to)) { + goto invalid_message; } rp = erts_pid2proc(NULL, 0, to, rp_locks); @@ -1381,15 +1426,24 @@ int erts_net_message(Port *prt, ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND; /* 'from' is send an exit signal to 'to' */ if (type == DOP_EXIT2) { - from = tuple[2]; - to = tuple[3]; - reason = tuple[4]; - token = NIL; + if (tuple_arity != 4) { + goto invalid_message; + } + from = tuple[2]; + to = tuple[3]; + reason = tuple[4]; + token = NIL; } else { - from = tuple[2]; - to = tuple[3]; - token = tuple[4]; - reason = tuple[5]; + if (tuple_arity != 5) { + goto invalid_message; + } + from = tuple[2]; + to = tuple[3]; + token = tuple[4]; + reason = tuple[5]; + } + if (is_not_pid(from) || is_not_internal_pid(to)) { + goto invalid_message; } rp = erts_pid2proc_opt(NULL, 0, to, rp_locks, ERTS_P2P_FLG_SMP_INC_REFC); @@ -1408,10 +1462,14 @@ int erts_net_message(Port *prt, break; } case DOP_GROUP_LEADER: + if (tuple_arity != 3) { + goto invalid_message; + } from = tuple[2]; /* Group leader */ to = tuple[3]; /* new member */ - if (is_not_pid(from)) - break; + if (is_not_pid(from) || is_not_pid(to)) { + goto invalid_message; + } rp = erts_pid2proc(NULL, 0, to, ERTS_PROC_LOCK_MAIN); if (!rp) @@ -1420,16 +1478,8 @@ int erts_net_message(Port *prt, erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_MAIN); break; - default: { - erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf(); - erts_dsprintf(dsbufp, - "Illegal value in distribution dispatch switch: " - "%.200T", - arg); - erts_send_error_to_logger_nogl(dsbufp); - PURIFY_MSG("data error"); - goto data_error; - } + default: + goto invalid_message; } erts_cleanup_offheap(&off_heap); @@ -1441,8 +1491,14 @@ int erts_net_message(Port *prt, UnUseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE); ERTS_SMP_CHK_NO_PROC_LOCKS; return 0; - + invalid_message: + { + erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf(); + erts_dsprintf(dsbufp, "Invalid distribution message: %.200T", arg); + erts_send_error_to_logger_nogl(dsbufp); + } data_error: + PURIFY_MSG("data error"); erts_cleanup_offheap(&off_heap); #ifndef HYBRID /* FIND ME! */ if (ctl != ctl_default) { diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 79252d0593..4b44a2b420 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -39,6 +39,7 @@ atom_roundtrip/1, atom_roundtrip_r12b/1, contended_atom_cache_entry/1, + bad_dist_structure/1, bad_dist_ext/1, bad_dist_ext_receive/1, bad_dist_ext_process_info/1, @@ -61,6 +62,7 @@ all(suite) -> [ stop_dist, trap_bif, dist_auto_connect, dist_parallel_send, atom_roundtrip, atom_roundtrip_r12b, contended_atom_cache_entry, + bad_dist_structure, bad_dist_ext ]. @@ -174,7 +176,7 @@ bulk_sendsend2(Terms, BinSize, BusyBufSize) -> ?line {ok, NodeRecv} = start_node(bulk_receiver), ?line Recv = spawn(NodeRecv, erlang, apply, [fun receiver/2, [0, 0]]), ?line Bin = list_to_binary(lists:duplicate(BinSize*1024, 253)), - ?line Size = Terms*size(Bin), + %%?line Size = Terms*size(Bin), %% SLF LEFT OFF HERE. %% When the caller uses small hunks, like 4k via @@ -187,7 +189,7 @@ bulk_sendsend2(Terms, BinSize, BusyBufSize) -> ?line {ok, NodeSend} = start_node(bulk_sender, "+zdbbl " ++ integer_to_list(BusyBufSize)), ?line _Send = spawn(NodeSend, erlang, apply, [fun sendersender/4, [self(), Recv, Bin, Terms]]), - ?line {Elapsed, {TermsN, SizeN}, MonitorCount} = + ?line {Elapsed, {_TermsN, SizeN}, MonitorCount} = receive {sendersender, BigRes} -> BigRes end, @@ -227,7 +229,7 @@ sendersender3(To, _Bin, 0, SendDone, MonitorCount) -> ok end, receive - {monitor, _Pid, _Type, _Info} = M -> + {monitor, _Pid, _Type, _Info} -> sendersender3(To, _Bin, 0, SendDone, MonitorCount + 1) after 0 -> if SendDone -> @@ -522,7 +524,7 @@ sink1() -> lost_exit(doc) -> "Test that EXIT and DOWN messages send to another node are not lost if " - "if the distribution port is busy."; + "the distribution port is busy."; lost_exit(Config) when is_list(Config) -> ?line {ok, Node} = start_node(lost_exit), @@ -1143,8 +1145,7 @@ contended_atom_cache_entry(Config) when is_list(Config) -> ?line {ok, SNode} = start_node(Config), ?line {ok, RNode} = start_node(Config), ?line Success = make_ref(), - ?line Mstr - = spawn_link( + ?line spawn_link( SNode, fun () -> erts_debug:set_internal_state(available_internal_state, @@ -1201,13 +1202,13 @@ contended_atom_cache_entry(Config) when is_list(Config) -> ?line stop_node(RNode), ?line ok. -send_ref_atom(To, Ref, Atom, 0) -> +send_ref_atom(_To, _Ref, _Atom, 0) -> ok; send_ref_atom(To, Ref, Atom, N) -> To ! {Ref, Atom}, send_ref_atom(To, Ref, Atom, N-1). -receive_ref_atom(Ref, Atom, 0) -> +receive_ref_atom(_Ref, _Atom, 0) -> ok; receive_ref_atom(Ref, Atom, N) -> receive @@ -1242,7 +1243,7 @@ unwanted_cixs() -> nodes()). -get_conflicting_atoms(CIX, 0) -> +get_conflicting_atoms(_CIX, 0) -> []; get_conflicting_atoms(CIX, N) -> {A, B, C} = now(), @@ -1256,6 +1257,187 @@ get_conflicting_atoms(CIX, N) -> get_conflicting_atoms(CIX, N) end. +-define(COOKIE, ''). +-define(DOP_LINK, 1). +-define(DOP_SEND, 2). +-define(DOP_EXIT, 3). +-define(DOP_UNLINK, 4). +-define(DOP_NODE_LINK, 5). +-define(DOP_REG_SEND, 6). +-define(DOP_GROUP_LEADER, 7). +-define(DOP_EXIT2, 8). + +-define(DOP_SEND_TT, 12). +-define(DOP_EXIT_TT, 13). +-define(DOP_REG_SEND_TT, 16). +-define(DOP_EXIT2_TT, 18). + +-define(DOP_MONITOR_P, 19). +-define(DOP_DEMONITOR_P, 20). +-define(DOP_MONITOR_P_EXIT, 21). + +start_monitor(Offender,P) -> + ?line Parent = self(), + ?line Q = spawn(Offender, + fun () -> + Ref = erlang:monitor(process,P), + Parent ! {self(),ref,Ref}, + receive + just_stay_alive -> ok + end + end), + ?line Ref = receive + {Q,ref,R} -> + R + after 5000 -> + error + end, + io:format("Ref is ~p~n",[Ref]), + ok. +start_link(Offender,P) -> + ?line Parent = self(), + ?line Q = spawn(Offender, + fun () -> + process_flag(trap_exit,true), + link(P), + Parent ! {self(),ref,P}, + receive + just_stay_alive -> ok + end + end), + ?line Ref = receive + {Q,ref,R} -> + R + after 5000 -> + error + end, + io:format("Ref is ~p~n",[Ref]), + ok. + +bad_dist_structure(suite) -> + []; +bad_dist_structure(doc) -> + ["Test dist messages with valid structure (binary to term ok) but malformed" + "control content"]; +bad_dist_structure(Config) when is_list(Config) -> + %process_flag(trap_exit,true), + ODog = ?config(watchdog, Config), + ?t:timetrap_cancel(ODog), + Dog = ?t:timetrap(?t:seconds(15)), + + ?line {ok, Offender} = start_node(bad_dist_structure_offender), + ?line {ok, Victim} = start_node(bad_dist_structure_victim), + ?line start_node_monitors([Offender,Victim]), + ?line Parent = self(), + ?line P = spawn(Victim, + fun () -> + process_flag(trap_exit,true), + Parent ! {self(), started}, + receive check_msgs -> ok end, + bad_dist_struct_check_msgs([one, + two]), + Parent ! {self(), messages_checked}, + receive done -> ok end + end), + ?line receive {P, started} -> ok end, + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line verify_up(Offender, Victim), + ?line true = lists:member(Offender, rpc:call(Victim, erlang, nodes, [])), + ?line start_monitor(Offender,P), + ?line P ! one, + ?line send_bad_structure(Offender, P,{?DOP_MONITOR_P_EXIT,'replace',P,normal},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_monitor(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_MONITOR_P_EXIT,'replace',P,normal,normal},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_link(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_LINK},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_link(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_UNLINK,'replace'},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_link(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_UNLINK,'replace',make_ref()},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_link(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_UNLINK,make_ref(),P},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_link(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_UNLINK,normal,normal},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_monitor(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_MONITOR_P,'replace',P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_monitor(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_MONITOR_P,'replace',P,normal},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_monitor(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_DEMONITOR_P,'replace',P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line start_monitor(Offender,P), + ?line send_bad_structure(Offender, P,{?DOP_DEMONITOR_P,'replace',P,normal},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT,'replace',P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT,make_ref(),normal,normal},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT_TT,'replace',token,P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT_TT,make_ref(),token,normal,normal},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT2,'replace',P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT2,make_ref(),normal,normal},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT2_TT,'replace',token,P},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_EXIT2_TT,make_ref(),token,normal,normal},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_GROUP_LEADER,'replace'},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_GROUP_LEADER,'replace','atomic'},2), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_GROUP_LEADER,'replace',P},0), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND_TT,'replace','',name},2,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND_TT,'replace','',name,token},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND,'replace',''},2,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND,'replace','',P},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND,'replace','',name},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_REG_SEND,'replace','',name,{token}},2,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_SEND_TT,'',P},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_SEND_TT,'',name,token},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_SEND,''},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_SEND,'',name},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line send_bad_structure(Offender, P,{?DOP_SEND,'',P,{token}},0,{message}), + ?line pong = rpc:call(Victim, net_adm, ping, [Offender]), + ?line P ! two, + ?line P ! check_msgs, + ?line receive + {P, messages_checked} -> ok + after 5000 -> + exit(victim_is_dead) + end, + + ?line {message_queue_len, 0} + = rpc:call(Victim, erlang, process_info, [P, message_queue_len]), + + ?line unlink(P), + ?line P ! done, + ?line stop_node(Offender), + ?line stop_node(Victim), + ?t:timetrap_cancel(Dog), + ok. bad_dist_ext(doc) -> []; bad_dist_ext(suite) -> @@ -1483,6 +1665,22 @@ bad_dist_ext_connection_id(Config) when is_list(Config) -> ?line stop_node(Victim). +bad_dist_struct_check_msgs([]) -> + receive + Msg -> + exit({unexpected_message, Msg}) + after 0 -> + ok + end; +bad_dist_struct_check_msgs([M|Ms]) -> + receive + {'EXIT',_,_} = EM -> + io:format("Ignoring exit message: ~p~n",[EM]), + bad_dist_struct_check_msgs([M|Ms]); + Msg -> + M = Msg, + bad_dist_struct_check_msgs(Ms) + end. bad_dist_ext_check_msgs([]) -> receive Msg -> @@ -1497,24 +1695,6 @@ bad_dist_ext_check_msgs([M|Ms]) -> bad_dist_ext_check_msgs(Ms) end. --define(COOKIE, ''). --define(DOP_LINK, 1). --define(DOP_SEND, 2). --define(DOP_EXIT, 3). --define(DOP_UNLINK, 4). --define(DOP_NODE_LINK, 5). --define(DOP_REG_SEND, 6). --define(DOP_GROUP_LEADER, 7). --define(DOP_EXIT2, 8). - --define(DOP_SEND_TT, 12). --define(DOP_EXIT_TT, 13). --define(DOP_REG_SEND_TT, 16). --define(DOP_EXIT2_TT, 18). - --define(DOP_MONITOR_P, 19). --define(DOP_DEMONITOR_P, 20). --define(DOP_MONITOR_P_EXIT, 21). dport_reg_send(Node, Name, Msg) -> DPrt = case dport(Node) of @@ -1546,6 +1726,39 @@ dport_send(To, Msg) -> ?COOKIE, To}), dmsg_ext(Msg)]). +send_bad_structure(Offender,Victim,Bad,WhereToPutSelf) -> + send_bad_structure(Offender,Victim,Bad,WhereToPutSelf,[]). +send_bad_structure(Offender,Victim,Bad,WhereToPutSelf,PayLoad) -> + Parent = self(), + Done = make_ref(), + spawn(Offender, + fun () -> + Node = node(Victim), + pong = net_adm:ping(Node), + DPrt = dport(Node), + Bad1 = case WhereToPutSelf of + 0 -> + Bad; + N when N > 0 -> + setelement(N,Bad,self()) + end, + DData = [dmsg_hdr(), + dmsg_ext(Bad1)] ++ + case PayLoad of + [] -> []; + _Other -> [dmsg_ext(PayLoad)] + end, + port_command(DPrt, DData), + Parent ! {DData,Done} + end), + receive + {WhatSent,Done} -> + io:format("Offender sent ~p~n",[WhatSent]), + ok + after 5000 -> + exit(unable_to_send) + end. + %% send_bad_msgs(): %% Send a valid distribution header and control message @@ -1629,10 +1842,10 @@ dmsg_bad_hdr() -> 255]. % 255 atom references -dmsg_fake_hdr1() -> - A = <<"fake header atom 1">>, - [131, % Version Magic - $D, 1, 16#8, 0, size(A), A]. % Fake header +%% dmsg_fake_hdr1() -> +%% A = <<"fake header atom 1">>, +%% [131, % Version Magic +%% $D, 1, 16#8, 0, size(A), A]. % Fake header dmsg_fake_hdr2() -> A1 = <<"fake header atom 1">>, @@ -1817,7 +2030,7 @@ flush_node_changes() -> node_monitor_loop(Master) -> receive - {nodeup, Node, InfoList} = Msg -> + {nodeup, Node, _InfoList} = Msg -> Master ! {nodeup, node(), Node}, ?t:format("~p ~p: ~p~n", [node(), erlang:now(), Msg]), node_monitor_loop(Master); @@ -1854,9 +2067,9 @@ verify_no_down(A, B) -> ok end. -verify_down(A, B) -> - receive {nodedown, A, B, _} -> ok end, - receive {nodedown, B, A, _} -> ok end. +%% verify_down(A, B) -> +%% receive {nodedown, A, B, _} -> ok end, +%% receive {nodedown, B, A, _} -> ok end. verify_down(A, ReasonA, B, ReasonB) -> receive @@ -1876,11 +2089,11 @@ from(H, [H | T]) -> T; from(H, [_ | T]) -> from(H, T); from(_, []) -> []. -fun_spawn(Fun) -> - fun_spawn(Fun, []). +%% fun_spawn(Fun) -> +%% fun_spawn(Fun, []). -fun_spawn(Fun, Args) -> - spawn_link(erlang, apply, [Fun, Args]). +%% fun_spawn(Fun, Args) -> +%% spawn_link(erlang, apply, [Fun, Args]). long_or_short() -> -- cgit v1.2.3 From 98a66242abe688d852ec46f4298a364fc0124995 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 14 Dec 2010 15:46:57 +0100 Subject: Support for recursive unions and structs. Break loop if recursive TypeCode. --- lib/ic/doc/src/notes.xml | 38 +++++++++++++++++++++++++- lib/ic/vsn.mk | 19 +------------ lib/orber/doc/src/ch_idl_to_erlang_mapping.xml | 37 +++++++++++++++++++++++-- lib/orber/doc/src/notes.xml | 30 ++++++++++++++++++++ lib/orber/src/cdr_decode.erl | 21 ++++++++++---- lib/orber/vsn.mk | 27 +----------------- 6 files changed, 119 insertions(+), 53 deletions(-) diff --git a/lib/ic/doc/src/notes.xml b/lib/ic/doc/src/notes.xml index dbafde7b4b..45ba233051 100644 --- a/lib/ic/doc/src/notes.xml +++ b/lib/ic/doc/src/notes.xml @@ -4,7 +4,7 @@

- 19982009 + 19982010 Ericsson AB. All Rights Reserved. @@ -30,6 +30,42 @@ notes.xml
+
+ IC 4.2.26 + +
+ Improvements and New Features + + +

+ Partial support for recursive structs and unions. Only available + for the erl_corba backend and requires that Light IFR is used. + I.e. the IC option {light_ifr, true} and that Orber is configured + in such a way that Light IFR is activated. Recursive TypeCode is + currently not supported.

+

+ Own Id: OTP-8868 Aux Id: seq11633

+
+
+
+
+ +
+ IC 4.2.25 + +
+ Improvements and New Features + + +

+ The documentation can now be built and installed without Java.

+

+ Own Id: OTP-8639 Aux Id:

+
+
+
+
+
IC 4.2.24 diff --git a/lib/ic/vsn.mk b/lib/ic/vsn.mk index e0fccf4889..6d6c7fa625 100644 --- a/lib/ic/vsn.mk +++ b/lib/ic/vsn.mk @@ -1,18 +1 @@ -IC_VSN = 4.2.24 - -TICKETS = OTP-8307 \ - OTP-8353 \ - OTP-8354 \ - OTP-8355 - -TICKETS_4.2.23 = OTP-8201 - -TICKETS_4.2.22 = OTP-8088 - -TICKETS_4.2.21 = OTP-7982 - -TICKETS_4.2.20 = OTP-7837 - -TICKETS_4.2.19 = OTP-7595 - -TICKETS_4.2.18 = OTP-7313 +IC_VSN = 4.2.26 diff --git a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml index a97ad65f0e..964ae3e92d 100644 --- a/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml +++ b/lib/orber/doc/src/ch_idl_to_erlang_mapping.xml @@ -4,7 +4,7 @@
- 19972009 + 19972010 Ericsson AB. All Rights Reserved. @@ -445,7 +445,19 @@ void op(in myEnum a);
Struct Data Type

A struct may have Basic, Template, Scoped Names and Constructed - types as members.

+ types as members. By using forward declaration we can define a recursive struct:

+ myStructSeq; +struct myStruct { + myStructSeq chain; +}; + +// Deprecated definition (anonymous) not supported by IC +struct myStruct { + sequence chain; +}; + ]]>
@@ -510,6 +522,25 @@ union LongUnion2 switch(long) { default: boolean DefaultValue; }; +

In the same way as structs, unions can be recursive if forward + declaration is used (anonymous types is deprecated and not supported):

+ myUnionSeq; +union myUnion switch (long) { + case 1 : myUnionSeq chain; + default: boolean DefaultValue; +}; + ]]> + + +

Recursive types (union and struct) require Light IFR. I.e. the + IC option {light_ifr, true} is used and that Orber is configured in such a way that + Light IFR is activated. Recursive TypeCode is currently not supported, which is + why these cannot be encapsulated in an any data type.

+
+

Every field in, for example, a struct must be initiated. Otherwise @@ -890,7 +921,7 @@ attribute long RWAttribute; object internal state with its object reference. The object internal state is an Erlang term which has a format defined by the user.

-

It is is not always the case that the internal state will be the first parameter, as stubs can use their own object reference as the first parameter (see the IC documentation).

+

It is not always the case that the internal state will be the first parameter, as stubs can use their own object reference as the first parameter (see the IC documentation).

A function call will invoke an operation. The first parameter of the function should be the object reference and then diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml index 6eda16a517..1e2cdd05ba 100644 --- a/lib/orber/doc/src/notes.xml +++ b/lib/orber/doc/src/notes.xml @@ -32,6 +32,36 @@ notes.xml

+
+ Orber 3.6.19 + +
+ Improvements and New Features + + +

+ Partial support for recursive structs and unions. + Only available for the erl_corba backend and requires + that Light IFR is used. I.e. the IC option {light_ifr, true} + and that Orber is configured in such a way that Light IFR + is activated. Recursive TypeCode is currently not supported.

+

+ Own Id: OTP-8868 Aux Id: seq11633

+
+
+
+
+ Fixed Bugs and Malfunctions + + +

The SSL option {ssl_imp, old} was not used if ssl_generation was + set to 2. Only R14B was affected by this.

+

Own Id: OTP-8994 Aux Id:seq11747

+
+
+
+
+
Orber 3.6.18
diff --git a/lib/orber/src/cdr_decode.erl b/lib/orber/src/cdr_decode.erl index 68f248364b..36ef6ce02f 100644 --- a/lib/orber/src/cdr_decode.erl +++ b/lib/orber/src/cdr_decode.erl @@ -1273,7 +1273,9 @@ get_user_exception_type(TypeId) -> %%----------------------------------------------------------------- dec_type_code(Version, Message, Len, ByteOrder, Buff, C) -> {TypeNo, Message1, Len1, NewC} = dec_type('tk_ulong', Version, Message, Len, ByteOrder, Buff, C), - dec_type_code(TypeNo, Version, Message1, Len1, ByteOrder, Buff, NewC). + TC = dec_type_code(TypeNo, Version, Message1, Len1, ByteOrder, Buff, NewC), + erase(orber_indirection), + TC. %%----------------------------------------------------------------- %% Func: dec_type_code/5 @@ -1482,13 +1484,22 @@ dec_type_code(33, Version, Message, Len, ByteOrder, Buff, C) -> {"name", {'tk_string', 0}}]}, Version, Rest1, 1, ByteOrder1, Buff, C+1+Ex), {{'tk_local_interface', RepId, Name}, Message1, Len1, NewC}; -dec_type_code(16#ffffffff, Version, Message, Len, ByteOrder, Buff, C) -> %% placeholder +dec_type_code(16#ffffffff, Version, Message, Len, ByteOrder, Buff, C) -> {Indirection, Message1, Len1, NewC} = dec_type('tk_long', Version, Message, Len, ByteOrder, Buff, C), Position = C+Indirection, - <<_:Position/binary, SubBuff/binary>> = Buff, - {TC, _, _, _} = dec_type_code(Version, SubBuff, Position, ByteOrder, Buff, Position), - {TC, Message1, Len1, NewC}; + case put(orber_indirection, Position) of + Position -> +%% {{'none', Indirection}, Message1, Len1, NewC}; + %% Recursive TypeCode. Break the loop. + orber:dbg("[~p] cdr_decode:dec_type_code(~p); Recursive TC not supported.", + [?LINE,Position], ?DEBUG_LEVEL), + corba:raise(#'MARSHAL'{completion_status=?COMPLETED_NO}); + _ -> + <<_:Position/binary, SubBuff/binary>> = Buff, + {TC, _, _, _} = dec_type_code(Version, SubBuff, Position, ByteOrder, Buff, Position), + {TC, Message1, Len1, NewC} + end; dec_type_code(Type, _, _, _, _, _, _) -> orber:dbg("[~p] cdr_decode:dec_type_code(~p); No match.", [?LINE, Type], ?DEBUG_LEVEL), diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk index c405326e9a..c973316412 100644 --- a/lib/orber/vsn.mk +++ b/lib/orber/vsn.mk @@ -1,27 +1,2 @@ -ORBER_VSN = 3.6.18 - -TICKETS = OTP-8900 - -TICKETS_3.6.17 = OTP-8840 - -TICKETS_3.6.16 = OTP-8543 \ - OTP-8489 - -TICKETS_3.6.15 = OTP-8353 \ - OTP-8354 \ - OTP-8374 \ - OTP-8409 \ - OTP-8448 - -TICKETS_3.6.14 = OTP-8201 - -TICKETS_3.6.14 = OTP-8201 - -TICKETS_3.6.13 = OTP-7987 - -TICKETS_3.6.12 = OTP-7906 - -TICKETS_3.6.11 = OTP-7837 - -TICKETS_3.6.10 = OTP-7595 +ORBER_VSN = 3.6.19 -- cgit v1.2.3 From 638a610d0b7ada7b2099b6127410aafb9fae3313 Mon Sep 17 00:00:00 2001 From: Ahmed Omar Date: Wed, 15 Dec 2010 11:26:18 +0100 Subject: Fixes a race condition found in percept_db start/1 function. When function start/1 finds an instance of percept_db running, it will send a message to stop it and spawn a process to start a new one, which leads to a race condition. The function will return {restarted, pid()} but the pid() will die once it tries to create the ets table. --- lib/percept/src/percept_db.erl | 49 +++++++++++++++++----- lib/percept/test/percept_db_SUITE.erl | 76 +++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 lib/percept/test/percept_db_SUITE.erl diff --git a/lib/percept/src/percept_db.erl b/lib/percept/src/percept_db.erl index edb0d79a29..52e9afb78f 100644 --- a/lib/percept/src/percept_db.erl +++ b/lib/percept/src/percept_db.erl @@ -33,7 +33,7 @@ ]). -include("percept.hrl"). - +-define(STOP_TIMEOUT, 1000). %%========================================================================== %% %% Type definitions @@ -77,17 +77,32 @@ start() -> case erlang:whereis(percept_db) of undefined -> - Pid = spawn( fun() -> init_percept_db() end), - erlang:register(percept_db, Pid), - {started, Pid}; + {started, do_start()}; PerceptDB -> - erlang:unregister(percept_db), - PerceptDB ! {action, stop}, - Pid = spawn( fun() -> init_percept_db() end), - erlang:register(percept_db, Pid), - {restarted, Pid} + {restarted, restart(PerceptDB)} end. +%% @spec restart(pid()) -> pid() +%% @private +%% @doc restarts the percept database. + +-spec restart(pid())-> pid(). + +restart(PerceptDB)-> + stop_sync(PerceptDB), + do_start(). + +%% @spec do_start(pid()) -> pid() +%% @private +%% @doc starts the percept database. + +-spec do_start()-> pid(). + +do_start()-> + Pid = spawn( fun() -> init_percept_db() end), + erlang:register(percept_db, Pid), + Pid. + %% @spec stop() -> not_started | {stopped, Pid} %% Pid = pid() %% @doc Stops the percept database. @@ -103,6 +118,22 @@ stop() -> {stopped, Pid} end. +%% @spec stop_sync(pid()) -> true +%% @private +%% @doc Stops the percept database, with a synchronous call. + +-spec stop_sync(pid())-> true. + +stop_sync(Pid)-> + MonitorRef = erlang:monitor(process, Pid), + stop(), + receive + {'DOWN', MonitorRef, _Type, Pid, _Info}-> + true + after ?STOP_TIMEOUT-> + exit(Pid, kill) + end. + %% @spec insert(tuple()) -> ok %% @doc Inserts a trace or profile message to the database. diff --git a/lib/percept/test/percept_db_SUITE.erl b/lib/percept/test/percept_db_SUITE.erl new file mode 100644 index 0000000000..79be9714ba --- /dev/null +++ b/lib/percept/test/percept_db_SUITE.erl @@ -0,0 +1,76 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(percept_db_SUITE). +-include("test_server.hrl"). + +%% Test server specific exports +-export([all/1]). +-export([init_per_suite/1, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2]). + +%% Test cases +-export([ + start/1 + ]). + +%% Default timetrap timeout (set in init_per_testcase) +-define(default_timeout, ?t:minutes(2)). +-define(restarts, 10). +-define(alive_timeout, 500). + +init_per_suite(Config) when is_list(Config) -> + Config. + +end_per_suite(Config) when is_list(Config) -> + Config. + +init_per_testcase(_Case, Config) -> + Dog = ?t:timetrap(?default_timeout), + [{max_size, 300}, {watchdog,Dog} | Config]. + +end_per_testcase(_Case, Config) -> + Dog = ?config(watchdog, Config), + ?t:timetrap_cancel(Dog), + ok. + +all(suite) -> + % Test cases + [start]. + +%%---------------------------------------------------------------------- +%% Tests +%%---------------------------------------------------------------------- + +start(suite) -> + []; +start(doc) -> + ["Percept_db start and restart test."]; +start(Config) when is_list(Config) -> + ok = restart(?restarts), + {stopped, _DB} = percept_db:stop(), + ok. + +restart(0)-> + ok; +restart(N)-> + {_, DB} = percept_db:start(), + timer:sleep(?alive_timeout), + true = erlang:is_process_alive(DB), + restart(N-1). -- cgit v1.2.3 From 36cb935fadde690f923bb5ae5a729f8ca6212046 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 15 Dec 2010 12:28:52 +0100 Subject: Remove ancient distribution message DOP_NODE_LINK from all code --- erts/emulator/beam/dist.c | 3 --- erts/emulator/beam/dist.h | 3 +-- erts/emulator/test/distribution_SUITE.erl | 1 - erts/emulator/test/erl_link_SUITE.erl | 3 +-- lib/erl_interface/include/ei.h | 2 +- lib/erl_interface/src/connect/ei_connect.c | 3 +-- lib/erl_interface/src/connect/eirecv.c | 6 +----- lib/erl_interface/src/misc/show_msg.c | 9 --------- .../java_src/com/ericsson/otp/erlang/AbstractConnection.java | 7 +------ lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java | 3 +-- 10 files changed, 7 insertions(+), 33 deletions(-) diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index fc400945b3..02910fad90 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -1182,9 +1182,6 @@ int erts_net_message(Port *prt, erts_destroy_monitor(mon); break; - case DOP_NODE_LINK: /* XXX never sent ?? */ - break; - case DOP_REG_SEND_TT: if (tuple_arity != 5) { goto invalid_message; diff --git a/erts/emulator/beam/dist.h b/erts/emulator/beam/dist.h index 9ccc3e5ba9..695a4fc3fe 100644 --- a/erts/emulator/beam/dist.h +++ b/erts/emulator/beam/dist.h @@ -52,7 +52,7 @@ #define DOP_SEND 2 #define DOP_EXIT 3 #define DOP_UNLINK 4 -#define DOP_NODE_LINK 5 +/* Ancient DOP_NODE_LINK (5) was here, can be reused */ #define DOP_REG_SEND 6 #define DOP_GROUP_LEADER 7 #define DOP_EXIT2 8 @@ -69,7 +69,6 @@ /* distribution trap functions */ extern Export* dsend2_trap; extern Export* dsend3_trap; -/*extern Export* dsend_nosuspend_trap;*/ extern Export* dlink_trap; extern Export* dunlink_trap; extern Export* dmonitor_node_trap; diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 4b44a2b420..f26455e6da 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -1262,7 +1262,6 @@ get_conflicting_atoms(CIX, N) -> -define(DOP_SEND, 2). -define(DOP_EXIT, 3). -define(DOP_UNLINK, 4). --define(DOP_NODE_LINK, 5). -define(DOP_REG_SEND, 6). -define(DOP_GROUP_LEADER, 7). -define(DOP_EXIT2, 8). diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index 542c8dffbe..11a7a61586 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1050,7 +1050,6 @@ stop_node(Node) -> -define(DOP_SEND, 2). -define(DOP_EXIT, 3). -define(DOP_UNLINK, 4). --define(DOP_NODE_LINK, 5). -define(DOP_REG_SEND, 6). -define(DOP_GROUP_LEADER, 7). -define(DOP_EXIT2, 8). diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h index 466d84bb99..0c72ab977a 100644 --- a/lib/erl_interface/include/ei.h +++ b/lib/erl_interface/include/ei.h @@ -84,7 +84,7 @@ #define ERL_SEND 2 #define ERL_EXIT 3 #define ERL_UNLINK 4 -#define ERL_NODE_LINK 5 + #define ERL_REG_SEND 6 #define ERL_GROUP_LEADER 7 #define ERL_EXIT2 8 diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c index 99ccba0686..53b0e0426b 100644 --- a/lib/erl_interface/src/connect/ei_connect.c +++ b/lib/erl_interface/src/connect/ei_connect.c @@ -938,7 +938,7 @@ int ei_do_receive_msg(int fd, int staticbuffer_p, return ERL_ERROR; } x->index = x->buffsz; - switch (msg->msgtype) { /* FIXME are these all? */ + switch (msg->msgtype) { /* FIXME does not handle trace tokens and monitors */ case ERL_SEND: case ERL_REG_SEND: case ERL_LINK: @@ -946,7 +946,6 @@ int ei_do_receive_msg(int fd, int staticbuffer_p, case ERL_GROUP_LEADER: case ERL_EXIT: case ERL_EXIT2: - case ERL_NODE_LINK: return ERL_MSG; default: diff --git a/lib/erl_interface/src/connect/eirecv.c b/lib/erl_interface/src/connect/eirecv.c index 7d72ddeeae..86852f947d 100644 --- a/lib/erl_interface/src/connect/eirecv.c +++ b/lib/erl_interface/src/connect/eirecv.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-2010. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -196,10 +196,6 @@ ei_recv_internal (int fd, ei_trace(1,&msg->token); /* turn on tracing */ break; - case ERL_NODE_LINK: /* { NODE_LINK } */ - if (ei_tracelevel >= 4) show_this_msg = 1; - break; - default: /* unknown type, just put any remaining bytes into buffer */ break; diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c index 14bea5e01f..194296798b 100644 --- a/lib/erl_interface/src/misc/show_msg.c +++ b/lib/erl_interface/src/misc/show_msg.c @@ -181,11 +181,6 @@ int ei_show_sendmsg(FILE *stream, const char *header, const char *msgbuf) mbuf = header; break; - case ERL_NODE_LINK: - /* nothing to do */ - mbuf = header; - break; - default: break; } @@ -241,10 +236,6 @@ static void show_msg(FILE *stream, int direction, const erlang_msg *msg, show_pid(stream,&msg->to); break; - case ERL_NODE_LINK: - fprintf(stream,"NODE_LINK"); - break; - case ERL_REG_SEND: fprintf(stream,"REG_SEND From: "); show_pid(stream,&msg->from); diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java index ab0b299bf9..9ba6a4a0ab 100644 --- a/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java +++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/AbstractConnection.java @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2009. All Rights Reserved. + * Copyright Ericsson AB 2000-2010. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -68,7 +68,6 @@ public abstract class AbstractConnection extends Thread { protected static final int sendTag = 2; protected static final int exitTag = 3; protected static final int unlinkTag = 4; - protected static final int nodeLinkTag = 5; protected static final int regSendTag = 6; protected static final int groupLeaderTag = 7; protected static final int exit2Tag = 8; @@ -697,7 +696,6 @@ public abstract class AbstractConnection extends Thread { // absolutely no idea what to do with these, so we ignore // them... case groupLeaderTag: // { GROUPLEADER, FromPid, ToPid} - case nodeLinkTag: // { NODELINK } // (just show trace) if (traceLevel >= ctrlThreshold) { System.out.println("<- " + headerType(head) + " " @@ -880,9 +878,6 @@ public abstract class AbstractConnection extends Thread { case unlinkTag: return "UNLINK"; - case nodeLinkTag: - return "NODELINK"; - case regSendTag: return "REG_SEND"; diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java index 80d8a5ccae..6f507bf4bb 100644 --- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java +++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMsg.java @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2009. All Rights Reserved. + * Copyright Ericsson AB 2000-2010. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -54,7 +54,6 @@ public class OtpMsg { public static final int sendTag = 2; public static final int exitTag = 3; public static final int unlinkTag = 4; - /* public static final int nodeLinkTag = 5; */ public static final int regSendTag = 6; /* public static final int groupLeaderTag = 7; */ public static final int exit2Tag = 8; -- cgit v1.2.3 From 64e1ea2c076f4e858d3938fca83f4bf7732df575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 15 Dec 2010 14:06:58 +0100 Subject: Fix .gitignore Ignore vim tmp-files --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index d67116d6e3..54bfadea9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ # Match at any level. + +# emacs *~ +# vim +.*.sw[a-z] + autom4te.cache *.beam *.asn1db @@ -162,6 +167,7 @@ make/win32/ /erts/emulator/test/*_SUITE_make.erl /erts/emulator/test/*_SUITE_data/Makefile /erts/test/install_SUITE_data/install_bin +/erts/test/autoimport_SUITE_data/erlang.xml # asn1 -- cgit v1.2.3 From 42544db2088a28326bda8998b92c434724354756 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 15 Dec 2010 23:08:51 +0100 Subject: Remove stray semicolons in erl_term.h --- erts/emulator/beam/erl_term.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index b8e4473141..815cc1beae 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -193,7 +193,7 @@ struct erl_node_; /* Declared in erl_node_tables.h */ #endif #define _is_aligned(x) (((Uint)(x) & 0x3) == 0) #define _unchecked_make_boxed(x) ((Uint) COMPRESS_POINTER(x) + TAG_PRIMARY_BOXED) -_ET_DECLARE_CHECKED(Eterm,make_boxed,Eterm*); +_ET_DECLARE_CHECKED(Eterm,make_boxed,Eterm*) #define make_boxed(x) _ET_APPLY(make_boxed,(x)) #if 1 #define _is_not_boxed(x) ((x) & (_TAG_PRIMARY_MASK-TAG_PRIMARY_BOXED)) @@ -204,12 +204,12 @@ _ET_DECLARE_CHECKED(int,is_boxed,Eterm) #define is_boxed(x) (((x) & _TAG_PRIMARY_MASK) == TAG_PRIMARY_BOXED) #endif #define _unchecked_boxed_val(x) ((Eterm*) EXPAND_POINTER(((x) - TAG_PRIMARY_BOXED))) -_ET_DECLARE_CHECKED(Eterm*,boxed_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,boxed_val,Eterm) #define boxed_val(x) _ET_APPLY(boxed_val,(x)) /* cons cell ("list") access methods */ #define _unchecked_make_list(x) ((Uint) COMPRESS_POINTER(x) + TAG_PRIMARY_LIST) -_ET_DECLARE_CHECKED(Eterm,make_list,Eterm*); +_ET_DECLARE_CHECKED(Eterm,make_list,Eterm*) #define make_list(x) _ET_APPLY(make_list,(x)) #if 1 #define _unchecked_is_not_list(x) ((x) & (_TAG_PRIMARY_MASK-TAG_PRIMARY_LIST)) @@ -226,7 +226,7 @@ _ET_DECLARE_CHECKED(int,is_not_list,Eterm) #define _list_precond(x) (is_list(x)) #endif #define _unchecked_list_val(x) ((Eterm*) EXPAND_POINTER((x) - TAG_PRIMARY_LIST)) -_ET_DECLARE_CHECKED(Eterm*,list_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,list_val,Eterm) #define list_val(x) _ET_APPLY(list_val,(x)) #define CONS(hp, car, cdr) \ @@ -995,14 +995,14 @@ _ET_DECLARE_CHECKED(struct erl_node_*,external_ref_node,Eterm) #endif #define _unchecked_make_cp(x) ((Eterm) COMPRESS_POINTER(x)) -_ET_DECLARE_CHECKED(Eterm,make_cp,BeamInstr*); +_ET_DECLARE_CHECKED(Eterm,make_cp,BeamInstr*) #define make_cp(x) _ET_APPLY(make_cp,(x)) #define is_not_CP(x) ((x) & _CPMASK) #define is_CP(x) (!is_not_CP(x)) #define _unchecked_cp_val(x) ((BeamInstr*) EXPAND_POINTER(x)) -_ET_DECLARE_CHECKED(BeamInstr*,cp_val,Eterm); +_ET_DECLARE_CHECKED(BeamInstr*,cp_val,Eterm) #define cp_val(x) _ET_APPLY(cp_val,(x)) #define make_catch(x) (((x) << _TAG_IMMED2_SIZE) | _TAG_IMMED2_CATCH) -- cgit v1.2.3 From 5c2c753281f5d26978ac4f56e9280f82a6cc3bbc Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 15 Dec 2010 23:09:26 +0100 Subject: Remove unused variable --- erts/emulator/beam/erl_alloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 7793f60f4f..e85e2d7e3f 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1568,7 +1568,6 @@ erts_memory(int *print_to_p, void *print_to_arg, void *proc, Eterm earg) Eterm atoms[sizeof(size)/sizeof(Uint)]; Uint *uintps[sizeof(size)/sizeof(Uint)]; Eterm euints[sizeof(size)/sizeof(Uint)]; - int need_atom; int want_tot_or_sys; int length; Eterm res = THE_NON_VALUE; @@ -1756,7 +1755,6 @@ erts_memory(int *print_to_p, void *print_to_arg, void *proc, Eterm earg) /* Calculate values needed... */ want_tot_or_sys = want.total || want.system; - need_atom = ERTS_MEM_NEED_ALL_ALCU || want.atom; if (ERTS_MEM_NEED_ALL_ALCU) { size.total = 0; -- cgit v1.2.3 From 5224310c3975d5d5abf78914ecb63007a299ebae Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 1 Dec 2010 23:42:26 +0100 Subject: Cache invaldation first version does not break old test cases --- lib/ssl/src/ssl_certificate_db.erl | 28 +++++- lib/ssl/src/ssl_connection.erl | 10 +- lib/ssl/src/ssl_handshake.erl | 10 +- lib/ssl/src/ssl_handshake.hrl | 1 + lib/ssl/src/ssl_manager.erl | 86 +++++++++++----- lib/ssl/src/ssl_session.erl | 30 +++--- lib/ssl/test/ssl_basic_SUITE.erl | 197 ++++++++++++++++++++++++++++++++++++- lib/ssl/test/ssl_test_lib.erl | 37 +++++-- 8 files changed, 339 insertions(+), 60 deletions(-) diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl index 2a5a7f3394..019f73fc80 100644 --- a/lib/ssl/src/ssl_certificate_db.erl +++ b/lib/ssl/src/ssl_certificate_db.erl @@ -27,7 +27,9 @@ -export([create/0, remove/1, add_trusted_certs/3, remove_trusted_certs/2, lookup_trusted_cert/3, issuer_candidate/1, - lookup_cached_certs/1, cache_pem_file/3]). + lookup_cached_certs/1, cache_pem_file/4, uncache_pem_file/2, ref_count/3]). + +-type time() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}. %%==================================================================== %% Internal application API @@ -98,17 +100,32 @@ add_trusted_certs(Pid, File, [CertsDb, FileToRefDb, PidToFileDb]) -> insert(Pid, File, PidToFileDb), {ok, Ref}. %%-------------------------------------------------------------------- --spec cache_pem_file(pid(), string(), certdb_ref()) -> term(). +-spec cache_pem_file(pid(), string(), time(), certdb_ref()) -> term(). %% %% Description: Cache file as binary in DB %%-------------------------------------------------------------------- -cache_pem_file(Pid, File, [CertsDb, _FileToRefDb, PidToFileDb]) -> +cache_pem_file(Pid, File, Time, [CertsDb, _FileToRefDb, PidToFileDb]) -> {ok, PemBin} = file:read_file(File), Content = public_key:pem_decode(PemBin), - insert({file, File}, Content, CertsDb), + insert({file, File}, {Time, Content}, CertsDb), insert(Pid, File, PidToFileDb), {ok, Content}. +%-------------------------------------------------------------------- +-spec uncache_pem_file(string(), certdb_ref()) -> no_return(). +%% +%% Description: If a cached file is no longer valid (changed on disk) +%% we must terminate the connections using the old file content, and +%% when those processes are finish the cache will be cleaned. It is +%% a rare but possible case a new ssl client/server is started with +%% a filename with the same name as previously started client/server +%% but with different content. +%% -------------------------------------------------------------------- +uncache_pem_file(File, [_CertsDb, _FileToRefDb, PidToFileDb]) -> + Pids = select(PidToFileDb, [{{'$1', File},[],['$$']}]), + lists:foreach(fun(Pid) -> + exit(Pid, shutdown) + end, Pids). %%-------------------------------------------------------------------- -spec remove_trusted_certs(pid(), certdb_ref()) -> term(). @@ -202,6 +219,9 @@ lookup(Key, Db) -> [Pick(Data) || Data <- Contents] end. +select(Db, MatchSpec)-> + ets:select(Db, MatchSpec). + remove_certs(Ref, CertsDb) -> ets:match_delete(CertsDb, {{Ref, '_', '_'}, '_'}). diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 6c9ac65b64..478f465705 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -70,7 +70,7 @@ %% {{md5_hash, sha_hash}, {prev_md5, prev_sha}} (binary()) tls_handshake_hashes, % see above tls_cipher_texts, % list() received but not deciphered yet - own_cert, % binary() + own_cert, % binary() | undefined session, % #session{} from ssl_handshake.hrl session_cache, % session_cache_cb, % @@ -304,8 +304,10 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, try ssl_init(SSLOpts0, Role) of {ok, Ref, CacheRef, OwnCert, Key, DHParams} -> + Session = State0#state.session, State = State0#state{tls_handshake_hashes = Hashes0, own_cert = OwnCert, + session = Session#session{own_certificate = OwnCert}, cert_db_ref = Ref, session_cache = CacheRef, private_key = Key, @@ -331,6 +333,7 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, %%-------------------------------------------------------------------- hello(start, #state{host = Host, port = Port, role = client, ssl_options = SslOpts, + own_cert = Cert, transport_cb = Transport, socket = Socket, connection_states = ConnectionStates, renegotiation = {Renegotiation, _}} @@ -338,7 +341,7 @@ hello(start, #state{host = Host, port = Port, role = client, Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates, - SslOpts, Renegotiation), + SslOpts, Renegotiation, Cert), Version = Hello#client_hello.client_version, Hashes0 = ssl_handshake:init_hashes(), @@ -678,6 +681,7 @@ cipher(Msg, State) -> %%-------------------------------------------------------------------- connection(#hello_request{}, #state{host = Host, port = Port, socket = Socket, + own_cert = Cert, ssl_options = SslOpts, negotiated_version = Version, transport_cb = Transport, @@ -686,7 +690,7 @@ connection(#hello_request{}, #state{host = Host, port = Port, tls_handshake_hashes = Hashes0} = State0) -> Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0, - SslOpts, Renegotiation), + SslOpts, Renegotiation, Cert), {BinMsg, ConnectionStates1, Hashes1} = encode_handshake(Hello, Version, ConnectionStates0, Hashes0), diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index c7a1c4965d..125c28b373 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -30,7 +30,7 @@ -include("ssl_internal.hrl"). -include_lib("public_key/include/public_key.hrl"). --export([master_secret/4, client_hello/5, server_hello/4, hello/4, +-export([master_secret/4, client_hello/6, server_hello/4, hello/4, hello_request/0, certify/6, certificate/3, client_certificate_verify/5, certificate_verify/5, certificate_request/2, key_exchange/2, server_key_exchange_hash/2, @@ -49,13 +49,13 @@ %%==================================================================== %%-------------------------------------------------------------------- -spec client_hello(host(), port_num(), #connection_states{}, - #ssl_options{}, boolean()) -> #client_hello{}. + #ssl_options{}, boolean(), der_cert()) -> #client_hello{}. %% %% Description: Creates a client hello message. %%-------------------------------------------------------------------- client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions, ciphers = UserSuites} - = SslOpts, Renegotiation) -> + = SslOpts, Renegotiation, OwnCert) -> Fun = fun(Version) -> ssl_record:protocol_version(Version) @@ -65,7 +65,7 @@ client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions, SecParams = Pending#connection_state.security_parameters, Ciphers = available_suites(UserSuites, Version), - Id = ssl_manager:client_session_id(Host, Port, SslOpts), + Id = ssl_manager:client_session_id(Host, Port, SslOpts, OwnCert), #client_hello{session_id = Id, client_version = Version, @@ -571,7 +571,7 @@ select_session(Hello, Port, Session, Version, #ssl_options{ciphers = UserSuites} = SslOpts, Cache, CacheCb, Cert) -> SuggestedSessionId = Hello#client_hello.session_id, SessionId = ssl_manager:server_session_id(Port, SuggestedSessionId, - SslOpts), + SslOpts, Cert), Suites = available_suites(Cert, UserSuites, Version), case ssl_session:is_new(SuggestedSessionId, SessionId) of diff --git a/lib/ssl/src/ssl_handshake.hrl b/lib/ssl/src/ssl_handshake.hrl index 68a7802ef2..8ae4d2332e 100644 --- a/lib/ssl/src/ssl_handshake.hrl +++ b/lib/ssl/src/ssl_handshake.hrl @@ -36,6 +36,7 @@ -record(session, { session_id, peer_certificate, + own_certificate, compression_method, cipher_suite, master_secret, diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index 3b02d96562..dc613eec11 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -29,13 +29,13 @@ %% Internal application API -export([start_link/1, connection_init/2, cache_pem_file/1, - lookup_trusted_cert/3, issuer_candidate/1, client_session_id/3, - server_session_id/3, + lookup_trusted_cert/3, issuer_candidate/1, client_session_id/4, + server_session_id/4, register_session/2, register_session/3, invalidate_session/2, invalidate_session/3]). % Spawn export --export([init_session_validator/1]). +-export([init_session_validator/1, recache_pem/4]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, @@ -43,6 +43,7 @@ -include("ssl_handshake.hrl"). -include("ssl_internal.hrl"). +-include_lib("kernel/include/file.hrl"). -record(state, { session_cache, @@ -76,16 +77,17 @@ start_link(Opts) -> connection_init(Trustedcerts, Role) -> call({connection_init, Trustedcerts, Role}). %%-------------------------------------------------------------------- --spec cache_pem_file(string()) -> {ok, term()}. +-spec cache_pem_file(string()) -> {ok, term()} | {error, reason()}. %% -%% Description: Cach a pem file and +%% Description: Cach a pem file and return its content. %%-------------------------------------------------------------------- -cache_pem_file(File) -> - case ssl_certificate_db:lookup_cached_certs(File) of - [{_,Content}] -> - {ok, Content}; - [] -> - call({cache_pem, File}) +cache_pem_file(File) -> + try file:read_file_info(File) of + {ok, #file_info{mtime = LastWrite}} -> + cache_pem_file(File, LastWrite) + catch + _:Reason -> + {error, Reason} end. %%-------------------------------------------------------------------- -spec lookup_trusted_cert(reference(), serialnumber(), issuer()) -> @@ -106,20 +108,21 @@ lookup_trusted_cert(Ref, SerialNumber, Issuer) -> issuer_candidate(PrevCandidateKey) -> ssl_certificate_db:issuer_candidate(PrevCandidateKey). %%-------------------------------------------------------------------- --spec client_session_id(host(), port_num(), #ssl_options{}) -> session_id(). +-spec client_session_id(host(), port_num(), #ssl_options{}, + der_cert() | undefined) -> session_id(). %% %% Description: Select a session id for the client. %%-------------------------------------------------------------------- -client_session_id(Host, Port, SslOpts) -> - call({client_session_id, Host, Port, SslOpts}). +client_session_id(Host, Port, SslOpts, OwnCert) -> + call({client_session_id, Host, Port, SslOpts, OwnCert}). %%-------------------------------------------------------------------- --spec server_session_id(host(), port_num(), #ssl_options{}) -> session_id(). +-spec server_session_id(host(), port_num(), #ssl_options{}, der_cert()) -> session_id(). %% %% Description: Select a session id for the server. %%-------------------------------------------------------------------- -server_session_id(Port, SuggestedSessionId, SslOpts) -> - call({server_session_id, Port, SuggestedSessionId, SslOpts}). +server_session_id(Port, SuggestedSessionId, SslOpts, OwnCert) -> + call({server_session_id, Port, SuggestedSessionId, SslOpts, OwnCert}). %%-------------------------------------------------------------------- -spec register_session(port_num(), #session{}) -> ok. @@ -201,28 +204,35 @@ handle_call({{connection_init, Trustedcerts, _Role}, Pid}, _From, end, {reply, Result, State}; -handle_call({{client_session_id, Host, Port, SslOpts}, _}, _, +handle_call({{client_session_id, Host, Port, SslOpts, OwnCert}, _}, _, #state{session_cache = Cache, session_cache_cb = CacheCb} = State) -> - Id = ssl_session:id({Host, Port, SslOpts}, Cache, CacheCb), + Id = ssl_session:id({Host, Port, SslOpts}, Cache, CacheCb, OwnCert), {reply, Id, State}; -handle_call({{server_session_id, Port, SuggestedSessionId, SslOpts}, _}, +handle_call({{server_session_id, Port, SuggestedSessionId, SslOpts, OwnCert}, _}, _, #state{session_cache_cb = CacheCb, session_cache = Cache, session_lifetime = LifeTime} = State) -> Id = ssl_session:id(Port, SuggestedSessionId, SslOpts, - Cache, CacheCb, LifeTime), + Cache, CacheCb, LifeTime, OwnCert), {reply, Id, State}; -handle_call({{cache_pem, File},Pid}, _, State = #state{certificate_db = Db}) -> - try ssl_certificate_db:cache_pem_file(Pid,File,Db) of +handle_call({{cache_pem, File, LastWrite}, Pid}, _, + #state{certificate_db = Db} = State) -> + try ssl_certificate_db:cache_pem_file(Pid, File, LastWrite, Db) of Result -> {reply, Result, State} catch _:Reason -> {reply, {error, Reason}, State} - end. + end; +handle_call({{recache_pem, File, LastWrite}, Pid}, From, + #state{certificate_db = Db} = State) -> + ssl_certificate_db:uncache_pem_file(File, Pid, Db), + spawn_link(?MODULE, recache_pem, [File, Db, LastWrite, From]), + {noreply, State}. + %%-------------------------------------------------------------------- -spec handle_cast(msg(), #state{}) -> {noreply, #state{}}. %% Possible return values not used now. @@ -286,12 +296,14 @@ handle_info({'EXIT', _, _}, State) -> handle_info({'DOWN', _Ref, _Type, _Pid, ecacertfile}, State) -> {noreply, State}; +handle_info({'DOWN', _Ref, _Type, Pid, shutdown}, State) -> + handle_info({remove_trusted_certs, Pid}, State); handle_info({'DOWN', _Ref, _Type, Pid, _Reason}, State) -> erlang:send_after(?CERTIFICATE_CACHE_CLEANUP, self(), {remove_trusted_certs, Pid}), {noreply, State}; handle_info({remove_trusted_certs, Pid}, - State = #state{certificate_db = Db}) -> + #state{certificate_db = Db} = State) -> ssl_certificate_db:remove_trusted_certs(Pid, Db), {noreply, State}; @@ -362,3 +374,27 @@ session_validation({{{Host, Port}, _}, Session}, LifeTime) -> session_validation({{Port, _}, Session}, LifeTime) -> validate_session(Port, Session, LifeTime), LifeTime. + +cache_pem_file(File, LastWrite) -> + case ssl_certificate_db:lookup_cached_certs(File) of + [{_, {Mtime, Content}}] -> + case LastWrite of + Mtime -> + {ok, Content}; + _ -> + call({recache_pem, File, LastWrite}) + end; + [] -> + call({cache_pem, File, LastWrite}) + end. + + +recache_pem(File, Db, LastWrite, From) -> + case ssl_certificate_db:ref_count(File, Db, 0) of + 0 -> + Result = call({cache_pem, File, LastWrite}), + gen_server:reply(From, Result); + _ -> + timer:sleep(1000), + recache_pem(File, Db, LastWrite, From) + end. diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl index 25e7445180..dc4b7a711c 100644 --- a/lib/ssl/src/ssl_session.erl +++ b/lib/ssl/src/ssl_session.erl @@ -28,7 +28,7 @@ -include("ssl_internal.hrl"). %% Internal application API --export([is_new/2, id/3, id/6, valid_session/2]). +-export([is_new/2, id/4, id/7, valid_session/2]). -define(GEN_UNIQUE_ID_MAX_TRIES, 10). @@ -48,13 +48,14 @@ is_new(_ClientSuggestion, _ServerDecision) -> true. %%-------------------------------------------------------------------- --spec id({host(), port_num(), #ssl_options{}}, cache_ref(), atom()) -> binary(). +-spec id({host(), port_num(), #ssl_options{}}, cache_ref(), atom(), + undefined | binary()) -> binary(). %% %% Description: Should be called by the client side to get an id %% for the client hello message. %%-------------------------------------------------------------------- -id(ClientInfo, Cache, CacheCb) -> - case select_session(ClientInfo, Cache, CacheCb) of +id(ClientInfo, Cache, CacheCb, OwnCert) -> + case select_session(ClientInfo, Cache, CacheCb, OwnCert) of no_session -> <<>>; SessionId -> @@ -63,19 +64,19 @@ id(ClientInfo, Cache, CacheCb) -> %%-------------------------------------------------------------------- -spec id(port_num(), binary(), #ssl_options{}, cache_ref(), - atom(), seconds()) -> binary(). + atom(), seconds(), binary()) -> binary(). %% %% Description: Should be called by the server side to get an id %% for the server hello message. %%-------------------------------------------------------------------- -id(Port, <<>>, _, Cache, CacheCb, _) -> +id(Port, <<>>, _, Cache, CacheCb, _, _) -> new_id(Port, ?GEN_UNIQUE_ID_MAX_TRIES, Cache, CacheCb); id(Port, SuggestedSessionId, #ssl_options{reuse_sessions = ReuseEnabled, reuse_session = ReuseFun}, - Cache, CacheCb, SecondLifeTime) -> + Cache, CacheCb, SecondLifeTime, OwnCert) -> case is_resumable(SuggestedSessionId, Port, ReuseEnabled, - ReuseFun, Cache, CacheCb, SecondLifeTime) of + ReuseFun, Cache, CacheCb, SecondLifeTime, OwnCert) of true -> SuggestedSessionId; false -> @@ -93,19 +94,20 @@ valid_session(#session{time_stamp = TimeStamp}, LifeTime) -> %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- -select_session({HostIP, Port, SslOpts}, Cache, CacheCb) -> +select_session({HostIP, Port, SslOpts}, Cache, CacheCb, OwnCert) -> Sessions = CacheCb:select_session(Cache, {HostIP, Port}), - select_session(Sessions, SslOpts). + select_session(Sessions, SslOpts, OwnCert). -select_session([], _) -> +select_session([], _, _) -> no_session; select_session(Sessions, #ssl_options{ciphers = Ciphers, - reuse_sessions = ReuseSession}) -> + reuse_sessions = ReuseSession}, OwnCert) -> IsResumable = fun(Session) -> ReuseSession andalso (Session#session.is_resumable) andalso lists:member(Session#session.cipher_suite, Ciphers) + andalso (OwnCert == Session#session.own_certificate) end, case [Id || [Id, Session] <- Sessions, IsResumable(Session)] of [] -> @@ -140,14 +142,16 @@ new_id(Port, Tries, Cache, CacheCb) -> end. is_resumable(SuggestedSessionId, Port, ReuseEnabled, ReuseFun, Cache, - CacheCb, SecondLifeTime) -> + CacheCb, SecondLifeTime, OwnCert) -> case CacheCb:lookup(Cache, {Port, SuggestedSessionId}) of #session{cipher_suite = CipherSuite, + own_certificate = SessionOwnCert, compression_method = Compression, is_resumable = Is_resumable, peer_certificate = PeerCert} = Session -> ReuseEnabled andalso Is_resumable + andalso (OwnCert == SessionOwnCert) andalso valid_session(Session, SecondLifeTime) andalso ReuseFun(SuggestedSessionId, PeerCert, Compression, CipherSuite); diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 8f9554f3ce..92de3fe070 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -125,6 +125,9 @@ init_per_testcase(empty_protocol_versions, Config) -> ssl:start(), Config; +init_per_testcase(different_ca_peer_sign, Config0) -> + ssl_test_lib:make_mix_cert(Config0); + init_per_testcase(_TestCase, Config0) -> Config = lists:keydelete(watchdog, 1, Config0), Dog = test_server:timetrap(?TIMEOUT), @@ -205,7 +208,9 @@ all(suite) -> invalid_signature_client, invalid_signature_server, cert_expired, client_with_cert_cipher_suites_handshake, unknown_server_ca_fail, der_input, unknown_server_ca_accept_verify_none, unknown_server_ca_accept_verify_peer, - unknown_server_ca_accept_backwardscompatibilty + unknown_server_ca_accept_backwardscompatibilty, + different_ca_peer_sign, no_reuses_session_server_restart_new_cert, + no_reuses_session_server_restart_new_cert_file ]. %% Test cases starts here. @@ -3051,6 +3056,196 @@ der_input_opts(Opts) -> end, ssl_test_lib:pem_to_der(CaCertsfile)), {Cert, {rsa, Key}, CaCerts, DHParams}. +%%-------------------------------------------------------------------- +different_ca_peer_sign(doc) -> + ["Check that a CA can have a different signature algorithm than the peer cert."]; + +different_ca_peer_sign(suite) -> + []; + +different_ca_peer_sign(Config) when is_list(Config) -> + ClientOpts = ?config(client_mix_opts, Config), + ServerOpts = ?config(server_mix_verify_opts, Config), + + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, send_recv_result_active_once, []}}, + {options, [{active, once}, + {verify, verify_peer} | ServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, + send_recv_result_active_once, + []}}, + {options, [{active, once}, + {verify, verify_peer} + | ClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + + +%%-------------------------------------------------------------------- +no_reuses_session_server_restart_new_cert(doc) -> + ["Check that a session is not reused if the server is restarted with a new cert."]; + +no_reuses_session_server_restart_new_cert(suite) -> + []; + +no_reuses_session_server_restart_new_cert(Config) when is_list(Config) -> + + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + DsaServerOpts = ?config(server_dsa_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Server = + ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, session_info_result, []}}, + {options, ServerOpts}]), + Port = ssl_test_lib:inet_port(Server), + Client0 = + ssl_test_lib:start_client([{node, ClientNode}, + {port, Port}, {host, Hostname}, + {mfa, {ssl_test_lib, no_result, []}}, + {from, self()}, {options, ClientOpts}]), + SessionInfo = + receive + {Server, Info} -> + Info + end, + + Server ! listen, + + %% Make sure session is registered + test_server:sleep(?SLEEP), + ssl_test_lib:close(Server), + %% Make sure port is free + test_server:sleep(?SLEEP * 3), + + Server1 = + ssl_test_lib:start_server([{node, ServerNode}, {port, Port}, + {from, self()}, + {mfa, {?MODULE, session_info_result, []}}, + {options, DsaServerOpts}]), + receive + {Server1, _} -> + ok + end, + + Client1 = + ssl_test_lib:start_client([{node, ClientNode}, + {port, Port}, {host, Hostname}, + {mfa, {?MODULE, session_info_result, []}}, + {from, self()}, {options, ClientOpts}]), + receive + {Client1, SessionInfo} -> + test_server:fail(session_reused_when_server_has_new_cert); + {Client1, _Other} -> + ok + end, + + ssl_test_lib:close(Server1), + ssl_test_lib:close(Client0), + ssl_test_lib:close(Client1), + process_flag(trap_exit, false). + +%%-------------------------------------------------------------------- +no_reuses_session_server_restart_new_cert_file(doc) -> + ["Check that a session is not reused if a server is restarted with a new " + "cert contained in a file with the same name as the old cert."]; + +no_reuses_session_server_restart_new_cert_file(suite) -> + []; + +no_reuses_session_server_restart_new_cert_file(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + DsaServerOpts = ?config(server_dsa_opts, Config), + PrivDir = ?config(priv_dir, Config), + + NewServerOpts = new_config(PrivDir, ServerOpts), + + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Server = + ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, session_info_result, []}}, + {options, NewServerOpts}]), + Port = ssl_test_lib:inet_port(Server), + Client0 = + ssl_test_lib:start_client([{node, ClientNode}, + {port, Port}, {host, Hostname}, + {mfa, {ssl_test_lib, no_result, []}}, + {from, self()}, {options, ClientOpts}]), + SessionInfo = + receive + {Server, Info} -> + Info + end, + + Server ! listen, + + %% Make sure session is registered + test_server:sleep(?SLEEP), + ssl_test_lib:close(Server), + %% Make sure port is free + test_server:sleep(?SLEEP), + + NewServerOpts = new_config(PrivDir, DsaServerOpts), + + Server1 = + ssl_test_lib:start_server([{node, ServerNode}, {port, Port}, + {from, self()}, + {mfa, {?MODULE, session_info_result, []}}, + {options, NewServerOpts}]), + + receive + {Server1, _} -> + ok + end, + + Client1 = + ssl_test_lib:start_client([{node, ClientNode}, + {port, Port}, {host, Hostname}, + {mfa, {?MODULE, session_info_result, []}}, + {from, self()}, {options, ClientOpts}]), + receive + {Client1, SessionInfo} -> + test_server:fail(session_reused_when_server_has_new_cert); + {Client1, _Other} -> + ok + end, + + ssl_test_lib:close(Server1), + ssl_test_lib:close(Client0), + ssl_test_lib:close(Client1), + process_flag(trap_exit, false). + +new_config(PrivDir, ServerOpts0) -> + CaCertFile = proplists:get_value(cacertfile, ServerOpts0), + CertFile = proplists:get_value(certfile, ServerOpts0), + KeyFile = proplists:get_value(keyfile, ServerOpts0), + NewCaCertFile = filename:join(PrivDir, "new_ca.pem"), + NewCertFile = filename:join(PrivDir, "new_cert.pem"), + NewKeyFile = filename:join(PrivDir, "new_key.pem"), + file:copy(CaCertFile, NewCaCertFile), + file:copy(CertFile, NewCertFile), + file:copy(KeyFile, NewKeyFile), + ServerOpts1 = proplists:delete(cacertfile, ServerOpts0), + ServerOpts2 = proplists:delete(certfile, ServerOpts1), + ServerOpts = proplists:delete(keyfile, ServerOpts2), + [{cacertfile, NewCaCertFile}, {certfile, NewCertFile}, + {keyfile, NewKeyFile} | ServerOpts]. + + %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index e1e8214ed6..bcefedf453 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -327,8 +327,8 @@ cert_options(Config) -> make_dsa_cert(Config) -> - {ServerCaCertFile, ServerCertFile, ServerKeyFile} = make_dsa_cert_files("server", Config), - {ClientCaCertFile, ClientCertFile, ClientKeyFile} = make_dsa_cert_files("client", Config), + {ServerCaCertFile, ServerCertFile, ServerKeyFile} = make_cert_files("server", Config, dsa, dsa, ""), + {ClientCaCertFile, ClientCertFile, ClientKeyFile} = make_cert_files("client", Config, dsa, dsa, ""), [{server_dsa_opts, [{ssl_imp, new},{reuseaddr, true}, {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, @@ -342,22 +342,41 @@ make_dsa_cert(Config) -> | Config]. - -make_dsa_cert_files(RoleStr, Config) -> - CaInfo = {CaCert, _} = erl_make_certs:make_cert([{key, dsa}]), - {Cert, CertKey} = erl_make_certs:make_cert([{key, dsa}, {issuer, CaInfo}]), +make_mix_cert(Config) -> + {ServerCaCertFile, ServerCertFile, ServerKeyFile} = make_cert_files("server", Config, dsa, + rsa, "mix"), + {ClientCaCertFile, ClientCertFile, ClientKeyFile} = make_cert_files("client", Config, dsa, + rsa, "mix"), + [{server_mix_opts, [{ssl_imp, new},{reuseaddr, true}, + {cacertfile, ServerCaCertFile}, + {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, + {server_mix_verify_opts, [{ssl_imp, new},{reuseaddr, true}, + {cacertfile, ClientCaCertFile}, + {certfile, ServerCertFile}, {keyfile, ServerKeyFile}, + {verify, verify_peer}]}, + {client_mix_opts, [{ssl_imp, new},{reuseaddr, true}, + {cacertfile, ClientCaCertFile}, + {certfile, ClientCertFile}, {keyfile, ClientKeyFile}]} + | Config]. + +make_cert_files(RoleStr, Config, Alg1, Alg2, Prefix) -> + Alg1Str = atom_to_list(Alg1), + Alg2Str = atom_to_list(Alg2), + CaInfo = {CaCert, _} = erl_make_certs:make_cert([{key, Alg1}]), + {Cert, CertKey} = erl_make_certs:make_cert([{key, Alg2}, {issuer, CaInfo}]), CaCertFile = filename:join([?config(priv_dir, Config), - RoleStr, "dsa_cacerts.pem"]), + RoleStr, Prefix ++ Alg1Str ++ "_cacerts.pem"]), CertFile = filename:join([?config(priv_dir, Config), - RoleStr, "dsa_cert.pem"]), + RoleStr, Alg2Str ++ "_cert.pem"]), KeyFile = filename:join([?config(priv_dir, Config), - RoleStr, "dsa_key.pem"]), + RoleStr, Prefix ++ Alg2Str ++ "_key.pem"]), der_to_pem(CaCertFile, [{'Certificate', CaCert, not_encrypted}]), der_to_pem(CertFile, [{'Certificate', Cert, not_encrypted}]), der_to_pem(KeyFile, [CertKey]), {CaCertFile, CertFile, KeyFile}. + start_upgrade_server(Args) -> Result = spawn_link(?MODULE, run_upgrade_server, [Args]), receive -- cgit v1.2.3 From b9dcf285187eb0119662069b8c485a9298b324bb Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 10 Dec 2010 10:43:14 +0100 Subject: Cache invalidation and consistent user closing Added cache invalidation control of ssl certificates so that sessions will not be reused if file content is changed. There was a glitch in ssl:close that made it possible to to get eaddrinuse even though reuseadder-option was used. Also improved tests for better user-close handling. --- lib/ssl/src/ssl_certificate_db.erl | 34 ++-- lib/ssl/src/ssl_connection.erl | 32 +++- lib/ssl/src/ssl_manager.erl | 33 ++-- lib/ssl/test/ssl_basic_SUITE.erl | 332 ++++++++++++++++------------------ lib/ssl/test/ssl_test_lib.erl | 85 ++++----- lib/ssl/test/ssl_to_openssl_SUITE.erl | 4 - 6 files changed, 262 insertions(+), 258 deletions(-) diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl index 019f73fc80..f34459de37 100644 --- a/lib/ssl/src/ssl_certificate_db.erl +++ b/lib/ssl/src/ssl_certificate_db.erl @@ -27,7 +27,7 @@ -export([create/0, remove/1, add_trusted_certs/3, remove_trusted_certs/2, lookup_trusted_cert/3, issuer_candidate/1, - lookup_cached_certs/1, cache_pem_file/4, uncache_pem_file/2, ref_count/3]). + lookup_cached_certs/1, cache_pem_file/4, uncache_pem_file/2, lookup/2]). -type time() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}. @@ -122,10 +122,13 @@ cache_pem_file(Pid, File, Time, [CertsDb, _FileToRefDb, PidToFileDb]) -> %% but with different content. %% -------------------------------------------------------------------- uncache_pem_file(File, [_CertsDb, _FileToRefDb, PidToFileDb]) -> - Pids = select(PidToFileDb, [{{'$1', File},[],['$$']}]), + [Pids] = select(PidToFileDb, [{{'$1', File},[],['$$']}]), lists:foreach(fun(Pid) -> exit(Pid, shutdown) end, Pids). + + + %%-------------------------------------------------------------------- -spec remove_trusted_certs(pid(), certdb_ref()) -> term(). @@ -190,6 +193,22 @@ issuer_candidate(PrevCandidateKey) -> {Key, Cert} end. +%%-------------------------------------------------------------------- +-spec lookup(term(), term()) -> term() | undefined. +%% +%% Description: Looks up an element in a certificat . +%%-------------------------------------------------------------------- +lookup(Key, Db) -> + case ets:lookup(Db, Key) of + [] -> + undefined; + Contents -> + Pick = fun({_, Data}) -> Data; + ({_,_,Data}) -> Data + end, + [Pick(Data) || Data <- Contents] + end. + %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- @@ -208,17 +227,6 @@ ref_count(Key, Db,N) -> delete(Key, Db) -> _ = ets:delete(Db, Key). -lookup(Key, Db) -> - case ets:lookup(Db, Key) of - [] -> - undefined; - Contents -> - Pick = fun({_, Data}) -> Data; - ({_,_,Data}) -> Data - end, - [Pick(Data) || Data <- Contents] - end. - select(Db, MatchSpec)-> ets:select(Db, MatchSpec). diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 478f465705..675e5e44bd 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -90,7 +90,8 @@ log_alert, % boolean() renegotiation, % {boolean(), From | internal | peer} recv_during_renegotiation, %boolean() - send_queue % queue() + send_queue, % queue() + terminated = false % }). -define(DEFAULT_DIFFIE_HELLMAN_PARAMS, @@ -781,8 +782,12 @@ handle_sync_event(start, _, connection, State) -> handle_sync_event(start, From, StateName, State) -> {next_state, StateName, State#state{from = From}}; -handle_sync_event(close, _, _StateName, State) -> - {stop, normal, ok, State}; +handle_sync_event(close, _, StateName, State) -> + %% Run terminate before returning + %% so that the reuseaddr inet-option will work + %% as intended. + (catch terminate(user_close, StateName, State)), + {stop, normal, ok, State#state{terminated = true}}; handle_sync_event({shutdown, How0}, _, StateName, #state{transport_cb = Transport, @@ -970,6 +975,11 @@ handle_info(Msg, StateName, State) -> %% necessary cleaning up. When it returns, the gen_fsm terminates with %% Reason. The return value is ignored. %%-------------------------------------------------------------------- +terminate(_, _, #state{terminated = true}) -> + %% Happens when user closes the connection using ssl:close/1 + %% we want to guarantee that Transport:close has been called + %% when ssl:close/1 returns. + ok; terminate(Reason, connection, #state{negotiated_version = Version, connection_states = ConnectionStates, transport_cb = Transport, @@ -979,14 +989,14 @@ terminate(Reason, connection, #state{negotiated_version = Version, notify_renegotiater(Renegotiate), BinAlert = terminate_alert(Reason, Version, ConnectionStates), Transport:send(Socket, BinAlert), - workaround_transport_delivery_problems(Socket, Transport), + workaround_transport_delivery_problems(Socket, Transport, Reason), Transport:close(Socket); -terminate(_Reason, _StateName, #state{transport_cb = Transport, +terminate(Reason, _StateName, #state{transport_cb = Transport, socket = Socket, send_queue = SendQueue, renegotiation = Renegotiate}) -> notify_senders(SendQueue), notify_renegotiater(Renegotiate), - workaround_transport_delivery_problems(Socket, Transport), + workaround_transport_delivery_problems(Socket, Transport, Reason), Transport:close(Socket). %%-------------------------------------------------------------------- @@ -2189,7 +2199,8 @@ notify_renegotiater({true, From}) when not is_atom(From) -> notify_renegotiater(_) -> ok. -terminate_alert(Reason, Version, ConnectionStates) when Reason == normal; Reason == shutdown -> +terminate_alert(Reason, Version, ConnectionStates) when Reason == normal; Reason == shutdown; + Reason == user_close -> {BinAlert, _} = encode_alert(?ALERT_REC(?WARNING, ?CLOSE_NOTIFY), Version, ConnectionStates), BinAlert; @@ -2198,10 +2209,13 @@ terminate_alert(_, Version, ConnectionStates) -> Version, ConnectionStates), BinAlert. -workaround_transport_delivery_problems(Socket, Transport) -> +workaround_transport_delivery_problems(_,_, user_close) -> + ok; +workaround_transport_delivery_problems(Socket, Transport, _) -> %% Standard trick to try to make sure all %% data sent to to tcp port is really sent - %% before tcp port is closed. + %% before tcp port is closed so that the peer will + %% get a correct error message. inet:setopts(Socket, [{active, false}]), Transport:shutdown(Socket, write), Transport:recv(Socket, 0). diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index dc613eec11..f845b1ecc0 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -35,7 +35,7 @@ invalidate_session/3]). % Spawn export --export([init_session_validator/1, recache_pem/4]). +-export([init_session_validator/1]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, @@ -229,8 +229,8 @@ handle_call({{cache_pem, File, LastWrite}, Pid}, _, end; handle_call({{recache_pem, File, LastWrite}, Pid}, From, #state{certificate_db = Db} = State) -> - ssl_certificate_db:uncache_pem_file(File, Pid, Db), - spawn_link(?MODULE, recache_pem, [File, Db, LastWrite, From]), + ssl_certificate_db:uncache_pem_file(File, Db), + cast({recache_pem, File, LastWrite, Pid, From}), {noreply, State}. %%-------------------------------------------------------------------- @@ -269,7 +269,21 @@ handle_cast({invalidate_session, Port, #session{session_id = ID}}, #state{session_cache = Cache, session_cache_cb = CacheCb} = State) -> CacheCb:delete(Cache, {Port, ID}), - {noreply, State}. + {noreply, State}; + +handle_cast({recache_pem, File, LastWrite, Pid, From}, + #state{certificate_db = [_, FileToRefDb, _]} = State0) -> + case ssl_certificate_db:lookup(File, FileToRefDb) of + undefined -> + {reply, Msg, State} = handle_call({{cache_pem, File, LastWrite}, Pid}, From, State0), + gen_server:reply(From, Msg), + {noreply, State}; + _ -> %% Send message to self letting cleanup messages be handled + %% first so that no reference to the old version of file + %% exists when we cache the new one. + cast({recache_pem, File, LastWrite, Pid, From}), + {noreply, State0} + end. %%-------------------------------------------------------------------- -spec handle_info(msg(), #state{}) -> {noreply, #state{}}. @@ -387,14 +401,3 @@ cache_pem_file(File, LastWrite) -> [] -> call({cache_pem, File, LastWrite}) end. - - -recache_pem(File, Db, LastWrite, From) -> - case ssl_certificate_db:ref_count(File, Db, 0) of - 0 -> - Result = call({cache_pem, File, LastWrite}), - gen_server:reply(From, Result); - _ -> - timer:sleep(1000), - recache_pem(File, Db, LastWrite, From) - end. diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 92de3fe070..962d2d8cf0 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -27,6 +27,7 @@ -include("test_server.hrl"). -include("test_server_line.hrl"). -include_lib("public_key/include/public_key.hrl"). + -include("ssl_alert.hrl"). -define('24H_in_sec', 86400). @@ -209,8 +210,9 @@ all(suite) -> client_with_cert_cipher_suites_handshake, unknown_server_ca_fail, der_input, unknown_server_ca_accept_verify_none, unknown_server_ca_accept_verify_peer, unknown_server_ca_accept_backwardscompatibilty, - different_ca_peer_sign, no_reuses_session_server_restart_new_cert, - no_reuses_session_server_restart_new_cert_file + %different_ca_peer_sign, + no_reuses_session_server_restart_new_cert, + no_reuses_session_server_restart_new_cert_file, reuseaddr ]. %% Test cases starts here. @@ -326,7 +328,6 @@ basic_test(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). - %%-------------------------------------------------------------------- controlling_process(doc) -> @@ -526,9 +527,7 @@ client_closes_socket(Config) when is_list(Config) -> _Client = spawn_link(Connect), - ssl_test_lib:check_result(Server, {error,closed}), - - ssl_test_lib:close(Server). + ssl_test_lib:check_result(Server, {error,closed}). %%-------------------------------------------------------------------- @@ -743,7 +742,6 @@ socket_options(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client, ok), ssl_test_lib:close(Server), - ssl_test_lib:close(Client), {ok, Listen} = ssl:listen(0, ServerOpts), {ok,[{mode,list}]} = ssl:getopts(Listen, [mode]), @@ -846,6 +844,7 @@ send_recv(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). +%%-------------------------------------------------------------------- send_close(doc) -> [""]; @@ -872,8 +871,7 @@ send_close(Config) when is_list(Config) -> ok = ssl:send(SslS, "Hello world"), {ok,<<"Hello world">>} = ssl:recv(SslS, 11), gen_tcp:close(TcpS), - {error, _} = ssl:send(SslS, "Hello world"), - ssl_test_lib:close(Server). + {error, _} = ssl:send(SslS, "Hello world"). %%-------------------------------------------------------------------- close_transport_accept(doc) -> @@ -1048,8 +1046,7 @@ tcp_connect(Config) when is_list(Config) -> {Server, {error, Error}} -> test_server:format("Error ~p", [Error]) end - end, - ssl_test_lib:close(Server). + end. dummy(_Socket) -> @@ -1154,13 +1151,13 @@ ecertfile(Config) when is_list(Config) -> %%-------------------------------------------------------------------- -ecacertfile(doc) -> +ecacertfile(doc) -> ["Test what happens with an invalid cacert file"]; -ecacertfile(suite) -> +ecacertfile(suite) -> []; -ecacertfile(Config) when is_list(Config) -> +ecacertfile(Config) when is_list(Config) -> ClientOpts = [{reuseaddr, true}|?config(client_opts, Config)], ServerBadOpts = [{reuseaddr, true}|?config(server_bad_ca, Config)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -1537,7 +1534,7 @@ erlang_cipher_suite(Suite) -> Suite. cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) -> - process_flag(trap_exit, true), + %% process_flag(trap_exit, true), test_server:format("Testing CipherSuite ~p~n", [CipherSuite]), {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -1561,16 +1558,8 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) -> Result = ssl_test_lib:wait_for_result(Server, ok, Client, ok), ssl_test_lib:close(Server), - receive - {'EXIT', Server, normal} -> - ok - end, ssl_test_lib:close(Client), - receive - {'EXIT', Client, normal} -> - ok - end, - process_flag(trap_exit, false), + case Result of ok -> []; @@ -1612,7 +1601,6 @@ reuse_session(suite) -> []; reuse_session(Config) when is_list(Config) -> - process_flag(trap_exit, true), ClientOpts = ?config(client_opts, Config), ServerOpts = ?config(server_opts, Config), {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -1620,13 +1608,13 @@ reuse_session(Config) when is_list(Config) -> Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, {from, self()}, - {mfa, {?MODULE, session_info_result, []}}, - {options, ServerOpts}]), + {mfa, {?MODULE, session_info_result, []}}, + {options, ServerOpts}]), Port = ssl_test_lib:inet_port(Server), Client0 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, - {mfa, {ssl_test_lib, no_result, []}}, + {mfa, {ssl_test_lib, no_result, []}}, {from, self()}, {options, ClientOpts}]), SessionInfo = receive @@ -1634,16 +1622,16 @@ reuse_session(Config) when is_list(Config) -> Info end, - Server ! listen, + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, %% Make sure session is registered test_server:sleep(?SLEEP), Client1 = - ssl_test_lib:start_client([{node, ClientNode}, - {port, Port}, {host, Hostname}, - {mfa, {?MODULE, session_info_result, []}}, - {from, self()}, {options, ClientOpts}]), + ssl_test_lib:start_client([{node, ClientNode}, + {port, Port}, {host, Hostname}, + {mfa, {?MODULE, session_info_result, []}}, + {from, self()}, {options, ClientOpts}]), receive {Client1, SessionInfo} -> ok; @@ -1653,10 +1641,10 @@ reuse_session(Config) when is_list(Config) -> test_server:fail(session_not_reused) end, - Server ! listen, + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, Client2 = - ssl_test_lib:start_client([{node, ClientNode}, + ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, {mfa, {?MODULE, session_info_result, []}}, {from, self()}, {options, [{reuse_sessions, false} @@ -1670,10 +1658,6 @@ reuse_session(Config) when is_list(Config) -> end, ssl_test_lib:close(Server), - ssl_test_lib:close(Client0), - ssl_test_lib:close(Client1), - ssl_test_lib:close(Client2), - Server1 = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, @@ -1685,7 +1669,7 @@ reuse_session(Config) when is_list(Config) -> Client3 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port1}, {host, Hostname}, - {mfa, {?MODULE, session_info_result, []}}, + {mfa, {ssl_test_lib, no_result, []}}, {from, self()}, {options, ClientOpts}]), SessionInfo1 = @@ -1694,7 +1678,7 @@ reuse_session(Config) when is_list(Config) -> Info1 end, - Server1 ! listen, + Server1 ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, %% Make sure session is registered test_server:sleep(?SLEEP), @@ -1710,14 +1694,16 @@ reuse_session(Config) when is_list(Config) -> test_server:fail( session_reused_when_session_reuse_disabled_by_server); {Client4, _Other} -> + test_server:format("OTHER: ~p ~n", [_Other]), ok end, - + ssl_test_lib:close(Server1), + ssl_test_lib:close(Client0), + ssl_test_lib:close(Client1), + ssl_test_lib:close(Client2), ssl_test_lib:close(Client3), - ssl_test_lib:close(Client4), - process_flag(trap_exit, false). - + ssl_test_lib:close(Client4). session_info_result(Socket) -> ssl:session_info(Socket). @@ -1730,7 +1716,6 @@ reuse_session_expired(suite) -> []; reuse_session_expired(Config) when is_list(Config) -> - process_flag(trap_exit, true), ClientOpts = ?config(client_opts, Config), ServerOpts = ?config(server_opts, Config), {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), @@ -1751,8 +1736,8 @@ reuse_session_expired(Config) when is_list(Config) -> {Server, Info} -> Info end, - - Server ! listen, + + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, %% Make sure session is registered test_server:sleep(?SLEEP), @@ -1772,7 +1757,7 @@ reuse_session_expired(Config) when is_list(Config) -> end, Server ! listen, - + %% Make sure session is unregistered due to expiration test_server:sleep((?EXPIRE+1) * 1000), @@ -1787,12 +1772,12 @@ reuse_session_expired(Config) when is_list(Config) -> {Client2, _} -> ok end, - + process_flag(trap_exit, false), ssl_test_lib:close(Server), ssl_test_lib:close(Client0), ssl_test_lib:close(Client1), - ssl_test_lib:close(Client2), - process_flag(trap_exit, false). + ssl_test_lib:close(Client2). + %%-------------------------------------------------------------------- server_does_not_want_to_reuse_session(doc) -> ["Test reuse of sessions (short handshake)"]; @@ -1825,10 +1810,11 @@ server_does_not_want_to_reuse_session(Config) when is_list(Config) -> Info end, - Server ! listen, + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, %% Make sure session is registered test_server:sleep(?SLEEP), + ssl_test_lib:close(Client0), Client1 = ssl_test_lib:start_client([{node, ClientNode}, @@ -1841,11 +1827,9 @@ server_does_not_want_to_reuse_session(Config) when is_list(Config) -> {Client1, _Other} -> ok end, - + ssl_test_lib:close(Server), - ssl_test_lib:close(Client0), - ssl_test_lib:close(Client1), - process_flag(trap_exit, false). + ssl_test_lib:close(Client1). %%-------------------------------------------------------------------- @@ -2012,6 +1996,7 @@ server_verify_none_active_once(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client, ok), ssl_test_lib:close(Server), ssl_test_lib:close(Client). + %%-------------------------------------------------------------------- server_verify_client_once_passive(doc) -> @@ -2039,7 +2024,7 @@ server_verify_client_once_passive(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client0, ok), ssl_test_lib:close(Client0), - Server ! listen, + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, Client1 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, {from, self()}, @@ -2077,7 +2062,7 @@ server_verify_client_once_active(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client0, ok), ssl_test_lib:close(Client0), - Server ! listen, + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, Client1 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, {from, self()}, @@ -2088,7 +2073,6 @@ server_verify_client_once_active(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client1). - %%-------------------------------------------------------------------- server_verify_client_once_active_once(doc) -> @@ -2116,18 +2100,17 @@ server_verify_client_once_active_once(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client0, ok), ssl_test_lib:close(Client0), - Server ! listen, - + Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}}, Client1 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, - {host, Hostname}, - {from, self()}, - {mfa, {?MODULE, result_ok, []}}, - {options, [{active, once} | ClientOpts]}]), + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, result_ok, []}}, + {options, [{active, once} | ClientOpts]}]), ssl_test_lib:check_result(Client1, ok), ssl_test_lib:close(Server), ssl_test_lib:close(Client1). - + %%-------------------------------------------------------------------- server_verify_no_cacerts(doc) -> @@ -2135,9 +2118,8 @@ server_verify_no_cacerts(doc) -> server_verify_no_cacerts(suite) -> []; - server_verify_no_cacerts(Config) when is_list(Config) -> - ServerOpts = ServerOpts = ?config(server_opts, Config), + ServerOpts = ?config(server_opts, Config), {_, ServerNode, _} = ssl_test_lib:run_where(Config), Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0}, {from, self()}, @@ -2298,8 +2280,6 @@ client_verify_none_active_once(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). - - %%-------------------------------------------------------------------- client_renegotiate(doc) -> ["Test ssl:renegotiate/1 on client."]; @@ -2308,7 +2288,6 @@ client_renegotiate(suite) -> []; client_renegotiate(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2331,11 +2310,9 @@ client_renegotiate(Config) when is_list(Config) -> {options, [{reuse_sessions, false} | ClientOpts]}]), ssl_test_lib:check_result(Client, ok, Server, ok), - ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - process_flag(trap_exit, false), - ok. + ssl_test_lib:close(Client). + %%-------------------------------------------------------------------- server_renegotiate(doc) -> ["Test ssl:renegotiate/1 on server."]; @@ -2344,7 +2321,6 @@ server_renegotiate(suite) -> []; server_renegotiate(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2367,8 +2343,7 @@ server_renegotiate(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client, ok), ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - ok. + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- client_renegotiate_reused_session(doc) -> @@ -2378,7 +2353,6 @@ client_renegotiate_reused_session(suite) -> []; client_renegotiate_reused_session(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2401,11 +2375,8 @@ client_renegotiate_reused_session(Config) when is_list(Config) -> {options, [{reuse_sessions, true} | ClientOpts]}]), ssl_test_lib:check_result(Client, ok, Server, ok), - ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - process_flag(trap_exit, false), - ok. + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- server_renegotiate_reused_session(doc) -> ["Test ssl:renegotiate/1 on server when the ssl session will be reused."]; @@ -2414,7 +2385,6 @@ server_renegotiate_reused_session(suite) -> []; server_renegotiate_reused_session(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2437,9 +2407,7 @@ server_renegotiate_reused_session(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok, Client, ok), ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - ok. - + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- client_no_wrap_sequence_number(doc) -> ["Test that erlang client will renegotiate session when", @@ -2451,7 +2419,6 @@ client_no_wrap_sequence_number(suite) -> []; client_no_wrap_sequence_number(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2476,11 +2443,8 @@ client_no_wrap_sequence_number(Config) when is_list(Config) -> {renegotiate_at, N} | ClientOpts]}]), ssl_test_lib:check_result(Client, ok), - ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - process_flag(trap_exit, false), - ok. + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- server_no_wrap_sequence_number(doc) -> ["Test that erlang server will renegotiate session when", @@ -2492,7 +2456,6 @@ server_no_wrap_sequence_number(suite) -> []; server_no_wrap_sequence_number(Config) when is_list(Config) -> - process_flag(trap_exit, true), ServerOpts = ?config(server_opts, Config), ClientOpts = ?config(client_opts, Config), @@ -2516,9 +2479,7 @@ server_no_wrap_sequence_number(Config) when is_list(Config) -> ssl_test_lib:check_result(Server, ok), ssl_test_lib:close(Server), - ssl_test_lib:close(Client), - ok. - + ssl_test_lib:close(Client). %%-------------------------------------------------------------------- extended_key_usage(doc) -> ["Test cert that has a critical extended_key_usage extension"]; @@ -2890,9 +2851,7 @@ unknown_server_ca_fail(Config) when is_list(Config) -> | ClientOpts]}]), ssl_test_lib:check_result(Server, {error,"unknown ca"}, - Client, {error, "unknown ca"}), - ssl_test_lib:close(Server), - ssl_test_lib:close(Client). + Client, {error, "unknown ca"}). %%-------------------------------------------------------------------- unknown_server_ca_accept_verify_none(doc) -> @@ -3057,37 +3016,37 @@ der_input_opts(Opts) -> {Cert, {rsa, Key}, CaCerts, DHParams}. %%-------------------------------------------------------------------- -different_ca_peer_sign(doc) -> - ["Check that a CA can have a different signature algorithm than the peer cert."]; +%% different_ca_peer_sign(doc) -> +%% ["Check that a CA can have a different signature algorithm than the peer cert."]; -different_ca_peer_sign(suite) -> - []; +%% different_ca_peer_sign(suite) -> +%% []; -different_ca_peer_sign(Config) when is_list(Config) -> - ClientOpts = ?config(client_mix_opts, Config), - ServerOpts = ?config(server_mix_verify_opts, Config), +%% different_ca_peer_sign(Config) when is_list(Config) -> +%% ClientOpts = ?config(client_mix_opts, Config), +%% ServerOpts = ?config(server_mix_verify_opts, Config), - {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), - Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, - {from, self()}, - {mfa, {?MODULE, send_recv_result_active_once, []}}, - {options, [{active, once}, - {verify, verify_peer} | ServerOpts]}]), - Port = ssl_test_lib:inet_port(Server), +%% {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), +%% Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, +%% {from, self()}, +%% {mfa, {?MODULE, send_recv_result_active_once, []}}, +%% {options, [{active, once}, +%% {verify, verify_peer} | ServerOpts]}]), +%% Port = ssl_test_lib:inet_port(Server), - Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, - {host, Hostname}, - {from, self()}, - {mfa, {?MODULE, - send_recv_result_active_once, - []}}, - {options, [{active, once}, - {verify, verify_peer} - | ClientOpts]}]), +%% Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, +%% {host, Hostname}, +%% {from, self()}, +%% {mfa, {?MODULE, +%% send_recv_result_active_once, +%% []}}, +%% {options, [{active, once}, +%% {verify, verify_peer} +%% | ClientOpts]}]), - ssl_test_lib:check_result(Server, ok, Client, ok), - ssl_test_lib:close(Server), - ssl_test_lib:close(Client). +%% ssl_test_lib:check_result(Server, ok, Client, ok), +%% ssl_test_lib:close(Server), +%% ssl_test_lib:close(Client). %%-------------------------------------------------------------------- @@ -3121,23 +3080,16 @@ no_reuses_session_server_restart_new_cert(Config) when is_list(Config) -> Info end, - Server ! listen, - %% Make sure session is registered test_server:sleep(?SLEEP), ssl_test_lib:close(Server), - %% Make sure port is free - test_server:sleep(?SLEEP * 3), + ssl_test_lib:close(Client0), Server1 = ssl_test_lib:start_server([{node, ServerNode}, {port, Port}, {from, self()}, - {mfa, {?MODULE, session_info_result, []}}, + {mfa, {ssl_test_lib, no_result, []}}, {options, DsaServerOpts}]), - receive - {Server1, _} -> - ok - end, Client1 = ssl_test_lib:start_client([{node, ClientNode}, @@ -3150,11 +3102,8 @@ no_reuses_session_server_restart_new_cert(Config) when is_list(Config) -> {Client1, _Other} -> ok end, - ssl_test_lib:close(Server1), - ssl_test_lib:close(Client0), - ssl_test_lib:close(Client1), - process_flag(trap_exit, false). + ssl_test_lib:close(Client1). %%-------------------------------------------------------------------- no_reuses_session_server_restart_new_cert_file(doc) -> @@ -3166,12 +3115,11 @@ no_reuses_session_server_restart_new_cert_file(suite) -> no_reuses_session_server_restart_new_cert_file(Config) when is_list(Config) -> ClientOpts = ?config(client_opts, Config), - ServerOpts = ?config(server_opts, Config), + ServerOpts = ?config(server_verification_opts, Config), DsaServerOpts = ?config(server_dsa_opts, Config), PrivDir = ?config(priv_dir, Config), NewServerOpts = new_config(PrivDir, ServerOpts), - {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), Server = @@ -3191,27 +3139,19 @@ no_reuses_session_server_restart_new_cert_file(Config) when is_list(Config) -> Info end, - Server ! listen, - - %% Make sure session is registered - test_server:sleep(?SLEEP), + %% Make sure session is registered and we get + %% new file time stamp when calling new_config! + test_server:sleep(?SLEEP* 2), ssl_test_lib:close(Server), - %% Make sure port is free - test_server:sleep(?SLEEP), + ssl_test_lib:close(Client0), NewServerOpts = new_config(PrivDir, DsaServerOpts), Server1 = ssl_test_lib:start_server([{node, ServerNode}, {port, Port}, {from, self()}, - {mfa, {?MODULE, session_info_result, []}}, + {mfa, {ssl_test_lib, no_result, []}}, {options, NewServerOpts}]), - - receive - {Server1, _} -> - ok - end, - Client1 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, @@ -3223,28 +3163,50 @@ no_reuses_session_server_restart_new_cert_file(Config) when is_list(Config) -> {Client1, _Other} -> ok end, - ssl_test_lib:close(Server1), - ssl_test_lib:close(Client0), - ssl_test_lib:close(Client1), - process_flag(trap_exit, false). + ssl_test_lib:close(Client1). -new_config(PrivDir, ServerOpts0) -> - CaCertFile = proplists:get_value(cacertfile, ServerOpts0), - CertFile = proplists:get_value(certfile, ServerOpts0), - KeyFile = proplists:get_value(keyfile, ServerOpts0), - NewCaCertFile = filename:join(PrivDir, "new_ca.pem"), - NewCertFile = filename:join(PrivDir, "new_cert.pem"), - NewKeyFile = filename:join(PrivDir, "new_key.pem"), - file:copy(CaCertFile, NewCaCertFile), - file:copy(CertFile, NewCertFile), - file:copy(KeyFile, NewKeyFile), - ServerOpts1 = proplists:delete(cacertfile, ServerOpts0), - ServerOpts2 = proplists:delete(certfile, ServerOpts1), - ServerOpts = proplists:delete(keyfile, ServerOpts2), - [{cacertfile, NewCaCertFile}, {certfile, NewCertFile}, - {keyfile, NewKeyFile} | ServerOpts]. +%%-------------------------------------------------------------------- +reuseaddr(doc) -> + [""]; +reuseaddr(suite) -> + []; + +reuseaddr(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = + ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {ssl_test_lib, no_result, []}}, + {options, [{active, false} | ServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + Client = + ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {ssl_test_lib, no_result, []}}, + {options, [{active, false} | ClientOpts]}]), + test_server:sleep(?SLEEP), + ssl_test_lib:close(Server), + + Server1 = + ssl_test_lib:start_server([{node, ServerNode}, {port, Port}, + {from, self()}, + {mfa, {?MODULE, send_recv_result, []}}, + {options, [{active, false} | ServerOpts]}]), + Client1 = + ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, send_recv_result, []}}, + {options, [{active, false} | ClientOpts]}]), + + ssl_test_lib:check_result(Server1, ok, Client1, ok), + ssl_test_lib:close(Server1), + ssl_test_lib:close(Client1). %%-------------------------------------------------------------------- %%% Internal functions @@ -3252,7 +3214,7 @@ new_config(PrivDir, ServerOpts0) -> erlang_ssl_receive(Socket, Data) -> receive {ssl, Socket, Data} -> - io:format("Received ~p~n",[Data]), + test_server:format("Received ~p~n",[Data]), ok; Other -> test_server:fail({unexpected_message, Other}) @@ -3282,7 +3244,6 @@ send_recv_result_active_once(Socket) -> result_ok(_Socket) -> ok. - renegotiate(Socket, Data) -> test_server:format("Renegotiating ~n", []), Result = ssl:renegotiate(Socket), @@ -3299,3 +3260,24 @@ renegotiate_reuse_session(Socket, Data) -> %% Make sure session is registerd test_server:sleep(?SLEEP), renegotiate(Socket, Data). + + +new_config(PrivDir, ServerOpts0) -> + CaCertFile = proplists:get_value(cacertfile, ServerOpts0), + CertFile = proplists:get_value(certfile, ServerOpts0), + KeyFile = proplists:get_value(keyfile, ServerOpts0), + NewCaCertFile = filename:join(PrivDir, "new_ca.pem"), + NewCertFile = filename:join(PrivDir, "new_cert.pem"), + NewKeyFile = filename:join(PrivDir, "new_key.pem"), + file:copy(CaCertFile, NewCaCertFile), + file:copy(CertFile, NewCertFile), + file:copy(KeyFile, NewKeyFile), + ServerOpts1 = proplists:delete(cacertfile, ServerOpts0), + ServerOpts2 = proplists:delete(certfile, ServerOpts1), + ServerOpts = proplists:delete(keyfile, ServerOpts2), + + {ok, PEM} = file:read_file(NewCaCertFile), + test_server:format("CA file content: ~p~n", [public_key:pem_decode(PEM)]), + + [{cacertfile, NewCaCertFile}, {certfile, NewCertFile}, + {keyfile, NewKeyFile} | ServerOpts]. diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index bcefedf453..f6ccbe85e3 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -81,14 +81,20 @@ run_server(ListenSocket, Opts) -> no_result_msg -> ok; Msg -> - test_server:format("Msg: ~p ~n", [Msg]), + test_server:format("Server Msg: ~p ~n", [Msg]), Pid ! {self(), Msg} end, - receive + receive listen -> run_server(ListenSocket, Opts); + {listen, MFA} -> + run_server(ListenSocket, [MFA | proplists:delete(mfa, Opts)]); close -> - ok = rpc:call(Node, ssl, close, [AcceptSocket]) + test_server:format("Server closing ~p ~n", [self()]), + Result = rpc:call(Node, ssl, close, [AcceptSocket], 500), + test_server:format("Result ~p ~n", [Result]); + {ssl_closed, _} -> + ok end. %%% To enable to test with s_client -reconnect @@ -151,19 +157,30 @@ run_client(Opts) -> no_result_msg -> ok; Msg -> + test_server:format("Client Msg: ~p ~n", [Msg]), Pid ! {self(), Msg} end, - receive + receive close -> - ok = rpc:call(Node, ssl, close, [Socket]) + test_server:format("Client closing~n", []), + rpc:call(Node, ssl, close, [Socket]); + {ssl_closed, Socket} -> + ok end; {error, Reason} -> - test_server:format("Client: connection failed: ~p ~n", [Reason]), + test_server:format("Client: connection failed: ~p ~n", [Reason]), Pid ! {self(), {error, Reason}} end. close(Pid) -> - Pid ! close. + test_server:format("Close ~p ~n", [Pid]), + Monitor = erlang:monitor(process, Pid), + Pid ! close, + receive + {'DOWN', Monitor, process, Pid, Reason} -> + erlang:demonitor(Monitor), + test_server:format("Pid: ~p down due to:~p ~n", [Pid, Reason]) + end. check_result(Server, ServerMsg, Client, ClientMsg) -> receive @@ -208,47 +225,27 @@ check_result(Pid, Msg) -> test_server:fail(Reason) end. -check_result_ignore_renegotiation_reject(Pid, Msg) -> - receive - {Pid, fail_session_fatal_alert_during_renegotiation} -> - test_server:comment("Server rejected old renegotiation"), - ok; - {ssl_error, _, esslconnect} -> - test_server:comment("Server rejected old renegotiation"), - ok; - {Pid, Msg} -> - ok; - {Port, {data,Debug}} when is_port(Port) -> - io:format("openssl ~s~n",[Debug]), - check_result(Pid,Msg); - Unexpected -> - Reason = {{expected, {Pid, Msg}}, - {got, Unexpected}}, - test_server:fail(Reason) - end. - - wait_for_result(Server, ServerMsg, Client, ClientMsg) -> receive {Server, ServerMsg} -> receive {Client, ClientMsg} -> - ok; - Unexpected -> - Unexpected + ok + %% Unexpected -> + %% Unexpected end; {Client, ClientMsg} -> receive {Server, ServerMsg} -> - ok; - Unexpected -> - Unexpected + ok + %% Unexpected -> + %% Unexpected end; {Port, {data,Debug}} when is_port(Port) -> io:format("openssl ~s~n",[Debug]), - wait_for_result(Server, ServerMsg, Client, ClientMsg); - Unexpected -> - Unexpected + wait_for_result(Server, ServerMsg, Client, ClientMsg) + %% Unexpected -> + %% Unexpected end. @@ -258,9 +255,9 @@ wait_for_result(Pid, Msg) -> ok; {Port, {data,Debug}} when is_port(Port) -> io:format("openssl ~s~n",[Debug]), - wait_for_result(Pid,Msg); - Unexpected -> - Unexpected + wait_for_result(Pid,Msg) + %% Unexpected -> + %% Unexpected end. cert_options(Config) -> @@ -367,7 +364,7 @@ make_cert_files(RoleStr, Config, Alg1, Alg2, Prefix) -> CaCertFile = filename:join([?config(priv_dir, Config), RoleStr, Prefix ++ Alg1Str ++ "_cacerts.pem"]), CertFile = filename:join([?config(priv_dir, Config), - RoleStr, Alg2Str ++ "_cert.pem"]), + RoleStr, Prefix ++ Alg2Str ++ "_cert.pem"]), KeyFile = filename:join([?config(priv_dir, Config), RoleStr, Prefix ++ Alg2Str ++ "_key.pem"]), @@ -414,10 +411,12 @@ run_upgrade_server(Opts) -> end, {Module, Function, Args} = proplists:get_value(mfa, Opts), Msg = rpc:call(Node, Module, Function, [SslAcceptSocket | Args]), + test_server:format("Upgrade Server Msg: ~p ~n", [Msg]), Pid ! {self(), Msg}, receive close -> - ok = rpc:call(Node, ssl, close, [SslAcceptSocket]) + test_server:format("Upgrade Server closing~n", []), + rpc:call(Node, ssl, close, [SslAcceptSocket]) end catch error:{badmatch, Error} -> Pid ! {self(), Error} @@ -447,10 +446,12 @@ run_upgrade_client(Opts) -> test_server:format("apply(~p, ~p, ~p)~n", [Module, Function, [SslSocket | Args]]), Msg = rpc:call(Node, Module, Function, [SslSocket | Args]), + test_server:format("Upgrade Client Msg: ~p ~n", [Msg]), Pid ! {self(), Msg}, receive close -> - ok = rpc:call(Node, ssl, close, [SslSocket]) + test_server:format("Upgrade Client closing~n", []), + rpc:call(Node, ssl, close, [SslSocket]) end. start_upgrade_server_error(Args) -> diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index afedeaf099..46ad0c17b6 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -1164,10 +1164,6 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) -> close_port(OpenSslPort), %% Clean close down! ssl_test_lib:close(Client), - receive - {'EXIT', Client, normal} -> - ok - end, Return = case Result of ok -> -- cgit v1.2.3 From 38d3b11a9d62aa1cfe51377b426c43a5ea7f3350 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Wed, 15 Dec 2010 10:16:57 +0100 Subject: Prepare for release --- lib/ssl/src/ssl.appup.src | 2 ++ lib/ssl/vsn.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src index 51c5289bd2..a9c07ec87c 100644 --- a/lib/ssl/src/ssl.appup.src +++ b/lib/ssl/src/ssl.appup.src @@ -1,10 +1,12 @@ %% -*- erlang -*- {"%VSN%", [ + {"4.1.1", [{restart_application, ssl}]}, {"4.1", [{restart_application, ssl}]}, {"4.0.1", [{restart_application, ssl}]} ], [ + {"4.1.1", [{restart_application, ssl}]}, {"4.1", [{restart_application, ssl}]}, {"4.0.1", [{restart_application, ssl}]} ]}. diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk index ee692adb3b..b1ae0db7e7 100644 --- a/lib/ssl/vsn.mk +++ b/lib/ssl/vsn.mk @@ -1,2 +1,2 @@ -SSL_VSN = 4.1.1 +SSL_VSN = 4.1.2 -- cgit v1.2.3 From 766c7cabb1545418bf59e8dcfcc1a5fae8b01d40 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 16 Dec 2010 11:27:23 +0100 Subject: Fix rwlock resource leak when hitting system limit --- erts/emulator/beam/erl_db.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 8577354d27..0dfc0e721f 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -1436,8 +1436,7 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2) "** Too many db tables **\n"); free_heir_data(tb); tb->common.meth->db_free_table(tb); - erts_db_free(ERTS_ALC_T_DB_TABLE, tb, (void *) tb, sizeof(DbTable)); - ERTS_ETS_MISC_MEM_ADD(-sizeof(DbTable)); + db_unref(tb, LCK_NONE); BIF_ERROR(BIF_P, SYSTEM_LIMIT); } -- cgit v1.2.3 From 8b18824e2b13e60fb1a067f80dbb228172f6a3d2 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 15 Dec 2010 00:56:56 +0100 Subject: Safe deallocation of ETS-table structures Ensure that all threads potentially accessing an ETS-table have dropped all references to the table before deallocating it. --- erts/emulator/beam/erl_alloc.types | 2 + erts/emulator/beam/erl_db.c | 36 +++++++++- erts/emulator/beam/erl_lock_check.c | 2 + erts/emulator/beam/erl_process.c | 137 ++++++++++++++++++++++++++++++++++++ erts/emulator/beam/erl_process.h | 14 ++-- lib/stdlib/test/ets_SUITE.erl | 18 +++++ 6 files changed, 201 insertions(+), 8 deletions(-) diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types index 408ffd12f7..b7b9c6a133 100644 --- a/erts/emulator/beam/erl_alloc.types +++ b/erts/emulator/beam/erl_alloc.types @@ -263,6 +263,8 @@ type XPORTS_LIST SHORT_LIVED SYSTEM extra_port_list type PROC_LCK_WTR LONG_LIVED SYSTEM proc_lock_waiter type PROC_LCK_QS LONG_LIVED SYSTEM proc_lock_queues type RUNQ_BLNS LONG_LIVED SYSTEM run_queue_balancing +type MISC_AUX_WORK_Q LONG_LIVED SYSTEM misc_aux_work_q +type MISC_AUX_WORK SHORT_LIVED SYSTEM misc_aux_work +endif # diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 0dfc0e721f..e662b17592 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -227,10 +227,10 @@ static ERTS_INLINE DbTable* db_ref(DbTable* tb, db_lock_kind_t kind) } return tb; } - -static ERTS_INLINE DbTable* db_unref(DbTable* tb, db_lock_kind_t kind) + +static void +free_dbtable(DbTable* tb) { - if (kind != LCK_READ && !erts_refc_dectest(&tb->common.ref, 0)) { #ifdef HARDDEBUG if (erts_smp_atomic_read(&tb->common.memory_size) != sizeof(DbTable)) { erts_fprintf(stderr, "ets: db_unref memory remain=%ld fix=%x\n", @@ -257,6 +257,36 @@ static ERTS_INLINE DbTable* db_unref(DbTable* tb, db_lock_kind_t kind) ASSERT(is_immed(tb->common.heir_data)); erts_db_free(ERTS_ALC_T_DB_TABLE, tb, (void *) tb, sizeof(DbTable)); ERTS_ETS_MISC_MEM_ADD(-sizeof(DbTable)); +} + +#ifdef ERTS_SMP +static void +chk_free_dbtable(void *vtb) +{ + DbTable * tb = (DbTable *) vtb; + ERTS_THR_MEMORY_BARRIER; + if (erts_refc_dectest(&tb->common.ref, 0) == 0) + free_dbtable(tb); +} +#endif + +static ERTS_INLINE DbTable* db_unref(DbTable* tb, db_lock_kind_t kind) +{ + if (kind != LCK_READ && erts_refc_dectest(&tb->common.ref, 0) == 0) { +#ifdef ERTS_SMP + int scheds = erts_get_max_no_executing_schedulers(); + if (scheds == 1) + free_dbtable(tb); + else { + int refs = scheds - 1; + ASSERT(scheds > 1); + ERTS_THR_MEMORY_BARRIER; + erts_refc_add(&tb->common.ref, refs, refs); + erts_smp_schedule_misc_aux_work(1, scheds, chk_free_dbtable, tb); + } +#else + free_dbtable(tb); +#endif return NULL; } return tb; diff --git a/erts/emulator/beam/erl_lock_check.c b/erts/emulator/beam/erl_lock_check.c index 04c7dbd2ec..d298fe8f71 100644 --- a/erts/emulator/beam/erl_lock_check.c +++ b/erts/emulator/beam/erl_lock_check.c @@ -177,6 +177,8 @@ static erts_lc_lock_order_t erts_lock_order[] = { { "async_id", NULL }, { "pix_lock", "address" }, { "run_queues_lists", NULL }, + { "misc_aux_work_queue", "index" }, + { "misc_aux_work_pre_alloc_lock", "address" }, { "sched_stat", NULL }, { "run_queue_sleep_list", "address" }, #endif diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index fc950af8ce..4ec06d8c82 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -586,6 +586,122 @@ erts_sched_finish_poke(ErtsSchedulerSleepInfo *ssi, long flags) } } +typedef struct erts_misc_aux_work_t_ erts_misc_aux_work_t; +struct erts_misc_aux_work_t_ { + erts_misc_aux_work_t *next; + void (*func)(void *); + void *arg; +}; + +typedef struct { + erts_smp_mtx_t mtx; + erts_misc_aux_work_t *first; + erts_misc_aux_work_t *last; +} erts_misc_aux_work_q_t; + +typedef union { + erts_misc_aux_work_q_t data; + char align[ERTS_ALC_CACHE_LINE_ALIGN_SIZE(sizeof(erts_misc_aux_work_q_t))]; +} erts_algnd_misc_aux_work_q_t; + +static erts_algnd_misc_aux_work_q_t *misc_aux_work_queues; + +ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(misc_aux_work, + erts_misc_aux_work_t, + 200, + ERTS_ALC_T_MISC_AUX_WORK) + +static void +init_misc_aux_work(void) +{ + int ix; + + init_misc_aux_work_alloc(); + + misc_aux_work_queues = erts_alloc(ERTS_ALC_T_MISC_AUX_WORK_Q, + (sizeof(erts_algnd_misc_aux_work_q_t) + *(erts_no_schedulers+1))); + if ((((UWord) misc_aux_work_queues) & ERTS_CACHE_LINE_MASK) != 0) + misc_aux_work_queues = ((erts_algnd_misc_aux_work_q_t *) + ((((UWord) misc_aux_work_queues) + & ~ERTS_CACHE_LINE_MASK) + + ERTS_CACHE_LINE_SIZE)); + + for (ix = 0; ix < erts_no_schedulers; ix++) { + erts_smp_mtx_init_x(&misc_aux_work_queues[ix].data.mtx, + "misc_aux_work_queue", + make_small(ix + 1)); + misc_aux_work_queues[ix].data.first = NULL; + misc_aux_work_queues[ix].data.last = NULL; + } +} + +static void +handle_misc_aux_work(ErtsSchedulerData *esdp) +{ + int ix = (int) esdp->no - 1; + erts_misc_aux_work_t *mawp; + + erts_smp_mtx_lock(&misc_aux_work_queues[ix].data.mtx); + mawp = misc_aux_work_queues[ix].data.first; + misc_aux_work_queues[ix].data.first = NULL; + misc_aux_work_queues[ix].data.last = NULL; + erts_smp_mtx_unlock(&misc_aux_work_queues[ix].data.mtx); + + while (mawp) { + erts_misc_aux_work_t *free_mawp; + mawp->func(mawp->arg); + free_mawp = mawp; + mawp = mawp->next; + misc_aux_work_free(free_mawp); + } +} + +void +erts_smp_schedule_misc_aux_work(int ignore_self, + int max_sched, + void (*func)(void *), + void *arg) +{ + int ix, ignore_ix = -1; + + if (ignore_self) { + ErtsSchedulerData *esdp = erts_get_scheduler_data(); + if (esdp) + ignore_ix = (int) esdp->no - 1; + } + + ASSERT(0 <= max_sched && max_sched <= erts_no_schedulers); + + for (ix = 0; ix < max_sched; ix++) { + long aux_work; + erts_misc_aux_work_t *mawp; + ErtsSchedulerSleepInfo *ssi; + if (ix == ignore_ix) + continue; + + mawp = misc_aux_work_alloc(); + + mawp->func = func; + mawp->arg = arg; + mawp->next = NULL; + + erts_smp_mtx_lock(&misc_aux_work_queues[ix].data.mtx); + if (!misc_aux_work_queues[ix].data.last) + misc_aux_work_queues[ix].data.first = mawp; + else + misc_aux_work_queues[ix].data.last->next = mawp; + misc_aux_work_queues[ix].data.last = mawp; + erts_smp_mtx_unlock(&misc_aux_work_queues[ix].data.mtx); + + ssi = ERTS_SCHED_SLEEP_INFO_IX(ix); + aux_work = erts_smp_atomic_bor(&ssi->aux_work, + ERTS_SSI_AUX_WORK_MISC); + if ((aux_work & ERTS_SSI_AUX_WORK_MISC) == 0) + erts_sched_poke(ssi); + } +} + #ifdef ERTS_SMP_SCHEDULERS_NEED_TO_CHECK_CHILDREN void erts_smp_notify_check_children_needed(void) @@ -611,6 +727,12 @@ blockable_aux_work(ErtsSchedulerData *esdp, long aux_work) { if (aux_work & ERTS_SSI_BLOCKABLE_AUX_WORK_MASK) { + if (aux_work & ERTS_SSI_AUX_WORK_MISC) { + aux_work = erts_smp_atomic_band(&ssi->aux_work, + ~ERTS_SSI_AUX_WORK_MISC); + aux_work &= ~ERTS_SSI_AUX_WORK_MISC; + handle_misc_aux_work(esdp); + } #ifdef ERTS_SMP_SCHEDULERS_NEED_TO_CHECK_CHILDREN if (aux_work & ERTS_SSI_AUX_WORK_CHECK_CHILDREN) { aux_work = erts_smp_atomic_band(&ssi->aux_work, @@ -2603,6 +2725,8 @@ erts_init_scheduling(int mrq, int no_schedulers, int no_schedulers_online) erts_smp_atomic_init(&doing_sys_schedule, 0); + init_misc_aux_work(); + #else /* !ERTS_SMP */ { ErtsSchedulerData *esdp; @@ -2730,6 +2854,19 @@ resume_process(Process *p) p->rstatus = P_FREE; } +int +erts_get_max_no_executing_schedulers(void) +{ +#ifdef ERTS_SMP + if (erts_smp_atomic_read(&schdlr_sspnd.changing)) + return (int) erts_no_schedulers; + ERTS_THR_MEMORY_BARRIER; + return (int) erts_smp_atomic_read(&schdlr_sspnd.active); +#else + return 1; +#endif +} + #ifdef ERTS_SMP static void diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index c038e57b65..0215993035 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -236,16 +236,14 @@ typedef enum { | ERTS_SSI_FLG_WAITING \ | ERTS_SSI_FLG_SUSPENDED) - -#if !defined(ERTS_SCHED_NEED_BLOCKABLE_AUX_WORK) \ - && defined(ERTS_SMP_SCHEDULERS_NEED_TO_CHECK_CHILDREN) #define ERTS_SCHED_NEED_BLOCKABLE_AUX_WORK -#endif #define ERTS_SSI_AUX_WORK_CHECK_CHILDREN (((long) 1) << 0) +#define ERTS_SSI_AUX_WORK_MISC (((long) 1) << 1) #define ERTS_SSI_BLOCKABLE_AUX_WORK_MASK \ - (ERTS_SSI_AUX_WORK_CHECK_CHILDREN) + (ERTS_SSI_AUX_WORK_CHECK_CHILDREN \ + | ERTS_SSI_AUX_WORK_MISC) #define ERTS_SSI_NONBLOCKABLE_AUX_WORK_MASK \ (0) @@ -1034,6 +1032,7 @@ int erts_sched_set_wakeup_limit(char *str); #ifdef DEBUG void erts_dbg_multi_scheduling_return_trap(Process *, Eterm); #endif +int erts_get_max_no_executing_schedulers(void); #ifdef ERTS_SMP ErtsSchedSuspendResult erts_schedulers_state(Uint *, Uint *, Uint *, int); @@ -1048,6 +1047,11 @@ int erts_is_multi_scheduling_blocked(void); Eterm erts_multi_scheduling_blockers(Process *); void erts_start_schedulers(void); void erts_smp_notify_check_children_needed(void); +void +erts_smp_schedule_misc_aux_work(int ignore_self, + int max_sched, + void (*func)(void *), + void *arg); #endif void erts_sched_notify_check_cpu_bind(void); Uint erts_active_schedulers(void); diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 620848003c..4e789790f6 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -5325,7 +5325,25 @@ my_tab_to_list(_Ts,'$end_of_table', Acc) -> lists:reverse(Acc); my_tab_to_list(Ts,Key, Acc) -> my_tab_to_list(Ts,ets:next(Ts,Key),[ets:lookup(Ts, Key)| Acc]). +wait_for_all_schedulers_online_to_execute() -> + PMs = lists:map(fun (Sched) -> + spawn_opt(fun () -> ok end, + [monitor, {scheduler, Sched}]) + end, + lists:seq(1,erlang:system_info(schedulers_online))), + lists:foreach(fun ({P, M}) -> + receive + {'DOWN', M, process, P, _} -> ok + end + end, + PMs), + ok. + etsmem() -> + %% Wait until it is guaranteed that all already scheduled + %% deallocations of DbTable structures have completed. + wait_for_all_schedulers_online_to_execute(), + AllTabs = lists:map(fun(T) -> {T,ets:info(T,name),ets:info(T,size), ets:info(T,memory),ets:info(T,type)} end, ets:all()), -- cgit v1.2.3 From 46d9d4c36e1a9d52256b49d6fe6e519fc54a0f6e Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 16 Dec 2010 12:10:23 +0100 Subject: Stop using reference counter when write accessing ETS-tables --- erts/emulator/beam/erl_db.c | 136 +++++++++++++++++---------------------- erts/emulator/beam/erl_db_util.h | 5 +- 2 files changed, 61 insertions(+), 80 deletions(-) diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index e662b17592..6f19acdc3b 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -219,43 +219,34 @@ Export ets_select_continue_exp; * Static traps */ static Export ets_delete_continue_exp; - -static ERTS_INLINE DbTable* db_ref(DbTable* tb, db_lock_kind_t kind) -{ - if (tb != NULL && kind != LCK_READ) { - erts_refc_inc(&tb->common.ref, 2); - } - return tb; -} static void free_dbtable(DbTable* tb) { #ifdef HARDDEBUG if (erts_smp_atomic_read(&tb->common.memory_size) != sizeof(DbTable)) { - erts_fprintf(stderr, "ets: db_unref memory remain=%ld fix=%x\n", - erts_smp_atomic_read(&tb->common.memory_size)-sizeof(DbTable), + erts_fprintf(stderr, "ets: free_dbtable memory remain=%ld fix=%x\n", + erts_smp_atomic_read(&tb->common.memory_size)-sizeof(DbTable), tb->common.fixations); } - erts_fprintf(stderr, "ets: db_unref(%T) deleted!!!\r\n", + erts_fprintf(stderr, "ets: free_dbtable(%T) deleted!!!\r\n", tb->common.id); - erts_fprintf(stderr, "ets: db_unref: meta_pid_to_tab common.memory_size = %ld\n", + erts_fprintf(stderr, "ets: free_dbtable: meta_pid_to_tab common.memory_size = %ld\n", erts_smp_atomic_read(&meta_pid_to_tab->common.memory_size)); print_table(ERTS_PRINT_STDOUT, NULL, 1, meta_pid_to_tab); - erts_fprintf(stderr, "ets: db_unref: meta_pid_to_fixed_tab common.memory_size = %ld\n", + erts_fprintf(stderr, "ets: free_dbtable: meta_pid_to_fixed_tab common.memory_size = %ld\n", erts_smp_atomic_read(&meta_pid_to_fixed_tab->common.memory_size)); print_table(ERTS_PRINT_STDOUT, NULL, 1, meta_pid_to_fixed_tab); - #endif #ifdef ERTS_SMP erts_smp_rwmtx_destroy(&tb->common.rwlock); erts_smp_mtx_destroy(&tb->common.fixlock); #endif ASSERT(is_immed(tb->common.heir_data)); - erts_db_free(ERTS_ALC_T_DB_TABLE, tb, (void *) tb, sizeof(DbTable)); + erts_db_free(ERTS_ALC_T_DB_TABLE, tb, (void *) tb, sizeof(DbTable)); ERTS_ETS_MISC_MEM_ADD(-sizeof(DbTable)); } @@ -270,26 +261,26 @@ chk_free_dbtable(void *vtb) } #endif -static ERTS_INLINE DbTable* db_unref(DbTable* tb, db_lock_kind_t kind) +static void schedule_free_dbtable(DbTable* tb) { - if (kind != LCK_READ && erts_refc_dectest(&tb->common.ref, 0) == 0) { + /* + * NON-SMP case: Caller is *not* allowed to access the *tb + * structure after this function has returned! + * SMP case: Caller is allowed to access the *tb structure + * until the bif has returned (we typically + * need to unlock the table lock after this + * function has returned). + */ #ifdef ERTS_SMP - int scheds = erts_get_max_no_executing_schedulers(); - if (scheds == 1) - free_dbtable(tb); - else { - int refs = scheds - 1; - ASSERT(scheds > 1); - ERTS_THR_MEMORY_BARRIER; - erts_refc_add(&tb->common.ref, refs, refs); - erts_smp_schedule_misc_aux_work(1, scheds, chk_free_dbtable, tb); - } + int scheds = erts_get_max_no_executing_schedulers(); + ASSERT(scheds >= 1); + ASSERT(erts_refc_read(&tb->common.ref, 0) == 0); + erts_refc_init(&tb->common.ref, scheds); + ERTS_THR_MEMORY_BARRIER; + erts_smp_schedule_misc_aux_work(0, scheds, chk_free_dbtable, tb); #else - free_dbtable(tb); + free_dbtable(tb); #endif - return NULL; - } - return tb; } static ERTS_INLINE void db_init_lock(DbTable* tb, int use_frequent_read_lock, @@ -300,8 +291,6 @@ static ERTS_INLINE void db_init_lock(DbTable* tb, int use_frequent_read_lock, if (use_frequent_read_lock) rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_FREQUENT_READ; #endif - erts_refc_init(&tb->common.ref, 1); - erts_refc_init(&tb->common.fixref, 0); #ifdef ERTS_SMP erts_smp_rwmtx_init_opt_x(&tb->common.rwlock, &rwmtx_opt, rwname, tb->common.the_name); @@ -310,7 +299,7 @@ static ERTS_INLINE void db_init_lock(DbTable* tb, int use_frequent_read_lock, #endif } -static ERTS_INLINE void db_lock_take_over_ref(DbTable* tb, db_lock_kind_t kind) +static ERTS_INLINE void db_lock(DbTable* tb, db_lock_kind_t kind) { #ifdef ERTS_SMP ASSERT(tb != meta_pid_to_tab && tb != meta_pid_to_fixed_tab); @@ -338,16 +327,13 @@ static ERTS_INLINE void db_lock_take_over_ref(DbTable* tb, db_lock_kind_t kind) #endif } -static ERTS_INLINE void db_lock(DbTable* tb, db_lock_kind_t kind) -{ - (void) db_ref(tb, kind); -#ifdef ERTS_SMP - db_lock_take_over_ref(tb, kind); -#endif -} - static ERTS_INLINE void db_unlock(DbTable* tb, db_lock_kind_t kind) { + /* + * In NON-SMP case tb may refer to an already deallocated + * DbTable structure. That is, ONLY the SMP case is allowed + * to follow the tb pointer! + */ #ifdef ERTS_SMP ASSERT(tb != meta_pid_to_tab && tb != meta_pid_to_fixed_tab); @@ -374,7 +360,6 @@ static ERTS_INLINE void db_unlock(DbTable* tb, db_lock_kind_t kind) } } #endif - (void) db_unref(tb, kind); /* May delete table... */ } @@ -401,6 +386,13 @@ DbTable* db_get_table_aux(Process *p, DbTable *tb = NULL; erts_smp_rwmtx_t *mtl = NULL; + /* + * IMPORTANT: Only scheduler threads are allowed + * to access tables. Memory management + * depend on it. + */ + ASSERT(erts_get_scheduler_data()); + if (is_small(id)) { Uint slot = unsigned_val(id) & meta_main_tab_slot_mask; if (!meta_already_locked) { @@ -414,12 +406,8 @@ DbTable* db_get_table_aux(Process *p, || erts_lc_rwmtx_is_rwlocked(test_mtl)); } #endif - if (slot < db_max_tabs && IS_SLOT_ALIVE(slot)) { - /* SMP: inc to prevent race, between unlock of meta_main_tab_lock - * and the table locking outside the meta_main_tab_lock - */ - tb = db_ref(meta_main_tab[slot].u.tb, kind); - } + if (slot < db_max_tabs && IS_SLOT_ALIVE(slot)) + tb = meta_main_tab[slot].u.tb; } else if (is_atom(id)) { struct meta_name_tab_entry* bucket = meta_name_tab_bucket(id,&mtl); @@ -433,16 +421,15 @@ DbTable* db_get_table_aux(Process *p, if (bucket->pu.tb != NULL) { if (is_atom(bucket->u.name_atom)) { /* single */ - if (bucket->u.name_atom == id) { - tb = db_ref(bucket->pu.tb, kind); - } + if (bucket->u.name_atom == id) + tb = bucket->pu.tb; } else { /* multi */ Uint cnt = unsigned_val(bucket->u.mcnt); Uint i; for (i=0; ipu.mvec[i].u.name_atom == id) { - tb = db_ref(bucket->pu.mvec[i].pu.tb, kind); + tb = bucket->pu.mvec[i].pu.tb; break; } } @@ -450,7 +437,7 @@ DbTable* db_get_table_aux(Process *p, } } if (tb) { - db_lock_take_over_ref(tb, kind); + db_lock(tb, kind); if (tb->common.id != id || ((tb->common.status & what) == 0 && p->id != tb->common.owner)) { db_unlock(tb, kind); @@ -624,11 +611,11 @@ done: */ static ERTS_INLINE void local_fix_table(DbTable* tb) { - erts_refc_inc(&tb->common.fixref, 1); + erts_refc_inc(&tb->common.ref, 1); } static ERTS_INLINE void local_unfix_table(DbTable* tb) { - if (erts_refc_dectest(&tb->common.fixref, 0) == 0) { + if (erts_refc_dectest(&tb->common.ref, 0) == 0) { ASSERT(IS_HASH_TABLE(tb->common.status)); db_unfix_table_hash(&(tb->hash)); } @@ -1444,6 +1431,7 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2) tb->common.type = status & ERTS_ETS_TABLE_TYPES; /* Note, 'type' is *read only* from now on... */ #endif + erts_refc_init(&tb->common.ref, 0); db_init_lock(tb, status & (DB_FINE_LOCKED|DB_FREQ_READ), "db_tab", "db_tab_fix"); tb->common.keypos = keypos; @@ -1466,7 +1454,7 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2) "** Too many db tables **\n"); free_heir_data(tb); tb->common.meth->db_free_table(tb); - db_unref(tb, LCK_NONE); + free_dbtable(tb); BIF_ERROR(BIF_P, SYSTEM_LIMIT); } @@ -1500,9 +1488,10 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2) free_slot(slot); erts_smp_rwmtx_rwunlock(mmtl); - db_lock_take_over_ref(tb,LCK_WRITE); + db_lock(tb,LCK_WRITE); free_heir_data(tb); tb->common.meth->db_free_table(tb); + schedule_free_dbtable(tb); db_unlock(tb,LCK_WRITE); BIF_ERROR(BIF_P, BADARG); } @@ -2874,8 +2863,7 @@ void init_db(void) meta_pid_to_tab->common.meth = &db_hash; meta_pid_to_tab->common.compress = 0; - erts_refc_init(&meta_pid_to_tab->common.ref, 1); - erts_refc_init(&meta_pid_to_tab->common.fixref, 0); + erts_refc_init(&meta_pid_to_tab->common.ref, 0); /* Neither rwlock or fixlock used db_init_lock(meta_pid_to_tab, "meta_pid_to_tab", "meta_pid_to_tab_FIX");*/ @@ -2907,8 +2895,7 @@ void init_db(void) meta_pid_to_fixed_tab->common.meth = &db_hash; meta_pid_to_fixed_tab->common.compress = 0; - erts_refc_init(&meta_pid_to_fixed_tab->common.ref, 1); - erts_refc_init(&meta_pid_to_fixed_tab->common.fixref, 0); + erts_refc_init(&meta_pid_to_fixed_tab->common.ref, 0); /* Neither rwlock or fixlock used db_init_lock(meta_pid_to_fixed_tab, "meta_pid_to_fixed_tab", "meta_pid_to_fixed_tab_FIX");*/ @@ -3066,12 +3053,10 @@ retry: to_pid, to_locks, ERTS_P2P_FLG_TRY_LOCK); if (to_proc == ERTS_PROC_LOCK_BUSY) { - db_ref(tb, LCK_NONE); /* while unlocked */ db_unlock(tb,LCK_WRITE); to_proc = erts_pid2proc(p, ERTS_PROC_LOCK_MAIN, to_pid, to_locks); db_lock(tb,LCK_WRITE); - tb = db_unref(tb, LCK_NONE); ASSERT(tb != NULL); if (tb->common.owner != p->id) { @@ -3182,13 +3167,13 @@ erts_db_process_exiting(Process *c_p, ErtsProcLocks c_p_locks) erts_smp_rwmtx_t *mmtl = get_meta_main_tab_lock(ix); erts_smp_rwmtx_rlock(mmtl); if (!IS_SLOT_FREE(ix)) { - tb = db_ref(GET_ANY_SLOT_TAB(ix), LCK_WRITE); + tb = GET_ANY_SLOT_TAB(ix); ASSERT(tb); } erts_smp_rwmtx_runlock(mmtl); if (tb) { int do_yield; - db_lock_take_over_ref(tb, LCK_WRITE); + db_lock(tb, LCK_WRITE); /* Ownership may have changed since we looked up the table. */ if (tb->common.owner != pid) { @@ -3270,7 +3255,7 @@ erts_db_process_exiting(Process *c_p, ErtsProcLocks c_p_locks) erts_smp_rwmtx_t *mmtl = get_meta_main_tab_lock(ix); erts_smp_rwmtx_rlock(mmtl); if (IS_SLOT_ALIVE(ix)) { - tb = db_ref(meta_main_tab[ix].u.tb, LCK_WRITE_REC); + tb = meta_main_tab[ix].u.tb; ASSERT(tb); } erts_smp_rwmtx_runlock(mmtl); @@ -3278,7 +3263,7 @@ erts_db_process_exiting(Process *c_p, ErtsProcLocks c_p_locks) int reds; DbFixation** pp; - db_lock_take_over_ref(tb, LCK_WRITE_REC); + db_lock(tb, LCK_WRITE_REC); #ifdef ERTS_SMP erts_smp_mtx_lock(&tb->common.fixlock); #endif @@ -3289,7 +3274,7 @@ erts_db_process_exiting(Process *c_p, ErtsProcLocks c_p_locks) if ((*pp)->pid == pid) { DbFixation* fix = *pp; long diff = -(long)fix->counter; - erts_refc_add(&tb->common.fixref,diff,0); + erts_refc_add(&tb->common.ref,diff,0); *pp = fix->next; erts_db_free(ERTS_ALC_T_DB_FIXATION, tb, fix, sizeof(DbFixation)); @@ -3364,7 +3349,7 @@ static void fix_table_locked(Process* p, DbTable* tb) #ifdef ERTS_SMP erts_smp_mtx_lock(&tb->common.fixlock); #endif - erts_refc_inc(&tb->common.fixref,1); + erts_refc_inc(&tb->common.ref,1); fix = tb->common.fixations; if (fix == NULL) { get_now(&(tb->common.megasec), @@ -3418,7 +3403,7 @@ static void unfix_table_locked(Process* p, DbTable* tb, for (pp = &tb->common.fixations; *pp != NULL; pp = &(*pp)->next) { if ((*pp)->pid == p->id) { DbFixation* fix = *pp; - erts_refc_dec(&tb->common.fixref,0); + erts_refc_dec(&tb->common.ref,0); --(fix->counter); ASSERT(fix->counter >= 0); if (fix->counter > 0) { @@ -3448,7 +3433,6 @@ unlocked: #ifdef ERTS_SMP if (*kind_p == LCK_READ && tb->common.is_thread_safe) { /* Must have write lock while purging pseudo-deleted (OTP-8166) */ - db_ref(tb, LCK_WRITE); /* LCK_WRITE need it, but not LCK_READ */ erts_smp_rwmtx_runlock(&tb->common.rwlock); erts_smp_rwmtx_rwlock(&tb->common.rwlock); *kind_p = LCK_WRITE; @@ -3467,6 +3451,8 @@ static void free_fixations_locked(DbTable *tb) fix = tb->common.fixations; while (fix != NULL) { + long diff = -(long)fix->counter; + erts_refc_add(&tb->common.ref,diff,0); next_fix = fix->next; db_meta_lock(meta_pid_to_fixed_tab, LCK_WRITE_REC); db_erase_bag_exact2(meta_pid_to_fixed_tab, @@ -3590,10 +3576,6 @@ static int free_table_cont(Process *p, mmtl = get_meta_main_tab_lock(tb->common.slot); #ifdef ERTS_SMP if (erts_smp_rwmtx_tryrwlock(mmtl) == EBUSY) { - /* - * We keep our increased refc over this op in order to - * prevent the table from disapearing. - */ erts_smp_rwmtx_rwunlock(&tb->common.rwlock); erts_smp_rwmtx_rwlock(mmtl); erts_smp_rwmtx_rwlock(&tb->common.rwlock); @@ -3608,7 +3590,7 @@ static int free_table_cont(Process *p, make_small(tb->common.slot)); db_meta_unlock(meta_pid_to_tab, LCK_WRITE_REC); } - db_unref(tb, LCK_NONE); + schedule_free_dbtable(tb); BUMP_REDS(p, 100); return 0; } diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 10ba755e80..58ad39d772 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -206,8 +206,7 @@ typedef struct db_fixation { */ typedef struct db_table_common { - erts_refc_t ref; - erts_refc_t fixref; /* fixation counter */ + erts_refc_t ref; /* fixation counter and delete counter */ #ifdef ERTS_SMP erts_smp_rwmtx_t rwlock; /* rw lock on table */ erts_smp_mtx_t fixlock; /* Protects fixations,megasec,sec,microsec */ @@ -253,7 +252,7 @@ typedef struct db_table_common { (DB_BAG | DB_SET | DB_DUPLICATE_BAG))) #define IS_TREE_TABLE(Status) (!!((Status) & \ DB_ORDERED_SET)) -#define NFIXED(T) (erts_refc_read(&(T)->common.fixref,0)) +#define NFIXED(T) (erts_refc_read(&(T)->common.ref,0)) #define IS_FIXED(T) (NFIXED(T) != 0) Eterm erts_ets_copy_object(Eterm, Process*); -- cgit v1.2.3 From 778a60894820bbecd2f3b62619e4c284c9e53ca9 Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Thu, 16 Dec 2010 11:22:02 +0000 Subject: Grammar and typo fixes for the httpc module documentation --- lib/inets/doc/src/httpc.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index c20358178b..69e1009bc2 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -36,7 +36,7 @@

When starting the Inets application a manager process for the default profile will be started. The functions in this API - that does not explicitly use a profile will accesses the + that do not explicitly use a profile will access the default profile. A profile keeps track of proxy options, cookies and other options that can be applied to more than one request.

@@ -209,7 +209,7 @@ ssl_options() = {verify, code()} |

Timeout time for the request.

-

The clock start ticking as soon as the request has been +

The clock starts ticking as soon as the request has been sent.

Time is in milliseconds.

Defaults to infinity.

@@ -246,11 +246,11 @@ ssl_options() = {verify, code()} | -

Should the client automatically retreive the information +

Should the client automatically retrieve the information from the new URI and return that as the result instead of a 30X-result code.

Note that for some 30X-result codes automatic redirect - is not allowed in these cases the 30X-result will always + is not allowed. In these cases the 30X-result will always be returned.

Defaults to true.

@@ -296,11 +296,11 @@ ssl_options() = {verify, code()} |

Streams the body of a 200 or 206 response to the calling process or to a file. When streaming to the calling process - using the option self the the following stream messages + using the option self the following stream messages will be sent to that process: {http, {RequestId, stream_start, Headers}, {http, {RequestId, stream, BinBodyPart}, {http, {RequestId, stream_end, Headers}. When - streaming to to the calling processes using the option + streaming to the calling processes using the option {self, once} the first message will have an additional element e.i. {http, {RequestId, stream_start, Headers, Pid}, this is the process id that should be used as an argument to @@ -338,7 +338,7 @@ ssl_options() = {verify, code()} | case insenstive. This feature should only be used if there is no other way to communicate with the server or for testing purpose. Also note that when this option is used no headers - will be automatically added, all necessary headers has to be + will be automatically added, all necessary headers have to be provided by the user.

Defaults to false.

@@ -354,17 +354,17 @@ ssl_options() = {verify, code()} | checked in any way.

Note that this may change the socket behaviour (see inet:setopts/2) - for an already existing, and therefor already connected + for an already existing one, and therefore an already connected request handler.

-

By defaults the socket options set by the +

By default the socket options set by the set_options/1,2 - function is used when establishing connection.

+ function are used when establishing the connection.

-

Defines how the client will deliver the result for a - asynchroneous request (sync has the value +

Defines how the client will deliver the result for an + asynchronous request (sync has the value false).

@@ -480,7 +480,7 @@ apply(Module, Function, [ReplyInfo | Args]) Default is 120000 (= 2 min). If a persistent connection is idle longer than the keep_alive_timeout the client will close the connection. - The server may also have a such a time out but you should + The server may also have such a timeout but you should not count on it! MaxPipeline = integer() Default is 2. @@ -527,7 +527,7 @@ apply(Module, Function, [ReplyInfo | Args]) ideal to be sent on a persistent connection, this very much depends on the application. Note that a very long queue of requests may cause a - user perceived delays as earlier request may take a long time + user perceived delay as earlier requests may take a long time to complete. The HTTP/1.1 specification does suggest a limit of 2 persistent connections per server, which is the default value of the max_sessions option.

-- cgit v1.2.3 From 67dd153f6aff8dab6dc8d938664696675b152c20 Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Thu, 16 Dec 2010 03:33:10 +0100 Subject: Fix type specification of the ets:new/2 BIF The options for the ets:new/2 call has changed recently. There are read_concurrency hints as well as compressed tables. The hipe/dialyzer did not take this into account. This patch corrects the problem by going through the documentation and altering the type specification. The error fixed is with the dialyzer. When constructing an ETS table with, e.g., {read_concurrency, true}, the dialyzer will report that the caller of ets:new/2 will not return. ; First, we update the documentation from the ets man page. ; Second, we reorder the type specification of keypos so they appear in the same order as in the documentation. ; Finally, we add the missing read_concurrency and compressed Tweak options. --- lib/hipe/cerl/erl_bif_types.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index ed5bf03804..9bddcc980f 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -4940,10 +4940,11 @@ t_matchres() -> %% From the 'ets' documentation %%----------------------------- %% Option = Type | Access | named_table | {keypos,Pos} -%% | {heir,pid(),HeirData} | {heir,none} -%% | {write_concurrency,boolean()} +%% | {heir,pid(),HeirData} | {heir,none} | Tweaks %% Type = set | ordered_set | bag | duplicate_bag %% Access = public | protected | private +%% Tweaks = {write_concurrency,boolean()} +%% | {read_concurrency,boolean()} | compressed %% Pos = integer() %% HeirData = term() t_ets_new_options() -> @@ -4955,10 +4956,12 @@ t_ets_new_options() -> t_atom('protected'), t_atom('private'), t_atom('named_table'), + t_tuple([t_atom('keypos'), t_integer()]), t_tuple([t_atom('heir'), t_pid(), t_any()]), t_tuple([t_atom('heir'), t_atom('none')]), - t_tuple([t_atom('keypos'), t_integer()]), - t_tuple([t_atom('write_concurrency'), t_boolean()])])). + t_tuple([t_atom('write_concurrency'), t_boolean()]), + t_tuple([t_atom('read_concurrency'), t_boolean()]), + t_atom('compressed')])). t_ets_info_items() -> t_sup([t_atom('fixed'), -- cgit v1.2.3 From 6bd03dbc48e148d1fcad13d2301231507e49c77d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 16 Dec 2010 14:44:18 +0100 Subject: Added dumping of data after (snmpa_vacm) cleanup call. --- lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 7 ++++++- lib/snmp/src/agent/snmpa_vacm.erl | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 5e188c74c5..f0c4a16cee 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -181,13 +181,18 @@ init_tabs(Sec2Group, Access, View) -> snmpa_local_db:table_delete(db(vacmSecurityToGroupTable)), snmpa_local_db:table_create(db(vacmSecurityToGroupTable)), init_sec2group_table(Sec2Group), + ?vdebug("create vacm access table",[]), snmpa_vacm:cleanup(), init_access_table(Access), + ?vdebug("create vacm view-tree-family table",[]), snmpa_local_db:table_delete(db(vacmViewTreeFamilyTable)), snmpa_local_db:table_create(db(vacmViewTreeFamilyTable)), - init_view_table(View). + init_view_table(View), + + ?vdebug("table(s) initiated",[]), + ok. init_sec2group_table([Row | T]) -> % ?vtrace("init security-to-group table: " diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 91cecfcd1e..892dc265f1 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -258,7 +258,8 @@ delete(Key) -> cleanup() -> - ets:delete_all_objects(snmpa_vacm). + ets:delete_all_objects(snmpa_vacm), + dump_table(). dump_table(true) -> dump_table(); -- cgit v1.2.3 From b3feb428e2489ef8813e36f14c3e8d9b4f4deaba Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 16 Dec 2010 15:54:31 +0100 Subject: Set types correctly for open_port({spawn_executable, ... --- lib/hipe/cerl/erl_bif_types.erl | 11 ++++++----- lib/hipe/cerl/erl_types.erl | 6 ++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index eba95dc6af..f00821e450 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -125,7 +125,8 @@ t_tuple/1, t_tuple_args/1, t_tuple_size/1, - t_tuple_subtypes/1 + t_tuple_subtypes/1, + t_unicode_string/0 ]). -ifdef(DO_ERL_BIF_TYPES_TEST). @@ -3800,7 +3801,7 @@ arg_types(erlang, now, 0) -> arg_types(erlang, open_port, 2) -> [t_sup(t_atom(), t_sup([t_tuple([t_atom('spawn'), t_string()]), t_tuple([t_atom('spawn_driver'), t_string()]), - t_tuple([t_atom('spawn_executable'), t_string()]), + t_tuple([t_atom('spawn_executable'), t_sup(t_unicode_string(),t_binary())]), t_tuple([t_atom('fd'), t_integer(), t_integer()])])), t_list(t_sup(t_sup([t_atom('stream'), t_atom('exit_status'), @@ -3816,8 +3817,8 @@ arg_types(erlang, open_port, 2) -> t_tuple([t_atom('line'), t_integer()]), t_tuple([t_atom('cd'), t_string()]), t_tuple([t_atom('env'), t_list(t_tuple(2))]), % XXX: More - t_tuple([t_atom('args'), t_list(t_string())]), - t_tuple([t_atom('arg0'), t_string()])])))]; + t_tuple([t_atom('args'), t_list(t_sup(t_unicode_string(),t_binary()))]), + t_tuple([t_atom('arg0'),t_sup(t_unicode_string(),t_binary())])])))]; arg_types(erlang, phash, 2) -> [t_any(), t_pos_integer()]; arg_types(erlang, phash2, 1) -> @@ -4979,7 +4980,7 @@ t_ets_info_items() -> %% ===================================================================== t_prim_file_name() -> - t_sup(t_string(), t_binary()). + t_sup(t_unicode_string(), t_binary()). %% ===================================================================== %% These are used for the built-in functions of 'gen_tcp' diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index c8dc162457..080d6936b2 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -196,6 +196,7 @@ t_tuple_size/1, t_tuple_sizes/1, t_tuple_subtypes/1, + t_unicode_string/0, t_unify/2, t_unify/3, t_unit/0, @@ -1456,6 +1457,11 @@ t_is_tuple(_) -> false. %% Non-primitive types, including some handy syntactic sugar types %% +-spec t_unicode_string() -> erl_type(). + +t_unicode_string() -> + t_list(t_unicode_char()). + -spec t_charlist() -> erl_type(). t_charlist() -> -- cgit v1.2.3 From e11350655b27b87c891bdf4e420472a220521f99 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 9 Dec 2010 15:01:24 +0100 Subject: External include files HTTPD header file install "fixed". That is, the include files in the include dir are installed in the include dir (by the Makefile in the src/inets_app). New wrapper header files (with the same names httpd.hrl and mod_auth.hrl) has been created in the src/http_server dir (which in turn is installed in the src/http_server dir by the Makefile in the src/http_server dir). --- lib/inets/doc/src/http_server.xml | 4 ++-- lib/inets/include/mod_auth.hrl | 33 +++++++++++++++++++++++++++++++++ lib/inets/src/http_server/Makefile | 5 +---- lib/inets/src/http_server/httpd.hrl | 27 +++++++++++++++++++++++++++ lib/inets/src/http_server/mod_auth.hrl | 26 ++++++++++++-------------- lib/inets/src/inets_app/Makefile | 11 +++++++---- lib/inets/vsn.mk | 2 +- 7 files changed, 83 insertions(+), 25 deletions(-) create mode 100644 lib/inets/include/mod_auth.hrl create mode 100644 lib/inets/src/http_server/httpd.hrl diff --git a/lib/inets/doc/src/http_server.xml b/lib/inets/doc/src/http_server.xml index 68dfd1add0..47ed9cd229 100644 --- a/lib/inets/doc/src/http_server.xml +++ b/lib/inets/doc/src/http_server.xml @@ -1,4 +1,4 @@ - + @@ -766,7 +766,7 @@ http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[ -module(mnesia_test). -export([start/0,load_data/0]). --include("mod_auth.hrl"). +-include_lib("mod_auth.hrl"). first_start() -> mnesia:create_schema([node()]), diff --git a/lib/inets/include/mod_auth.hrl b/lib/inets/include/mod_auth.hrl new file mode 100644 index 0000000000..cf931e681a --- /dev/null +++ b/lib/inets/include/mod_auth.hrl @@ -0,0 +1,33 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% + +-ifndef(mod_auth_hrl). +-define(mod_auth_hrl, true). + +-record(httpd_user, + {username, + password, + user_data}). + +-record(httpd_group, + {name, + userlist}). + +-endif. % -ifdef(mod_auth_hrl). diff --git a/lib/inets/src/http_server/Makefile b/lib/inets/src/http_server/Makefile index bdd8c5ee3c..55cc68dede 100644 --- a/lib/inets/src/http_server/Makefile +++ b/lib/inets/src/http_server/Makefile @@ -82,9 +82,7 @@ MODULES = \ mod_security \ mod_security_server -INCLUDE = ../../include - -HRL_FILES = $(INCLUDE)/httpd.hrl httpd_internal.hrl mod_auth.hrl +HRL_FILES = httpd.hrl httpd_internal.hrl mod_auth.hrl ERL_FILES = $(MODULES:%=%.erl) @@ -100,7 +98,6 @@ include ../inets_app/inets.mk ERL_COMPILE_FLAGS += \ $(INETS_FLAGS) \ $(INETS_ERL_COMPILE_FLAGS) \ - -I$(INCLUDE) \ -I../inets_app \ -I../http_lib \ diff --git a/lib/inets/src/http_server/httpd.hrl b/lib/inets/src/http_server/httpd.hrl new file mode 100644 index 0000000000..4eba833e2c --- /dev/null +++ b/lib/inets/src/http_server/httpd.hrl @@ -0,0 +1,27 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% This is a simple wrapper for code that has not been updated to +%% handle the move of this file to the include dir. + +-ifndef(src_httpd_hrl). +-define(src_httpd_hrl, true). + +-include_lib("inets/include/httpd.hrl"). + +-endif. % -ifdef(src_httpd_hrl). diff --git a/lib/inets/src/http_server/mod_auth.hrl b/lib/inets/src/http_server/mod_auth.hrl index 9b316cecc4..674e6d1652 100644 --- a/lib/inets/src/http_server/mod_auth.hrl +++ b/lib/inets/src/http_server/mod_auth.hrl @@ -1,29 +1,27 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% -%% %CopyrightEnd% %% +%% %CopyrightEnd% %% +%% This is a simple wrapper for code that has not been updated to +%% handle the move of this file to the include dir. + +-ifndef(src_mod_auth_hrl). +-define(src_mod_auth_hrl, true). --record(httpd_user, - {username, - password, - user_data}). +-include_lib("inets/include/mod_auth.hrl"). --record(httpd_group, - {name, - userlist}). - +-endif. % -ifdef(src_mod_auth_hrl). diff --git a/lib/inets/src/inets_app/Makefile b/lib/inets/src/inets_app/Makefile index 4632ff3b68..20e22917e2 100644 --- a/lib/inets/src/inets_app/Makefile +++ b/lib/inets/src/inets_app/Makefile @@ -47,7 +47,9 @@ MODULES = \ inets_sup \ inets_regexp -HRL_FILES = inets_internal.hrl +INTERNAL_HRL_FILES = inets_internal.hrl +EXTERNAL_HRL_FILES = ../../include/httpd.hrl \ + ../../include/mod_auth.hrl ERL_FILES = $(MODULES:%=%.erl) @@ -74,8 +76,7 @@ include inets.mk ERL_COMPILE_FLAGS += \ $(INETS_FLAGS) \ - $(INETS_ERL_COMPILE_FLAGS) \ - -I../../include + $(INETS_ERL_COMPILE_FLAGS) # ---------------------------------------------------- @@ -110,7 +111,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt $(INSTALL_DIR) $(RELSYSDIR)/src $(INSTALL_DIR) $(RELSYSDIR)/src/inets_app - $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/inets_app + $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/inets_app + $(INSTALL_DIR) $(RELSYSDIR)/include + $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(RELSYSDIR)/include $(INSTALL_DIR) $(RELSYSDIR)/ebin $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk index f462290a99..67737ee552 100644 --- a/lib/inets/vsn.mk +++ b/lib/inets/vsn.mk @@ -18,7 +18,7 @@ # %CopyrightEnd% APPLICATION = inets -INETS_VSN = 5.5.1 +INETS_VSN = 5.5.2 PRE_VSN = APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 9372111e120c23cd9048e8888c608846139e756d Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 17 Dec 2010 10:02:30 +0100 Subject: Cleaned up meaningless code discovered thanks to cover --- lib/ssl/src/ssl_ssl3.erl | 5 ----- lib/ssl/src/ssl_tls1.erl | 5 ----- 2 files changed, 10 deletions(-) diff --git a/lib/ssl/src/ssl_ssl3.erl b/lib/ssl/src/ssl_ssl3.erl index c49f9f1e6d..f2926b2d2f 100644 --- a/lib/ssl/src/ssl_ssl3.erl +++ b/lib/ssl/src/ssl_ssl3.erl @@ -102,11 +102,6 @@ mac_hash(Method, Mac_write_secret, Seq_num, Type, Length, Fragment) -> %% hash(MAC_write_secret + pad_1 + seq_num + %% SSLCompressed.type + SSLCompressed.length + %% SSLCompressed.fragment)); - case Method of - ?NULL -> ok; - _ -> - ok - end, Mac = mac_hash(Method, Mac_write_secret, [<>, Fragment]), diff --git a/lib/ssl/src/ssl_tls1.erl b/lib/ssl/src/ssl_tls1.erl index 3784483e9c..5f9850c386 100644 --- a/lib/ssl/src/ssl_tls1.erl +++ b/lib/ssl/src/ssl_tls1.erl @@ -128,11 +128,6 @@ mac_hash(Method, Mac_write_secret, Seq_num, Type, {Major, Minor}, %% HMAC_hash(MAC_write_secret, seq_num + TLSCompressed.type + %% TLSCompressed.version + TLSCompressed.length + %% TLSCompressed.fragment)); - case Method of - ?NULL -> ok; - _ -> - ok - end, Mac = hmac_hash(Method, Mac_write_secret, [<>, -- cgit v1.2.3 From 1b5f4da2d59f3d42a5e7bb1f7aa1d65436bc2ef5 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 17 Dec 2010 10:52:56 +0100 Subject: Fix missed change of aux_work type --- erts/emulator/beam/erl_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index fbe4381aca..09062ff2e8 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -678,7 +678,7 @@ erts_smp_schedule_misc_aux_work(int ignore_self, ASSERT(0 <= max_sched && max_sched <= erts_no_schedulers); for (ix = 0; ix < max_sched; ix++) { - long aux_work; + erts_aint32_t aux_work; erts_misc_aux_work_t *mawp; ErtsSchedulerSleepInfo *ssi; if (ix == ignore_ix) -- cgit v1.2.3 From 264f3beaa4eec74244c6ed66d31e48ae5025df51 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 17 Dec 2010 11:35:06 +0100 Subject: Decrement refc after unlock in exit/2 --- erts/emulator/beam/bif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 6e9755ad48..864e7c1178 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -1351,9 +1351,10 @@ BIF_RETTYPE exit_2(BIF_ALIST_2) #ifdef ERTS_SMP if (rp == BIF_P) rp_locks &= ~ERTS_PROC_LOCK_MAIN; - else + if (rp_locks) + erts_smp_proc_unlock(rp, rp_locks); + if (rp != BIF_P) erts_smp_proc_dec_refc(rp); - erts_smp_proc_unlock(rp, rp_locks); #endif /* * We may have exited ourselves and may have to take action. -- cgit v1.2.3 From 4a27e3d65e76fb0b9e516b6f48cf344098531843 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 17 Dec 2010 15:32:53 +0100 Subject: Correct usage of pointer-to-size in unix_efile --- erts/emulator/drivers/unix/unix_efile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c index 6297ccb8bc..4b3934657c 100644 --- a/erts/emulator/drivers/unix/unix_efile.c +++ b/erts/emulator/drivers/unix/unix_efile.c @@ -620,7 +620,7 @@ efile_readdir(Efile_error* errInfo, /* Where to return error codes. */ if (IS_DOT_OR_DOTDOT(dirp->d_name)) continue; buffer[0] = '\0'; - strncat(buffer, dirp->d_name, size-1); + strncat(buffer, dirp->d_name, (*size)-1); *size = strlen(dirp->d_name); return 1; } -- cgit v1.2.3 From bb4d67a8f13a5a626e587836cda65c66ae17af0f Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 17 Dec 2010 15:41:30 +0100 Subject: Update release notes --- lib/ssl/doc/src/notes.xml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml index 313f1e59c9..2ccbc5348c 100644 --- a/lib/ssl/doc/src/notes.xml +++ b/lib/ssl/doc/src/notes.xml @@ -31,7 +31,31 @@

This document describes the changes made to the SSL application.

-
SSL 4.1.1 +
SSL 4.1.2 + +
Fixed Bugs and Malfunctions + + +

+ The ssl application caches certificate files, it will now + invalidate cache entries if the diskfile is changed.

+

+ Own Id: OTP-8965 Aux Id: seq11739

+
+ +

+ Now runs the terminate function before returning from the + call made by ssl:close/1, as before the caller of + ssl:close/1 could get problems with the reuseaddr option.

+

+ Own Id: OTP-8992

+
+
+
+ +
+ +
SSL 4.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 69486d5b01b3281ea1c9ca168b2658c1159a82ce Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 17 Dec 2010 17:05:47 +0100 Subject: Remove dead code (and dialyzer errors) from filename and re --- lib/stdlib/src/filename.erl | 14 ++++++-------- lib/stdlib/src/re.erl | 42 +++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl index e38b8957f2..24abf1e977 100644 --- a/lib/stdlib/src/filename.erl +++ b/lib/stdlib/src/filename.erl @@ -165,8 +165,6 @@ basename1([$/|[]], Tail, DirSep2) -> basename1([], Tail, DirSep2); basename1([$/|Rest], _Tail, DirSep2) -> basename1(Rest, [], DirSep2); -basename1([[_|_]=List|Rest], Tail, DirSep2) -> - basename1(List++Rest, Tail, DirSep2); basename1([DirSep2|Rest], Tail, DirSep2) when is_integer(DirSep2) -> basename1([$/|Rest], Tail, DirSep2); basename1([Char|Rest], Tail, DirSep2) when is_integer(Char) -> @@ -280,8 +278,6 @@ dirname(Name0) -> Name = flatten(Name0), dirname(Name, [], [], separators()). -dirname([[_|_]=List|Rest], Dir, File, Seps) -> - dirname(List++Rest, Dir, File, Seps); dirname([$/|Rest], Dir, File, Seps) -> dirname(Rest, File++Dir, [$/], Seps); dirname([DirSep|Rest], Dir, File, {DirSep,_}=Seps) when is_integer(DirSep) -> @@ -346,8 +342,6 @@ extension(Name) when is_binary(Name) -> [] end, case binary:matches(Name,[<<".">>]) of - nomatch -> % Bug in binary workaround :( - <<>>; [] -> <<>>; List -> @@ -479,6 +473,12 @@ maybe_remove_dirsep(Name, _) -> %% by a previous call to join/{1,2}. -spec append(file:filename(), file:name()) -> file:filename(). +append(Dir, Name) when is_binary(Dir), is_binary(Name) -> + <>; +append(Dir, Name) when is_binary(Dir) -> + append(Dir,filename_string_to_binary(Name)); +append(Dir, Name) when is_binary(Name) -> + append(filename_string_to_binary(Dir),Name); append(Dir, Name) -> Dir ++ [$/|Name]. @@ -685,8 +685,6 @@ split([$/|Rest], Comp, Components, OsType) -> split(Rest, [], [lists:reverse(Comp)|Components], OsType); split([Char|Rest], Comp, Components, OsType) when is_integer(Char) -> split(Rest, [Char|Comp], Components, OsType); -split([List|Rest], Comp, Components, OsType) when is_list(List) -> - split(List++Rest, Comp, Components, OsType); split([], [], Components, _OsType) -> lists:reverse(Components); split([], Comp, Components, OsType) -> diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl index 296a6b3d23..9642de17b4 100644 --- a/lib/stdlib/src/re.erl +++ b/lib/stdlib/src/re.erl @@ -208,29 +208,25 @@ replace(Subject,RE,Replacement,Options) -> process_repl_params(Options,iodata,false), FlatSubject = to_binary(Subject, Unicode), FlatReplacement = to_binary(Replacement, Unicode), - case do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt) of - {error,_Err} -> - throw(badre); - IoList -> - case Convert of - iodata -> - IoList; - binary -> - case Unicode of - false -> - iolist_to_binary(IoList); - true -> - unicode:characters_to_binary(IoList,unicode) - end; - list -> - case Unicode of - false -> - binary_to_list(iolist_to_binary(IoList)); - true -> - unicode:characters_to_list(IoList,unicode) - end - end - end + IoList = do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt), + case Convert of + iodata -> + IoList; + binary -> + case Unicode of + false -> + iolist_to_binary(IoList); + true -> + unicode:characters_to_binary(IoList,unicode) + end; + list -> + case Unicode of + false -> + binary_to_list(iolist_to_binary(IoList)); + true -> + unicode:characters_to_list(IoList,unicode) + end + end catch throw:badopt -> erlang:error(badarg,[Subject,RE,Replacement,Options]); -- cgit v1.2.3 From e6371155f2466067541eecafd1ec2a9c8e4a614b Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Mon, 20 Dec 2010 14:11:45 +0100 Subject: Make file_name_SUITE:very_icky work on Windows --- lib/kernel/test/file_name_SUITE.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index fea4df8539..fbafbcd9b7 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -507,8 +507,16 @@ check_very_icky(Mod) -> end, ?line {NumOK,NumNOK} = filelib:fold_files(".",".*",true,fun(_F,{N,M}) when is_list(_F) -> io:format("~ts~n",[_F]),{N+1,M}; (_F,{N,M}) -> io:format("~p~n",[_F]),{N,M+1} end,{0,0}), ?line ok = filelib:fold_files(".",[1076,1089,1072,124,46,42],true,fun(_F,_) -> ok end,false), - ?line SF3 = unicode:characters_to_binary("åäösubfil3",file:native_name_encoding()), - ?line Sorted = lists:sort([SF3,<<"åäösubfil2">>]), + ?line SF3 = unicode:characters_to_binary("åäösubfil3", + file:native_name_encoding()), + ?line SF2 = case treat_icky(<<"åäösubfil2">>) of + LF2 when is_list(LF2) -> + unicode:characters_to_binary(LF2, + file:native_name_encoding()); + BF2 -> + BF2 + end, + ?line Sorted = lists:sort([SF3,SF2]), ?line Sorted = lists:sort(filelib:wildcard("*",<<"åäösubdir2">>)), ok catch -- cgit v1.2.3 From 8f15f156e539aaa6d69acc28d527ef6da94d40d3 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Mon, 20 Dec 2010 14:55:23 +0100 Subject: Removed dead code --- lib/stdlib/src/epp.erl | 10 ++-------- lib/stdlib/src/escript.erl | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl index e5ccaddbb4..d4844b8c1e 100644 --- a/lib/stdlib/src/epp.erl +++ b/lib/stdlib/src/epp.erl @@ -427,10 +427,7 @@ scan_toks(From, St) -> epp_reply(From, {error,E}), wait_req_scan(St#epp{location=Cl}); {eof,Cl} -> - leave_file(From, St#epp{location=Cl}); - {error,_E} -> - epp_reply(From, {error,{St#epp.location,epp,cannot_parse}}), - leave_file(wait_request(St), St) %This serious, just exit! + leave_file(From, St#epp{location=Cl}) end. scan_toks([{'-',_Lh},{atom,_Ld,define}=Define|Toks], From, St) -> @@ -811,10 +808,7 @@ skip_toks(From, St, [I|Sis]) -> {error,_E,Cl} -> skip_toks(From, St#epp{location=Cl}, [I|Sis]); {eof,Cl} -> - leave_file(From, St#epp{location=Cl,istk=[I|Sis]}); - {error,_E} -> - epp_reply(From, {error,{St#epp.location,epp,cannot_parse}}), - leave_file(wait_request(St), St) %This serious, just exit! + leave_file(From, St#epp{location=Cl,istk=[I|Sis]}) end; skip_toks(From, St, []) -> scan_toks(From, St). diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl index 99e454f593..7cb02afb11 100644 --- a/lib/stdlib/src/escript.erl +++ b/lib/stdlib/src/escript.erl @@ -570,9 +570,7 @@ parse_beam(S, File, HeaderSz, CheckOnly) -> forms_or_bin = Bin} end; {error, beam_lib, Reason} when is_tuple(Reason) -> - fatal(element(1, Reason)); - {error, beam_lib, Reason} -> - fatal(Reason) + fatal(element(1, Reason)) end. parse_source(S, File, Fd, StartLine, HeaderSz, CheckOnly) -> -- cgit v1.2.3 From 21768de9bb18c968e71494c07375089191087b79 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Fri, 17 Dec 2010 17:34:39 +0200 Subject: Fix bug in the handling of 'or' by Dialyzer Dialyzer had a minor issue when the arguments of the built-in function 'or' had the fixed value 'false'. This testcase should return no warnings: -module(false_false). -export([false_or/0]). false_or() -> false or false. --- lib/dialyzer/src/dialyzer_typesig.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl index f68472d2fc..c45615d670 100644 --- a/lib/dialyzer/src/dialyzer_typesig.erl +++ b/lib/dialyzer/src/dialyzer_typesig.erl @@ -1406,9 +1406,13 @@ get_bif_constr({erlang, 'or', 2}, Dst, [Arg1, Arg2] = Args, _State) -> ArgV1 = mk_fun_var(ArgFun(Arg2), [Arg2, Dst]), ArgV2 = mk_fun_var(ArgFun(Arg1), [Arg1, Dst]), DstV = mk_fun_var(DstFun, Args), - Disj = mk_disj_constraint_list([mk_constraint(Arg1, sub, True), - mk_constraint(Arg2, sub, True), - mk_constraint(Dst, sub, False)]), + F = fun(A) -> + try [mk_constraint(A, sub, True)] + catch throw:error -> [] + end + end, + Constrs = F(Arg1) ++ F(Arg2), + Disj = mk_disj_constraint_list([mk_constraint(Dst, sub, False)|Constrs]), mk_conj_constraint_list([mk_constraint(Dst, sub, DstV), mk_constraint(Arg1, sub, ArgV1), mk_constraint(Arg2, sub, ArgV2), -- cgit v1.2.3 From ce6172a1badb21a97a4235db27e2f991f01d5b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 7 Dec 2010 11:40:52 +0100 Subject: Teach timer-wheel to keep min time Increases the speed of the timer-wheel --- erts/emulator/beam/time.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c index 9cb6ea34ef..a07c746760 100644 --- a/erts/emulator/beam/time.c +++ b/erts/emulator/beam/time.c @@ -99,6 +99,8 @@ static erts_smp_mtx_t tiw_lock; static ErlTimer** tiw; /* the timing wheel, allocated in init_time() */ static Uint tiw_pos; /* current position in wheel */ static Uint tiw_nto; /* number of timeouts in wheel */ +static Uint tiw_min; +static ErlTimer *tiw_min_ptr; /* END tiw_lock protected variables */ @@ -182,6 +184,12 @@ static erts_aint_t next_time_internal(void) /* PRE: tiw_lock taken by caller */ if (tiw_nto == 0) return -1; /* no timeouts in wheel */ + + if (tiw_min_ptr) { + min = tiw_min; + dt = do_time_read(); + return ((min >= dt) ? (min - dt) : 0); + } /* start going through wheel to find next timeout */ tm = nto = 0; @@ -194,11 +202,17 @@ static erts_aint_t next_time_internal(void) /* PRE: tiw_lock taken by caller */ if (p->count == 0) { /* found next timeout */ dt = do_time_read(); + /* p->count is zero */ + tiw_min_ptr = p; + tiw_min = tm; return ((tm >= dt) ? (tm - dt) : 0); } else { /* keep shortest time in 'min' */ - if (tm + p->count*TIW_SIZE < min) + if (tm + p->count*TIW_SIZE < min) { min = tm + p->count*TIW_SIZE; + tiw_min_ptr = p; + tiw_min = min; + } } p = p->next; } @@ -252,6 +266,11 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is prev = &tiw[tiw_pos]; while ((p = *prev) != NULL) { if (p->count < count) { /* we have a timeout */ + /* remove min time */ + if (tiw_min_ptr == p) { + tiw_min_ptr = NULL; + tiw_min = 0; + } *prev = p->next; /* Remove from list */ tiw_nto--; p->next = NULL; @@ -270,6 +289,8 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is dtime--; } tiw_pos = keep_pos; + if (tiw_min_ptr) + tiw_min -= dt; erts_smp_mtx_unlock(&tiw_lock); @@ -400,6 +421,8 @@ init_time(void) tiw[i] = NULL; do_time_init(); tiw_pos = tiw_nto = 0; + tiw_min_ptr = NULL; + tiw_min = 0; timer_thread_init(); } @@ -434,6 +457,18 @@ insert_timer(ErlTimer* p, Uint t) /* insert at head of list at slot */ p->next = tiw[tm]; tiw[tm] = p; + + /* insert min time */ + if ((tiw_nto == 0) || ((tiw_min_ptr != NULL) && (ticks < tiw_min))) { + tiw_min = ticks; + tiw_min_ptr = p; + } + if ((tiw_min_ptr == p) && (ticks > tiw_min)) { + /* some other timer might be 'min' now */ + tiw_min = 0; + tiw_min_ptr = NULL; + } + tiw_nto++; timer_thread_post_insert(ticks); @@ -443,6 +478,7 @@ void erl_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, void* arg, Uint t) { + erts_deliver_time(); erts_smp_mtx_lock(&tiw_lock); if (p->active) { /* XXX assert ? */ @@ -476,6 +512,13 @@ erl_cancel_timer(ErlTimer* p) prev = &tiw[p->slot]; while ((tp = *prev) != NULL) { if (tp == p) { + + /* is it the 'min' timer ? */ + if (p == tiw_min_ptr) { + tiw_min_ptr = NULL; + tiw_min = 0; + } + *prev = p->next; /* Remove from list */ tiw_nto--; p->next = NULL; @@ -530,7 +573,6 @@ time_left(ErlTimer *p) } #ifdef DEBUG - void p_slpq() { int i; @@ -560,5 +602,4 @@ void p_slpq() erts_smp_mtx_unlock(&tiw_lock); } - #endif /* DEBUG */ -- cgit v1.2.3 From cc38c833de443fa550ecf17201b6aac0d0ad25f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 14 Dec 2010 13:44:41 +0100 Subject: Refactor timer interface --- erts/emulator/beam/break.c | 2 +- erts/emulator/beam/erl_bif_timer.c | 12 +++--- erts/emulator/beam/erl_init.c | 4 +- erts/emulator/beam/erl_process.c | 20 +++++----- erts/emulator/beam/erl_time.h | 63 +++++++++++++++++++++++++++++- erts/emulator/beam/erl_time_sup.c | 6 +-- erts/emulator/beam/global.h | 78 ------------------------------------- erts/emulator/beam/io.c | 12 +++--- erts/emulator/beam/time.c | 22 ++++------- erts/emulator/beam/utils.c | 4 +- erts/emulator/sys/common/erl_mseg.c | 3 +- erts/emulator/sys/vxworks/sys.c | 2 +- 12 files changed, 102 insertions(+), 126 deletions(-) diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c index fd2ec91e65..d255cf3558 100644 --- a/erts/emulator/beam/break.c +++ b/erts/emulator/beam/break.c @@ -558,7 +558,7 @@ do_break(void) #endif #ifdef DEBUG case 't': - p_slpq(); + erts_p_slpq(); return; case 'b': bin_check(); diff --git a/erts/emulator/beam/erl_bif_timer.c b/erts/emulator/beam/erl_bif_timer.c index 4ae2f6ebf4..3508e8e0dc 100644 --- a/erts/emulator/beam/erl_bif_timer.c +++ b/erts/emulator/beam/erl_bif_timer.c @@ -478,7 +478,7 @@ setup_bif_timer(Uint32 xflags, tab_insert(btm); ASSERT(btm == tab_find(ref)); btm->tm.active = 0; /* MUST be initalized */ - erl_set_timer(&btm->tm, + erts_set_timer(&btm->tm, (ErlTimeoutProc) bif_timer_timeout, (ErlCancelProc) bif_timer_cleanup, (void *) btm, @@ -550,7 +550,7 @@ BIF_RETTYPE cancel_timer_1(BIF_ALIST_1) res = am_false; } else { - Uint left = time_left(&btm->tm); + Uint left = erts_time_left(&btm->tm); if (!(btm->flags & BTM_FLG_BYNAME)) { erts_smp_proc_lock(btm->receiver.proc.ess, ERTS_PROC_LOCK_MSGQ); unlink_proc(btm); @@ -558,7 +558,7 @@ BIF_RETTYPE cancel_timer_1(BIF_ALIST_1) } tab_remove(btm); ASSERT(!tab_find(BIF_ARG_1)); - erl_cancel_timer(&btm->tm); + erts_cancel_timer(&btm->tm); erts_smp_btm_rwunlock(); res = erts_make_integer(left, BIF_P); } @@ -587,7 +587,7 @@ BIF_RETTYPE read_timer_1(BIF_ALIST_1) res = am_false; } else { - Uint left = time_left(&btm->tm); + Uint left = erts_time_left(&btm->tm); res = erts_make_integer(left, BIF_P); } @@ -613,7 +613,7 @@ erts_print_bif_timer_info(int to, void *to_arg) : btm->receiver.proc.ess->id); erts_print(to, to_arg, "=timer:%T\n", receiver); erts_print(to, to_arg, "Message: %T\n", btm->message); - erts_print(to, to_arg, "Time left: %d ms\n", time_left(&btm->tm)); + erts_print(to, to_arg, "Time left: %d ms\n", erts_time_left(&btm->tm)); } } @@ -640,7 +640,7 @@ erts_cancel_bif_timers(Process *p, ErtsProcLocks plocks) tab_remove(btm); tmp_btm = btm; btm = btm->receiver.proc.next; - erl_cancel_timer(&tmp_btm->tm); + erts_cancel_timer(&tmp_btm->tm); } p->bif_timers = NULL; diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c index f4e0717d30..0a57eb6d88 100644 --- a/erts/emulator/beam/erl_init.c +++ b/erts/emulator/beam/erl_init.c @@ -250,7 +250,7 @@ erl_init(int ncpu) erts_init_monitors(); erts_init_gc(); - init_time(); + erts_init_time(); erts_init_sys_common_misc(); erts_init_process(ncpu); erts_init_scheduling(use_multi_run_queue, @@ -289,7 +289,7 @@ erl_init(int ncpu) erts_delay_trap = erts_export_put(am_erlang, am_delay_trap, 2); erts_late_init_process(); #if HAVE_ERTS_MSEG - erts_mseg_late_init(); /* Must be after timer (init_time()) and thread + erts_mseg_late_init(); /* Must be after timer (erts_init_time()) and thread initializations */ #endif #ifdef HIPE diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index 77ee1d6ac5..bf553ae88a 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -997,8 +997,8 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq) erl_sys_schedule(1); /* Might give us something to do */ - dt = do_time_read_and_reset(); - if (dt) bump_timer(dt); + dt = erts_do_time_read_and_reset(); + if (dt) erts_bump_timer(dt); sys_aux_work: @@ -1094,8 +1094,8 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq) erl_sys_schedule(0); - dt = do_time_read_and_reset(); - if (dt) bump_timer(dt); + dt = erts_do_time_read_and_reset(); + if (dt) erts_bump_timer(dt); flgs = sched_prep_cont_spin_wait(ssi); if (flgs & ERTS_SSI_FLG_WAITING) @@ -5070,10 +5070,10 @@ Process *schedule(Process *p, int calls) ERTS_SMP_CHK_NO_PROC_LOCKS; - dt = do_time_read_and_reset(); + dt = erts_do_time_read_and_reset(); if (dt) { erts_smp_runq_unlock(rq); - bump_timer(dt); + erts_bump_timer(dt); erts_smp_runq_lock(rq); } BM_STOP_TIMER(system); @@ -5214,8 +5214,8 @@ Process *schedule(Process *p, int calls) #endif erts_smp_runq_unlock(rq); erl_sys_schedule(runnable); - dt = do_time_read_and_reset(); - if (dt) bump_timer(dt); + dt = erts_do_time_read_and_reset(); + if (dt) erts_bump_timer(dt); #ifdef ERTS_SMP erts_smp_runq_lock(rq); erts_smp_atomic32_set(&doing_sys_schedule, 0); @@ -7476,7 +7476,7 @@ cancel_timer(Process* p) #ifdef ERTS_SMP erts_cancel_smp_ptimer(p->u.ptimer); #else - erl_cancel_timer(&p->u.tm); + erts_cancel_timer(&p->u.tm); #endif } @@ -7502,7 +7502,7 @@ set_timer(Process* p, Uint timeout) (ErlTimeoutProc) timeout_proc, timeout); #else - erl_set_timer(&p->u.tm, + erts_set_timer(&p->u.tm, (ErlTimeoutProc) timeout_proc, NULL, (void*) p, diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h index 6f6b971d34..f4e230655d 100644 --- a/erts/emulator/beam/erl_time.h +++ b/erts/emulator/beam/erl_time.h @@ -20,6 +20,9 @@ #ifndef ERL_TIME_H__ #define ERL_TIME_H__ +extern erts_smp_atomic_t do_time; /* set at clock interrupt */ +extern SysTimeval erts_first_emu_time; + /* ** Timer entry: */ @@ -39,7 +42,6 @@ typedef void (*ErlTimeoutProc)(void*); typedef void (*ErlCancelProc)(void*); #ifdef ERTS_SMP - /* * Process and port timer */ @@ -61,7 +63,66 @@ void erts_create_smp_ptimer(ErtsSmpPTimer **timer_ref, ErlTimeoutProc timeout_func, Uint timeout); void erts_cancel_smp_ptimer(ErtsSmpPTimer *ptimer); +#endif + +/* timer-wheel api */ +void erts_init_time(void); +void erts_set_timer(ErlTimer*, ErlTimeoutProc, ErlCancelProc, void*, Uint); +void erts_cancel_timer(ErlTimer*); +void erts_bump_timer(erts_aint_t); +Uint erts_timer_wheel_memory_size(void); +Uint erts_time_left(ErlTimer *); +erts_aint_t erts_next_time(void); + +#ifdef DEBUG +void erts_p_slpq(void); #endif +ERTS_GLB_INLINE erts_aint_t erts_do_time_read_and_reset(void); +ERTS_GLB_INLINE void erts_do_time_add(long); + +#if ERTS_GLB_INLINE_INCL_FUNC_DEF + +ERTS_GLB_INLINE erts_aint_t erts_do_time_read_and_reset(void) { return erts_smp_atomic_xchg(&do_time, 0L); } +ERTS_GLB_INLINE void erts_do_time_add(long elapsed) { erts_smp_atomic_add(&do_time, elapsed); } + +#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */ + + +/* time_sup */ + +#if (defined(HAVE_GETHRVTIME) || defined(HAVE_CLOCK_GETTIME)) +# ifndef HAVE_ERTS_NOW_CPU +# define HAVE_ERTS_NOW_CPU +# ifdef HAVE_GETHRVTIME +# define erts_start_now_cpu() sys_start_hrvtime() +# define erts_stop_now_cpu() sys_stop_hrvtime() +# endif +# endif +void erts_get_now_cpu(Uint* megasec, Uint* sec, Uint* microsec); #endif + +void erts_get_timeval(SysTimeval *tv); +long erts_get_time(void); +void erts_get_emu_time(SysTimeval *); + +ERTS_GLB_INLINE int erts_cmp_timeval(SysTimeval *t1p, SysTimeval *t2p); + +#if ERTS_GLB_INLINE_INCL_FUNC_DEF + +ERTS_GLB_INLINE int +erts_cmp_timeval(SysTimeval *t1p, SysTimeval *t2p) +{ + if (t1p->tv_sec == t2p->tv_sec) { + if (t1p->tv_usec < t2p->tv_usec) + return -1; + else if (t1p->tv_usec > t2p->tv_usec) + return 1; + return 0; + } + return t1p->tv_sec < t2p->tv_sec ? -1 : 1; +} + +#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */ +#endif /* ERL_TIME_H__ */ diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c index 7b8706ea13..932bf678cd 100644 --- a/erts/emulator/beam/erl_time_sup.c +++ b/erts/emulator/beam/erl_time_sup.c @@ -389,7 +389,7 @@ static void do_erts_deliver_time(const SysTimeval *current) this by simply pretend as if the time stood still. :) */ if (elapsed > 0) { - do_time_add(elapsed); + erts_do_time_add(elapsed); last_delivered = cur_time; } } @@ -811,9 +811,9 @@ void erts_time_remaining(SysTimeval *rem_time) #endif long elapsed; - /* next_time() returns no of ticks to next timeout or -1 if none */ + /* erts_next_time() returns no of ticks to next timeout or -1 if none */ - if ((ticks = next_time()) == -1) { + if ((ticks = erts_next_time()) == -1) { /* timer queue empty */ /* this will cause at most 100000000 ticks */ rem_time->tv_sec = 100000; diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index c948af14ae..e8a9d5f32f 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -1425,84 +1425,6 @@ void erl_drv_thr_init(void); /* time.c */ -ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void); -#ifdef ERTS_TIMER_THREAD -ERTS_GLB_INLINE int next_time(void); -ERTS_GLB_INLINE void bump_timer(erts_aint_t); -#else -erts_aint_t next_time(void); -void bump_timer(erts_aint_t); -extern erts_smp_atomic_t do_time; /* set at clock interrupt */ -ERTS_GLB_INLINE void do_time_add(erts_aint_t); -#endif - -#if ERTS_GLB_INLINE_INCL_FUNC_DEF - -#ifdef ERTS_TIMER_THREAD -ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void) { return 0; } -ERTS_GLB_INLINE erts_aint_t next_time(void) { return -1; } -ERTS_GLB_INLINE void bump_timer(erts_aint_t ignore) { } -#else -ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void) -{ - return erts_smp_atomic_xchg(&do_time, 0L); -} -ERTS_GLB_INLINE void do_time_add(erts_aint_t elapsed) -{ - erts_smp_atomic_add(&do_time, elapsed); -} -#endif - -#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */ - -void init_time(void); -void erl_set_timer(ErlTimer*, ErlTimeoutProc, ErlCancelProc, void*, Uint); -void erl_cancel_timer(ErlTimer*); -Uint time_left(ErlTimer *); - -Uint erts_timer_wheel_memory_size(void); - -#if (defined(HAVE_GETHRVTIME) || defined(HAVE_CLOCK_GETTIME)) -# ifndef HAVE_ERTS_NOW_CPU -# define HAVE_ERTS_NOW_CPU -# ifdef HAVE_GETHRVTIME -# define erts_start_now_cpu() sys_start_hrvtime() -# define erts_stop_now_cpu() sys_stop_hrvtime() -# endif -# endif -void erts_get_now_cpu(Uint* megasec, Uint* sec, Uint* microsec); -#endif - -void erts_get_timeval(SysTimeval *tv); -long erts_get_time(void); - -extern SysTimeval erts_first_emu_time; - -void erts_get_emu_time(SysTimeval *); - -ERTS_GLB_INLINE int erts_cmp_timeval(SysTimeval *t1p, SysTimeval *t2p); - -#if ERTS_GLB_INLINE_INCL_FUNC_DEF - -ERTS_GLB_INLINE int -erts_cmp_timeval(SysTimeval *t1p, SysTimeval *t2p) -{ - if (t1p->tv_sec == t2p->tv_sec) { - if (t1p->tv_usec < t2p->tv_usec) - return -1; - else if (t1p->tv_usec > t2p->tv_usec) - return 1; - return 0; - } - return t1p->tv_sec < t2p->tv_sec ? -1 : 1; -} - -#endif - -#ifdef DEBUG -void p_slpq(void); -#endif - /* utils.c */ /* diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index f6c6a01fb2..f21a96c754 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -670,7 +670,7 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */ #ifdef ERTS_SMP erts_cancel_smp_ptimer(port->ptimer); #else - erl_cancel_timer(&(port->tm)); + erts_cancel_timer(&(port->tm)); #endif stopq(port); kill_port(port); @@ -1839,7 +1839,7 @@ terminate_port(Port *prt) #ifdef ERTS_SMP erts_cancel_smp_ptimer(prt->ptimer); #else - erl_cancel_timer(&prt->tm); + erts_cancel_timer(&prt->tm); #endif drv = prt->drv_ptr; @@ -4068,7 +4068,7 @@ drv_cancel_timer(Port *prt) #ifdef ERTS_SMP erts_cancel_smp_ptimer(prt->ptimer); #else - erl_cancel_timer(&prt->tm); + erts_cancel_timer(&prt->tm); #endif if (erts_port_task_is_scheduled(&prt->timeout_task)) erts_port_task_abort(prt->id, &prt->timeout_task); @@ -4092,7 +4092,7 @@ int driver_set_timer(ErlDrvPort ix, UWord t) (ErlTimeoutProc) schedule_port_timeout, t); #else - erl_set_timer(&prt->tm, + erts_set_timer(&prt->tm, (ErlTimeoutProc) schedule_port_timeout, NULL, prt, @@ -4123,9 +4123,9 @@ driver_read_timer(ErlDrvPort ix, unsigned long* t) return -1; ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt)); #ifdef ERTS_SMP - *t = prt->ptimer ? time_left(&prt->ptimer->timer.tm) : 0; + *t = prt->ptimer ? erts_time_left(&prt->ptimer->timer.tm) : 0; #else - *t = time_left(&prt->tm); + *t = erts_time_left(&prt->tm); #endif return 0; } diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c index a07c746760..20522f6f19 100644 --- a/erts/emulator/beam/time.c +++ b/erts/emulator/beam/time.c @@ -227,7 +227,7 @@ static erts_aint_t next_time_internal(void) /* PRE: tiw_lock taken by caller */ #if !defined(ERTS_TIMER_THREAD) /* Private export to erl_time_sup.c */ -erts_aint_t next_time(void) +erts_aint_t erts_next_time(void) { erts_aint_t ret; @@ -310,19 +310,11 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is } } -#if defined(ERTS_TIMER_THREAD) -static void timer_thread_bump_timer(void) -{ - erts_smp_mtx_lock(&tiw_lock); - bump_timer_internal(do_time_reset()); -} -#else -void bump_timer(erts_aint_t dt) /* dt is value from do_time */ +void erts_bump_timer(erts_aint_t dt) /* dt is value from do_time */ { erts_smp_mtx_lock(&tiw_lock); bump_timer_internal(dt); } -#endif Uint erts_timer_wheel_memory_size(void) @@ -405,7 +397,7 @@ static ERTS_INLINE void timer_thread_init(void) { } /* this routine links the time cells into a free list at the start and sets the time queue as empty */ void -init_time(void) +erts_init_time(void) { int i; @@ -475,7 +467,7 @@ insert_timer(ErlTimer* p, Uint t) } void -erl_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, +erts_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, void* arg, Uint t) { @@ -498,7 +490,7 @@ erl_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, } void -erl_cancel_timer(ErlTimer* p) +erts_cancel_timer(ErlTimer* p) { ErlTimer *tp; ErlTimer **prev; @@ -545,7 +537,7 @@ erl_cancel_timer(ErlTimer* p) immediately if it hadn't been cancelled). */ Uint -time_left(ErlTimer *p) +erts_time_left(ErlTimer *p) { Uint left; erts_aint_t dt; @@ -573,7 +565,7 @@ time_left(ErlTimer *p) } #ifdef DEBUG -void p_slpq() +void erts_p_slpq() { int i; ErlTimer* p; diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 2bf283d9ec..ab37ed1d81 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -3183,7 +3183,7 @@ erts_create_smp_ptimer(ErtsSmpPTimer **timer_ref, *timer_ref = res; - erl_set_timer(&res->timer.tm, + erts_set_timer(&res->timer.tm, (ErlTimeoutProc) ptimer_timeout, (ErlCancelProc) ptimer_cancelled, (void*) res, @@ -3197,7 +3197,7 @@ erts_cancel_smp_ptimer(ErtsSmpPTimer *ptimer) ASSERT(*ptimer->timer.timer_ref == ptimer); *ptimer->timer.timer_ref = NULL; ptimer->timer.flags |= ERTS_PTMR_FLG_CANCELLED; - erl_cancel_timer(&ptimer->timer.tm); + erts_cancel_timer(&ptimer->timer.tm); } } diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index b1ee165489..010d60eb63 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -35,6 +35,7 @@ #include "global.h" #include "erl_threads.h" #include "erl_mtrace.h" +#include "erl_time.h" #include "big.h" #if HAVE_ERTS_MSEG @@ -271,7 +272,7 @@ schedule_cache_check(void) #endif { cache_check_timer.active = 0; - erl_set_timer(&cache_check_timer, + erts_set_timer(&cache_check_timer, check_cache, NULL, NULL, diff --git a/erts/emulator/sys/vxworks/sys.c b/erts/emulator/sys/vxworks/sys.c index 411b4b37cf..c6e7b65f32 100644 --- a/erts/emulator/sys/vxworks/sys.c +++ b/erts/emulator/sys/vxworks/sys.c @@ -85,7 +85,7 @@ EXTERN_FUNCTION(void, erl_exit, (int n, char*, _DOTS_)); EXTERN_FUNCTION(void, erl_error, (char*, va_list)); EXTERN_FUNCTION(int, driver_interrupt, (int, int)); EXTERN_FUNCTION(void, increment_time, (int)); -EXTERN_FUNCTION(int, next_time, (_VOID_)); +EXTERN_FUNCTION(int, erts_next_time, (_VOID_)); EXTERN_FUNCTION(void, set_reclaim_free_function, (FreeFunction)); EXTERN_FUNCTION(int, erl_mem_info_get, (MEM_PART_STATS *)); EXTERN_FUNCTION(void, erl_crash_dump, (char* file, int line, char* fmt, ...)); -- cgit v1.2.3 From 4e894385dba69227fde6a5b402b169ec4621a356 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 20 Dec 2010 17:05:39 +0100 Subject: OTP-8987 In some cases SSH returned {error, normal} when a channel was terminated unexpectedly. This has now been changed to {error, channel_closed}. OTP-8986 It is now possible to use SSH to sign and verify binary data. --- lib/ssh/doc/src/notes.xml | 25 +++++++++++++++++++++ lib/ssh/doc/src/ssh.xml | 32 ++++++++++++++++++++++++++ lib/ssh/src/ssh.erl | 41 ++++++++++++++++++++++++++++++++++ lib/ssh/src/ssh_connection_manager.erl | 6 ++--- lib/ssh/src/ssh_file.erl | 9 ++++++-- lib/ssh/src/ssh_rsa.erl | 3 +-- lib/ssh/vsn.mk | 2 +- 7 files changed, 110 insertions(+), 8 deletions(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 9bedd446f4..d2ec7b4097 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -29,6 +29,31 @@ notes.xml
+
Ssh 2.0.4 +
Fixed Bugs and Malfunctions + + +

In some cases SSH returned {error, normal} when a channel was terminated + unexpectedly. This has now been changed to {error, channel_closed}.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-8986 Aux Id: seq11748

+
+
+
+
Improvements and New Features + + +

+ It is now possible to use SSH to sign and verify binary data.

+

+ Own Id: OTP-8986

+
+
+
+
+
Ssh 2.0.3
Fixed Bugs and Malfunctions diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml index 71e6b2cd3d..2c5096a25f 100644 --- a/lib/ssh/doc/src/ssh.xml +++ b/lib/ssh/doc/src/ssh.xml @@ -282,6 +282,22 @@ + + sign_data(Data, Algorithm) -> Signature | {error, Reason} + + + Data = binary() + Algorithm = "ssh-rsa" + Signature = binary() + Reason = term() + + +

Signs the supplied binary using the SSH key. +

+
+
+ + start() -> start(Type) -> ok | {error, Reason} @@ -339,6 +355,22 @@ by the listener up and running.

+ + + verify_data(Data, Signature, Algorithm) -> ok | {error, Reason} + + + Data = binary() + Algorithm = "ssh-rsa" + Signature = binary() + Reason = term() + + +

Verifies the supplied binary against the binary signature. +

+
+
+ diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl index 994c77436a..b7f56b1b38 100644 --- a/lib/ssh/src/ssh.erl +++ b/lib/ssh/src/ssh.erl @@ -30,6 +30,8 @@ stop_listener/1, stop_listener/2, stop_daemon/1, stop_daemon/2, shell/1, shell/2, shell/3]). +-export([sign_data/2, verify_data/3]). + %%-------------------------------------------------------------------- %% Function: start([, Type]) -> ok %% @@ -95,6 +97,8 @@ connect(Host, Port, Options, Timeout) -> {error, Other}; {'DOWN', MRef, _, Manager, Reason} when is_pid(Manager) -> receive %% Clear EXIT message from queue + {'EXIT', Manager, _What} when Reason == normal -> + {error, channel_closed}; {'EXIT', Manager, _What} -> {error, Reason} after 0 -> @@ -239,6 +243,43 @@ shell(Host, Port, Options) -> Error end. + +%%-------------------------------------------------------------------- +%% Function: sign_data(Data, Algorithm) -> binary() | +%% {error, Reason} +%% +%% Data = binary() +%% Algorithm = "ssh-rsa" +%% +%% Description: Use SSH key to sign data. +%%-------------------------------------------------------------------- +sign_data(Data, Algorithm) when is_binary(Data) -> + case ssh_file:private_identity_key(Algorithm,[]) of + {ok, Key} when Algorithm == "ssh-rsa" -> + ssh_rsa:sign(Key, Data); + Error -> + Error + end. + +%%-------------------------------------------------------------------- +%% Function: verify_data(Data, Signature, Algorithm) -> ok | +%% {error, Reason} +%% +%% Data = binary() +%% Signature = binary() +%% Algorithm = "ssh-rsa" +%% +%% Description: Use SSH signature to verify data. +%%-------------------------------------------------------------------- +verify_data(Data, Signature, Algorithm) when is_binary(Data), is_binary(Signature) -> + case ssh_file:public_identity_key(Algorithm, []) of + {ok, Key} when Algorithm == "ssh-rsa" -> + ssh_rsa:verify(Key, Data, Signature); + Error -> + Error + end. + + %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl index 6bf89224cf..9bfd5270da 100644 --- a/lib/ssh/src/ssh_connection_manager.erl +++ b/lib/ssh/src/ssh_connection_manager.erl @@ -147,7 +147,7 @@ close(ConnectionManager, ChannelId) -> try call(ConnectionManager, {close, ChannelId}) of ok -> ok; - {error,normal} -> + {error, channel_closed} -> ok catch exit:{noproc, _} -> @@ -158,7 +158,7 @@ stop(ConnectionManager) -> try call(ConnectionManager, stop) of ok -> ok; - {error,normal} -> + {error, channel_closed} -> ok catch exit:{noproc, _} -> @@ -604,7 +604,7 @@ call(Pid, Msg, Timeout) -> exit:{timeout, _} -> {error, timeout}; exit:{normal, _} -> - {error, normal} + {error, channel_closed} end. cast(Pid, Msg) -> diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl index 13722656db..cd0d01c546 100755 --- a/lib/ssh/src/ssh_file.erl +++ b/lib/ssh/src/ssh_file.erl @@ -33,8 +33,8 @@ lookup_host_key/3, add_host_key/3, % del_host_key/2, lookup_user_key/3, ssh_dir/2, file_name/3]). --export([private_identity_key/2]). -%% , public_identity_key/2, +-export([private_identity_key/2, + public_identity_key/2]). %% identity_keys/2]). -export([encode_public_key/1, decode_public_key_v2/2]). @@ -140,6 +140,11 @@ private_identity_key(Alg, Opts) -> Path = file_name(user, identity_key_filename(Alg), Opts), read_private_key_v2(Path, Alg). +public_identity_key(Alg, Opts) -> + Path = file_name(user, identity_key_filename(Alg) ++ ".pub", Opts), + read_public_key_v2(Path, Alg). + + read_public_key_v2(File, Type) -> case file:read_file(File) of {ok,Bin} -> diff --git a/lib/ssh/src/ssh_rsa.erl b/lib/ssh/src/ssh_rsa.erl index e27cdcf7bd..91b8285b2e 100755 --- a/lib/ssh/src/ssh_rsa.erl +++ b/lib/ssh/src/ssh_rsa.erl @@ -202,8 +202,7 @@ rsassa_pkcs1_v1_5_verify(Public=#ssh_key { public={N,_E}}, Mb, Sb) -> case emsa_pkcs1_v1_5_encode(Mb, K) of EM -> ok; _S -> - io:format("S: ~p~n", [_S]), - {error, invalid_signature} % exit(invalid_signature) + {error, invalid_signature} end. diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index db03168ad9..51f9f47446 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,5 +1,5 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 2.0.3 +SSH_VSN = 2.0.4 APP_VSN = "ssh-$(SSH_VSN)" -- cgit v1.2.3 From 264e7630339604f9113c57b99216f7cf35768580 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 20 Dec 2010 17:07:49 +0100 Subject: Release note contained wrong ticker number. --- lib/ssh/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index d2ec7b4097..8d73c033be 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -38,7 +38,7 @@

*** POTENTIAL INCOMPATIBILITY ***

- Own Id: OTP-8986 Aux Id: seq11748

+ Own Id: OTP-8987 Aux Id: seq11748

-- cgit v1.2.3 From 454f2ef1c95a9d543fc5a66eca4f286a3144b7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 20 Dec 2010 11:56:50 +0100 Subject: Remove timer-thread implementation --- erts/emulator/beam/erl_time_sup.c | 13 -- erts/emulator/beam/sys.h | 11 -- erts/emulator/beam/time.c | 147 +--------------------- erts/emulator/beam/utils.c | 7 -- erts/emulator/sys/unix/erl_unix_sys.h | 7 -- erts/emulator/sys/unix/sys.c | 223 ---------------------------------- 6 files changed, 5 insertions(+), 403 deletions(-) diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c index 932bf678cd..ca4b54188e 100644 --- a/erts/emulator/beam/erl_time_sup.c +++ b/erts/emulator/beam/erl_time_sup.c @@ -358,10 +358,6 @@ static int clock_resolution; ** instead of something like select. */ -#if defined(ERTS_TIMER_THREAD) -static ERTS_INLINE void init_erts_deliver_time(const SysTimeval *inittv) { } -static ERTS_INLINE void do_erts_deliver_time(const SysTimeval *current) { } -#else static SysTimeval last_delivered; static void init_erts_deliver_time(const SysTimeval *inittv) @@ -393,7 +389,6 @@ static void do_erts_deliver_time(const SysTimeval *current) last_delivered = cur_time; } } -#endif int erts_init_time_sup(void) @@ -786,7 +781,6 @@ get_sys_now(Uint* megasec, Uint* sec, Uint* microsec) to a struct timeval representing current time (to save a gettimeofday() where possible) or NULL */ -#if !defined(ERTS_TIMER_THREAD) void erts_deliver_time(void) { SysTimeval now; @@ -797,7 +791,6 @@ void erts_deliver_time(void) { erts_smp_mtx_unlock(&erts_timeofday_mtx); } -#endif /* get *real* time (not ticks) remaining until next timeout - if there isn't one, give a "long" time, that is guaranteed @@ -806,9 +799,7 @@ void erts_deliver_time(void) { void erts_time_remaining(SysTimeval *rem_time) { int ticks; -#if !defined(ERTS_TIMER_THREAD) SysTimeval cur_time; -#endif long elapsed; /* erts_next_time() returns no of ticks to next timeout or -1 if none */ @@ -822,9 +813,6 @@ void erts_time_remaining(SysTimeval *rem_time) /* next timeout after ticks ticks */ ticks *= CLOCK_RESOLUTION; -#if defined(ERTS_TIMER_THREAD) - elapsed = 0; -#else erts_smp_mtx_lock(&erts_timeofday_mtx); get_tolerant_timeofday(&cur_time); @@ -839,7 +827,6 @@ void erts_time_remaining(SysTimeval *rem_time) rem_time->tv_sec = rem_time->tv_usec = 0; return; } -#endif rem_time->tv_sec = (ticks - elapsed) / 1000; rem_time->tv_usec = 1000 * ((ticks - elapsed) % 1000); } diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index 5a4dad0a28..dff2dc37a2 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -39,13 +39,6 @@ #define ENABLE_CHILD_WAITER_THREAD 1 #endif -/* The ERTS_TIMER_TREAD #define must be visible to the - erl_${OS}_sys.h #include files: it controls whether - certain optional facilities should be defined or not. */ -#if defined(ERTS_SMP) && 0 -#define ERTS_TIMER_THREAD -#endif - #if defined (__WIN32__) # include "erl_win_sys.h" #elif defined (VXWORKS) @@ -562,11 +555,7 @@ extern char *erts_default_arg0; extern char os_type[]; extern int sys_init_time(void); -#if defined(ERTS_TIMER_THREAD) -#define erts_deliver_time() -#else extern void erts_deliver_time(void); -#endif extern void erts_time_remaining(SysTimeval *); extern int erts_init_time_sup(void); extern void erts_sys_init_float(void); diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c index 20522f6f19..4f491aa66f 100644 --- a/erts/emulator/beam/time.c +++ b/erts/emulator/beam/time.c @@ -107,70 +107,10 @@ static ErlTimer *tiw_min_ptr; /* Actual interval time chosen by sys_init_time() */ static int itime; /* Constant after init */ -#if defined(ERTS_TIMER_THREAD) -static SysTimeval time_start; /* start of current time interval */ -static erts_aint_t ticks_end; /* time_start+ticks_end == time_wakeup */ -static erts_aint_t ticks_latest; /* delta from time_start at latest time update*/ - -static ERTS_INLINE erts_aint_t time_gettimeofday(SysTimeval *now) -{ - erts_aint_t elapsed; - - erts_get_timeval(now); - now->tv_usec = 1000 * (now->tv_usec / 1000); /* ms resolution */ - elapsed = (1000 * (now->tv_sec - time_start.tv_sec) + - (now->tv_usec - time_start.tv_usec) / 1000); - // elapsed /= CLOCK_RESOLUTION; - return elapsed; -} - -static erts_aint_t do_time_update(void) -{ - SysTimeval now; - erts_aint_t elapsed; - - elapsed = time_gettimeofday(&now); - ticks_latest = elapsed; - return elapsed; -} - -static ERTS_INLINE erts_aint_t do_time_read(void) -{ - return ticks_latest; -} - -static erts_aint_t do_time_reset(void) -{ - SysTimeval now; - erts_aint_t elapsed; - - elapsed = time_gettimeofday(&now); - time_start = now; - ticks_end = LONG_MAX; - ticks_latest = 0; - return elapsed; -} - -static ERTS_INLINE void do_time_init(void) -{ - (void)do_time_reset(); -} - -#else erts_smp_atomic_t do_time; /* set at clock interrupt */ -static ERTS_INLINE erts_aint_t do_time_read(void) -{ - return erts_smp_atomic_read(&do_time); -} -static ERTS_INLINE erts_aint_t do_time_update(void) -{ - return do_time_read(); -} -static ERTS_INLINE void do_time_init(void) -{ - erts_smp_atomic_init(&do_time, (erts_aint_t) 0); -} -#endif +static ERTS_INLINE erts_aint_t do_time_read(void) { return erts_smp_atomic_read(&do_time); } +static ERTS_INLINE erts_aint_t do_time_update(void) { return do_time_read(); } +static ERTS_INLINE void do_time_init(void) { erts_smp_atomic_init(&do_time, 0L); } /* get the time (in units of itime) to the next timeout, or -1 if there are no timeouts */ @@ -225,7 +165,6 @@ static erts_aint_t next_time_internal(void) /* PRE: tiw_lock taken by caller */ return ((min >= dt) ? (min - dt) : 0); } -#if !defined(ERTS_TIMER_THREAD) /* Private export to erl_time_sup.c */ erts_aint_t erts_next_time(void) { @@ -237,7 +176,6 @@ erts_aint_t erts_next_time(void) erts_smp_mtx_unlock(&tiw_lock); return ret; } -#endif static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is write-locked */ { @@ -265,6 +203,7 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is if (tiw_pos == keep_pos) count--; prev = &tiw[tiw_pos]; while ((p = *prev) != NULL) { + ASSERT( p != p->next); if (p->count < count) { /* we have a timeout */ /* remove min time */ if (tiw_min_ptr == p) { @@ -322,78 +261,6 @@ erts_timer_wheel_memory_size(void) return (Uint) TIW_SIZE * sizeof(ErlTimer*); } -#if defined(ERTS_TIMER_THREAD) -static struct erts_iwait *timer_thread_iwait; - -static int timer_thread_setup_delay(SysTimeval *rem_time) -{ - erts_aint_t elapsed; - erts_aint_t ticks; - - erts_smp_mtx_lock(&tiw_lock); - elapsed = do_time_update(); - ticks = next_time_internal(); - if (ticks == -1) /* timer queue empty */ - ticks = 100*1000*1000; - if (elapsed > ticks) - elapsed = ticks; - ticks -= elapsed; - //ticks *= CLOCK_RESOLUTION; - rem_time->tv_sec = ticks / 1000; - rem_time->tv_usec = 1000 * (ticks % 1000); - ticks_end = ticks; - erts_smp_mtx_unlock(&tiw_lock); - return ticks; -} - -static void *timer_thread_start(void *ignore) -{ - SysTimeval delay; - -#ifdef ERTS_ENABLE_LOCK_CHECK - erts_lc_set_thread_name("timer"); -#endif - erts_register_blockable_thread(); - - for(;;) { - if (timer_thread_setup_delay(&delay)) { - erts_smp_activity_begin(ERTS_ACTIVITY_WAIT, NULL, NULL, NULL); - ASSERT_NO_LOCKED_LOCKS; - erts_iwait_wait(timer_thread_iwait, &delay); - ASSERT_NO_LOCKED_LOCKS; - erts_smp_activity_end(ERTS_ACTIVITY_WAIT, NULL, NULL, NULL); - } - else - erts_smp_chk_system_block(NULL, NULL, NULL); - timer_thread_bump_timer(); - ASSERT_NO_LOCKED_LOCKS; - } - /*NOTREACHED*/ - return NULL; -} - -static ERTS_INLINE void timer_thread_post_insert(Uint ticks) -{ - if ((Sint)ticks < ticks_end) - erts_iwait_interrupt(timer_thread_iwait); -} - -static void timer_thread_init(void) -{ - erts_thr_opts_t opts = ERTS_THR_OPTS_DEFAULT_INITER; - erts_tid_t tid; - - opts->detached = 1; - - timer_thread_iwait = erts_iwait_init(); - erts_thr_create(&tid, timer_thread_start, NULL, &opts); -} - -#else -static ERTS_INLINE void timer_thread_post_insert(Uint ticks) { } -static ERTS_INLINE void timer_thread_init(void) { } -#endif - /* this routine links the time cells into a free list at the start and sets the time queue as empty */ void @@ -415,8 +282,6 @@ erts_init_time(void) tiw_pos = tiw_nto = 0; tiw_min_ptr = NULL; tiw_min = 0; - - timer_thread_init(); } /* @@ -462,8 +327,6 @@ insert_timer(ErlTimer* p, Uint t) } tiw_nto++; - - timer_thread_post_insert(ticks); } void @@ -483,7 +346,7 @@ erts_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, p->active = 1; insert_timer(p, t); erts_smp_mtx_unlock(&tiw_lock); -#if defined(ERTS_SMP) && !defined(ERTS_TIMER_THREAD) +#if defined(ERTS_SMP) if (t <= (Uint) LONG_MAX) erts_sys_schedule_interrupt_timed(1, (long) t); #endif diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index ab37ed1d81..1d60b54d21 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -59,13 +59,6 @@ /* profile_scheduler mini message queue */ -#ifdef ERTS_TIMER_THREAD -/* A timer thread is not welcomed with this lock violation work around. - * - Björn-Egil - */ -#error Timer thread may not be enabled due to lock violation. -#endif - typedef struct { Uint scheduler_id; Uint no_schedulers; diff --git a/erts/emulator/sys/unix/erl_unix_sys.h b/erts/emulator/sys/unix/erl_unix_sys.h index 2d5ef882f6..824678a0bb 100644 --- a/erts/emulator/sys/unix/erl_unix_sys.h +++ b/erts/emulator/sys/unix/erl_unix_sys.h @@ -329,11 +329,4 @@ extern int exit_async(void); #define ERTS_EXIT_AFTER_DUMP _exit -#ifdef ERTS_TIMER_THREAD -struct erts_iwait; /* opaque for clients */ -extern struct erts_iwait *erts_iwait_init(void); -extern void erts_iwait_wait(struct erts_iwait *iwait, struct timeval *delay); -extern void erts_iwait_interrupt(struct erts_iwait *iwait); -#endif /* ERTS_TIMER_THREAD */ - #endif /* #ifndef _ERL_UNIX_SYS_H */ diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index d021baa6bf..bfc04faa45 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -3109,226 +3109,3 @@ erl_sys_args(int* argc, char** argv) } *argc = j; } - -#ifdef ERTS_TIMER_THREAD - -/* - * Interruptible-wait facility: low-level synchronisation state - * and methods that are implementation dependent. - * - * Constraint: Every implementation must define 'struct erts_iwait' - * with a field 'erts_smp_atomic_t state;'. - */ - -/* values for struct erts_iwait's state field */ -#define IWAIT_WAITING 0 -#define IWAIT_AWAKE 1 -#define IWAIT_INTERRUPT 2 - -#if 0 /* XXX: needs feature test in erts/configure.in */ - -/* - * This is an implementation of the interruptible wait facility on - * top of Linux-specific futexes. - */ -#include -#define FUTEX_WAIT 0 -#define FUTEX_WAKE 1 -static int sys_futex(void *futex, int op, int val, const struct timespec *timeout) -{ - return syscall(__NR_futex, futex, op, val, timeout); -} - -struct erts_iwait { - erts_smp_atomic_t state; /* &state.counter is our futex */ -}; - -static void iwait_lowlevel_init(struct erts_iwait *iwait) { /* empty */ } - -static void iwait_lowlevel_wait(struct erts_iwait *iwait, struct timeval *delay) -{ - struct timespec timeout; - int res; - - timeout.tv_sec = delay->tv_sec; - timeout.tv_nsec = delay->tv_usec * 1000; - res = sys_futex((void*)&iwait->state.counter, FUTEX_WAIT, IWAIT_WAITING, &timeout); - if (res < 0 && errno != ETIMEDOUT && errno != EWOULDBLOCK && errno != EINTR) - perror("FUTEX_WAIT"); -} - -static void iwait_lowlevel_interrupt(struct erts_iwait *iwait) -{ - int res = sys_futex((void*)&iwait->state.counter, FUTEX_WAKE, 1, NULL); - if (res < 0) - perror("FUTEX_WAKE"); -} - -#else /* using poll() or select() */ - -/* - * This is an implementation of the interruptible wait facility on - * top of pipe(), poll() or select(), read(), and write(). - */ -struct erts_iwait { - erts_smp_atomic_t state; - int read_fd; /* wait polls and reads this fd */ - int write_fd; /* interrupt writes this fd */ -}; - -static void iwait_lowlevel_init(struct erts_iwait *iwait) -{ - int fds[2]; - - if (pipe(fds) < 0) { - perror("pipe()"); - exit(1); - } - iwait->read_fd = fds[0]; - iwait->write_fd = fds[1]; -} - -#if defined(ERTS_USE_POLL) - -#include -#define PERROR_POLL "poll()" - -static int iwait_lowlevel_poll(int read_fd, struct timeval *delay) -{ - struct pollfd pollfd; - int timeout; - - pollfd.fd = read_fd; - pollfd.events = POLLIN; - pollfd.revents = 0; - timeout = delay->tv_sec * 1000 + delay->tv_usec / 1000; - return poll(&pollfd, 1, timeout); -} - -#else /* !ERTS_USE_POLL */ - -#include -#define PERROR_POLL "select()" - -static int iwait_lowlevel_poll(int read_fd, struct timeval *delay) -{ - fd_set readfds; - - FD_ZERO(&readfds); - FD_SET(read_fd, &readfds); - return select(read_fd + 1, &readfds, NULL, NULL, delay); -} - -#endif /* !ERTS_USE_POLL */ - -static void iwait_lowlevel_wait(struct erts_iwait *iwait, struct timeval *delay) -{ - int res; - char buf[64]; - - res = iwait_lowlevel_poll(iwait->read_fd, delay); - if (res > 0) - (void)read(iwait->read_fd, buf, sizeof buf); - else if (res < 0 && errno != EINTR) - perror(PERROR_POLL); -} - -static void iwait_lowlevel_interrupt(struct erts_iwait *iwait) -{ - int res = write(iwait->write_fd, "!", 1); - if (res < 0) - perror("write()"); -} - -#endif /* using poll() or select() */ - -#if 0 /* not using poll() or select() */ -/* - * This is an implementation of the interruptible wait facility on - * top of pthread_cond_timedwait(). This has two problems: - * 1. pthread_cond_timedwait() requires an absolute time point, - * so the relative delay must be converted to absolute time. - * Worse, this breaks if the machine's time is adjusted while - * we're preparing to wait. - * 2. Each cond operation requires additional mutex lock/unlock operations. - * - * Problem 2 is probably not too bad on Linux (they'll just become - * relatively cheap futex operations), but problem 1 is the real killer. - * Only use this implementation if no better alternatives are available! - */ -struct erts_iwait { - erts_smp_atomic_t state; - pthread_cond_t cond; - pthread_mutex_t mutex; -}; - -static void iwait_lowlevel_init(struct erts_iwait *iwait) -{ - iwait->cond = (pthread_cond_t) PTHREAD_COND_INITIALIZER; - iwait->mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; -} - -static void iwait_lowlevel_wait(struct erts_iwait *iwait, struct timeval *delay) -{ - struct timeval tmp; - struct timespec timeout; - - /* Due to pthread_cond_timedwait()'s use of absolute - time, this must be the real gettimeofday(), _not_ - the "smoothed" one beam/erl_time_sup.c implements. */ - gettimeofday(&tmp, NULL); - - tmp.tv_sec += delay->tv_sec; - tmp.tv_usec += delay->tv_usec; - if (tmp.tv_usec >= 1000*1000) { - tmp.tv_usec -= 1000*1000; - tmp.tv_sec += 1; - } - timeout.tv_sec = tmp.tv_sec; - timeout.tv_nsec = tmp.tv_usec * 1000; - pthread_mutex_lock(&iwait->mutex); - pthread_cond_timedwait(&iwait->cond, &iwait->mutex, &timeout); - pthread_mutex_unlock(&iwait->mutex); -} - -static void iwait_lowlevel_interrupt(struct erts_iwait *iwait) -{ - pthread_mutex_lock(&iwait->mutex); - pthread_cond_signal(&iwait->cond); - pthread_mutex_unlock(&iwait->mutex); -} - -#endif /* not using POLL */ - -/* - * Interruptible-wait facility. This is just a wrapper around the - * low-level synchronisation code, where we maintain our logical - * state in order to suppress some state transitions. - */ - -struct erts_iwait *erts_iwait_init(void) -{ - struct erts_iwait *iwait = malloc(sizeof *iwait); - if (!iwait) { - perror("malloc"); - exit(1); - } - iwait_lowlevel_init(iwait); - erts_smp_atomic_init(&iwait->state, IWAIT_AWAKE); - return iwait; -} - -void erts_iwait_wait(struct erts_iwait *iwait, struct timeval *delay) -{ - if (erts_smp_atomic_xchg(&iwait->state, IWAIT_WAITING) != IWAIT_INTERRUPT) - iwait_lowlevel_wait(iwait, delay); - erts_smp_atomic_set(&iwait->state, IWAIT_AWAKE); -} - -void erts_iwait_interrupt(struct erts_iwait *iwait) -{ - if (erts_smp_atomic_xchg(&iwait->state, IWAIT_INTERRUPT) == IWAIT_WAITING) - iwait_lowlevel_interrupt(iwait); -} - -#endif /* ERTS_TIMER_THREAD */ -- cgit v1.2.3 From b36c9d12d7960c06872d866c25a913eb45b957bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 14 Dec 2010 15:08:49 +0100 Subject: Fix type-checking of variable used in zero-width bit syntax construction <> will always produce an empty binary, regardless of the type of A. The bug is in the run-time system. Fix it so that a non-numeric value for A will cause a badarg exception. Reported-by: Zvi --- erts/emulator/beam/erl_bits.c | 14 ++++++++------ erts/emulator/test/bs_construct_SUITE.erl | 21 ++++++++++++++++++--- lib/stdlib/test/erl_eval_SUITE.erl | 16 +++++++++++++--- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index 88d2c06246..6f8a7436d5 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -555,10 +555,11 @@ fmt_int(byte *buf, Uint sz, Eterm val, Uint size, Uint flags) { unsigned long offs; - ASSERT(size != 0); offs = BIT_OFFSET(size); if (is_small(val)) { Sint v = signed_val(val); + + ASSERT(size != 0); /* Tested by caller */ if (flags & BSF_LITTLE) { /* Little endian */ sz--; COPY_VAL(buf,1,v,sz); @@ -578,6 +579,9 @@ fmt_int(byte *buf, Uint sz, Eterm val, Uint size, Uint flags) ErtsDigit* dp = big_v(val); int n = MIN(sz,ds); + if (size == 0) { + return 0; + } if (flags & BSF_LITTLE) { sz -= n; /* pad with this amount */ if (sign) { @@ -729,15 +733,13 @@ erts_new_bs_put_integer(ERL_BITS_PROTO_3(Eterm arg, Uint num_bits, unsigned flag Uint b; byte *iptr; - if (num_bits == 0) { - return 1; - } - bit_offset = BIT_OFFSET(bin_offset); if (is_small(arg)) { Uint rbits = 8 - bit_offset; - if (bit_offset + num_bits <= 8) { + if (num_bits == 0) { + return 1; + } else if (bit_offset + num_bits <= 8) { /* * All bits are in the same byte. */ diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 3d9b51d278..138a19a626 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,7 +27,7 @@ mem_leak/1, coerce_to_float/1, bjorn/1, huge_float_field/1, huge_binary/1, system_limit/1, badarg/1, copy_writable_binary/1, kostis/1, dynamic/1, bs_add/1, - otp_7422/1]). + otp_7422/1, zero_width/1]). -include("test_server.hrl"). @@ -36,7 +36,7 @@ all(suite) -> not_used, in_guard, mem_leak, coerce_to_float, bjorn, huge_float_field, huge_binary, system_limit, badarg, copy_writable_binary, kostis, dynamic, bs_add, - otp_7422]. + otp_7422, zero_width]. big(1) -> 57285702734876389752897683. @@ -786,5 +786,20 @@ otp_7422_bin(N) when N < 512 -> end), otp_7422_bin(N+1); otp_7422_bin(_) -> ok. + +zero_width(Config) when is_list(Config) -> + ?line Z = id(0), + Small = id(42), + Big = id(1 bsl 128), + ?line <<>> = <>, + ?line <<>> = <>, + ?line <<>> = <>, + ?line <<>> = <>, + + ?line {'EXIT',{badarg,_}} = (catch <>), + ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):Z>>), + ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):0>>), + + ok. id(I) -> I. diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index c60a558fa1..254ce0095d 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,8 @@ otp_8133/1, funs/1, try_catch/1, - eval_expr_5/1]). + eval_expr_5/1, + zero_width/1]). %% %% Define to run outside of test server @@ -76,7 +77,8 @@ all(suite) -> [guard_1, guard_2, match_pattern, string_plusplus, pattern_expr, match_bin, guard_3, guard_4, lc, simple_cases, unary_plus, apply_atom, otp_5269, otp_6539, otp_6543, - otp_6787, otp_6977, otp_7550, otp_8133, funs, try_catch, eval_expr_5]. + otp_6787, otp_6977, otp_7550, otp_8133, funs, try_catch, eval_expr_5, + zero_width]. guard_1(doc) -> ["(OTP-2405)"]; @@ -1326,6 +1328,14 @@ eval_expr_5(Config) when is_list(Config) -> ok end. +zero_width(Config) when is_list(Config) -> + ?line check(fun() -> + {'EXIT',{badarg,_}} = (catch <>), + ok + end, "begin {'EXIT',{badarg,_}} = (catch <>), " + "ok end.", ok), + ok. + %% Check the string in different contexts: as is; in fun; from compiled code. check(F, String, Result) -> check1(F, String, Result), -- cgit v1.2.3 From 1837597bf31dfbeef25d5393d27cb05382b5d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 14 Dec 2010 16:16:09 +0100 Subject: compiler: Don't include -export_type as attributes in BEAM files Similar to -spec and -type, -export_type should be not be included as attributes (and therefore loaded) in BEAM files, but only in the abstract code chunk. --- lib/compiler/src/v3_kernel.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl index fbe4d8617e..3b33a08cf7 100644 --- a/lib/compiler/src/v3_kernel.erl +++ b/lib/compiler/src/v3_kernel.erl @@ -147,6 +147,7 @@ attributes([]) -> []. include_attribute(type) -> false; include_attribute(spec) -> false; include_attribute(opaque) -> false; +include_attribute(export_type) -> false; include_attribute(_) -> true. function({#c_var{name={F,Arity}=FA},Body}, St0) -> -- cgit v1.2.3 From f5578f760104b437f935b8163c2572c42a2064a1 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 21 Dec 2010 15:15:24 +0100 Subject: Remove faulty change left by mistake in epp --- lib/stdlib/src/epp.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl index d4844b8c1e..e5ccaddbb4 100644 --- a/lib/stdlib/src/epp.erl +++ b/lib/stdlib/src/epp.erl @@ -427,7 +427,10 @@ scan_toks(From, St) -> epp_reply(From, {error,E}), wait_req_scan(St#epp{location=Cl}); {eof,Cl} -> - leave_file(From, St#epp{location=Cl}) + leave_file(From, St#epp{location=Cl}); + {error,_E} -> + epp_reply(From, {error,{St#epp.location,epp,cannot_parse}}), + leave_file(wait_request(St), St) %This serious, just exit! end. scan_toks([{'-',_Lh},{atom,_Ld,define}=Define|Toks], From, St) -> @@ -808,7 +811,10 @@ skip_toks(From, St, [I|Sis]) -> {error,_E,Cl} -> skip_toks(From, St#epp{location=Cl}, [I|Sis]); {eof,Cl} -> - leave_file(From, St#epp{location=Cl,istk=[I|Sis]}) + leave_file(From, St#epp{location=Cl,istk=[I|Sis]}); + {error,_E} -> + epp_reply(From, {error,{St#epp.location,epp,cannot_parse}}), + leave_file(wait_request(St), St) %This serious, just exit! end; skip_toks(From, St, []) -> scan_toks(From, St). -- cgit v1.2.3 From 29424044c3fec94779984ac3c3f9511f9f0ce55a Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 21 Dec 2010 17:12:37 +0100 Subject: Correct type specs in io --- lib/stdlib/src/io.erl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl index 1d0f9374bc..78412ab2bc 100644 --- a/lib/stdlib/src/io.erl +++ b/lib/stdlib/src/io.erl @@ -39,6 +39,8 @@ -type device() :: atom() | pid(). -type prompt() :: atom() | string(). +-type error_description() :: term(). % Whatever the io-server sends. +-type request_error() :: {'error',error_description()}. %% XXX: Some uses of line() in this file may need to read erl_scan:location() -type line() :: pos_integer(). @@ -299,32 +301,32 @@ format(Io, Format, Args) -> %% Scanning Erlang code. --spec scan_erl_exprs(prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Prompt) -> scan_erl_exprs(default_input(), Prompt, 1). --spec scan_erl_exprs(device(), prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(device(), prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Io, Prompt) -> scan_erl_exprs(Io, Prompt, 1). --spec scan_erl_exprs(device(), prompt(), line()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(device(), prompt(), line()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Io, Prompt, Pos0) -> request(Io, {get_until,unicode,Prompt,erl_scan,tokens,[Pos0]}). --spec scan_erl_form(prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_form(prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Prompt) -> scan_erl_form(default_input(), Prompt, 1). --spec scan_erl_form(device(), prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_form(device(), prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Io, Prompt) -> scan_erl_form(Io, Prompt, 1). --spec scan_erl_form(device(), prompt(), line()) -> erl_scan:tokens_result(). +-spec scan_erl_form(device(), prompt(), line()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Io, Prompt, Pos0) -> request(Io, {get_until,unicode,Prompt,erl_scan,tokens,[Pos0]}). @@ -335,7 +337,8 @@ scan_erl_form(Io, Prompt, Pos0) -> -type parse_ret() :: {'ok', erl_parse_expr_list(), line()} | {'eof', line()} - | {'error', erl_scan:error_info(), line()}. + | {'error', erl_scan:error_info(), line()} + | request_error(). -spec parse_erl_exprs(prompt()) -> parse_ret(). @@ -364,7 +367,8 @@ parse_erl_exprs(Io, Prompt, Pos0) -> -type parse_form_ret() :: {'ok', erl_parse_absform(), line()} | {'eof', line()} - | {'error', erl_scan:error_info(), line()}. + | {'error', erl_scan:error_info(), line()} + | request_error(). -spec parse_erl_form(prompt()) -> parse_form_ret(). -- cgit v1.2.3 From d9e039164f2eb1dce7b37e24371d1be8d82b6c92 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 27 Dec 2010 14:56:05 +0100 Subject: Improved error handling for ssh:connect/3/4. --- lib/ssh/src/ssh.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl index b7f56b1b38..cada109df0 100644 --- a/lib/ssh/src/ssh.erl +++ b/lib/ssh/src/ssh.erl @@ -96,13 +96,17 @@ connect(Host, Port, Options, Timeout) -> do_demonitor(MRef, Manager), {error, Other}; {'DOWN', MRef, _, Manager, Reason} when is_pid(Manager) -> + error_logger:warning_report([{ssh, connect}, + {diagnose, + "Connection was closed before properly set up."}, + {host, Host}, + {port, Port}, + {reason, Reason}]), receive %% Clear EXIT message from queue - {'EXIT', Manager, _What} when Reason == normal -> - {error, channel_closed}; {'EXIT', Manager, _What} -> - {error, Reason} + {error, channel_closed} after 0 -> - {error, Reason} + {error, channel_closed} end after Timeout -> do_demonitor(MRef, Manager), -- cgit v1.2.3 From 7859736f126397e4a62ed9e0b4563c54d8dd1158 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Mon, 13 Dec 2010 15:37:43 +0200 Subject: Fix native code compiler infinite loop and update type info for 're' The introduction of filenames being unicode binaries revealed a problem in the type analysis of the native code compiler which resulted in an infinite loop when compiling the 'filename' module. In addition, the hard-coded type information for the built-in functions of the 're' module was out-of-date, which resulted in erroneous type information for 'filelib' functions being stored in the PLT. --- lib/hipe/cerl/erl_bif_types.erl | 23 ++++++++++++----------- lib/hipe/cerl/erl_types.erl | 28 +++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index ed5bf03804..eba95dc6af 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -48,6 +48,7 @@ t_boolean/0, t_byte/0, t_char/0, + t_charlist/0, t_cons/0, t_cons/2, t_cons_hd/1, @@ -4517,11 +4518,11 @@ arg_types(os, timestamp, 0) -> arg_types(re, compile, 1) -> [t_iodata()]; arg_types(re, compile, 2) -> - [t_iodata(), t_list(t_re_compile_option())]; + [t_sup(t_iodata(), t_charlist()), t_list(t_re_compile_option())]; arg_types(re, run, 2) -> - [t_iodata(), t_re_RE()]; + [t_sup(t_iodata(), t_charlist()), t_re_RE()]; arg_types(re, run, 3) -> - [t_iodata(), t_re_RE(), t_list(t_re_run_option())]; + [t_sup(t_iodata(), t_charlist()), t_re_RE(), t_list(t_re_run_option())]; %%------- string -------------------------------------------------------------- arg_types(string, chars, 2) -> [t_char(), t_non_neg_integer()]; @@ -4978,8 +4979,7 @@ t_ets_info_items() -> %% ===================================================================== t_prim_file_name() -> - t_sup([t_string(), - t_binary()]). + t_sup(t_string(), t_binary()). %% ===================================================================== %% These are used for the built-in functions of 'gen_tcp' @@ -5136,13 +5136,14 @@ t_re_MP() -> %% it's supposed to be an opaque data type t_tuple([t_atom('re_pattern'), t_integer(), t_integer(), t_binary()]). t_re_RE() -> - t_sup(t_re_MP(), t_iodata()). + t_sup([t_re_MP(), t_iodata(), t_charlist()]). t_re_compile_option() -> - t_sup([t_atoms(['anchored', 'caseless', 'dollar_endonly', 'dotall', - 'extended', 'firstline', 'multiline', 'no_auto_capture', - 'dupnames', 'ungreedy']), - t_tuple([t_atom('newline'), t_re_NLSpec()])]). + t_sup([t_atoms(['unicode', 'anchored', 'caseless', 'dollar_endonly', + 'dotall', 'extended', 'firstline', 'multiline', + 'no_auto_capture', 'dupnames', 'ungreedy']), + t_tuple([t_atom('newline'), t_re_NLSpec()]), + t_atoms(['bsr_anycrlf', 'bsr_unicode'])]). t_re_run_option() -> t_sup([t_atoms(['anchored', 'global', 'notbol', 'noteol', 'notempty']), @@ -5159,7 +5160,7 @@ t_re_Type() -> t_atoms(['index', 'list', 'binary']). t_re_NLSpec() -> - t_atoms(['cr', 'crlf', 'lf', 'anycrlf']). + t_atoms(['cr', 'crlf', 'lf', 'anycrlf', 'any']). t_re_ValueSpec() -> t_sup(t_atoms(['all', 'all_but_first', 'first', 'none']), t_re_ValueList()). diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 1ed85af172..c8dc162457 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -62,6 +62,7 @@ t_boolean/0, t_byte/0, t_char/0, + t_charlist/0, t_collect_vars/1, t_cons/0, t_cons/2, @@ -1455,6 +1456,21 @@ t_is_tuple(_) -> false. %% Non-primitive types, including some handy syntactic sugar types %% +-spec t_charlist() -> erl_type(). + +t_charlist() -> + t_charlist(1). + +-spec t_charlist(non_neg_integer()) -> erl_type(). + +t_charlist(N) when N > 0 -> + t_maybe_improper_list(t_sup([t_unicode_char(), + t_unicode_binary(), + t_charlist(N-1)]), + t_sup(t_unicode_binary(), t_nil())); +t_charlist(0) -> + t_maybe_improper_list(t_any(), t_sup(t_unicode_binary(), t_nil())). + -spec t_constant() -> erl_type(). t_constant() -> @@ -1549,6 +1565,16 @@ t_parameterized_module() -> t_timeout() -> t_sup(t_non_neg_integer(), t_atom('infinity')). +-spec t_unicode_binary() -> erl_type(). + +t_unicode_binary() -> + t_binary(). % with characters encoded in UTF-8 coding standard + +-spec t_unicode_char() -> erl_type(). + +t_unicode_char() -> + t_integer(). % representing a valid unicode codepoint + %%----------------------------------------------------------------------------- %% Some built-in opaque types %% @@ -2825,7 +2851,7 @@ t_subtract(?list(Contents1, Termination1, Size1) = T, true -> case {Size1, Size2} of {?nonempty_qual, ?unknown_qual} -> ?none; - {?unknown_qual, ?nonempty_qual} -> Termination1; + {?unknown_qual, ?nonempty_qual} -> ?nil; {S, S} -> ?none end; false -> -- cgit v1.2.3 From 5aa0bc494167f30062eb1e4cc6968c3818ec35d1 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 16 Dec 2010 15:54:31 +0100 Subject: Set types correctly for open_port({spawn_executable, ... --- lib/hipe/cerl/erl_bif_types.erl | 11 ++++++----- lib/hipe/cerl/erl_types.erl | 6 ++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index eba95dc6af..f00821e450 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -125,7 +125,8 @@ t_tuple/1, t_tuple_args/1, t_tuple_size/1, - t_tuple_subtypes/1 + t_tuple_subtypes/1, + t_unicode_string/0 ]). -ifdef(DO_ERL_BIF_TYPES_TEST). @@ -3800,7 +3801,7 @@ arg_types(erlang, now, 0) -> arg_types(erlang, open_port, 2) -> [t_sup(t_atom(), t_sup([t_tuple([t_atom('spawn'), t_string()]), t_tuple([t_atom('spawn_driver'), t_string()]), - t_tuple([t_atom('spawn_executable'), t_string()]), + t_tuple([t_atom('spawn_executable'), t_sup(t_unicode_string(),t_binary())]), t_tuple([t_atom('fd'), t_integer(), t_integer()])])), t_list(t_sup(t_sup([t_atom('stream'), t_atom('exit_status'), @@ -3816,8 +3817,8 @@ arg_types(erlang, open_port, 2) -> t_tuple([t_atom('line'), t_integer()]), t_tuple([t_atom('cd'), t_string()]), t_tuple([t_atom('env'), t_list(t_tuple(2))]), % XXX: More - t_tuple([t_atom('args'), t_list(t_string())]), - t_tuple([t_atom('arg0'), t_string()])])))]; + t_tuple([t_atom('args'), t_list(t_sup(t_unicode_string(),t_binary()))]), + t_tuple([t_atom('arg0'),t_sup(t_unicode_string(),t_binary())])])))]; arg_types(erlang, phash, 2) -> [t_any(), t_pos_integer()]; arg_types(erlang, phash2, 1) -> @@ -4979,7 +4980,7 @@ t_ets_info_items() -> %% ===================================================================== t_prim_file_name() -> - t_sup(t_string(), t_binary()). + t_sup(t_unicode_string(), t_binary()). %% ===================================================================== %% These are used for the built-in functions of 'gen_tcp' diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index c8dc162457..080d6936b2 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -196,6 +196,7 @@ t_tuple_size/1, t_tuple_sizes/1, t_tuple_subtypes/1, + t_unicode_string/0, t_unify/2, t_unify/3, t_unit/0, @@ -1456,6 +1457,11 @@ t_is_tuple(_) -> false. %% Non-primitive types, including some handy syntactic sugar types %% +-spec t_unicode_string() -> erl_type(). + +t_unicode_string() -> + t_list(t_unicode_char()). + -spec t_charlist() -> erl_type(). t_charlist() -> -- cgit v1.2.3 From 03b9a1912b6bd2eb9c86b3fd010c0aea792536b9 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 17 Dec 2010 17:05:47 +0100 Subject: Remove dead code (and dialyzer errors) from filename and re --- lib/stdlib/src/filename.erl | 14 ++++++-------- lib/stdlib/src/re.erl | 42 +++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl index e38b8957f2..24abf1e977 100644 --- a/lib/stdlib/src/filename.erl +++ b/lib/stdlib/src/filename.erl @@ -165,8 +165,6 @@ basename1([$/|[]], Tail, DirSep2) -> basename1([], Tail, DirSep2); basename1([$/|Rest], _Tail, DirSep2) -> basename1(Rest, [], DirSep2); -basename1([[_|_]=List|Rest], Tail, DirSep2) -> - basename1(List++Rest, Tail, DirSep2); basename1([DirSep2|Rest], Tail, DirSep2) when is_integer(DirSep2) -> basename1([$/|Rest], Tail, DirSep2); basename1([Char|Rest], Tail, DirSep2) when is_integer(Char) -> @@ -280,8 +278,6 @@ dirname(Name0) -> Name = flatten(Name0), dirname(Name, [], [], separators()). -dirname([[_|_]=List|Rest], Dir, File, Seps) -> - dirname(List++Rest, Dir, File, Seps); dirname([$/|Rest], Dir, File, Seps) -> dirname(Rest, File++Dir, [$/], Seps); dirname([DirSep|Rest], Dir, File, {DirSep,_}=Seps) when is_integer(DirSep) -> @@ -346,8 +342,6 @@ extension(Name) when is_binary(Name) -> [] end, case binary:matches(Name,[<<".">>]) of - nomatch -> % Bug in binary workaround :( - <<>>; [] -> <<>>; List -> @@ -479,6 +473,12 @@ maybe_remove_dirsep(Name, _) -> %% by a previous call to join/{1,2}. -spec append(file:filename(), file:name()) -> file:filename(). +append(Dir, Name) when is_binary(Dir), is_binary(Name) -> + <
>; +append(Dir, Name) when is_binary(Dir) -> + append(Dir,filename_string_to_binary(Name)); +append(Dir, Name) when is_binary(Name) -> + append(filename_string_to_binary(Dir),Name); append(Dir, Name) -> Dir ++ [$/|Name]. @@ -685,8 +685,6 @@ split([$/|Rest], Comp, Components, OsType) -> split(Rest, [], [lists:reverse(Comp)|Components], OsType); split([Char|Rest], Comp, Components, OsType) when is_integer(Char) -> split(Rest, [Char|Comp], Components, OsType); -split([List|Rest], Comp, Components, OsType) when is_list(List) -> - split(List++Rest, Comp, Components, OsType); split([], [], Components, _OsType) -> lists:reverse(Components); split([], Comp, Components, OsType) -> diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl index 296a6b3d23..9642de17b4 100644 --- a/lib/stdlib/src/re.erl +++ b/lib/stdlib/src/re.erl @@ -208,29 +208,25 @@ replace(Subject,RE,Replacement,Options) -> process_repl_params(Options,iodata,false), FlatSubject = to_binary(Subject, Unicode), FlatReplacement = to_binary(Replacement, Unicode), - case do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt) of - {error,_Err} -> - throw(badre); - IoList -> - case Convert of - iodata -> - IoList; - binary -> - case Unicode of - false -> - iolist_to_binary(IoList); - true -> - unicode:characters_to_binary(IoList,unicode) - end; - list -> - case Unicode of - false -> - binary_to_list(iolist_to_binary(IoList)); - true -> - unicode:characters_to_list(IoList,unicode) - end - end - end + IoList = do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt), + case Convert of + iodata -> + IoList; + binary -> + case Unicode of + false -> + iolist_to_binary(IoList); + true -> + unicode:characters_to_binary(IoList,unicode) + end; + list -> + case Unicode of + false -> + binary_to_list(iolist_to_binary(IoList)); + true -> + unicode:characters_to_list(IoList,unicode) + end + end catch throw:badopt -> erlang:error(badarg,[Subject,RE,Replacement,Options]); -- cgit v1.2.3 From 0fe99329f6d39a5dfddda689a90917982fa2ee0b Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 21 Dec 2010 17:12:37 +0100 Subject: Correct type specs in io --- lib/stdlib/src/io.erl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl index 1d0f9374bc..78412ab2bc 100644 --- a/lib/stdlib/src/io.erl +++ b/lib/stdlib/src/io.erl @@ -39,6 +39,8 @@ -type device() :: atom() | pid(). -type prompt() :: atom() | string(). +-type error_description() :: term(). % Whatever the io-server sends. +-type request_error() :: {'error',error_description()}. %% XXX: Some uses of line() in this file may need to read erl_scan:location() -type line() :: pos_integer(). @@ -299,32 +301,32 @@ format(Io, Format, Args) -> %% Scanning Erlang code. --spec scan_erl_exprs(prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Prompt) -> scan_erl_exprs(default_input(), Prompt, 1). --spec scan_erl_exprs(device(), prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(device(), prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Io, Prompt) -> scan_erl_exprs(Io, Prompt, 1). --spec scan_erl_exprs(device(), prompt(), line()) -> erl_scan:tokens_result(). +-spec scan_erl_exprs(device(), prompt(), line()) -> erl_scan:tokens_result() | request_error(). scan_erl_exprs(Io, Prompt, Pos0) -> request(Io, {get_until,unicode,Prompt,erl_scan,tokens,[Pos0]}). --spec scan_erl_form(prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_form(prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Prompt) -> scan_erl_form(default_input(), Prompt, 1). --spec scan_erl_form(device(), prompt()) -> erl_scan:tokens_result(). +-spec scan_erl_form(device(), prompt()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Io, Prompt) -> scan_erl_form(Io, Prompt, 1). --spec scan_erl_form(device(), prompt(), line()) -> erl_scan:tokens_result(). +-spec scan_erl_form(device(), prompt(), line()) -> erl_scan:tokens_result() | request_error(). scan_erl_form(Io, Prompt, Pos0) -> request(Io, {get_until,unicode,Prompt,erl_scan,tokens,[Pos0]}). @@ -335,7 +337,8 @@ scan_erl_form(Io, Prompt, Pos0) -> -type parse_ret() :: {'ok', erl_parse_expr_list(), line()} | {'eof', line()} - | {'error', erl_scan:error_info(), line()}. + | {'error', erl_scan:error_info(), line()} + | request_error(). -spec parse_erl_exprs(prompt()) -> parse_ret(). @@ -364,7 +367,8 @@ parse_erl_exprs(Io, Prompt, Pos0) -> -type parse_form_ret() :: {'ok', erl_parse_absform(), line()} | {'eof', line()} - | {'error', erl_scan:error_info(), line()}. + | {'error', erl_scan:error_info(), line()} + | request_error(). -spec parse_erl_form(prompt()) -> parse_form_ret(). -- cgit v1.2.3 From 86413606615440a7951b4c62162e2bfb87aa158c Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 28 Dec 2010 14:34:56 +0100 Subject: Prepare release --- lib/hipe/doc/src/notes.xml | 18 ++++++++++++++++++ lib/hipe/vsn.mk | 2 +- lib/stdlib/doc/src/notes.xml | 18 ++++++++++++++++++ lib/stdlib/vsn.mk | 2 +- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml index c188db483d..8c9dbc0c18 100644 --- a/lib/hipe/doc/src/notes.xml +++ b/lib/hipe/doc/src/notes.xml @@ -30,6 +30,24 @@

This document describes the changes made to HiPE.

+
Hipe 3.7.8.1 + +
Fixed Bugs and Malfunctions + + +

+ Several type specifications for standard libraries were + wrong in the R14B01 release. This is now corrected. The + corrections concern types in re,io,filename and the + module erlang itself.

+

+ Own Id: OTP-9008

+
+
+
+ +
+
Hipe 3.7.8
Improvements and New Features diff --git a/lib/hipe/vsn.mk b/lib/hipe/vsn.mk index fa9dc91ff0..513b1f4943 100644 --- a/lib/hipe/vsn.mk +++ b/lib/hipe/vsn.mk @@ -1 +1 @@ -HIPE_VSN = 3.7.8 +HIPE_VSN = 3.7.8.1 diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml index 940044d0a8..a8fe41f000 100644 --- a/lib/stdlib/doc/src/notes.xml +++ b/lib/stdlib/doc/src/notes.xml @@ -30,6 +30,24 @@

This document describes the changes made to the STDLIB application.

+
STDLIB 1.17.2.1 + +
Fixed Bugs and Malfunctions + + +

+ Several type specifications for standard libraries were + wrong in the R14B01 release. This is now corrected. The + corrections concern types in re,io,filename and the + module erlang itself.

+

+ Own Id: OTP-9008

+
+
+
+ +
+
STDLIB 1.17.2
Fixed Bugs and Malfunctions diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk index db7954af04..6c209e97b9 100644 --- a/lib/stdlib/vsn.mk +++ b/lib/stdlib/vsn.mk @@ -1 +1 @@ -STDLIB_VSN = 1.17.2 +STDLIB_VSN = 1.17.2.1 -- cgit v1.2.3 From 25e6de467ebddd6ba006ab95811711008cc4e1ea Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Thu, 2 Sep 2010 23:06:08 +0200 Subject: ssh: ensure ~/.ssh exists Make sure that ~/.ssh exists before trying to open files like ~/.ssh/known_hosts. Reported-By: Daniel Goertzen --- lib/ssh/src/ssh_file.erl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl index 13722656db..c78f5dc337 100755 --- a/lib/ssh/src/ssh_file.erl +++ b/lib/ssh/src/ssh_file.erl @@ -27,6 +27,8 @@ -include("PKCS-1.hrl"). -include("DSS.hrl"). +-include_lib("kernel/include/file.hrl"). + -export([public_host_dsa_key/2,private_host_dsa_key/2, public_host_rsa_key/2,private_host_rsa_key/2, public_host_key/2,private_host_key/2, @@ -43,6 +45,9 @@ -define(DBG_PATHS, true). +-define(PERM_700, 8#700). +-define(PERM_644, 8#644). + %% API public_host_dsa_key(Type, Opts) -> File = file_name(Type, "ssh_host_dsa_key.pub", Opts), @@ -113,8 +118,10 @@ do_lookup_host_key(Host, Alg, Opts) -> add_host_key(Host, Key, Opts) -> Host1 = add_ip(replace_localhost(Host)), - case file:open(file_name(user, "known_hosts", Opts),[write,append]) of + KnownHosts = file_name(user, "known_hosts", Opts), + case file:open(KnownHosts, [write,append]) of {ok, Fd} -> + ok = file:change_mode(KnownHosts, ?PERM_644), Res = add_key_fd(Fd, Host1, Key), file:close(Fd), Res; @@ -532,4 +539,7 @@ file_name(Type, Name, Opts) -> default_user_dir()-> {ok,[[Home|_]]} = init:get_argument(home), - filename:join(Home, ".ssh"). + UserDir = filename:join(Home, ".ssh"), + ok = filelib:ensure_dir(filename:join(UserDir, "dummy")), + ok = file:change_mode(UserDir, ?PERM_700), + UserDir. -- cgit v1.2.3 From 842fc4aeb48f65b3974a108b1073271551bebf1f Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 28 Dec 2010 15:51:29 +0100 Subject: OTP-9010: SSH now ensures that the .ssh directory exists before trying to access files located in that directory. --- lib/ssh/doc/src/notes.xml | 14 ++++++++++++++ lib/ssh/vsn.mk | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 9bedd446f4..acadfdc3b4 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -29,6 +29,20 @@ notes.xml +
Ssh 2.0.4 +
Improvements and New Features + + +

+ SSH now ensures that the .ssh directory exists before trying + to access files located in that directory.

+

+ Own Id: OTP-9010

+
+
+
+
+
Ssh 2.0.3
Fixed Bugs and Malfunctions diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index db03168ad9..51f9f47446 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,5 +1,5 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 2.0.3 +SSH_VSN = 2.0.4 APP_VSN = "ssh-$(SSH_VSN)" -- cgit v1.2.3 From e7a56088a38bf79a650659b5b6381f71af75c740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 16 Dec 2010 19:39:07 +0100 Subject: Teach timer-wheel slots to use double linked lists Conflicts: erts/emulator/beam/erl_time.h --- erts/emulator/beam/erl_time.h | 1 + erts/emulator/beam/time.c | 82 ++++++++++++++++++++++++++----------------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h index f4e230655d..93d8ea4cb4 100644 --- a/erts/emulator/beam/erl_time.h +++ b/erts/emulator/beam/erl_time.h @@ -28,6 +28,7 @@ extern SysTimeval erts_first_emu_time; */ typedef struct erl_timer { struct erl_timer* next; /* next entry tiw slot or chain */ + struct erl_timer* prev; /* prev entry tiw slot or chain */ Uint slot; /* slot in timer wheel */ Uint count; /* number of loops remaining */ int active; /* 1=activated, 0=deactivated */ diff --git a/erts/emulator/beam/time.c b/erts/emulator/beam/time.c index 4f491aa66f..c65cc37fc6 100644 --- a/erts/emulator/beam/time.c +++ b/erts/emulator/beam/time.c @@ -165,6 +165,31 @@ static erts_aint_t next_time_internal(void) /* PRE: tiw_lock taken by caller */ return ((min >= dt) ? (min - dt) : 0); } +static void remove_timer(ErlTimer *p) { + /* first */ + if (!p->prev) { + tiw[p->slot] = p->next; + if(p->next) + p->next->prev = NULL; + } else { + p->prev->next = p->next; + } + + /* last */ + if (!p->next) { + if (p->prev) + p->prev->next = NULL; + } else { + p->next->prev = p->prev; + } + + p->next = NULL; + p->prev = NULL; + /* Make sure cancel callback isn't called */ + p->active = 0; + tiw_nto--; +} + /* Private export to erl_time_sup.c */ erts_aint_t erts_next_time(void) { @@ -210,11 +235,9 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is tiw_min_ptr = NULL; tiw_min = 0; } - *prev = p->next; /* Remove from list */ - tiw_nto--; - p->next = NULL; - p->active = 0; /* Make sure cancel callback - isn't called */ + + /* Remove from list */ + remove_timer(p); *timeout_tail = p; /* Insert in timeout queue */ timeout_tail = &p->next; } @@ -244,6 +267,7 @@ static ERTS_INLINE void bump_timer_internal(erts_aint_t dt) /* PRE: tiw_lock is * callback is called. */ p->next = NULL; + p->prev = NULL; p->slot = 0; (*p->timeout)(p->arg); } @@ -284,6 +308,9 @@ erts_init_time(void) tiw_min = 0; } + + + /* ** Insert a process into the time queue, with a timeout 't' */ @@ -313,8 +340,12 @@ insert_timer(ErlTimer* p, Uint t) /* insert at head of list at slot */ p->next = tiw[tm]; + p->prev = NULL; + if (p->next != NULL) + p->next->prev = p; tiw[tm] = p; + /* insert min time */ if ((tiw_nto == 0) || ((tiw_min_ptr != NULL) && (ticks < tiw_min))) { tiw_min = ticks; @@ -355,40 +386,25 @@ erts_set_timer(ErlTimer* p, ErlTimeoutProc timeout, ErlCancelProc cancel, void erts_cancel_timer(ErlTimer* p) { - ErlTimer *tp; - ErlTimer **prev; - erts_smp_mtx_lock(&tiw_lock); if (!p->active) { /* allow repeated cancel (drivers) */ erts_smp_mtx_unlock(&tiw_lock); return; } - /* find p in linked list at slot p->slot and remove it */ - prev = &tiw[p->slot]; - while ((tp = *prev) != NULL) { - if (tp == p) { - - /* is it the 'min' timer ? */ - if (p == tiw_min_ptr) { - tiw_min_ptr = NULL; - tiw_min = 0; - } - *prev = p->next; /* Remove from list */ - tiw_nto--; - p->next = NULL; - p->slot = p->count = 0; - p->active = 0; - if (p->cancel != NULL) { - erts_smp_mtx_unlock(&tiw_lock); - (*p->cancel)(p->arg); - } else { - erts_smp_mtx_unlock(&tiw_lock); - } - return; - } else { - prev = &tp->next; - } + /* is it the 'min' timer, remove min */ + if (p == tiw_min_ptr) { + tiw_min_ptr = NULL; + tiw_min = 0; + } + + remove_timer(p); + p->slot = p->count = 0; + + if (p->cancel != NULL) { + erts_smp_mtx_unlock(&tiw_lock); + (*p->cancel)(p->arg); + return; } erts_smp_mtx_unlock(&tiw_lock); } -- cgit v1.2.3 From 50d40fd0bf6c796e7acf20fc2ca377cfca734251 Mon Sep 17 00:00:00 2001 From: Ahmed Omar Date: Thu, 16 Dec 2010 11:45:10 +0100 Subject: Fixes a bug found in percept:stop_webserver/1, where it doesn't stop the webserver completely percept:stop_webserver/1 will only stop the httpd service in inets, but not the percept_httpd process. As a result, when trying to start the webserver again it will return {error, already_started}. Test case was updated to simulate this case and fix is included to stop the webserver in a consistent way wether stop_webserver/0 or stop_webserver/1 was used. --- lib/percept/src/percept.erl | 32 ++++++++++++++++++++++---------- lib/percept/test/percept_SUITE.erl | 2 ++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl index f5e0f7e469..3a2d9f7601 100644 --- a/lib/percept/src/percept.erl +++ b/lib/percept/src/percept.erl @@ -185,10 +185,27 @@ stop_webserver() -> undefined -> {error, not_started}; Pid -> - Pid ! {self(), get_port}, - receive Port -> ok end, - Pid ! quit, - stop_webserver(Port) + do_stop([], Pid) + end. + +do_stop([], Pid)-> + Pid ! {self(), get_port}, + Port = receive P -> P end, + do_stop(Port, Pid); +do_stop(Port, [])-> + case whereis(percept_httpd) of + undefined -> + {error, not_started}; + Pid -> + do_stop(Port, Pid) + end; +do_stop(Port, Pid)-> + case find_service_pid_from_port(inets:services_info(), Port) of + undefined -> + {error, not_started}; + Pid2 -> + Pid ! quit, + inets:stop(httpd, Pid2) end. %% @spec stop_webserver(integer()) -> ok | {error, not_started} @@ -196,12 +213,7 @@ stop_webserver() -> %% @hidden stop_webserver(Port) -> - case find_service_pid_from_port(inets:services_info(), Port) of - undefined -> - {error, not_started}; - Pid -> - inets:stop(httpd, Pid) - end. + do_stop(Port,[]). %%========================================================================== %% diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index ff7cccdaa8..803ce6b95f 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -70,6 +70,8 @@ webserver(Config) when is_list(Config) -> % Explicit start inets? ?line {started, _, Port} = percept:start_webserver(), ?line ok = percept:stop_webserver(Port), + ?line {started, _, NewPort} = percept:start_webserver(), + ?line ok = percept:stop_webserver(NewPort), ?line application:stop(inets), ok. -- cgit v1.2.3 From b5505246856d905d3981f8e1f82dbd3ca08a6ead Mon Sep 17 00:00:00 2001 From: Ahmed Omar Date: Thu, 16 Dec 2010 22:48:30 +0100 Subject: Verifies the consistency of stopping behavior. Updated the test case webserver to cover both stopping functions stop_webserver/1 and stop_webserver/0. --- lib/percept/test/percept_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index 803ce6b95f..964ac68481 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -70,6 +70,8 @@ webserver(Config) when is_list(Config) -> % Explicit start inets? ?line {started, _, Port} = percept:start_webserver(), ?line ok = percept:stop_webserver(Port), + ?line {started, _, _} = percept:start_webserver(), + ?line ok = percept:stop_webserver(), ?line {started, _, NewPort} = percept:start_webserver(), ?line ok = percept:stop_webserver(NewPort), ?line application:stop(inets), -- cgit v1.2.3 From bcbe0813a0b97f86a7db354e09bf0397cf68f787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 30 Dec 2010 17:48:36 +0100 Subject: Fix testcases erl_global_whereis, erl_global_names Enable erl_global_whereis and erl_global names. --- lib/erl_interface/test/erl_global_SUITE.erl | 20 ++++++++++++++------ .../test/erl_global_SUITE_data/erl_global_test.c | 4 ++-- lib/erl_interface/test/port_call_SUITE.erl | 2 ++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl index 9826e47d55..4f332037c6 100644 --- a/lib/erl_interface/test/erl_global_SUITE.erl +++ b/lib/erl_interface/test/erl_global_SUITE.erl @@ -31,7 +31,7 @@ -define(GLOBAL_NAME, global_register_node_test). all(suite) -> - [erl_global_registration]. + [erl_global_registration, erl_global_whereis, erl_global_names]. init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), @@ -59,7 +59,7 @@ erl_global_whereis(Config) when is_list(Config) -> ?line {ok, Fd} = erl_connect(P, node(), 42, erlang:get_cookie(), 0), ?line Self = self(), - ?line global:register_name(?GLOBAL_NAME, Self), + ?line yes = global:register_name(?GLOBAL_NAME, Self), ?line Self = erl_global_whereis(P, Fd, ?GLOBAL_NAME), ?line global:unregister_name(?GLOBAL_NAME), ?line 0 = erl_close_connection(P, Fd), @@ -73,14 +73,16 @@ erl_global_names(Config) when is_list(Config) -> ?line Self = self(), ?line global:register_name(?GLOBAL_NAME, Self), - ?line {[?GLOBAL_NAME], 1} = erl_global_names(P, Fd), + ?line {Names1, _N1} = erl_global_names(P, Fd), + ?line true = lists:member(atom_to_list(?GLOBAL_NAME), Names1), ?line global:unregister_name(?GLOBAL_NAME), + ?line {Names2, _N2} = erl_global_names(P, Fd), + ?line false = lists:member(atom_to_list(?GLOBAL_NAME), Names2), ?line 0 = erl_close_connection(P, Fd), ?line runner:send_eot(P), ?line runner:recv_eot(P), ok. - %%% Interface functions for erl_interface functions. erl_connect(P, Node, Num, Cookie, Creation) -> @@ -102,11 +104,17 @@ erl_global_register(P, Fd, Name) -> erl_global_whereis(P, Fd, Name) -> send_command(P, erl_global_whereis, [Fd,Name]), - get_send_result(P). + case get_term(P) of + {term, What} -> + What + end. erl_global_names(P, Fd) -> send_command(P, erl_global_names, [Fd]), - get_send_result(P). + case get_term(P) of + {term, What} -> + What + end. erl_global_unregister(P, Fd, Name) -> send_command(P, erl_global_unregister, [Fd,Name]), diff --git a/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c index fc698ca0c4..dc0d8a0091 100644 --- a/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c +++ b/lib/erl_interface/test/erl_global_SUITE_data/erl_global_test.c @@ -46,8 +46,8 @@ static struct { "erl_connect", 4, cmd_erl_connect, "erl_close_connection", 1, cmd_erl_close_connection, "erl_global_register", 2, cmd_erl_global_register, - "erl_global_whereis", 1, cmd_erl_global_whereis, - "erl_global_names", 0, cmd_erl_global_names, + "erl_global_whereis", 2, cmd_erl_global_whereis, + "erl_global_names", 1, cmd_erl_global_names, "erl_global_unregister", 2, cmd_erl_global_unregister, }; diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 895e29ad2e..2c550e4c0c 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -42,6 +42,8 @@ all(suite) -> basic(suite) -> []; basic(Config) when is_list(Config) -> case os:type() of + {unix, linux} -> + do_basic(Config); {unix, sunos} -> do_basic(Config); {win32,_} -> -- cgit v1.2.3 From cb50ed84a2d8afc904d1c6ce90edb5c32da1be48 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 16 Dec 2010 12:21:27 +0100 Subject: Fix minor typos in erl_nif documentation enif_realloc_binary return int enif_alloc/enif_free does not accept env as first argument. enif_send return int enif_self in alphabetic order --- erts/doc/src/erl_nif.xml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 27887cbdf6..5987ddbd5e 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -4,7 +4,7 @@
- 20012010 + 20012011 Ericsson AB. All Rights Reserved. @@ -464,7 +464,7 @@ typedef enum {
- void*enif_alloc(ErlNifEnv* env, size_t size) + void*enif_alloc(size_t size) Allocate dynamic memory.

Allocate memory of size bytes. Return NULL if allocation failed.

@@ -539,7 +539,7 @@ typedef enum {

Same as erl_drv_equal_tids.

- voidenif_free(ErlNifEnv* env, void* ptr) + voidenif_free(void* ptr) Free dynamic memory

Free memory allocated by enif_alloc.

@@ -857,11 +857,6 @@ typedef enum { enif_release_resource.

- ErlNifPid*enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) - Get the pid of the calling process. -

Initialize the pid variable *pid to represent the - calling process. Return pid.

-
ERL_NIF_TERMenif_make_string(ErlNifEnv* env, const char* string, ErlNifCharEncoding encoding) Create a string.

Create a list containing the characters of the @@ -980,11 +975,12 @@ typedef enum { reload or upgrade.

Was previously named enif_get_data.

- voidenif_realloc_binary(ErlNifBinary* bin, size_t size) + intenif_realloc_binary(ErlNifBinary* bin, size_t size) Change the size of a binary.

Change the size of a binary bin. The source binary may be read-only, in which case it will be left untouched and - a mutable copy is allocated and assigned to *bin.

+ a mutable copy is allocated and assigned to *bin. Return true on success, + false if memory allocation failed.

voidenif_release_binary(ErlNifBinary* bin) Release a binary. @@ -1041,7 +1037,12 @@ typedef enum {

Same as erl_drv_rwlock_tryrwlock.

- unsignedenif_send(ErlNifEnv* env, ErlNifPid* to_pid, ErlNifEnv* msg_env, ERL_NIF_TERM msg) + ErlNifPid*enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) + Get the pid of the calling process. +

Initialize the pid variable *pid to represent the + calling process. Return pid.

+
+ intenif_send(ErlNifEnv* env, ErlNifPid* to_pid, ErlNifEnv* msg_env, ERL_NIF_TERM msg) Send a message to a process.

Send a message to a process.

-- cgit v1.2.3 From 1791b2d34c966f6b3783d34307078da8bcb7ffbe Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Thu, 6 Jan 2011 02:23:43 +0200 Subject: Fix erroneous fail info of a hipe_bs_primop --- lib/hipe/icode/hipe_icode_primops.erl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/hipe/icode/hipe_icode_primops.erl b/lib/hipe/icode/hipe_icode_primops.erl index b0fe7eb708..a413531c07 100644 --- a/lib/hipe/icode/hipe_icode_primops.erl +++ b/lib/hipe/icode/hipe_icode_primops.erl @@ -2,19 +2,19 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. -%% +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -26,9 +26,6 @@ %% Notes : %% History : * 2001-06-13 Erik Johansson (happi@it.uu.se): %% Created. -%% -%% $Id$ -%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -module(hipe_icode_primops). @@ -197,7 +194,7 @@ fails(#element{}) -> true; %% fails(#gc_test{}) -> ??? fails({hipe_bs_primop, {bs_start_match, _}}) -> true; fails({hipe_bs_primop, {{bs_start_match, bitstr}, _}}) -> true; -fails({hipe_bs_primop, {{bs_start_match, ok_matchstate}, _}}) -> false; +fails({hipe_bs_primop, {{bs_start_match, ok_matchstate}, _}}) -> true; fails({hipe_bs_primop, {bs_get_binary, _, _}}) -> true; fails({hipe_bs_primop, {bs_get_binary_all, _, _}}) -> true; fails({hipe_bs_primop, {bs_get_binary_all_2, _, _}}) -> true; -- cgit v1.2.3 From 8f0736be41397a73f8eba239f799555f95cd9309 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 10 Jan 2011 11:03:51 +0100 Subject: Corrected handling of data from an ets select. The previous code happened to worked if the select-statment returned only on entry. --- lib/ssl/src/ssl_certificate_db.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl index f34459de37..3eceefa304 100644 --- a/lib/ssl/src/ssl_certificate_db.erl +++ b/lib/ssl/src/ssl_certificate_db.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -122,8 +122,8 @@ cache_pem_file(Pid, File, Time, [CertsDb, _FileToRefDb, PidToFileDb]) -> %% but with different content. %% -------------------------------------------------------------------- uncache_pem_file(File, [_CertsDb, _FileToRefDb, PidToFileDb]) -> - [Pids] = select(PidToFileDb, [{{'$1', File},[],['$$']}]), - lists:foreach(fun(Pid) -> + Pids = select(PidToFileDb, [{{'$1', File},[],['$$']}]), + lists:foreach(fun([Pid]) -> exit(Pid, shutdown) end, Pids). -- cgit v1.2.3 From 2c0b7c2a77ad5da376e85d208e29bd471061ac9a Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 10 Jan 2011 16:29:16 +0100 Subject: Fixed Dialyzer specs ------------------------------------------------------------------------- ssl's published documentation states: ssl_accept(ListenSocket) -> ssl_accept(ListenSocket, Timeout) -> ok | {error, Reason} (see http://www.erlang.org/doc/man/ssl.html#ssl_accept-1) while its code has the specs: -spec ssl_accept(#sslsocket{}) -> {ok, #sslsocket{}} | {error, reason()}. -spec ssl_accept(#sslsocket{}, list() | timeout()) -> {ok, #sslsocket{}} | {error, reason()}. One of the two cannot be right. This should be fixed. Moreover, I do not see why the spec just mentions list() for the options when the documentation explicitly mentions the options of ssl. Kostis --------------------------------------------------------------------- --- lib/ssl/doc/src/ssl.xml | 20 ++++++++++---------- lib/ssl/src/ssl.erl | 36 +++++++++++++++++++++++++++++------- lib/ssl/src/ssl_connection.erl | 3 ++- lib/ssl/src/ssl_internal.hrl | 3 +-- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml index ec272379bb..daf7b77527 100644 --- a/lib/ssl/doc/src/ssl.xml +++ b/lib/ssl/doc/src/ssl.xml @@ -4,7 +4,7 @@
- 19992010 + 19992011 Ericsson AB. All Rights Reserved. @@ -72,10 +72,10 @@ {verify_fun, {fun(), term()}} | {fail_if_no_peer_cert, boolean()} {depth, integer()} | - {cert, der_bin()}| {certfile, path()} | - {key, der_bin()} | {keyfile, path()} | {password, string()} | - {cacerts, [der_bin()]} | {cacertfile, path()} | - |{dh, der_bin()} | {dhfile, path()} | {ciphers, ciphers()} | + {cert, der_encoded()}| {certfile, path()} | + {key, der_encoded()} | {keyfile, path()} | {password, string()} | + {cacerts, [der_encoded()]} | {cacertfile, path()} | + |{dh, der_encoded()} | {dhfile, path()} | {ciphers, ciphers()} | {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | {reuse_session, fun()}

@@ -95,7 +95,7 @@

path() = string() - representing a file path.

-

der_bin() = binary() -Asn1 DER encoded entity as an erlang binary.

+

der_encoded() = binary() -Asn1 DER encoded entity as an erlang binary.

host() = hostname() | ipaddress()

@@ -136,14 +136,14 @@ - {cert, der_bin()} + {cert, der_encoded()} The DER encoded users certificate. If this option is supplied it will override the certfile option. {certfile, path()} Path to a file containing the user's certificate. - {key, der_bin()} + {key, der_encoded()} The DER encoded users private key. If this option is supplied it will override the keyfile option. @@ -158,7 +158,7 @@ Only used if the private keyfile is password protected. - {cacerts, [der_bin()]} + {cacerts, [der_encoded()]} The DER encoded trusted certificates. If this option is supplied it will override the cacertfile option. @@ -301,7 +301,7 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} | - {dh, der_bin()} + {dh, der_encoded()} The DER encoded Diffie Hellman parameters. If this option is supplied it will override the dhfile option. diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 7e5929d708..0e108c430f 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -49,6 +49,27 @@ inet_ssl, %% inet options for internal ssl socket cb %% Callback info }). +-type option() :: socketoption() | ssloption() | transportoption(). +-type socketoption() :: [{property(), term()}]. %% See gen_tcp and inet +-type property() :: atom(). + +-type ssloption() :: {verify, verify_type()} | + {verify_fun, {fun(), InitialUserState::term()}} | + {fail_if_no_peer_cert, boolean()} | {depth, integer()} | + {cert, der_encoded()} | {certfile, path()} | {key, der_encoded()} | + {keyfile, path()} | {password, string()} | {cacerts, [der_encoded()]} | + {cacertfile, path()} | {dh, der_encoded()} | {dhfile, path()} | + {ciphers, ciphers()} | {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | + {reuse_session, fun()}. + +-type verify_type() :: verify_none | verify_peer. +-type path() :: string(). +-type ciphers() :: [erl_cipher_suite()] | + string(). % (according to old API) +-type ssl_imp() :: new | old. + +-type transportoption() :: {CallbackModule::atom(), DataTag::atom(), ClosedTag::atom()}. + %%-------------------------------------------------------------------- -spec start() -> ok. @@ -77,8 +98,8 @@ stop() -> application:stop(ssl). %%-------------------------------------------------------------------- --spec connect(host() | port(), list()) -> {ok, #sslsocket{}}. --spec connect(host() | port(), list() | port_num(), timeout() | list()) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), [option()]) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), [option()] | port_num(), timeout() | list()) -> {ok, #sslsocket{}}. -spec connect(host() | port(), port_num(), list(), timeout()) -> {ok, #sslsocket{}}. %% @@ -126,7 +147,7 @@ connect(Host, Port, Options0, Timeout) -> end. %%-------------------------------------------------------------------- --spec listen(port_num(), list()) ->{ok, #sslsocket{}} | {error, reason()}. +-spec listen(port_num(), [option()]) ->{ok, #sslsocket{}} | {error, reason()}. %% %% Description: Creates a ssl listen socket. @@ -189,9 +210,10 @@ transport_accept(#sslsocket{} = ListenSocket, Timeout) -> ssl_broker:transport_accept(Pid, ListenSocket, Timeout). %%-------------------------------------------------------------------- --spec ssl_accept(#sslsocket{}) -> {ok, #sslsocket{}} | {error, reason()}. --spec ssl_accept(#sslsocket{}, list() | timeout()) -> {ok, #sslsocket{}} | {error, reason()}. --spec ssl_accept(port(), list(), timeout()) -> {ok, #sslsocket{}} | {error, reason()}. +-spec ssl_accept(#sslsocket{}) -> ok | {error, reason()}. +-spec ssl_accept(#sslsocket{} | port(), timeout()| [option()]) -> + ok | {ok, #sslsocket{}} | {error, reason()}. +-spec ssl_accept(port(), [option()], timeout()) -> {ok, #sslsocket{}} | {error, reason()}. %% %% Description: Performs accept on a ssl listen socket. e.i. performs %% ssl handshake. diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 675e5e44bd..4a31b57802 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1096,6 +1096,7 @@ init_private_key({rsa, PrivateKey}, _, _,_) -> init_private_key({dsa, PrivateKey},_,_,_) -> public_key:der_decode('DSAPrivateKey', PrivateKey). +-spec(handle_file_error/6 :: (_,_,_,_,_,_) -> no_return()). handle_file_error(Line, Error, {badmatch, Reason}, File, Throw, Stack) -> file_error(Line, Error, Reason, File, Throw, Stack); handle_file_error(Line, Error, Reason, File, Throw, Stack) -> diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl index 43a85c2d9d..715941e3ad 100644 --- a/lib/ssl/src/ssl_internal.hrl +++ b/lib/ssl/src/ssl_internal.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,7 +19,6 @@ %% - -ifndef(ssl_internal). -define(ssl_internal, true). -- cgit v1.2.3 From 2b021d21d7d084196560f50f392b1c4962094d99 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Wed, 14 Jul 2010 10:10:10 -0400 Subject: check return value of epmd server listen() call The listen() call can fail due to a variety of conditions, so check its return value and if it fails, print a suitable debug message if appropriate and then exit. The exit values used are the same for those already used for bind() failures: 0 if the error is EADDRINUSE, 1 otherwise. --- erts/epmd/src/epmd_srv.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index ef471a473a..6b3900fae2 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -157,8 +157,20 @@ void run(EpmdVars *g) dbg_printf(g,2,"starting"); - listen(listensock, SOMAXCONN); - + if(listen(listensock, SOMAXCONN) < 0) + { + if (errno == EADDRINUSE) + { + dbg_tty_printf(g,1,"there is already a epmd running at port %d", + g->port); + epmd_cleanup_exit(g,0); + } + else + { + dbg_perror(g,"failed to listen on socket"); + epmd_cleanup_exit(g,1); + } + } FD_ZERO(&g->orig_read_mask); FD_SET(listensock,&g->orig_read_mask); -- cgit v1.2.3 From 8b9519ccf398107c404a266687ed4b6456bef143 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 11 Jan 2011 17:23:08 +0100 Subject: Remove special treatment of EADDRINUSE --- erts/epmd/src/epmd_srv.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 6b3900fae2..3499ab2934 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -2,7 +2,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -157,20 +157,10 @@ void run(EpmdVars *g) dbg_printf(g,2,"starting"); - if(listen(listensock, SOMAXCONN) < 0) - { - if (errno == EADDRINUSE) - { - dbg_tty_printf(g,1,"there is already a epmd running at port %d", - g->port); - epmd_cleanup_exit(g,0); - } - else - { - dbg_perror(g,"failed to listen on socket"); - epmd_cleanup_exit(g,1); - } - } + if(listen(listensock, SOMAXCONN) < 0) { + dbg_perror(g,"failed to listen on socket"); + epmd_cleanup_exit(g,1); + } FD_ZERO(&g->orig_read_mask); FD_SET(listensock,&g->orig_read_mask); -- cgit v1.2.3 From a1a83039a77d39f7691969503d190cb6dfcd49c9 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 12 Jan 2011 15:41:46 +0100 Subject: Remove strange name field in efile_drv.c as it upsets -D_FORTIFY_SOURCE --- erts/emulator/drivers/common/efile_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 786fa7da77..6449c6f506 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -385,7 +385,6 @@ struct t_data ErlDrvBinary *binp; int size; int offset; - char name[1]; } read_file; struct { struct t_readdir_buf *first_buf; @@ -1117,7 +1116,7 @@ static void invoke_read_file(void *data) Sint64 size; if (! (d->result_ok = - efile_openfile(&d->errInfo, d->c.read_file.name, + efile_openfile(&d->errInfo, d->b, EFILE_MODE_READ, &fd, &size))) { goto done; } @@ -3071,7 +3070,7 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) { d->command = command; d->reply = !0; /* Copy name */ - FILENAME_COPY(d->c.read_file.name, filename); + FILENAME_COPY(d->b, filename); d->c.read_file.binp = NULL; d->invoke = invoke_read_file; d->free = free_read_file; -- cgit v1.2.3 From 114c51979e79888d5b35698bbecea68522979c57 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 13 Jan 2011 14:05:44 +0100 Subject: Reduce memory footprint Handshake hashes, premaster secret and "public_key_info" does not need to be saved when the connection has been established. The own certificate is no longer duplicated in the state. --- lib/ssl/src/ssl_connection.erl | 53 ++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 4a31b57802..489895cf29 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -70,7 +70,6 @@ %% {{md5_hash, sha_hash}, {prev_md5, prev_sha}} (binary()) tls_handshake_hashes, % see above tls_cipher_texts, % list() received but not deciphered yet - own_cert, % binary() | undefined session, % #session{} from ssl_handshake.hrl session_cache, % session_cache_cb, % @@ -307,7 +306,6 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, {ok, Ref, CacheRef, OwnCert, Key, DHParams} -> Session = State0#state.session, State = State0#state{tls_handshake_hashes = Hashes0, - own_cert = OwnCert, session = Session#session{own_certificate = OwnCert}, cert_db_ref = Ref, session_cache = CacheRef, @@ -334,12 +332,10 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, %%-------------------------------------------------------------------- hello(start, #state{host = Host, port = Port, role = client, ssl_options = SslOpts, - own_cert = Cert, + session = #session{own_certificate = Cert} = Session0, transport_cb = Transport, socket = Socket, connection_states = ConnectionStates, - renegotiation = {Renegotiation, _}} - = State0) -> - + renegotiation = {Renegotiation, _}} = State0) -> Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates, SslOpts, Renegotiation, Cert), @@ -351,13 +347,13 @@ hello(start, #state{host = Host, port = Port, role = client, Transport:send(Socket, BinMsg), State1 = State0#state{connection_states = CS2, negotiated_version = Version, %% Requested version - session = - #session{session_id = Hello#client_hello.session_id, - is_resumable = false}, + session = + Session0#session{session_id = Hello#client_hello.session_id, + is_resumable = false}, tls_handshake_hashes = Hashes1}, {Record, State} = next_record(State1), next_state(hello, Record, State); - + hello(start, #state{role = server} = State0) -> {Record, State} = next_record(State0), next_state(hello, Record, State); @@ -374,7 +370,6 @@ hello(#server_hello{cipher_suite = CipherSuite, negotiated_version = ReqVersion, renegotiation = {Renegotiation, _}, ssl_options = SslOptions} = State0) -> - case ssl_handshake:hello(Hello, SslOptions, ConnectionStates0, Renegotiation) of {Version, NewId, ConnectionStates} -> {KeyAlgorithm, _, _} = @@ -400,13 +395,11 @@ hello(#server_hello{cipher_suite = CipherSuite, hello(Hello = #client_hello{client_version = ClientVersion}, State = #state{connection_states = ConnectionStates0, - port = Port, session = Session0, + port = Port, session = #session{own_certificate = Cert} = Session0, renegotiation = {Renegotiation, _}, session_cache = Cache, session_cache_cb = CacheCb, - ssl_options = SslOpts, - own_cert = Cert}) -> - + ssl_options = SslOpts}) -> case ssl_handshake:hello(Hello, SslOpts, {Port, Session0, Cache, CacheCb, ConnectionStates0, Cert}, Renegotiation) of {Version, {Type, Session}, ConnectionStates} -> @@ -540,7 +533,7 @@ certify(#server_hello_done{}, connection_states = ConnectionStates0, negotiated_version = Version, premaster_secret = undefined, - role = client} = State0) -> + role = client} = State0) -> case ssl_handshake:master_secret(Version, Session, ConnectionStates0, client) of {MasterSecret, ConnectionStates1} -> @@ -617,7 +610,6 @@ certify_client_key_exchange(#client_diffie_hellman_public{dh_public = ClientPubl diffie_hellman_params = #'DHParameter'{prime = P, base = G}, diffie_hellman_keys = {_, ServerDhPrivateKey}} = State0) -> - case dh_master_secret(crypto:mpint(P), crypto:mpint(G), ClientPublicDhKey, ServerDhPrivateKey, State0) of #state{} = State1 -> {Record, State} = next_record(State1), @@ -660,8 +652,7 @@ cipher(#finished{verify_data = Data} = Finished, role = Role, session = #session{master_secret = MasterSecret} = Session0, - tls_handshake_hashes = Hashes0} = State) -> - + tls_handshake_hashes = Hashes0} = State) -> case ssl_handshake:verify_connection(Version, Finished, opposite_role(Role), MasterSecret, Hashes0) of @@ -682,14 +673,13 @@ cipher(Msg, State) -> %%-------------------------------------------------------------------- connection(#hello_request{}, #state{host = Host, port = Port, socket = Socket, - own_cert = Cert, + session = #session{own_certificate = Cert}, ssl_options = SslOpts, negotiated_version = Version, transport_cb = Transport, connection_states = ConnectionStates0, renegotiation = {Renegotiation, _}, tls_handshake_hashes = Hashes0} = State0) -> - Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts, Renegotiation, Cert), @@ -1162,7 +1152,7 @@ certify_client(#state{client_certificate_requested = true, role = client, transport_cb = Transport, negotiated_version = Version, cert_db_ref = CertDbRef, - own_cert = OwnCert, + session = #session{own_certificate = OwnCert}, socket = Socket, tls_handshake_hashes = Hashes0} = State) -> Certificate = ssl_handshake:certificate(OwnCert, CertDbRef, client), @@ -1178,10 +1168,10 @@ verify_client_cert(#state{client_certificate_requested = true, role = client, connection_states = ConnectionStates0, transport_cb = Transport, negotiated_version = Version, - own_cert = OwnCert, socket = Socket, private_key = PrivateKey, - session = #session{master_secret = MasterSecret}, + session = #session{master_secret = MasterSecret, + own_certificate = OwnCert}, tls_handshake_hashes = Hashes0} = State) -> case ssl_handshake:client_certificate_verify(OwnCert, MasterSecret, @@ -1347,7 +1337,7 @@ certify_server(#state{transport_cb = Transport, connection_states = ConnectionStates, tls_handshake_hashes = Hashes, cert_db_ref = CertDbRef, - own_cert = OwnCert} = State) -> + session = #session{own_certificate = OwnCert}} = State) -> case ssl_handshake:certificate(OwnCert, CertDbRef, server) of CertMsg = #certificate{} -> {BinCertMsg, NewConnectionStates, NewHashes} = @@ -1374,7 +1364,6 @@ key_exchange(#state{role = server, key_algorithm = Algo, when Algo == dhe_dss; Algo == dhe_rsa; Algo == dh_anon -> - Keys = crypto:dh_generate_key([crypto:mpint(P), crypto:mpint(G)]), ConnectionState = ssl_record:pending_connection_state(ConnectionStates0, read), @@ -1926,14 +1915,22 @@ next_state_connection(StateName, #state{send_queue = Queue0, next_state_is_connection(State) end. +%% In next_state_is_connection/1: clear tls_handshake_hashes, +%% premaster_secret and public_key_info (only needed during handshake) +%% to reduce memory foot print of a connection. next_state_is_connection(State = #state{recv_during_renegotiation = true, socket_options = #socket_options{active = false}}) -> - passive_receive(State#state{recv_during_renegotiation = false}, connection); + passive_receive(State#state{recv_during_renegotiation = false, + premaster_secret = undefined, + public_key_info = undefined, + tls_handshake_hashes = {<<>>, <<>>}}, connection); next_state_is_connection(State0) -> {Record, State} = next_record_if_active(State0), - next_state(connection, Record, State). + next_state(connection, Record, State#state{premaster_secret = undefined, + public_key_info = undefined, + tls_handshake_hashes = {<<>>, <<>>}}). register_session(_, _, _, #session{is_resumable = true} = Session) -> Session; %% Already registered -- cgit v1.2.3 From 39c74e5e45518b6d0f4fb5876d33e0046ba8e14b Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 13 Jan 2011 15:07:03 +0100 Subject: Fix assymetric (Un)UseTmpHeap in erl_process.c Also added ASSERTion in beam_emu.c that the tmp-heap-counter in 0. --- erts/emulator/beam/beam_emu.c | 5 ++++- erts/emulator/beam/erl_process.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 8a0e12dd4f..e831df932e 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1178,6 +1178,9 @@ void process_main(void) do_schedule1: PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); +#if HALFWORD_HEAP + ASSERT(erts_get_scheduler_data()->num_tmp_heap_used == 0); +#endif c_p = schedule(c_p, reds_used); #ifdef DEBUG pid = c_p->id; diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index ddfc27a93f..510fe27ffe 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -7068,11 +7068,11 @@ static void doit_exit_monitor(ErtsMonitor *mon, void *vpcontext) DeclareTmpHeapNoproc(lhp,3); ErtsProcLocks rp_locks = (ERTS_PROC_LOCK_LINK | ERTS_PROC_LOCKS_MSG_SEND); - UseTmpHeapNoproc(3); rp = erts_pid2proc(NULL, 0, mon->pid, rp_locks); if (rp == NULL) { goto done; } + UseTmpHeapNoproc(3); rmon = erts_remove_monitor(&(rp->monitors),mon->ref); if (rmon) { erts_destroy_monitor(rmon); -- cgit v1.2.3 From 326ec4e6a86e7ddb7b49f2465ad43adf86399aac Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Mon, 3 Jan 2011 13:59:19 +0200 Subject: Cosmetic changes --- lib/dialyzer/src/dialyzer_dataflow.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index b80c7efc1a..0e51ce059c 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1748,7 +1748,7 @@ bind_opaque_pats(GenType, Type, Pat, Map, State, Rev) -> bind_guard(Guard, Map, State) -> try bind_guard(Guard, Map, dict:new(), pos, State) of - {Map1, _Type} -> Map1 + {Map1, _Type} -> Map1 catch throw:{fail, Warning} -> {error, Warning}; throw:{fatal_fail, Warning} -> {error, Warning} @@ -2274,7 +2274,7 @@ handle_guard_and(Guard, Map, Env, Eval, State) -> handle_guard_or(Guard, Map, Env, Eval, State) -> [Arg1, Arg2] = cerl:call_args(Guard), case Eval of - pos -> + pos -> {Map1, Bool1} = try bind_guard(Arg1, Map, Env, pos, State) catch -- cgit v1.2.3 From 10c9b3f42e8c2be2d3cdd4f729c1901a79ead79c Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 14 Jan 2011 10:14:40 +0100 Subject: Removed use of deprecated function size --- lib/stdlib/src/base64.erl | 6 +++--- lib/stdlib/test/base64_SUITE.erl | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/stdlib/src/base64.erl b/lib/stdlib/src/base64.erl index 69d864051c..a14a72ac6d 100644 --- a/lib/stdlib/src/base64.erl +++ b/lib/stdlib/src/base64.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -217,12 +217,12 @@ mime_decode_binary(Result0, <>) -> Result0; 4 when Eq -> %% enforce at least one more '=' only ignoring illegals and spacing - Split = size(Result0), + Split = byte_size(Result0) - 1, <> = Result0, Result; 2 -> %% remove 2 bits - Split = size(Result0), + Split = byte_size(Result0) - 1, <> = Result0, Result end; diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index 3790e7d4c0..d8bb2dfb60 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,6 @@ %% -module(base64_SUITE). --author('jakob@erix.ericsson.se'). -include("test_server.hrl"). -include("test_server_line.hrl"). -- cgit v1.2.3 From 4dbf3c9e4ae7cfd19b247353369166d31b8f15e5 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 17 Jan 2011 11:24:19 +0100 Subject: Verification of a critical extended_key_usage-extension corrected When a verify fun is supplied, it should not be called to verify the extended_key_usage-extension when it is already verified by the ssl_certificate:validate_extension/2 --- lib/ssl/src/ssl_handshake.erl | 16 +++---- lib/ssl/test/ssl_basic_SUITE.erl | 101 +++++++++++++++++++++++++++++++-------- 2 files changed, 89 insertions(+), 28 deletions(-) diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 125c28b373..1f4c44d115 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -194,14 +194,12 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbRef, {fun(OtpCert, ExtensionOrError, {SslState, UserState}) -> case ssl_certificate:validate_extension(OtpCert, ExtensionOrError, - SslState) of - {valid, _} -> - apply_user_fun(Fun, OtpCert, - ExtensionOrError, UserState, - SslState); - {fail, Reason} -> - apply_user_fun(Fun, OtpCert, Reason, UserState, - SslState); + SslState) of + {valid, NewSslState} -> + {valid, {NewSslState, UserState}}; + {fail, Reason} -> + apply_user_fun(Fun, OtpCert, Reason, UserState, + SslState); {unknown, _} -> apply_user_fun(Fun, OtpCert, ExtensionOrError, UserState, SslState) diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 962d2d8cf0..d3e846f60b 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -204,7 +204,8 @@ all(suite) -> server_does_not_want_to_reuse_session, client_renegotiate, server_renegotiate, client_renegotiate_reused_session, server_renegotiate_reused_session, client_no_wrap_sequence_number, - server_no_wrap_sequence_number, extended_key_usage, + server_no_wrap_sequence_number, + extended_key_usage_verify_peer, extended_key_usage_verify_none, no_authority_key_identifier, invalid_signature_client, invalid_signature_server, cert_expired, client_with_cert_cipher_suites_handshake, unknown_server_ca_fail, @@ -2481,13 +2482,13 @@ server_no_wrap_sequence_number(Config) when is_list(Config) -> ssl_test_lib:close(Server), ssl_test_lib:close(Client). %%-------------------------------------------------------------------- -extended_key_usage(doc) -> - ["Test cert that has a critical extended_key_usage extension"]; +extended_key_usage_verify_peer(doc) -> + ["Test cert that has a critical extended_key_usage extension in verify_peer mode"]; -extended_key_usage(suite) -> +extended_key_usage_verify_peer(suite) -> []; -extended_key_usage(Config) when is_list(Config) -> +extended_key_usage_verify_peer(Config) when is_list(Config) -> ClientOpts = ?config(client_verification_opts, Config), ServerOpts = ?config(server_verification_opts, Config), PrivDir = ?config(priv_dir, Config), @@ -2503,13 +2504,13 @@ extended_key_usage(Config) when is_list(Config) -> ServerExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-serverAuth']}, ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate, ServerExtensions = ServerOTPTbsCert#'OTPTBSCertificate'.extensions, - NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions = - [ServerExtKeyUsageExt | + NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions = + [ServerExtKeyUsageExt | ServerExtensions]}, - NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key), + NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key), ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]), NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)], - + ClientCertFile = proplists:get_value(certfile, ClientOpts), NewClientCertFile = filename:join(PrivDir, "client/new_cert.pem"), [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile), @@ -2517,28 +2518,90 @@ extended_key_usage(Config) when is_list(Config) -> ClientExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-clientAuth']}, ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate, ClientExtensions = ClientOTPTbsCert#'OTPTBSCertificate'.extensions, - NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions = + NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions = [ClientExtKeyUsageExt | ClientExtensions]}, - NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key), + NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key), ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]), NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)], {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), - - Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, - {from, self()}, + + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, {mfa, {?MODULE, send_recv_result_active, []}}, {options, [{verify, verify_peer} | NewServerOpts]}]), Port = ssl_test_lib:inet_port(Server), - Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, {host, Hostname}, - {from, self()}, + {from, self()}, {mfa, {?MODULE, send_recv_result_active, []}}, {options, [{verify, verify_peer} | NewClientOpts]}]), - + ssl_test_lib:check_result(Server, ok, Client, ok), - + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). + +%%-------------------------------------------------------------------- +extended_key_usage_verify_none(doc) -> + ["Test cert that has a critical extended_key_usage extension in verify_none mode"]; + +extended_key_usage_verify_none(suite) -> + []; + +extended_key_usage_verify_none(Config) when is_list(Config) -> + ClientOpts = ?config(client_verification_opts, Config), + ServerOpts = ?config(server_verification_opts, Config), + PrivDir = ?config(priv_dir, Config), + + KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"), + [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile), + Key = public_key:pem_entry_decode(KeyEntry), + + ServerCertFile = proplists:get_value(certfile, ServerOpts), + NewServerCertFile = filename:join(PrivDir, "server/new_cert.pem"), + [{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile), + ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp), + ServerExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-serverAuth']}, + ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate, + ServerExtensions = ServerOTPTbsCert#'OTPTBSCertificate'.extensions, + NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions = + [ServerExtKeyUsageExt | + ServerExtensions]}, + NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]), + NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)], + + ClientCertFile = proplists:get_value(certfile, ClientOpts), + NewClientCertFile = filename:join(PrivDir, "client/new_cert.pem"), + [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile), + ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp), + ClientExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-clientAuth']}, + ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate, + ClientExtensions = ClientOTPTbsCert#'OTPTBSCertificate'.extensions, + NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions = + [ClientExtKeyUsageExt | + ClientExtensions]}, + NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key), + ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]), + NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)], + + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {?MODULE, send_recv_result_active, []}}, + {options, [{verify, verify_none} | NewServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {?MODULE, send_recv_result_active, []}}, + {options, [{verify, verify_none} | NewClientOpts]}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + ssl_test_lib:close(Server), ssl_test_lib:close(Client). -- cgit v1.2.3 From ecb20a2d826016db0a80c1e626f4b8fe4303d152 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 17 Jan 2011 14:13:15 +0100 Subject: Prepare for release --- lib/ssl/src/ssl.appup.src | 2 ++ lib/ssl/vsn.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src index a9c07ec87c..e6a8c557fc 100644 --- a/lib/ssl/src/ssl.appup.src +++ b/lib/ssl/src/ssl.appup.src @@ -1,11 +1,13 @@ %% -*- erlang -*- {"%VSN%", [ + {"4.1.2", [{restart_application, ssl}]}, {"4.1.1", [{restart_application, ssl}]}, {"4.1", [{restart_application, ssl}]}, {"4.0.1", [{restart_application, ssl}]} ], [ + {"4.1.2", [{restart_application, ssl}]}, {"4.1.1", [{restart_application, ssl}]}, {"4.1", [{restart_application, ssl}]}, {"4.0.1", [{restart_application, ssl}]} diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk index b1ae0db7e7..a4be7bb889 100644 --- a/lib/ssl/vsn.mk +++ b/lib/ssl/vsn.mk @@ -1,2 +1,2 @@ -SSL_VSN = 4.1.2 +SSL_VSN = 4.1.3 -- cgit v1.2.3 From 6deca2a989772f261b59f11da031832f1ea9c45d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 17 Jan 2011 14:16:54 +0100 Subject: Update release notes --- lib/ssl/doc/src/notes.xml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml index 2ccbc5348c..8f81ccb567 100644 --- a/lib/ssl/doc/src/notes.xml +++ b/lib/ssl/doc/src/notes.xml @@ -31,7 +31,29 @@

This document describes the changes made to the SSL application.

-
SSL 4.1.2 +
SSL 4.1.3 + +
Fixed Bugs and Malfunctions + + +

+ Fixed error in cache-handling fix from ssl-4.1.2

+

+ Own Id: OTP-9018 Aux Id: seq11739

+
+ +

+ Verification of a critical extended_key_usage-extension + corrected

+

+ Own Id: OTP-9029 Aux Id: seq11541

+
+
+
+ +
+ +
SSL 4.1.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6ce5ab74806d044070768175f48605bab7fa079d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 16 Dec 2010 10:32:28 +0100 Subject: Add erts_debug:instructions/0 for listing all specific instructions erts_debug:instructions/0 is useful for finding which specific instructions that are not used at all. --- erts/emulator/beam/beam_debug.c | 19 +++++++++++++++++++ erts/emulator/beam/bif.tab | 1 + erts/emulator/test/erts_debug_SUITE.erl | 9 +++++++-- lib/hipe/cerl/erl_bif_types.erl | 4 ++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index b0bf14b94f..6f2a21b50a 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -157,6 +157,25 @@ void debug_dump_code(BeamInstr *I, int num) } #endif +BIF_RETTYPE +erts_debug_instructions_0(BIF_ALIST_0) +{ + int i = 0; + Uint needed = num_instructions * 2; + Eterm* hp; + Eterm res = NIL; + + for (i = 0; i < num_instructions; i++) { + needed += 2*strlen(opc[i].name); + } + hp = HAlloc(BIF_P, needed); + for (i = num_instructions-1; i >= 0; i--) { + Eterm s = erts_bld_string_n(&hp, 0, opc[i].name, strlen(opc[i].name)); + res = erts_bld_cons(&hp, 0, s, res); + } + return res; +} + Eterm erts_debug_disassemble_1(Process* p, Eterm addr) { diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab index 60b4b1946b..d9dd80fa8b 100644 --- a/erts/emulator/beam/bif.tab +++ b/erts/emulator/beam/bif.tab @@ -660,6 +660,7 @@ bif erts_debug:display/1 bif 'erl.system.debug':display/1 ebif_erts_debug_display_1 bif erts_debug:dist_ext_to_term/2 bif 'erl.system.debug':dist_ext_to_term/2 ebif_erts_debug_dist_ext_to_term_2 +bif erts_debug:instructions/0 # # Monitor testing bif's... diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index e60a999df1..934a1b10a4 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -21,10 +21,10 @@ -include("test_server.hrl"). -export([all/1,init_per_testcase/2,fin_per_testcase/2, - flat_size/1,flat_size_big/1,df/1]). + flat_size/1,flat_size_big/1,df/1,instructions/1]). all(suite) -> - [flat_size,flat_size_big,df]. + [flat_size,flat_size_big,df,instructions]. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(2)), @@ -70,3 +70,8 @@ df(Config) when is_list(Config) -> pps() -> {erlang:ports()}. + +instructions(Config) when is_list(Config) -> + ?line Is = erts_debug:instructions(), + ?line _ = [list_to_atom(I) || I <- Is], + ok. diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index ed5bf03804..af36eed79a 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -1865,6 +1865,8 @@ type(erts_debug, flat_size, 1, Xs) -> strict(arg_types(erts_debug, flat_size, 1), Xs, fun (_) -> t_integer() end); type(erts_debug, get_internal_state, 1, _) -> t_any(); +type(erts_debug, instructions, 0, _) -> + t_list(t_list(t_byte())); type(erts_debug, lock_counters, 1, Xs) -> strict(arg_types(erts_debug, lock_counters, 1), Xs, fun ([Arg]) -> @@ -4091,6 +4093,8 @@ arg_types(erts_debug, flat_size, 1) -> [t_any()]; arg_types(erts_debug, get_internal_state, 1) -> [t_any()]; +arg_types(erts_debug, instructions, 0) -> + []; arg_types(erts_debug, lock_counters, 1) -> [t_sup([t_atom(enabled), t_atom(info), -- cgit v1.2.3 From e993388497b70f923d57b59a718ee37c4d964612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 15 Dec 2010 15:20:50 +0100 Subject: Add utils/count for counting the static instruction frequency --- erts/emulator/utils/count | 127 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 erts/emulator/utils/count diff --git a/erts/emulator/utils/count b/erts/emulator/utils/count new file mode 100755 index 0000000000..617f5c25e8 --- /dev/null +++ b/erts/emulator/utils/count @@ -0,0 +1,127 @@ +%% -*- erlang -*- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-mode(compile). + +main(_) -> + DisDir = "./dis", + ok = filelib:ensure_dir(filename:join(DisDir, "dummy")), + io:format("Dissambling to ~s\n", [DisDir]), + ok = file:set_cwd(DisDir), + Path = code:get_path() -- ["."], + Beams0 = [filelib:wildcard(filename:join(Dir, "*.beam")) || + Dir <- Path], + Beams = lists:append(Beams0), + Mods0 = [list_to_atom(filename:rootname(filename:basename(F))) || + F <- Beams], + Mods = lists:usort(Mods0), + start_sem(), + Ps = [begin + {_,Ref} = spawn_monitor(fun() -> count(M) end), + Ref + end || M <- Mods], + [put(list_to_atom(I), 0) || I <- erts_debug:instructions()], + Res = wait_for_all(Ps, 1), + OutFile = "count", + {ok,Out} = file:open(OutFile, [write]), + [io:format(Out, "~s ~p\n", [I,C]) || {I,C} <- Res], + ok = file:close(Out), + io:format("\nResult written to ~s\n", + [filename:join(DisDir, OutFile)]), + ok. + +wait_for_all([], _) -> + lists:reverse(lists:keysort(2, get())); +wait_for_all([_|_]=Ps, I) -> + receive + {'DOWN',Ref,process,_,Result} -> + io:format("\r~p", [I]), + [increment(Key, Count) || {Key,Count} <- Result], + wait_for_all(Ps -- [Ref], I+1) + end. + +count(M) -> + down(), + erts_debug:df(M), + {ok,Fd} = file:open(atom_to_list(M) ++ ".dis", [read,raw]), + count_is(Fd), + ok = file:close(Fd), + exit(get()). + +count_is(Fd) -> + case file:read_line(Fd) of + {ok,Line} -> + count_instr(Line), + count_is(Fd); + eof -> + ok + end. + +count_instr([$\s|T]) -> + count_instr_1(T, []); +count_instr([_|T]) -> + count_instr(T); +count_instr([]) -> + %% Empty line. + ok. + +count_instr_1([$\s|_], Acc) -> + Instr = list_to_atom(lists:reverse(Acc)), + increment(Instr, 1); +count_instr_1([H|T], Acc) -> + count_instr_1(T, [H|Acc]). + +increment(Key, Inc) -> + case get(Key) of + undefined -> + put(Key, Inc); + Count -> + put(Key, Count+Inc) + end. + +%%% +%%% Counting sempahore to limit the number of processes that +%%% can run concurrently. +%%% + +down() -> + sem ! {down,self()}, + receive + sem_taken -> ok + end. + +start_sem() -> + spawn(fun() -> + register(sem, self()), + process_flag(trap_exit, true), + do_sem(erlang:system_info(schedulers)+1) end). + +do_sem(0) -> + receive + {'EXIT',_,_} -> + do_sem(1) + end; +do_sem(C) -> + receive + {down,Pid} -> + link(Pid), + Pid ! sem_taken, + do_sem(C-1) + end. -- cgit v1.2.3 From ecb87dd4e18e445dd42788bd6a1db9d64c5fee1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 29 Sep 2010 12:16:01 +0200 Subject: Makefile.in: Add dependency for files generated by util/beam_makeops --- erts/emulator/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 6c33e2ca16..1420fd6bfa 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -505,7 +505,7 @@ ifdef HIPE_ENABLED OPCODE_TABLES += hipe/hipe_ops.tab endif -$(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES) +$(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES) utils/beam_makeops LANG=C $(PERL) utils/beam_makeops -outdir $(TTF_DIR) \ -emulator $(OPCODE_TABLES) -- cgit v1.2.3 From 89337287749d57024df06eaceca1236899efdcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 14:54:18 +0100 Subject: Remove the last vestiges of the allocating fmove/2 instruction There was a version of the BEAM loader and emulator that had two versions of the fmove/2 instruction, one version that allocated heap space internally and a newer version that assumed that a previous test_heap/2 instruction had already allocated the heap space. Though the allocating fmove/2 instruction is no longer supported, some vestiges of it still remains. --- erts/emulator/beam/beam_emu.c | 7 +------ erts/emulator/beam/beam_load.c | 9 --------- erts/emulator/beam/ops.tab | 8 ++------ 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 8a0e12dd4f..254eba42d0 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -4723,7 +4723,7 @@ apply_bif_or_nif_epilogue: NextPF(2, next); } - OpCase(fmove_new_ld): { + OpCase(fmove_ld): { Eterm fr = Arg(0); Eterm dest = make_float(HTOP); @@ -4753,11 +4753,6 @@ apply_bif_or_nif_epilogue: NextPF(2, next); } - /* - * Old allocating fmove. - */ - - #ifdef NO_FPE_SIGNALS OpCase(fclearerror): OpCase(i_fcheckerror): diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index df5602b040..2f335faad0 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -326,11 +326,6 @@ typedef struct { Literal* literals; /* Array of literals. */ LiteralPatch* literal_patches; /* Operands that need to be patched. */ Uint total_literal_size; /* Total heap size for all literals. */ - - /* - * Floating point. - */ - int new_float_instructions; /* New allocation scheme for floating point. */ } LoaderState; typedef struct { @@ -818,7 +813,6 @@ init_state(LoaderState* stp) stp->total_literal_size = 0; stp->literal_patches = 0; stp->string_patches = 0; - stp->new_float_instructions = 0; stp->may_load_nif = 0; stp->on_load = 0; } @@ -1618,7 +1612,6 @@ load_code(LoaderState* stp) BeamInstr val; BeamInstr words = 0; - stp->new_float_instructions = 1; GetTagAndValue(stp, tag, n); VerifyTag(stp, tag, TAG_u); while (n-- > 0) { @@ -2595,8 +2588,6 @@ binary_too_big_bits(LoaderState* stp, GenOpArg Size) return Size.type == TAG_u && (((Size.val+7)/8) >> (8*sizeof(Uint)-3) != 0); } -#define new_float_allocation(Stp) ((Stp)->new_float_instructions) - static GenOp* gen_put_binary(LoaderState* stp, GenOpArg Fail,GenOpArg Size, GenOpArg Unit, GenOpArg Flags, GenOpArg Src) diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index a2439d5582..8843dafa4b 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -1307,6 +1307,8 @@ fconv Arg=iqan Dst=l => move Arg x | fconv x Dst fmove q l fmove d l +fmove l d + fconv d l i_fadd l l l @@ -1322,12 +1324,6 @@ fcheckerror p => i_fcheckerror i_fcheckerror fclearerror -fmove FR=l Dst=d | new_float_allocation() => fmove_new FR Dst - -# The new instruction for moving a float out of a floating point register. -# (No allocation.) -fmove_new l d - # # New apply instructions in R10B. # -- cgit v1.2.3 From 177cca2e0ad8752022c3322f537ee836598b342a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 10 Nov 2010 14:03:50 +0100 Subject: BEAM loader: Fix bug in handling of "rest" arguments It would only really work in simple case like: select_val S=q Fail=f Size=u Rest=* => ... where all operands for a single instruction where bound to variables, and not for more complicated cases such as: i_put_tuple Dst Arity Puts=* | put PutSrc => ... --- erts/emulator/beam/beam_load.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 2f335faad0..feac89784b 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3992,14 +3992,17 @@ transform_engine(LoaderState* st) case TOP_rest_args: { int n = *pc++; + int formal_arity = gen_opc[instr->op].arity; + int num_vars = n + (instr->arity - formal_arity); + int j = formal_arity; + var = erts_alloc(ERTS_ALC_T_LOADER_TMP, - instr->arity * sizeof(GenOpArg)); + num_vars * sizeof(GenOpArg)); for (i = 0; i < n; i++) { var[i] = def_vars[i]; } - while (i < instr->arity) { - var[i] = instr->a[i]; - i++; + while (i < num_vars) { + var[i++] = instr->a[j++]; } } break; -- cgit v1.2.3 From 12d221c867d057379933d1434cd422302ad1e5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 08:50:27 +0100 Subject: beam_makeops: Relax requirements for having specific instructions --- erts/emulator/utils/beam_makeops | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index de19a2e35b..5c242ce9c4 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -80,6 +80,8 @@ my %cold_code; my @unnumbered_generic; my %unnumbered; +my %is_transformed; + # # Code transformations. # @@ -474,8 +476,9 @@ sub emulator_output { $gen_transform_offset{$key} : -1; my($spec_op) = $gen_to_spec{$key}; my($num_specific) = $num_specific{$key}; - defined $spec_op or $tr != -1 or + defined $spec_op or $obsolete[$gen_opnum{$name,$arity}] or + $is_transformed{$name,$arity} or error("instruction $key has no specific instruction"); $spec_op = -1 unless defined $spec_op; &init_item($name, $arity, $spec_op, $num_specific, $tr, $min_window{$key}); @@ -1103,6 +1106,10 @@ sub compile_transform { if ($obsolete[$gen_opnum{$name,$arity}]) { error("obsolete function must not be used in transformations"); } + + if ($src) { + $is_transformed{$name,$arity} = 1; + } [$name,$arity,@ops]; } -- cgit v1.2.3 From 27d18ae9bb1b17408fc2298c7e171593a8b2e8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 19 Oct 2010 20:37:26 +0200 Subject: beam_makeops: Allow -pack and -nonext to be combined --- erts/emulator/utils/beam_makeops | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 5c242ce9c4..c2fb101846 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -919,7 +919,10 @@ sub basic_generator { $var_decls .= "BeamInstr tmp_packed2;" if $macro_code =~ /tmp_packed2/; if ($flags =~ /-nonext/) { - $code = "$macro_code\n"; + $code = join("\n", + "{ $var_decls", + $macro_code, + "}"); } else { $code = join("\n", "{ $var_decls", -- cgit v1.2.3 From d310a5cb703822e95fa4c76c5c8ec566e5027a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 10 Dec 2010 05:39:03 +0100 Subject: beam_debug: Change one occurrence of "X[0]" to "x[0]" for consistency --- erts/emulator/beam/beam_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 6f2a21b50a..f73d0b31a2 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -405,7 +405,7 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) break; case 'x': /* x(N) */ if (reg_index(ap[0]) == 0) { - erts_print(to, to_arg, "X[0]"); + erts_print(to, to_arg, "x[0]"); } else { erts_print(to, to_arg, "x(%d)", reg_index(ap[0])); } -- cgit v1.2.3 From 7062f8dff2ddd110ec95c1b162273ea63c37897f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 14:19:21 +0100 Subject: beam_debug: Fix dissambly of some variable-operand instructions The i_jump_on_val_zero/3 and i_select_tuple_arity/3 instructions were not disassembled correctly. --- erts/emulator/beam/beam_debug.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index f73d0b31a2..5ada352202 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -559,6 +559,19 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; + case op_i_select_tuple_arity_sfI: + { + int n = ap[-1]; + + while (n > 0) { + Uint arity = arityval(ap[0]); + erts_print(to, to_arg, " {%d} f(" HEXF ")", arity, ap[1]); + ap += 2; + size += 2; + n--; + } + } + break; case op_i_jump_on_val_sfII: { int n; @@ -569,6 +582,16 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; + case op_i_jump_on_val_zero_sfI: + { + int n; + for (n = ap[-1]; n > 0; n--) { + erts_print(to, to_arg, "f(" HEXF ") ", ap[0]); + ap++; + size++; + } + } + break; case op_i_select_big_sf: while (ap[0]) { Eterm *bigp = (Eterm *) ap; -- cgit v1.2.3 From 7738e604909c52ebac606eed5f6314291747e938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 29 Sep 2010 10:24:29 +0200 Subject: BEAM loader: Omit type tests for instructions that don't need them --- erts/emulator/utils/beam_makeops | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index c2fb101846..8a5b8047eb 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -1301,13 +1301,22 @@ sub tr_gen_from { my($var, $type, $type_val, $cond, $val) = @$op; if ($type ne '' && $type ne '*') { - my($types) = ''; - my($type_mask) = 0; - foreach (split('', $type)) { - $types .= "$_ "; - $type_mask |= $type_bit{$_}; + # + # The is_bif, is_not_bif, and is_func instructions have + # their own built-in type test and don't need to + # be guarded with a type test instruction. + # + unless ($cond eq 'is_bif' or + $cond eq 'is_not_bif' or + $cond eq 'is_func') { + my($types) = ''; + my($type_mask) = 0; + foreach (split('', $type)) { + $types .= "$_ "; + $type_mask |= $type_bit{$_}; + } + push(@code, &make_op($types, 'is_type', $type_mask)); } - push(@code, &make_op($types, 'is_type', $type_mask)); } if ($cond eq 'is_func') { -- cgit v1.2.3 From ec325cc785916c6a4991fe2e03747a97b7e1ae75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 29 Sep 2010 12:16:56 +0200 Subject: BEAM loader: Combine is_type/1 and is_eq/1 instructions In the transformation engine in the loader, an is_eq/1 instruction is currently always preceded by an is_type/1 instruction. Therefore, save a word and slight amount of time by combining those instructions into an is_type_eq/2 instruction. --- erts/emulator/beam/beam_load.c | 12 ++++++++++++ erts/emulator/utils/beam_makeops | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index feac89784b..73644ecfd6 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3867,11 +3867,23 @@ transform_engine(LoaderState* st) if (i == 0) goto restart; break; +#if defined(TOP_is_eq) case TOP_is_eq: ASSERT(ap < instr->arity); if (*pc++ != instr->a[ap].val) goto restart; break; +#endif + case TOP_is_type_eq: + mask = *pc++; + + ASSERT(ap < instr->arity); + ASSERT(instr->a[ap].type < BEAM_NUM_TAGS); + if (((1 << instr->a[ap].type) & mask) == 0) + goto restart; + if (*pc++ != instr->a[ap].val) + goto restart; + break; case TOP_is_same_var: ASSERT(ap < instr->arity); i = *pc++; diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 8a5b8047eb..cb91517f04 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -1315,7 +1315,13 @@ sub tr_gen_from { $types .= "$_ "; $type_mask |= $type_bit{$_}; } - push(@code, &make_op($types, 'is_type', $type_mask)); + if ($cond ne 'is_eq') { + push(@code, &make_op($types, 'is_type', $type_mask)); + } else { + $cond = ''; + push(@code, &make_op($types, 'is_type_eq', + $type_mask, $val)); + } } } -- cgit v1.2.3 From e31af112f63b11622d6a3a49cb444d5613af2f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 18 Oct 2010 16:39:59 +0200 Subject: Pass the external word size to the beam_makeops script Giving the beam_makeops script access to the external word size (=the size of instruction words) will allow it to pack more operands into a word for the 64 bits emulator. --- erts/configure.in | 5 +++++ erts/emulator/Makefile.in | 4 +++- erts/emulator/utils/beam_makeops | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/erts/configure.in b/erts/configure.in index 6e983a07b0..627f734409 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -580,6 +580,11 @@ AC_SUBST(WFLAGS) AC_SUBST(CFLAG_RUNTIME_LIBRARY_PATH) AC_CHECK_SIZEOF(void *) # Needed for ARCH and smp checks below +if test "x$ac_cv_sizeof_void_p" = x8; then + AC_SUBST(EXTERNAL_WORD_SIZE, 64) +else + AC_SUBST(EXTERNAL_WORD_SIZE, 32) +fi dnl dnl Figure out operating system and cpu architecture diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 1420fd6bfa..f04df354a8 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -506,7 +506,9 @@ OPCODE_TABLES += hipe/hipe_ops.tab endif $(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES) utils/beam_makeops - LANG=C $(PERL) utils/beam_makeops -outdir $(TTF_DIR) \ + LANG=C $(PERL) utils/beam_makeops \ + -wordsize @EXTERNAL_WORD_SIZE@ \ + -outdir $(TTF_DIR) \ -emulator $(OPCODE_TABLES) # bif and atom table diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index cb91517f04..aa1aba6856 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -27,6 +27,7 @@ my $outdir = "."; # Directory for output files. my $verbose = 0; my $hot = 1; my $num_file_opcodes = 0; +my $wordsize = 32; # This is shift counts and mask for the packer. my $WHOLE_WORD = ''; @@ -171,6 +172,7 @@ while (@ARGV && $ARGV[0] =~ /^-(.*)/) { ($target = \&emulator_output), next if /^emulator/; ($target = \&compiler_output), next if /^compiler/; ($outdir = shift), next if /^outdir/; + ($wordsize = shift), next if /^wordsize/; ($verbose = 1), next if /^v/; die "$0: Bad option: -$_\n"; } -- cgit v1.2.3 From c5df89ea0d57e41190155dcf14cbc375dc647bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 19 Oct 2010 16:32:32 +0200 Subject: If the wordsize is 64 bits, pack up to 4 operands into a word In the 32-bit BEAM emulator, it is only possible to pack 3 register operands into one word. Therefore, the move2 instruction (that has 4 operands) needs two words for its operands. Take advantage of the larger wordsize in the 64-bit emulator and pack up to 4 operands into a single word. --- erts/emulator/beam/beam_load.c | 2 +- erts/emulator/utils/beam_makeops | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 73644ecfd6..c190efb0d1 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1765,7 +1765,7 @@ load_code(LoaderState* stp) } stp->specific_op = specific; - CodeNeed(opc[stp->specific_op].sz+2); /* Extra margin for packing */ + CodeNeed(opc[stp->specific_op].sz+16); /* Extra margin for packing */ code[ci++] = BeamOpCode(stp->specific_op); } diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index aa1aba6856..38c2f5bcfe 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -37,12 +37,20 @@ my @pack_mask; $pack_instr[2] = ['6', 'i']; $pack_instr[3] = ['0', '0', 'i']; +$pack_instr[4] = ['6', '6', '6', 'i']; # Only for 64 bit wordsize $pack_shift[2] = ['0', 'BEAM_LOOSE_SHIFT']; $pack_shift[3] = ['0', 'BEAM_TIGHT_SHIFT', '(2*BEAM_TIGHT_SHIFT)']; +$pack_shift[4] = ['0', 'BEAM_LOOSE_SHIFT', # Only for 64 bit wordsize + '(2*BEAM_LOOSE_SHIFT)', + '(3*BEAM_LOOSE_SHIFT)']; $pack_mask[2] = ['BEAM_LOOSE_MASK', $WHOLE_WORD]; $pack_mask[3] = ['BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK', 'BEAM_TIGHT_MASK']; +$pack_mask[4] = ['BEAM_LOOSE_MASK', # Only for 64 bit wordsize + 'BEAM_LOOSE_MASK', + 'BEAM_LOOSE_MASK', + $WHOLE_WORD]; # There are two types of instructions: generic and specific. # The generic instructions are those generated by the Beam compiler. @@ -970,7 +978,14 @@ sub do_pack { # beginning). my($up) = ''; # Pack commands (storing back while # moving forward). - my($args_per_word) = $packable_args < 4 ? $packable_args : 2; + my $args_per_word; + if ($packable_args < 4 or $wordsize == 64) { + $args_per_word = $packable_args; + } else { + # 4 packable argument, 32 bit wordsize. Need 2 words. + $args_per_word = 2; + } + my(@shift) = @{$pack_shift[$args_per_word]}; my(@mask) = @{$pack_mask[$args_per_word]}; my(@pack_instr) = @{$pack_instr[$args_per_word]}; -- cgit v1.2.3 From 32be05dcaa4c32596bfe5372451b0b89ccd2f151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 9 Nov 2010 15:49:06 +0100 Subject: BEAM loader: Pack more instructions using a new 'Q' type Introduce a new 'Q' type, similar to 'P' except that it can be packed. --- erts/emulator/beam/beam_debug.c | 1 + erts/emulator/beam/beam_emu.c | 1 + erts/emulator/beam/beam_load.c | 3 ++- erts/emulator/beam/ops.tab | 18 +++++++++--------- erts/emulator/utils/beam_makeops | 9 ++++++--- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 5ada352202..463d5f3acc 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -525,6 +525,7 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) ap++; break; case 'P': /* Byte offset into tuple (see beam_load.c) */ + case 'Q': /* Like 'P', but packable */ erts_print(to, to_arg, "%d", (*ap / sizeof(Eterm)) - 1); ap++; break; diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 254eba42d0..05afedcc7a 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -344,6 +344,7 @@ extern int count_instructions; #define xb(N) (*(Eterm *) (((unsigned char *)reg) + (N))) #define yb(N) (*(Eterm *) (((unsigned char *)E) + (N))) #define fb(N) (*(double *) (((unsigned char *)&(freg[0].fd)) + (N))) +#define Qb(N) (N) #define x(N) reg[N] #define y(N) E[N] #define r(N) x##N diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index c190efb0d1..8df053ae64 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1929,7 +1929,8 @@ load_code(LoaderState* stp) } code[ci++] = (BeamInstr) stp->import[i].bf; break; - case 'P': /* Byte offset into tuple */ + case 'P': /* Byte offset into tuple or stack */ + case 'Q': /* Like 'P', but packable */ VerifyTag(stp, tag, TAG_u); tmp = tmp_op->a[arg].val; code[ci++] = (BeamInstr) ((tmp_op->a[arg].val+1) * sizeof(Eterm)); diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 8843dafa4b..9e55e2030e 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -464,16 +464,16 @@ move_return n r move S r | deallocate D | return => move_deallocate_return S r D -%macro: move_deallocate_return MoveDeallocateReturn -nonext -move_deallocate_return x r P -move_deallocate_return y r P -move_deallocate_return c r P -move_deallocate_return n r P +%macro: move_deallocate_return MoveDeallocateReturn -pack -nonext +move_deallocate_return x r Q +move_deallocate_return y r Q +move_deallocate_return c r Q +move_deallocate_return n r Q deallocate D | return => deallocate_return D %macro: deallocate_return DeallocateReturn -nonext -deallocate_return P +deallocate_return Q test_heap Need u==1 | put_list Y=y r r => test_heap_1_put_list Need Y @@ -940,11 +940,11 @@ move S r | call_last Ar P=f D => move_call_last S r P D i_move_call_last f P c r -%macro:move_call_last MoveCallLast -arg_f -nonext +%macro:move_call_last MoveCallLast -arg_f -nonext -pack move_call_last/4 -move_call_last x r f P -move_call_last y r f P +move_call_last x r f Q +move_call_last y r f Q move S=c r | call_only Ar P=f => i_move_call_only P S r move S=x r | call_only Ar P=f => move_call_only S r P diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 38c2f5bcfe..ea06a48d29 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -129,7 +129,8 @@ my %arg_size = ('r' => 0, # x(0) - x register zero 't' => 1, # untagged integer -- can be packed 'b' => 1, # pointer to bif 'A' => 1, # arity value - 'P' => 1, # byte offset into tuple + 'P' => 1, # byte offset into tuple or stack + 'Q' => 1, # like 'P', but packable 'h' => 1, # character 'l' => 1, # float reg 'q' => 1, # literal term @@ -168,6 +169,7 @@ my @tag_type; $type_bit{'U'} = $type_bit{'u'}; $type_bit{'e'} = $type_bit{'u'}; $type_bit{'P'} = $type_bit{'u'}; + $type_bit{'Q'} = $type_bit{'u'}; } # @@ -809,6 +811,7 @@ sub basic_generator { 'I' => 1, 't' => 1, 'P' => 1, + 'Q' => 1, ); # Pick up the macro to use and its flags (if any). @@ -959,7 +962,7 @@ sub do_pack { # arguments, packing is not possible. # for ($i = 0; $i < @args; $i++) { - if ($args[$i] =~ /[xyt]/) { + if ($args[$i] =~ /[xytQ]/) { $packable_args++; } elsif ($args[$i] =~ /[sd]/) { return ('', '', @args); @@ -1005,7 +1008,7 @@ sub do_pack { for ($i = 0; $i < @args; $i++) { my($reg) = $args[$i]; my($this_size) = $arg_size{$reg}; - if ($reg =~ /[xyt]/) { + if ($reg =~ /[xytQ]/) { $this_size = 0; $did_some_packing = 1; -- cgit v1.2.3 From 3054e6b85da5822963128061aa0a0201f3f6512e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 9 Nov 2010 16:32:57 +0100 Subject: BEAM loader: Introduce a new move2_xxxx instruction --- erts/emulator/beam/ops.tab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 9e55e2030e..7f4035c4e6 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -250,10 +250,12 @@ move R R => move X1=x Y1=y | move X2=x Y2=y => move2 X1 Y1 X2 Y2 move Y1=y X1=x | move Y2=y X2=x => move2 Y1 X1 Y2 X2 +move X1=x X2=x | move X3=x X4=x => move2 X1 X2 X3 X4 %macro: move2 Move2 -pack move2 x y x y move2 y x y x +move2 x x x x %macro:move Move -pack -gen_dest move x x -- cgit v1.2.3 From 30f8eebe7b74a978de7acdb889b5d9e7a6f19ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 10 Nov 2010 18:43:32 +0100 Subject: Add test for non-matching big number --- erts/emulator/test/beam_literals_SUITE.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 75841adbfc..2238e89748 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -48,6 +48,7 @@ matching_bigs(doc) -> "Test matching of a few big number literals (in Beam," matching_bigs(Config) when is_list(Config) -> a = matching1(3972907842873739), b = matching1(-389789298378939783333333333333333333784), + other = matching1(3141699999999999999999999999999999999), other = matching1(42). matching_smalls(doc) -> "Test matching small numbers (both positive and negative)."; -- cgit v1.2.3 From 21cd0c4f8654286ce8b14157529fcfc916fc209e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 13:49:32 +0100 Subject: Eliminate the special instructions for selecting floats and bignums --- erts/emulator/beam/beam_debug.c | 32 ------- erts/emulator/beam/beam_emu.c | 103 --------------------- erts/emulator/beam/beam_load.c | 190 +++++++++++++++----------------------- erts/emulator/beam/ops.tab | 14 +-- erts/emulator/test/beam_SUITE.erl | 21 ++++- 5 files changed, 101 insertions(+), 259 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 463d5f3acc..9f8d338fbd 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -48,7 +48,6 @@ void dbg_bt(Process* p, Eterm* sp); void dbg_where(BeamInstr* addr, Eterm x0, Eterm* reg); -static void print_big(int to, void *to_arg, Eterm* addr); static int print_op(int to, void *to_arg, int op, int size, BeamInstr* addr); Eterm erts_debug_same_2(Process* p, Eterm term1, Eterm term2) @@ -593,39 +592,8 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; - case op_i_select_big_sf: - while (ap[0]) { - Eterm *bigp = (Eterm *) ap; - int arity = thing_arityval(*bigp); - print_big(to, to_arg, bigp); - size += TermWords(arity+1); - ap += TermWords(arity+1); - erts_print(to, to_arg, " f(" HEXF ") ", ap[0]); - ap++; - size++; - } - ap++; - size++; - break; } erts_print(to, to_arg, "\n"); return size; } - -static void -print_big(int to, void *to_arg, Eterm* addr) -{ - int i; - int k; - - i = BIG_SIZE(addr); - if (BIG_SIGN(addr)) - erts_print(to, to_arg, "-#integer(%d) = {", i); - else - erts_print(to, to_arg, "#integer(%d) = {", i); - erts_print(to, to_arg, "0x%x", BIG_DIGIT(addr, 0)); - for (k = 1; k < i; k++) - erts_print(to, to_arg, ",0x%x", BIG_DIGIT(addr, k)); - erts_print(to, to_arg, "}"); -} diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 05afedcc7a..266b897672 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -2846,109 +2846,6 @@ void process_main(void) Goto(*I); } - OpCase(i_select_big_sf): - { - Eterm* bigp; - Uint arity; - Eterm* given; - Uint given_arity; - Uint given_size; - - GetArg1(0, tmp_arg1); - if (is_big(tmp_arg1)) { - - /* - * The loader has sorted the bignumbers in descending order - * on the arity word. Therefore, we know that the search - * has failed as soon as we encounter an arity word less than - * the arity word of the given number. There is a zero word - * (less than any valid arity word) stored after the last bignumber. - */ - - given = big_val(tmp_arg1); - given_arity = given[0]; - given_size = thing_arityval(given_arity); - bigp = (Eterm *) &Arg(2); - while ((arity = bigp[0]) > given_arity) { - bigp += (TermWords(thing_arityval(arity) + 1) + 1) * (sizeof(BeamInstr)/sizeof(Eterm)); - } - while (bigp[0] == given_arity) { - if (memcmp(bigp+1, given+1, sizeof(Eterm)*given_size) == 0) { - BeamInstr *tmp = - ((BeamInstr *) (UWord) bigp) + TermWords(given_size + 1); - SET_I((BeamInstr *) *tmp); - Goto(*I); - } - bigp += (TermWords(thing_arityval(arity) + 1) + 1) * (sizeof(BeamInstr)/sizeof(Eterm)); - } - } - - /* - * Failed. - */ - - SET_I((BeamInstr *) Arg(1)); - Goto(*I); - } - -#if defined(ARCH_64) && !HALFWORD_HEAP - OpCase(i_select_float_sfI): - { - Uint f; - int n; - struct ValLabel { - Uint f; - BeamInstr* addr; - }; - struct ValLabel* ptr; - - GetArg1(0, tmp_arg1); - ASSERT(is_float(tmp_arg1)); - f = float_val(tmp_arg1)[1]; - n = Arg(2); - ptr = (struct ValLabel *) &Arg(3); - while (n-- > 0) { - if (ptr->f == f) { - SET_I(ptr->addr); - Goto(*I); - } - ptr++; - } - SET_I((Eterm *) Arg(1)); - Goto(*I); - } -#else - OpCase(i_select_float_sfI): - { - Uint fpart1; - Uint fpart2; - int n; - struct ValLabel { - Uint fpart1; - Uint fpart2; - BeamInstr* addr; - }; - struct ValLabel* ptr; - - GetArg1(0, tmp_arg1); - ASSERT(is_float(tmp_arg1)); - fpart1 = float_val(tmp_arg1)[1]; - fpart2 = float_val(tmp_arg1)[2]; - - n = Arg(2); - ptr = (struct ValLabel *) &Arg(3); - while (n-- > 0) { - if (ptr->fpart1 == fpart1 && ptr->fpart2 == fpart2) { - SET_I(ptr->addr); - Goto(*I); - } - ptr++; - } - SET_I((BeamInstr *) Arg(1)); - Goto(*I); - } -#endif - OpCase(set_tuple_element_sdP): { Eterm element; Eterm tuple; diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 8df053ae64..cf87e111db 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -89,13 +89,12 @@ typedef struct { } Label; /* - * Type for a operand for a generic instruction. + * Type for an operand for a generic instruction. */ typedef struct { unsigned type; /* Type of operand. */ - BeamInstr val; /* Value of operand. */ - Uint bigarity; /* Arity for bignumbers (only). */ + BeamInstr val; /* Value of operand. */ } GenOpArg; /* @@ -471,12 +470,14 @@ static int read_code_header(LoaderState* stp); static int load_code(LoaderState* stp); static GenOp* gen_element(LoaderState* stp, GenOpArg Fail, GenOpArg Index, GenOpArg Tuple, GenOpArg Dst); -static GenOp* gen_split_values(LoaderState* stp, GenOpArg S, GenOpArg Fail, +static GenOp* gen_split_values(LoaderState* stp, GenOpArg S, + GenOpArg TypeFail, GenOpArg Fail, GenOpArg Size, GenOpArg* Rest); static GenOp* gen_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, GenOpArg Size, GenOpArg* Rest); -static GenOp* gen_select_big(LoaderState* stp, GenOpArg S, GenOpArg Fail, - GenOpArg Size, GenOpArg* Rest); +static GenOp* gen_select_literals(LoaderState* stp, GenOpArg S, + GenOpArg Fail, GenOpArg Size, + GenOpArg* Rest); static GenOp* const_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, GenOpArg Size, GenOpArg* Rest); static GenOp* gen_func_info(LoaderState* stp, GenOpArg mod, GenOpArg Func, @@ -1972,56 +1973,6 @@ load_code(LoaderState* stp) stp->labels[tmp_op->a[arg].val].patches = ci; ci++; break; - case TAG_q: - { - Eterm lit; - - lit = stp->literals[tmp_op->a[arg].val].term; - if (is_big(lit)) { - Eterm* bigp; - Eterm *tmp; - Uint size; - Uint term_size; - - bigp = big_val(lit); - term_size = bignum_header_arity(*bigp); - size = TermWords(term_size + 1); - CodeNeed(size); - tmp = (Eterm *) (code + ci); - *tmp++ = *bigp++; - while (term_size-- > 0) { - *tmp++ = *bigp++; - } - ci +=size; - } else if (is_float(lit)) { -#if defined(ARCH_64) && !HALFWORD_HEAP - CodeNeed(1); - code[ci++] = float_val(stp->literals[tmp_op->a[arg].val].term)[1]; -#elif HALFWORD_HEAP - Eterm* fptr; - Uint size; - Eterm *tmp; - - fptr = float_val(stp->literals[tmp_op->a[arg].val].term)+1; - size = TermWords(2); - CodeNeed(size); - tmp = (Eterm *) (code + ci); - *tmp++ = *fptr++; - *tmp = *fptr; - ci += size; -#else - Eterm* fptr; - - fptr = float_val(stp->literals[tmp_op->a[arg].val].term)+1; - CodeNeed(2); - code[ci++] = *fptr++; - code[ci++] = *fptr; -#endif - } else { - LoadError0(stp, "literal is neither float nor big"); - } - } - break; default: LoadError1(stp, "unsupported primitive type '%c'", tag_to_letter[tmp_op->a[arg].type]); @@ -2233,11 +2184,12 @@ use_jump_tab(LoaderState* stp, GenOpArg Size, GenOpArg* Rest) } /* - * Predicate to test whether all values in a table are big numbers. + * Predicate to test whether all values in a table are either + * floats or bignums. */ static int -all_values_are_big(LoaderState* stp, GenOpArg Size, GenOpArg* Rest) +floats_or_bignums(LoaderState* stp, GenOpArg Size, GenOpArg* Rest) { int i; @@ -2249,9 +2201,6 @@ all_values_are_big(LoaderState* stp, GenOpArg Size, GenOpArg* Rest) if (Rest[i].type != TAG_q) { return 0; } - if (is_not_big(stp->literals[Rest[i].val].term)) { - return 0; - } if (Rest[i+1].type != TAG_f) { return 0; } @@ -3001,18 +2950,24 @@ gen_select_tuple_arity(LoaderState* stp, GenOpArg S, GenOpArg Fail, */ static GenOp* -gen_split_values(LoaderState* stp, GenOpArg S, GenOpArg Fail, - GenOpArg Size, GenOpArg* Rest) +gen_split_values(LoaderState* stp, GenOpArg S, GenOpArg TypeFail, + GenOpArg Fail, GenOpArg Size, GenOpArg* Rest) { GenOp* op1; GenOp* op2; GenOp* label; - Uint type; + GenOp* is_integer; int i; ASSERT(Size.val >= 2 && Size.val % 2 == 0); + NEW_GENOP(stp, is_integer); + is_integer->op = genop_is_integer_2; + is_integer->arity = 2; + is_integer->a[0] = TypeFail; + is_integer->a[1] = S; + NEW_GENOP(stp, label); label->op = genop_label_1; label->arity = 1; @@ -3038,15 +2993,13 @@ gen_split_values(LoaderState* stp, GenOpArg S, GenOpArg Fail, op2->a[2].type = TAG_u; op2->a[2].val = 0; - op1->next = label; - label->next = op2; - op2->next = NULL; - - type = Rest[0].type; + /* + * Split the list. + */ ASSERT(Size.type == TAG_u); for (i = 0; i < Size.val; i += 2) { - GenOp* op = (Rest[i].type == type) ? op1 : op2; + GenOp* op = (Rest[i].type == TAG_q) ? op2 : op1; int dst = 3 + op->a[2].val; ASSERT(Rest[i+1].type == TAG_f); @@ -3055,13 +3008,36 @@ gen_split_values(LoaderState* stp, GenOpArg S, GenOpArg Fail, op->arity += 2; op->a[2].val += 2; } + ASSERT(op1->a[2].val > 0); + ASSERT(op2->a[2].val > 0); /* - * None of the instructions should have zero elements in the list. + * Order the instruction sequence appropriately. */ - ASSERT(op1->a[2].val > 0); - ASSERT(op2->a[2].val > 0); + if (TypeFail.val == Fail.val) { + /* + * select_val L1 S ... (small numbers) + * label L1 + * is_integer Fail S + * select_val Fail S ... (bignums) + */ + op1->next = label; + label->next = is_integer; + is_integer->next = op2; + } else { + /* + * is_integer TypeFail S + * select_val L1 S ... (small numbers) + * label L1 + * select_val Fail S ... (bignums) + */ + is_integer->next = op1; + op1->next = label; + label->next = op2; + op1 = is_integer; + } + op2->next = NULL; return op1; } @@ -3154,8 +3130,9 @@ genopargcompare(GenOpArg* a, GenOpArg* b) } /* - * Generate a select_val instruction. We know that a jump table is not suitable, - * and that all values are of the same type (integer, atoms, floats; never bignums). + * Generate a select_val instruction. We know that a jump table + * is not suitable, and that all values are of the same type + * (integer or atoms). */ static GenOp* @@ -3169,12 +3146,7 @@ gen_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, NEW_GENOP(stp, op); op->next = NULL; - if (Rest[0].type != TAG_q) { - op->op = genop_i_select_val_3; - } else { - ASSERT(is_float(stp->literals[Rest[0].val].term)); - op->op = genop_i_select_float_3; - } + op->op = genop_i_select_val_3; GENOP_ARITY(op, arity); op->a[0] = S; op->a[1] = Fail; @@ -3199,54 +3171,40 @@ gen_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, return op; } -/* - * Compare function for qsort(). - */ - -static int -genbigcompare(GenOpArg* a, GenOpArg* b) -{ - int val = (int)(b->bigarity - a->bigarity); - - return val != 0 ? val : ((int) (a->val - b->val)); -} - /* * Generate a select_val instruction for big numbers. */ static GenOp* -gen_select_big(LoaderState* stp, GenOpArg S, GenOpArg Fail, +gen_select_literals(LoaderState* stp, GenOpArg S, GenOpArg Fail, GenOpArg Size, GenOpArg* Rest) { GenOp* op; - int arity = Size.val + 2 + 1; - int size = Size.val / 2; + GenOp* jump; + GenOp** prev_next = &op; + int i; - NEW_GENOP(stp, op); - op->next = NULL; - op->op = genop_i_select_big_2; - GENOP_ARITY(op, arity); - op->a[0] = S; - op->a[1] = Fail; for (i = 0; i < Size.val; i += 2) { + GenOp* op; ASSERT(Rest[i].type == TAG_q); - op->a[i+2] = Rest[i]; - op->a[i+2].bigarity = *big_val(stp->literals[op->a[i+2].val].term); - op->a[i+3] = Rest[i+1]; - } - ASSERT(i+2 == arity-1); - op->a[arity-1].type = TAG_u; - op->a[arity-1].val = 0; - - /* - * Sort the values in descending arity order. - */ - - qsort(op->a+2, size, 2*sizeof(GenOpArg), - (int (*)(const void *, const void *)) genbigcompare); + NEW_GENOP(stp, op); + op->op = genop_is_ne_exact_3; + op->arity = 3; + op->a[0] = Rest[i+1]; + op->a[1] = S; + op->a[2] = Rest[i]; + *prev_next = op; + prev_next = &op->next; + } + + NEW_GENOP(stp, jump); + jump->next = NULL; + jump->op = genop_jump_1; + jump->arity = 1; + jump->a[0] = Fail; + *prev_next = jump; return op; } diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 7f4035c4e6..2d89926bc5 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -132,8 +132,12 @@ select_val S=s Fail=f Size=u Rest=* | use_jump_tab(Size, Rest) => \ is_integer Fail=f S | select_val S=s Fail=f Size=u Rest=* | use_jump_tab(Size, Rest) => \ gen_jump_tab(S, Fail, Size, Rest) +is_integer TypeFail=f S | select_val S=s Fail=f Size=u Rest=* | \ + mixed_types(Size, Rest) => \ + gen_split_values(S, TypeFail, Fail, Size, Rest) + select_val S=s Fail=f Size=u Rest=* | mixed_types(Size, Rest) => \ - gen_split_values(S, Fail, Size, Rest) + gen_split_values(S, Fail, Fail, Size, Rest) is_integer Fail=f S | select_val S=s Fail=f Size=u Rest=* | \ fixed_size_values(Size, Rest) => gen_select_val(S, Fail, Size, Rest) @@ -141,12 +145,12 @@ is_integer Fail=f S | select_val S=s Fail=f Size=u Rest=* | \ is_atom Fail=f S | select_val S=s Fail=f Size=u Rest=* | \ fixed_size_values(Size, Rest) => gen_select_val(S, Fail, Size, Rest) +select_val S=s Fail=f Size=u Rest=* | floats_or_bignums(Size, Rest) => \ + gen_select_literals(S, Fail, Size, Rest) + select_val S=s Fail=f Size=u Rest=* | fixed_size_values(Size, Rest) => \ gen_select_val(S, Fail, Size, Rest) -select_val S=s Fail=f Size=u Rest=* | all_values_are_big(Size, Rest) => \ - gen_select_big(S, Fail, Size, Rest) - is_tuple Fail=f S | select_tuple_arity S=s Fail=f Size=u Rest=* => \ gen_select_tuple_arity(S, Fail, Size, Rest) @@ -155,8 +159,6 @@ select_tuple_arity S=s Fail=f Size=u Rest=* => \ i_select_val s f I i_select_tuple_arity s f I -i_select_big s f -i_select_float s f I i_jump_on_val_zero s f I i_jump_on_val s f I I diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 228ff15341..32ac07cb2d 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -20,7 +20,8 @@ -module(beam_SUITE). -export([all/1, packed_registers/1, apply_last/1, apply_last_bif/1, - buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1]). + buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1, + select_val/1]). -export([applied/2]). @@ -28,7 +29,7 @@ all(suite) -> [packed_registers, apply_last, apply_last_bif, buildo_mucho, - heap_sizes, big_lists]. + heap_sizes, big_lists, select_val]. %% Verify that apply(M, F, A) is really tail recursive. @@ -302,3 +303,19 @@ do_fconv(nil, Float) when is_float(Float) -> Float + []; do_fconv(tuple_literal, Float) when is_float(Float) -> Float + {a,b}. + +select_val(Config) when is_list(Config) -> + ?line zero = do_select_val(0), + ?line big = do_select_val(1 bsl 64), + ?line integer = do_select_val(42), + ok. + +do_select_val(X) -> + case X of + 0 -> + zero; + 1 bsl 64 -> + big; + Int when is_integer(Int) -> + integer + end. -- cgit v1.2.3 From d734f64cc5b4e8b906f0d4f1b28f67c492a05bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 12:18:50 +0100 Subject: Eliminate redundant jump instructions --- erts/emulator/beam/beam_load.c | 8 ++++++++ erts/emulator/beam/ops.tab | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index cf87e111db..65cd6f91bb 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2260,6 +2260,14 @@ mixed_types(LoaderState* stp, GenOpArg Size, GenOpArg* Rest) return 0; } +static int +same_label(LoaderState* stp, GenOpArg Target, GenOpArg Label) +{ + return Target.type = TAG_f && Label.type == TAG_u && + Target.val == Label.val; +} + + /* * Generate an instruction for element/2. */ diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 2d89926bc5..81be97fd1e 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -163,6 +163,11 @@ i_select_tuple_arity s f I i_jump_on_val_zero s f I i_jump_on_val s f I I +jump Target | label Lbl | same_label(Target, Lbl) => label Lbl + +is_ne_exact L1 S1 S2 | jump Fail | label L2 | same_label(L1, L2) => \ + is_eq_exact Fail S1 S2 | label L2 + %macro: get_list GetList -pack get_list x x x get_list x x y -- cgit v1.2.3 From 4d6e7ac0aa307271e0b265dd41dea4eb0fc1dee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 14 Dec 2010 06:35:54 +0100 Subject: beam_makeops: Refactor packing code to facilitate extensions We don't want the packable types listed in two places. --- erts/emulator/utils/beam_makeops | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index ea06a48d29..00bddd2548 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -954,18 +954,21 @@ sub basic_generator { sub do_pack { my(@args) = @_; - my($i); my($packable_args) = 0; + my @is_packable; # Packability (boolean) for each argument. # # Count the number of packable arguments. If we encounter any 's' or 'd' # arguments, packing is not possible. # - for ($i = 0; $i < @args; $i++) { - if ($args[$i] =~ /[xytQ]/) { + foreach my $arg (@args) { + if ($arg =~ /^[xytQ]/) { $packable_args++; - } elsif ($args[$i] =~ /[sd]/) { + push @is_packable, 1; + } elsif ($arg =~ /^[sd]/) { return ('', '', @args); + } else { + push @is_packable, 0; } } @@ -1005,10 +1008,10 @@ sub do_pack { my($ap) = 0; # Argument number within word. my($tmpnum) = 1; # Number of temporary variable. my($expr) = ''; - for ($i = 0; $i < @args; $i++) { + for (my $i = 0; $i < @args; $i++) { my($reg) = $args[$i]; my($this_size) = $arg_size{$reg}; - if ($reg =~ /[xytQ]/) { + if ($is_packable[$i]) { $this_size = 0; $did_some_packing = 1; -- cgit v1.2.3 From 56da36ef79a1c7ffb39836e1838084ed53dda6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 14 Dec 2010 07:23:19 +0100 Subject: Support packing of the 'I' type in a 64-bit emulator In many (not all) cases, the value for the 'I' type will fit into 32 bits. --- erts/emulator/beam/beam_debug.c | 6 ++++++ erts/emulator/beam/beam_emu.c | 1 + erts/emulator/beam/beam_load.c | 5 +++++ erts/emulator/utils/beam_makeops | 32 +++++++++++++++++++++++++++----- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 9f8d338fbd..4fa9d60bca 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -378,6 +378,12 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) *ap++ = packed & BEAM_LOOSE_MASK; packed >>= BEAM_LOOSE_SHIFT; break; +#ifdef ARCH_64 + case 'w': /* Shift 32 steps */ + *ap++ = packed & BEAM_WIDE_MASK; + packed >>= BEAM_WIDE_SHIFT; + break; +#endif case 'p': *sp++ = *--ap; break; diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 266b897672..bce51a001f 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -345,6 +345,7 @@ extern int count_instructions; #define yb(N) (*(Eterm *) (((unsigned char *)E) + (N))) #define fb(N) (*(double *) (((unsigned char *)&(freg[0].fd)) + (N))) #define Qb(N) (N) +#define Ib(N) (N) #define x(N) reg[N] #define y(N) E[N] #define r(N) x##N diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 65cd6f91bb..8c380536ae 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2002,6 +2002,11 @@ load_code(LoaderState* stp) case '6': /* Shift 16 steps */ packed = (packed << BEAM_LOOSE_SHIFT) | code[--ci]; break; +#ifdef ARCH_64 + case 'w': /* Shift 32 steps */ + packed = (packed << BEAM_WIDE_SHIFT) | code[--ci]; + break; +#endif case 'p': /* Put instruction (from stack). */ code[ci++] = *--sp; break; diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 00bddd2548..cf18ea4a92 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -513,12 +513,14 @@ sub emulator_output { print "#define NUM_SPECIFIC_OPS ", scalar(@op_to_name), "\n"; print "\n"; print "#ifdef ARCH_64\n"; + print "# define BEAM_WIDE_MASK 0xFFFFUL\n"; print "# define BEAM_LOOSE_MASK 0x1FFFUL\n"; print "#if HALFWORD_HEAP\n"; print "# define BEAM_TIGHT_MASK 0x1FFCUL\n"; print "#else\n"; print "# define BEAM_TIGHT_MASK 0x1FF8UL\n"; print "#endif\n"; + print "# define BEAM_WIDE_SHIFT 32\n"; print "# define BEAM_LOOSE_SHIFT 16\n"; print "# define BEAM_TIGHT_SHIFT 16\n"; print "#else\n"; @@ -956,15 +958,25 @@ sub do_pack { my(@args) = @_; my($packable_args) = 0; my @is_packable; # Packability (boolean) for each argument. + my $wide_packing = 0; # # Count the number of packable arguments. If we encounter any 's' or 'd' # arguments, packing is not possible. # + my $packable_types = "xytQ"; foreach my $arg (@args) { - if ($arg =~ /^[xytQ]/) { + if ($arg =~ /^[$packable_types]/) { $packable_args++; push @is_packable, 1; + } elsif ($arg =~ /^I/ and $wordsize == 64 and $packable_args < 2) { + $wide_packing = 1; + push @is_packable, 1; + if (++$packable_args == 2) { + # We can only pack two arguments. Turn off packing + # for the rest of the arguments. + $packable_types = "\xFF"; + } } elsif ($arg =~ /^[sd]/) { return ('', '', @args); } else { @@ -992,9 +1004,19 @@ sub do_pack { $args_per_word = 2; } - my(@shift) = @{$pack_shift[$args_per_word]}; - my(@mask) = @{$pack_mask[$args_per_word]}; - my(@pack_instr) = @{$pack_instr[$args_per_word]}; + my @shift; + my @mask; + my @instr; + + if ($wide_packing) { + @shift = ('0', 'BEAM_WIDE_SHIFT'); + @mask = ('BEAM_WIDE_MASK', $WHOLE_WORD); + @instr = ('w', 'i'); + } else { + @shift = @{$pack_shift[$args_per_word]}; + @mask = @{$pack_mask[$args_per_word]}; + @instr = @{$pack_instr[$args_per_word]}; + } # # Now generate the packing instructions. One complication is that @@ -1022,7 +1044,7 @@ sub do_pack { $this_size = 1; } - $down = "$pack_instr[$ap]$down"; + $down = "$instr[$ap]$down"; my($unpack) = &make_unpack($tmpnum, $shift[$ap], $mask[$ap]); $args[$i] = "pack:$this_size:$reg" . "b($unpack)"; -- cgit v1.2.3 From 33aca759679ed65ad5addebbdc8f2ad8929125a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 14 Dec 2010 07:49:13 +0100 Subject: Allow packing of some more instructions --- erts/emulator/beam/beam_emu.c | 17 +++++++---------- erts/emulator/beam/ops.tab | 17 +++++++++-------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index bce51a001f..82925fda2c 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -474,6 +474,13 @@ extern int count_instructions; HEAP_SPACE_VERIFIED(need); \ } while (0) +#define TestHeapPutList(Need, Reg) \ + do { \ + TestHeap((Need), 1); \ + PutList(Reg, r(0), r(0), StoreSimpleDest); \ + CHECK_TERM(r(0)); \ + } while (0) + #ifdef HYBRID #ifdef INCREMENTAL #define TestGlobalHeap(Nh, Live, hp) \ @@ -1407,16 +1414,6 @@ void process_main(void) Goto(*I); } - OpCase(test_heap_1_put_list_Iy): { - BeamInstr *next; - - PreFetch(2, next); - TestHeap(Arg(0), 1); - PutList(yb(Arg(1)), r(0), r(0), StoreSimpleDest); - CHECK_TERM(r(0)); - NextPF(2, next); - } - /* * Send is almost a standard call-BIF with two arguments, except for: * 1) It cannot be traced. diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 81be97fd1e..4546f056a9 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -101,16 +101,16 @@ return %macro: test_heap TestHeap -pack allocate t t -allocate_heap I I I +allocate_heap t I t deallocate I init y allocate_zero t t -allocate_heap_zero I I I +allocate_heap_zero t I t trim N Remaining => i_trim N i_trim I -test_heap I I +test_heap I t allocate_heap S u==0 R => allocate S R allocate_heap_zero S u==0 R => allocate_zero S R @@ -486,6 +486,7 @@ deallocate_return Q test_heap Need u==1 | put_list Y=y r r => test_heap_1_put_list Need Y +%macro: test_heap_1_put_list TestHeapPutList -pack test_heap_1_put_list I y # Test tuple & arity (head) @@ -585,14 +586,14 @@ is_list f y is_nonempty_list Fail=f S=rx | allocate Need Rs => is_nonempty_list_allocate Fail S Need Rs -%macro:is_nonempty_list_allocate IsNonemptyListAllocate -fail_action -is_nonempty_list_allocate f x I I -is_nonempty_list_allocate f r I I +%macro:is_nonempty_list_allocate IsNonemptyListAllocate -fail_action -pack +is_nonempty_list_allocate f x I t +is_nonempty_list_allocate f r I t is_nonempty_list F=f r | test_heap I1 I2 => is_non_empty_list_test_heap F r I1 I2 -%macro: is_non_empty_list_test_heap IsNonemptyListTestHeap -fail_action -is_non_empty_list_test_heap f r I I +%macro: is_non_empty_list_test_heap IsNonemptyListTestHeap -fail_action -pack +is_non_empty_list_test_heap f r I t %macro: is_nonempty_list IsNonemptyList -fail_action is_nonempty_list f x -- cgit v1.2.3 From 9cea01fb88b0e18e387b08fa3e6273dbf1f76082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 17 Dec 2010 10:58:54 +0100 Subject: beam_load: Run the packing engine before loading list arguments --- erts/emulator/beam/beam_load.c | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 8c380536ae..bc6186751e 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1951,34 +1951,6 @@ load_code(LoaderState* stp) arg++; } - /* - * Load any list arguments using the primitive tags. - */ - - for ( ; arg < tmp_op->arity; arg++) { - switch (tmp_op->a[arg].type) { - case TAG_i: - CodeNeed(1); - code[ci++] = make_small(tmp_op->a[arg].val); - break; - case TAG_u: - case TAG_a: - case TAG_v: - CodeNeed(1); - code[ci++] = tmp_op->a[arg].val; - break; - case TAG_f: - CodeNeed(1); - code[ci] = stp->labels[tmp_op->a[arg].val].patches; - stp->labels[tmp_op->a[arg].val].patches = ci; - ci++; - break; - default: - LoadError1(stp, "unsupported primitive type '%c'", - tag_to_letter[tmp_op->a[arg].type]); - } - } - /* * The packing engine. */ @@ -2021,6 +1993,34 @@ load_code(LoaderState* stp) ASSERT(sp == stack); /* Incorrect program? */ } + /* + * Load any list arguments using the primitive tags. + */ + + for ( ; arg < tmp_op->arity; arg++) { + switch (tmp_op->a[arg].type) { + case TAG_i: + CodeNeed(1); + code[ci++] = make_small(tmp_op->a[arg].val); + break; + case TAG_u: + case TAG_a: + case TAG_v: + CodeNeed(1); + code[ci++] = tmp_op->a[arg].val; + break; + case TAG_f: + CodeNeed(1); + code[ci] = stp->labels[tmp_op->a[arg].val].patches; + stp->labels[tmp_op->a[arg].val].patches = ci; + ci++; + break; + default: + LoadError1(stp, "unsupported primitive type '%c'", + tag_to_letter[tmp_op->a[arg].type]); + } + } + /* * Handle a few special cases. */ -- cgit v1.2.3 From e4a4632ed173f22642a2b67316b6decbc91b2a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 17 Dec 2010 11:13:55 +0100 Subject: beam_makeops: Support jumping to common code from an instruction macro --- erts/emulator/utils/beam_makeops | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index cf18ea4a92..e7c57142c0 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -938,6 +938,14 @@ sub basic_generator { "{ $var_decls", $macro_code, "}"); + } elsif ($flags =~ /-goto:(\S*)/) { + my $goto = $1; + $code = join("\n", + "{ $var_decls", + $macro_code, + "I += $size + 1;", + "goto $goto;", + "}"); } else { $code = join("\n", "{ $var_decls", -- cgit v1.2.3 From 824a481d5f38c748cd6efcb83cba0b8d26b88768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 08:23:55 +0100 Subject: Optimize creation of tuples Combine the put_tuple/2 and all following put/1 instructions to one i_put_tuple/2 instruction. In general, that will reduce the number of instruction words by 50 percent. Measurements seem to indicate that the speed is about the same. --- erts/emulator/beam/beam_debug.c | 28 ++++++++++++++++ erts/emulator/beam/beam_emu.c | 42 ++++++++++++++++++----- erts/emulator/beam/beam_load.c | 74 +++++++++++++++++++++++++++++++++++++++++ erts/emulator/beam/ops.tab | 39 ++++++++-------------- 4 files changed, 149 insertions(+), 34 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 4fa9d60bca..6c16c24d0d 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -330,6 +330,7 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) BeamInstr packed = 0; /* Accumulator for packed operations. */ BeamInstr args[8]; /* Arguments for this instruction. */ BeamInstr* ap; /* Pointer to arguments. */ + BeamInstr* unpacked; /* Unpacked arguments */ start_prog = opc[op].pack; @@ -551,6 +552,7 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) * Print more information about certain instructions. */ + unpacked = ap; ap = addr + size; switch (op) { case op_i_select_val_sfI: @@ -598,6 +600,32 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; + case op_i_put_tuple_rI: + case op_i_put_tuple_xI: + case op_i_put_tuple_yI: + { + int n = unpacked[-1]; + + while (n > 0) { + if (!is_header(ap[0])) { + erts_print(to, to_arg, " %T", (Eterm) ap[0]); + } else { + switch ((ap[0] >> 2) & 0x03) { + case R_REG_DEF: + erts_print(to, to_arg, " x(0)"); + break; + case X_REG_DEF: + erts_print(to, to_arg, " x(%d)", ap[0] >> 4); + break; + case Y_REG_DEF: + erts_print(to, to_arg, " y(%d)", ap[0] >> 4); + break; + } + } + ap++, size++, n--; + } + } + break; } erts_print(to, to_arg, "\n"); diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 82925fda2c..e36ac1f1e6 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -525,6 +525,11 @@ extern int count_instructions; SWAPIN; \ } while (0) +#define PutTuple(Dst, Arity) \ + do { \ + Dst = make_tuple(HTOP); \ + pt_arity = (Arity); \ + } while (0) /* * Check that we haven't used the reductions and jump to function pointed to by @@ -732,15 +737,6 @@ extern int count_instructions; (Dest) = (* (Eterm *) EXPAND_POINTER(tmp_arg1)); \ } while (0) -#define PutTuple(Arity, Src, Dest) \ - ASSERT(is_arity_value(Arity)); \ - Dest = make_tuple(HTOP); \ - HTOP[0] = (Arity); \ - HTOP[1] = (Src); \ - HTOP += 2 - -#define Put(Word) *HTOP++ = (Word) - #define EqualImmed(X, Y, Action) if (X != Y) { Action; } #define IsFloat(Src, Fail) if (is_not_float(Src)) { Fail; } @@ -1155,6 +1151,8 @@ void process_main(void) Uint temp_bits; /* Temporary used by BsSkipBits2 & BsGetInteger2 */ + Eterm pt_arity; /* Used by do_put_tuple */ + ERL_BITS_DECLARE_STATEP; /* Has to be last declaration */ @@ -1924,6 +1922,32 @@ void process_main(void) Goto(*I); } + do_put_tuple: { + Eterm* hp = HTOP; + + *hp++ = make_arityval(pt_arity); + + do { + Eterm term = *I++; + switch (term & _TAG_IMMED1_MASK) { + case (R_REG_DEF << _TAG_PRIMARY_SIZE) | TAG_PRIMARY_HEADER: + *hp++ = r(0); + break; + case (X_REG_DEF << _TAG_PRIMARY_SIZE) | TAG_PRIMARY_HEADER: + *hp++ = x(term >> _TAG_IMMED1_SIZE); + break; + case (Y_REG_DEF << _TAG_PRIMARY_SIZE) | TAG_PRIMARY_HEADER: + *hp++ = y(term >> _TAG_IMMED1_SIZE); + break; + default: + *hp++ = term; + break; + } + } while (--pt_arity != 0); + HTOP = hp; + Goto(*I); + } + /* * All guards with zero arguments have special instructions: * self/0 diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index bc6186751e..a476e439ca 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2015,6 +2015,30 @@ load_code(LoaderState* stp) stp->labels[tmp_op->a[arg].val].patches = ci; ci++; break; + case TAG_r: + CodeNeed(1); + code[ci++] = (R_REG_DEF << _TAG_PRIMARY_SIZE) | + TAG_PRIMARY_HEADER; + break; + case TAG_x: + CodeNeed(1); + code[ci++] = (tmp_op->a[arg].val << _TAG_IMMED1_SIZE) | + (X_REG_DEF << _TAG_PRIMARY_SIZE) | TAG_PRIMARY_HEADER; + break; + case TAG_y: + CodeNeed(1); + code[ci++] = (tmp_op->a[arg].val << _TAG_IMMED1_SIZE) | + (Y_REG_DEF << _TAG_PRIMARY_SIZE) | TAG_PRIMARY_HEADER; + break; + case TAG_n: + CodeNeed(1); + code[ci++] = NIL; + break; + case TAG_q: + CodeNeed(1); + new_literal_patch(stp, ci); + code[ci++] = tmp_op->a[arg].val; + break; default: LoadError1(stp, "unsupported primitive type '%c'", tag_to_letter[tmp_op->a[arg].type]); @@ -3440,6 +3464,56 @@ gen_guard_bif3(LoaderState* stp, GenOpArg Fail, GenOpArg Live, GenOpArg Bif, return op; } +static GenOp* +tuple_append_put5(LoaderState* stp, GenOpArg Arity, GenOpArg Dst, + GenOpArg* Puts, GenOpArg S1, GenOpArg S2, GenOpArg S3, + GenOpArg S4, GenOpArg S5) +{ + GenOp* op; + int arity = Arity.val; /* Arity of tuple, not the instruction */ + int i; + + NEW_GENOP(stp, op); + op->next = NULL; + GENOP_ARITY(op, arity+2+5); + op->op = genop_i_put_tuple_2; + op->a[0] = Dst; + op->a[1].type = TAG_u; + op->a[1].val = arity + 5; + for (i = 0; i < arity; i++) { + op->a[i+2] = Puts[i]; + } + op->a[arity+2] = S1; + op->a[arity+3] = S2; + op->a[arity+4] = S3; + op->a[arity+5] = S4; + op->a[arity+6] = S5; + return op; +} + +static GenOp* +tuple_append_put(LoaderState* stp, GenOpArg Arity, GenOpArg Dst, + GenOpArg* Puts, GenOpArg S) +{ + GenOp* op; + int arity = Arity.val; /* Arity of tuple, not the instruction */ + int i; + + NEW_GENOP(stp, op); + op->next = NULL; + GENOP_ARITY(op, arity+2+1); + op->op = genop_i_put_tuple_2; + op->a[0] = Dst; + op->a[1].type = TAG_u; + op->a[1].val = arity + 1; + for (i = 0; i < arity; i++) { + op->a[i+2] = Puts[i]; + } + op->a[arity+2] = S; + return op; +} + + /* * Freeze the code in memory, move the string table into place, diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 4546f056a9..f629cc80b6 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -345,25 +345,21 @@ i_is_eq_immed f y c # Putting things. # -put_tuple Arity Dst | put V => i_put_tuple Arity V Dst - -%macro: i_put_tuple PutTuple -pack -i_put_tuple A x x -i_put_tuple A y x -i_put_tuple A r x -i_put_tuple A n x -i_put_tuple A c x -i_put_tuple A x y -i_put_tuple A x r -i_put_tuple A y r -i_put_tuple A n r -i_put_tuple A c r +put_tuple Arity Dst => i_put_tuple Dst u -%cold -i_put_tuple A r y -i_put_tuple A y y -i_put_tuple A c y -%hot +i_put_tuple Dst Arity Puts=* | put S1 | put S2 | \ + put S3 | put S4 | put S5 => \ + tuple_append_put5(Arity, Dst, Puts, S1, S2, S3, S4, S5) + +i_put_tuple Dst Arity Puts=* | put S => \ + tuple_append_put(Arity, Dst, Puts, S) + +i_put_tuple/2 + +%macro:i_put_tuple PutTuple -pack -goto:do_put_tuple +i_put_tuple r I +i_put_tuple x I +i_put_tuple y I %macro:put_list PutList -pack -gen_dest @@ -416,13 +412,6 @@ put_list x r r put_list s s d %hot -%macro: put Put -put x -put r -put y -put c -put n - %macro: i_fetch FetchArgs -pack i_fetch c c i_fetch c r -- cgit v1.2.3 From 4d05097ec97cc18c795ffee83d1d08d396e16814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 11 Nov 2010 19:01:22 +0100 Subject: Simplify a select_val instruction that selects only one value The compiler does not generate select_val instructions that only selects one value, but the loader may previously have created such an instruction when it splitted a select_val instruction that selected on bignums. --- erts/emulator/beam/beam_load.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index a476e439ca..73f057929e 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3095,6 +3095,29 @@ gen_jump_tab(LoaderState* stp, GenOpArg S, GenOpArg Fail, GenOpArg Size, GenOpAr ASSERT(Size.val >= 2 && Size.val % 2 == 0); + /* + * If there is only one choice, don't generate a jump table. + */ + if (Size.val == 2) { + GenOp* jump; + + NEW_GENOP(stp, op); + op->arity = 3; + op->op = genop_is_ne_exact_3; + op->a[0] = Rest[1]; + op->a[1] = S; + op->a[2] = Rest[0]; + + NEW_GENOP(stp, jump); + jump->next = NULL; + jump->arity = 1; + jump->op = genop_jump_1; + jump->a[0] = Fail; + + op->next = jump; + return op; + } + /* * Calculate the minimum and maximum values and size of jump table. */ -- cgit v1.2.3 From a3981bb0d5742098e484e49661b7f378f18069d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Dec 2010 06:55:37 +0100 Subject: beam_emu: Clean up calling of the error_handler module There were two separate functions (call_error_handler() and call_breakpoint_handler()) that were identical except for the name of the function in the error_handler module being called. Generalize call_error_handler() by adding a function name argument so that it can be used for both purposes. Also let the call_error_handler() return the new program counter instead of passing it in c_p->i. That slightly decrease the code size at the call site. There is also no need to use the Dispatch() macro to yet again decrease the reduction counter, because that has just been done by the call instruction that caused the execution of the call_error_handler or i_debug_breakpoint instruction. --- erts/emulator/beam/beam_emu.c | 79 +++++++------------------------------------ 1 file changed, 13 insertions(+), 66 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index e36ac1f1e6..2f90f67351 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -998,8 +998,8 @@ static void save_stacktrace(Process* c_p, BeamInstr* pc, Eterm* reg, BifFunction bf, Eterm args); static struct StackTrace * get_trace_from_exc(Eterm exc); static Eterm make_arglist(Process* c_p, Eterm* reg, int a); -static Eterm call_error_handler(Process* p, BeamInstr* ip, Eterm* reg); -static Eterm call_breakpoint_handler(Process* p, BeamInstr* fi, Eterm* reg); +static BeamInstr* call_error_handler(Process* p, BeamInstr* ip, + Eterm* reg, Eterm func); static BeamInstr* fixed_apply(Process* p, Eterm* reg, Uint arity); static BeamInstr* apply(Process* p, Eterm module, Eterm function, Eterm args, Eterm* reg); @@ -2976,12 +2976,11 @@ void process_main(void) */ SWAPOUT; reg[0] = r(0); - tmp_arg1 = call_error_handler(c_p, I-3, reg); + I = call_error_handler(c_p, I-3, reg, am_undefined_function); r(0) = reg[0]; SWAPIN; - if (tmp_arg1) { - SET_I(c_p->i); - Dispatch(); + if (I) { + Goto(*I); } /* Fall through */ @@ -4884,12 +4883,11 @@ apply_bif_or_nif_epilogue: OpCase(i_debug_breakpoint): { SWAPOUT; reg[0] = r(0); - tmp_arg1 = call_breakpoint_handler(c_p, I-3, reg); + I = call_error_handler(c_p, I-3, reg, am_breakpoint); r(0) = reg[0]; SWAPIN; - if (tmp_arg1) { - SET_I(c_p->i); - Dispatch(); + if (I) { + Goto(*I); } goto no_error_handler; } @@ -5639,8 +5637,8 @@ build_stacktrace(Process* c_p, Eterm exc) { } -static Eterm -call_error_handler(Process* p, BeamInstr* fi, Eterm* reg) +static BeamInstr* +call_error_handler(Process* p, BeamInstr* fi, Eterm* reg, Eterm func) { Eterm* hp; Export* ep; @@ -5652,62 +5650,12 @@ call_error_handler(Process* p, BeamInstr* fi, Eterm* reg) /* * Search for the error_handler module. */ - ep = erts_find_function(erts_proc_get_error_handler(p), - am_undefined_function, 3); - if (ep == NULL) { /* No error handler */ - p->current = fi; - p->freason = EXC_UNDEF; - return 0; - } - p->i = ep->address; - - /* - * Create a list with all arguments in the x registers. - */ - - arity = fi[2]; - sz = 2 * arity; - if (HeapWordsLeft(p) < sz) { - erts_garbage_collect(p, sz, reg, arity); - } - hp = HEAP_TOP(p); - HEAP_TOP(p) += sz; - args = NIL; - for (i = arity-1; i >= 0; i--) { - args = CONS(hp, reg[i], args); - hp += 2; - } - - /* - * Set up registers for call to error_handler:undefined_function/3. - */ - reg[0] = fi[0]; - reg[1] = fi[1]; - reg[2] = args; - return 1; -} - -static Eterm -call_breakpoint_handler(Process* p, BeamInstr* fi, Eterm* reg) -{ - Eterm* hp; - Export* ep; - int arity; - Eterm args; - Uint sz; - int i; - - /* - * Search for error handler module. - */ - ep = erts_find_function(erts_proc_get_error_handler(p), - am_breakpoint, 3); + ep = erts_find_function(erts_proc_get_error_handler(p), func, 3); if (ep == NULL) { /* No error handler */ p->current = fi; p->freason = EXC_UNDEF; return 0; } - p->i = ep->address; /* * Create a list with all arguments in the x registers. @@ -5727,15 +5675,14 @@ call_breakpoint_handler(Process* p, BeamInstr* fi, Eterm* reg) } /* - * Set up registers for call to error_handler:breakpoint/3. + * Set up registers for call to error_handler:/3. */ reg[0] = fi[0]; reg[1] = fi[1]; reg[2] = args; - return 1; + return ep->address; } - static Export* apply_setup_error_handler(Process* p, Eterm module, Eterm function, Uint arity, Eterm* reg) -- cgit v1.2.3 From 0c44ee46cd9f108599aad58c7f0f62b34dad0615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Dec 2010 09:04:34 +0100 Subject: beam_emu: Don't inline helper functions into process_main() By default, GCC will inline calls to helper functions. Since process_main() is already huge, there is no reason to inline the helper functions (and some of them are used very seldom). --- erts/emulator/beam/beam_emu.c | 47 ++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 2f90f67351..82999ec79e 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -989,8 +989,41 @@ extern int count_instructions; #define IsPid(Src, Fail) if (is_not_pid(Src)) { Fail; } #define IsRef(Src, Fail) if (is_not_ref(Src)) { Fail; } -static BifFunction translate_gc_bif(void* gcf); -static BeamInstr* handle_error(Process* c_p, BeamInstr* pc, Eterm* reg, BifFunction bf); +/* + * process_main() is already huge, so we want to avoid inlining + * into it. Especially functions that are seldom used. + */ +#ifdef __GNUC__ +# define NOINLINE __attribute__((__noinline__)) +#else +# define NOINLINE +#endif + +/* + * The following functions are called directly by process_main(). + * Don't inline them. + */ +static BifFunction translate_gc_bif(void* gcf) NOINLINE; +static BeamInstr* handle_error(Process* c_p, BeamInstr* pc, + Eterm* reg, BifFunction bf) NOINLINE; +static BeamInstr* call_error_handler(Process* p, BeamInstr* ip, + Eterm* reg, Eterm func) NOINLINE; +static BeamInstr* fixed_apply(Process* p, Eterm* reg, Uint arity) NOINLINE; +static BeamInstr* apply(Process* p, Eterm module, Eterm function, + Eterm args, Eterm* reg) NOINLINE; +static int hibernate(Process* c_p, Eterm module, Eterm function, + Eterm args, Eterm* reg) NOINLINE; +static BeamInstr* call_fun(Process* p, int arity, + Eterm* reg, Eterm args) NOINLINE; +static BeamInstr* apply_fun(Process* p, Eterm fun, + Eterm args, Eterm* reg) NOINLINE; +static Eterm new_fun(Process* p, Eterm* reg, + ErlFunEntry* fe, int num_free) NOINLINE; + + +/* + * Functions not directly called by process_main(). OK to inline. + */ static BeamInstr* next_catch(Process* c_p, Eterm *reg); static void terminate_proc(Process* c_p, Eterm Value); static Eterm add_stacktrace(Process* c_p, Eterm Value, Eterm exc); @@ -998,16 +1031,6 @@ static void save_stacktrace(Process* c_p, BeamInstr* pc, Eterm* reg, BifFunction bf, Eterm args); static struct StackTrace * get_trace_from_exc(Eterm exc); static Eterm make_arglist(Process* c_p, Eterm* reg, int a); -static BeamInstr* call_error_handler(Process* p, BeamInstr* ip, - Eterm* reg, Eterm func); -static BeamInstr* fixed_apply(Process* p, Eterm* reg, Uint arity); -static BeamInstr* apply(Process* p, Eterm module, Eterm function, - Eterm args, Eterm* reg); -static int hibernate(Process* c_p, Eterm module, Eterm function, - Eterm args, Eterm* reg); -static BeamInstr* call_fun(Process* p, int arity, Eterm* reg, Eterm args); -static BeamInstr* apply_fun(Process* p, Eterm fun, Eterm args, Eterm* reg); -static Eterm new_fun(Process* p, Eterm* reg, ErlFunEntry* fe, int num_free); #if defined(VXWORKS) static int init_done; -- cgit v1.2.3 From a24830ce9db4325b51af56262094bb1d32ef4e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 19 Nov 2010 10:47:05 +0100 Subject: beam_emu: Eliminate sloppy use of tmp_arg1 and tmp_arg2 The tmp_arg1 and tmp_arg2 variables are intended for transferring values from the fetch/2 instructions to instructions such as i_plus/3. In many places, however, tmp_arg1 and tmp_arg2 are used as general temporary variables within a single instruction. Improve the code generation by replacing sloppy use of tmp_arg1 and tmp_arg2 with block-local variables. In most cases, that will allow the temporary values to be kept in registers. --- erts/emulator/beam/beam_emu.c | 603 +++++++++++++++++++++++------------------- 1 file changed, 330 insertions(+), 273 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 82999ec79e..09f6fc8cef 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1503,9 +1503,9 @@ void process_main(void) GetArg1(2, tuple); if (is_tuple(tuple)) { Eterm* tp = tuple_val(tuple); - tmp_arg2 = Arg(1); - if (tmp_arg2 <= arityval(*tp)) { - Eterm result = tp[tmp_arg2]; + Eterm pos = Arg(1); + if (pos <= arityval(*tp)) { + Eterm result = tp[pos]; StoreBifResult(3, result); } } @@ -1862,8 +1862,22 @@ void process_main(void) NextPF(0, next); } + { + Eterm select_val; + + OpCase(i_select_tuple_arity_sfI): + GetArg1(0, select_val); + + if (is_tuple(select_val)) { + select_val = *tuple_val(select_val); + goto do_binary_search; + } + SET_I((BeamInstr *) Arg(1)); + Goto(*I); + + OpCase(i_select_val_sfI): - GetArg1(0, tmp_arg1); + GetArg1(0, select_val); do_binary_search: { @@ -1900,9 +1914,9 @@ void process_main(void) unsigned int boffset = ((unsigned int)bdiff >> 1) & ~(sizeof(struct Pairs)-1); mid = (struct Pairs*)((char*)low + boffset); - if (tmp_arg1 < mid->val) { + if (select_val < mid->val) { high = mid; - } else if (tmp_arg1 > mid->val) { + } else if (select_val > mid->val) { low = mid + 1; } else { SET_I(mid->addr); @@ -1912,6 +1926,7 @@ void process_main(void) SET_I((BeamInstr *) Arg(1)); Goto(*I); } + } OpCase(i_jump_on_val_zero_sfI): { @@ -2608,23 +2623,25 @@ void process_main(void) OpCase(i_int_bnot_jsId): { - GetArg1(1, tmp_arg1); - if (is_small(tmp_arg1)) { - tmp_arg1 = make_small(~signed_val(tmp_arg1)); + Eterm bnot_val; + + GetArg1(1, bnot_val); + if (is_small(bnot_val)) { + bnot_val = make_small(~signed_val(bnot_val)); } else { Uint live = Arg(2); SWAPOUT; reg[0] = r(0); - reg[live] = tmp_arg1; - tmp_arg1 = erts_gc_bnot(c_p, reg, live); + reg[live] = bnot_val; + bnot_val = erts_gc_bnot(c_p, reg, live); r(0) = reg[0]; SWAPIN; ERTS_HOLE_CHECK(c_p); - if (is_nil(tmp_arg1)) { + if (is_nil(bnot_val)) { goto lb_Cl_error; } } - StoreBifResult(3, tmp_arg1); + StoreBifResult(3, bnot_val); } badarith: @@ -2879,18 +2896,6 @@ void process_main(void) goto do_schedule1; } - OpCase(i_select_tuple_arity_sfI): - { - GetArg1(0, tmp_arg1); - - if (is_tuple(tmp_arg1)) { - tmp_arg1 = *tuple_val(tmp_arg1); - goto do_binary_search; - } - SET_I((BeamInstr *) Arg(1)); - Goto(*I); - } - OpCase(set_tuple_element_sdP): { Eterm element; Eterm tuple; @@ -2936,15 +2941,17 @@ void process_main(void) the first argument. We also handle atom tags in the first argument for backwards compatibility. */ - GetArg2(0, tmp_arg1, tmp_arg2); - c_p->fvalue = tmp_arg2; + Eterm raise_val1; + Eterm raise_val2; + GetArg2(0, raise_val1, raise_val2); + c_p->fvalue = raise_val2; if (c_p->freason == EXC_NULL) { /* a safety check for the R10-0 case; should not happen */ c_p->ftrace = NIL; c_p->freason = EXC_ERROR; } /* for R10-0 code, keep existing c_p->ftrace and hope it's correct */ - switch (tmp_arg1) { + switch (raise_val1) { case am_throw: c_p->freason = EXC_THROWN & ~EXF_SAVETRACE; break; @@ -2960,8 +2967,8 @@ void process_main(void) passed from a user! Currently only expecting generated calls. */ struct StackTrace *s; - c_p->ftrace = tmp_arg1; - s = get_trace_from_exc(tmp_arg1); + c_p->ftrace = raise_val1; + s = get_trace_from_exc(raise_val1); if (s == NULL) { c_p->freason = EXC_ERROR; } else { @@ -2973,10 +2980,12 @@ void process_main(void) } OpCase(badmatch_s): { - GetArg1(0, tmp_arg1); - c_p->fvalue = tmp_arg1; - c_p->freason = BADMATCH; - } + Eterm badmatch_val; + + GetArg1(0, badmatch_val); + c_p->fvalue = badmatch_val; + c_p->freason = BADMATCH; + } /* Fall through here */ find_func_info: { @@ -3026,128 +3035,142 @@ void process_main(void) } } - OpCase(call_nif): - { - /* - * call_nif is always first instruction in function: - * - * I[-3]: Module - * I[-2]: Function - * I[-1]: Arity - * I[0]: &&call_nif - * I[1]: Function pointer to NIF function - * I[2]: Pointer to erl_module_nif - */ - BifFunction vbf; - - c_p->current = I-3; /* current and vbf set to please handle_error */ - SWAPOUT; - c_p->fcalls = FCALLS - 1; - PROCESS_MAIN_CHK_LOCKS(c_p); - tmp_arg2 = I[-1]; - ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + { + Eterm nif_bif_result; + Eterm bif_nif_arity; - ASSERT(!ERTS_PROC_IS_EXITING(c_p)); - { - typedef Eterm NifF(struct enif_environment_t*, int argc, Eterm argv[]); - NifF* fp = vbf = (NifF*) I[1]; - struct enif_environment_t env; - erts_pre_nif(&env, c_p, (struct erl_module_nif*)I[2]); - reg[0] = r(0); - tmp_arg1 = (*fp)(&env, tmp_arg2, reg); - erts_post_nif(&env); - } - ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(tmp_arg1)); - PROCESS_MAIN_CHK_LOCKS(c_p); - goto apply_bif_or_nif_epilogue; - - OpCase(apply_bif): - /* - * At this point, I points to the code[3] in the export entry for - * the BIF: - * - * code[0]: Module - * code[1]: Function - * code[2]: Arity - * code[3]: &&apply_bif - * code[4]: Function pointer to BIF function - */ + OpCase(call_nif): + { + /* + * call_nif is always first instruction in function: + * + * I[-3]: Module + * I[-2]: Function + * I[-1]: Arity + * I[0]: &&call_nif + * I[1]: Function pointer to NIF function + * I[2]: Pointer to erl_module_nif + */ + BifFunction vbf; - c_p->current = I-3; /* In case we apply process_info/1,2 or load_nif/1 */ - c_p->i = I; /* In case we apply check_process_code/2. */ - c_p->arity = 0; /* To allow garbage collection on ourselves - * (check_process_code/2). - */ - SWAPOUT; - c_p->fcalls = FCALLS - 1; - vbf = (BifFunction) Arg(0); - PROCESS_MAIN_CHK_LOCKS(c_p); - tmp_arg2 = I[-1]; - ASSERT(tmp_arg2 <= 3); - ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); - switch (tmp_arg2) { - case 3: + c_p->current = I-3; /* current and vbf set to please handle_error */ + SWAPOUT; + c_p->fcalls = FCALLS - 1; + PROCESS_MAIN_CHK_LOCKS(c_p); + bif_nif_arity = I[-1]; + ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + + ASSERT(!ERTS_PROC_IS_EXITING(c_p)); { - Eterm (*bf)(Process*, Eterm, Eterm, Eterm, BeamInstr*) = vbf; - ASSERT(!ERTS_PROC_IS_EXITING(c_p)); - tmp_arg1 = (*bf)(c_p, r(0), x(1), x(2), I); - ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(tmp_arg1)); - PROCESS_MAIN_CHK_LOCKS(c_p); + typedef Eterm NifF(struct enif_environment_t*, int argc, Eterm argv[]); + NifF* fp = vbf = (NifF*) I[1]; + struct enif_environment_t env; + erts_pre_nif(&env, c_p, (struct erl_module_nif*)I[2]); + reg[0] = r(0); + nif_bif_result = (*fp)(&env, bif_nif_arity, reg); + erts_post_nif(&env); } - break; - case 2: - { - Eterm (*bf)(Process*, Eterm, Eterm, BeamInstr*) = vbf; - ASSERT(!ERTS_PROC_IS_EXITING(c_p)); - tmp_arg1 = (*bf)(c_p, r(0), x(1), I); - ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(tmp_arg1)); - PROCESS_MAIN_CHK_LOCKS(c_p); + ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); + PROCESS_MAIN_CHK_LOCKS(c_p); + goto apply_bif_or_nif_epilogue; + + OpCase(apply_bif): + /* + * At this point, I points to the code[3] in the export entry for + * the BIF: + * + * code[0]: Module + * code[1]: Function + * code[2]: Arity + * code[3]: &&apply_bif + * code[4]: Function pointer to BIF function + */ + + c_p->current = I-3; /* In case we apply process_info/1,2 or load_nif/1 */ + c_p->i = I; /* In case we apply check_process_code/2. */ + c_p->arity = 0; /* To allow garbage collection on ourselves + * (check_process_code/2). + */ + SWAPOUT; + c_p->fcalls = FCALLS - 1; + vbf = (BifFunction) Arg(0); + PROCESS_MAIN_CHK_LOCKS(c_p); + bif_nif_arity = I[-1]; + ASSERT(bif_nif_arity <= 3); + ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + switch (bif_nif_arity) { + case 3: + { + Eterm (*bf)(Process*, Eterm, Eterm, Eterm, BeamInstr*) = vbf; + ASSERT(!ERTS_PROC_IS_EXITING(c_p)); + nif_bif_result = (*bf)(c_p, r(0), x(1), x(2), I); + ASSERT(!ERTS_PROC_IS_EXITING(c_p) || + is_non_value(nif_bif_result)); + PROCESS_MAIN_CHK_LOCKS(c_p); + } + break; + case 2: + { + Eterm (*bf)(Process*, Eterm, Eterm, BeamInstr*) = vbf; + ASSERT(!ERTS_PROC_IS_EXITING(c_p)); + nif_bif_result = (*bf)(c_p, r(0), x(1), I); + ASSERT(!ERTS_PROC_IS_EXITING(c_p) || + is_non_value(nif_bif_result)); + PROCESS_MAIN_CHK_LOCKS(c_p); + } + break; + case 1: + { + Eterm (*bf)(Process*, Eterm, BeamInstr*) = vbf; + ASSERT(!ERTS_PROC_IS_EXITING(c_p)); + nif_bif_result = (*bf)(c_p, r(0), I); + ASSERT(!ERTS_PROC_IS_EXITING(c_p) || + is_non_value(nif_bif_result)); + PROCESS_MAIN_CHK_LOCKS(c_p); + } + break; + case 0: + { + Eterm (*bf)(Process*, BeamInstr*) = vbf; + ASSERT(!ERTS_PROC_IS_EXITING(c_p)); + nif_bif_result = (*bf)(c_p, I); + ASSERT(!ERTS_PROC_IS_EXITING(c_p) || + is_non_value(nif_bif_result)); + PROCESS_MAIN_CHK_LOCKS(c_p); + break; + } + default: + erl_exit(1, "apply_bif: invalid arity: %u\n", + bif_nif_arity); } - break; - case 1: - { - Eterm (*bf)(Process*, Eterm, BeamInstr*) = vbf; - ASSERT(!ERTS_PROC_IS_EXITING(c_p)); - tmp_arg1 = (*bf)(c_p, r(0), I); - ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(tmp_arg1)); - PROCESS_MAIN_CHK_LOCKS(c_p); + + apply_bif_or_nif_epilogue: + ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); + ERTS_HOLE_CHECK(c_p); + if (c_p->mbuf) { + reg[0] = r(0); + nif_bif_result = erts_gc_after_bif_call(c_p, nif_bif_result, + reg, bif_nif_arity); + r(0) = reg[0]; } - break; - case 0: - { - Eterm (*bf)(Process*, BeamInstr*) = vbf; - ASSERT(!ERTS_PROC_IS_EXITING(c_p)); - tmp_arg1 = (*bf)(c_p, I); - ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(tmp_arg1)); - PROCESS_MAIN_CHK_LOCKS(c_p); - break; + SWAPIN; /* There might have been a garbage collection. */ + FCALLS = c_p->fcalls; + if (is_value(nif_bif_result)) { + r(0) = nif_bif_result; + CHECK_TERM(r(0)); + SET_I(c_p->cp); + Goto(*I); + } else if (c_p->freason == TRAP) { + SET_I(*((BeamInstr **) (UWord) ((c_p)->def_arg_reg + 3))); + r(0) = c_p->def_arg_reg[0]; + x(1) = c_p->def_arg_reg[1]; + x(2) = c_p->def_arg_reg[2]; + Dispatch(); } - } -apply_bif_or_nif_epilogue: - ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); - ERTS_HOLE_CHECK(c_p); - if (c_p->mbuf) { reg[0] = r(0); - tmp_arg1 = erts_gc_after_bif_call(c_p, tmp_arg1, reg, tmp_arg2); - r(0) = reg[0]; - } - SWAPIN; /* There might have been a garbage collection. */ - FCALLS = c_p->fcalls; - if (is_value(tmp_arg1)) { - r(0) = tmp_arg1; - CHECK_TERM(r(0)); - SET_I(c_p->cp); - Goto(*I); - } else if (c_p->freason == TRAP) { - SET_I(*((BeamInstr **) (UWord) ((c_p)->def_arg_reg + 3))); - r(0) = c_p->def_arg_reg[0]; - x(1) = c_p->def_arg_reg[1]; - x(2) = c_p->def_arg_reg[2]; - Dispatch(); + I = handle_error(c_p, c_p->cp, reg, vbf); + goto post_error_handling; } - reg[0] = r(0); - I = handle_error(c_p, c_p->cp, reg, vbf); - goto post_error_handling; } OpCase(i_get_sd): @@ -3161,10 +3184,14 @@ apply_bif_or_nif_epilogue: } OpCase(case_end_s): - GetArg1(0, tmp_arg1); - c_p->fvalue = tmp_arg1; - c_p->freason = EXC_CASE_CLAUSE; - goto find_func_info; + { + Eterm case_end_val; + + GetArg1(0, case_end_val); + c_p->fvalue = case_end_val; + c_p->freason = EXC_CASE_CLAUSE; + goto find_func_info; + } OpCase(if_end): c_p->freason = EXC_IF_CLAUSE; @@ -3177,10 +3204,13 @@ apply_bif_or_nif_epilogue: } OpCase(try_case_end_s): - GetArg1(0, tmp_arg1); - c_p->fvalue = tmp_arg1; - c_p->freason = EXC_TRY_CLAUSE; - goto find_func_info; + { + Eterm try_case_end_val; + GetArg1(0, try_case_end_val); + c_p->fvalue = try_case_end_val; + c_p->freason = EXC_TRY_CLAUSE; + goto find_func_info; + } /* * Construction of binaries using new instructions. @@ -3728,19 +3758,20 @@ apply_bif_or_nif_epilogue: Eterm header; BeamInstr *next; Uint slots; + Eterm context; OpCase(i_bs_start_match2_rfIId): { - tmp_arg1 = r(0); + context = r(0); do_start_match: slots = Arg(2); - if (!is_boxed(tmp_arg1)) { + if (!is_boxed(context)) { ClauseFail(); } PreFetch(4, next); - header = *boxed_val(tmp_arg1); + header = *boxed_val(context); if (header_is_bin_matchstate(header)) { - ErlBinMatchState* ms = (ErlBinMatchState *) boxed_val(tmp_arg1); + ErlBinMatchState* ms = (ErlBinMatchState *) boxed_val(context); Uint actual_slots = HEADER_NUM_SLOTS(header); ms->save_offset[0] = ms->mb.offset; if (actual_slots < slots) { @@ -3748,8 +3779,8 @@ apply_bif_or_nif_epilogue: Uint live = Arg(1); Uint wordsneeded = ERL_BIN_MATCHSTATE_SIZE(slots); - TestHeapPreserve(wordsneeded, live, tmp_arg1); - ms = (ErlBinMatchState *) boxed_val(tmp_arg1); + TestHeapPreserve(wordsneeded, live, context); + ms = (ErlBinMatchState *) boxed_val(context); dst = (ErlBinMatchState *) HTOP; *dst = *ms; *HTOP = HEADER_BIN_MATCHSTATE(slots); @@ -3761,12 +3792,12 @@ apply_bif_or_nif_epilogue: Eterm result; Uint live = Arg(1); Uint wordsneeded = ERL_BIN_MATCHSTATE_SIZE(slots); - TestHeapPreserve(wordsneeded, live, tmp_arg1); + TestHeapPreserve(wordsneeded, live, context); HEAP_TOP(c_p) = HTOP; #ifdef DEBUG c_p->stop = E; /* Needed for checking in HeapOnlyAlloc(). */ #endif - result = erts_bs_start_match_2(c_p, tmp_arg1, slots); + result = erts_bs_start_match_2(c_p, context, slots); HTOP = HEAP_TOP(c_p); HEAP_SPACE_VERIFIED(0); if (is_non_value(result)) { @@ -3780,12 +3811,12 @@ apply_bif_or_nif_epilogue: NextPF(4, next); } OpCase(i_bs_start_match2_xfIId): { - tmp_arg1 = xb(Arg(0)); + context = xb(Arg(0)); I++; goto do_start_match; } OpCase(i_bs_start_match2_yfIId): { - tmp_arg1 = yb(Arg(0)); + context = yb(Arg(0)); I++; goto do_start_match; } @@ -3878,93 +3909,105 @@ apply_bif_or_nif_epilogue: NextPF(2, next); } + { + Eterm bs_get_integer8_context; + OpCase(i_bs_get_integer_8_rfd): { - tmp_arg1 = r(0); - goto do_bs_get_integer_8; - } + bs_get_integer8_context = r(0); + goto do_bs_get_integer_8; + } OpCase(i_bs_get_integer_8_xfd): { - tmp_arg1 = xb(Arg(0)); - I++; - } + bs_get_integer8_context = xb(Arg(0)); + I++; + } do_bs_get_integer_8: { - ErlBinMatchBuffer *_mb; - Eterm _result; - _mb = ms_matchbuffer(tmp_arg1); - if (_mb->size - _mb->offset < 8) { - ClauseFail(); - } - if (BIT_OFFSET(_mb->offset) != 0) { - _result = erts_bs_get_integer_2(c_p, 8, 0, _mb); - } else { - _result = make_small(_mb->base[BYTE_OFFSET(_mb->offset)]); - _mb->offset += 8; + ErlBinMatchBuffer *_mb; + Eterm _result; + _mb = ms_matchbuffer(bs_get_integer8_context); + if (_mb->size - _mb->offset < 8) { + ClauseFail(); + } + if (BIT_OFFSET(_mb->offset) != 0) { + _result = erts_bs_get_integer_2(c_p, 8, 0, _mb); + } else { + _result = make_small(_mb->base[BYTE_OFFSET(_mb->offset)]); + _mb->offset += 8; + } + StoreBifResult(1, _result); } - StoreBifResult(1, _result); } - OpCase(i_bs_get_integer_16_rfd): { - tmp_arg1 = r(0); + { + Eterm bs_get_integer_16_context; + + OpCase(i_bs_get_integer_16_rfd): + bs_get_integer_16_context = r(0); goto do_bs_get_integer_16; - } - OpCase(i_bs_get_integer_16_xfd): { - tmp_arg1 = xb(Arg(0)); + OpCase(i_bs_get_integer_16_xfd): + bs_get_integer_16_context = xb(Arg(0)); I++; - } - do_bs_get_integer_16: { - ErlBinMatchBuffer *_mb; - Eterm _result; - _mb = ms_matchbuffer(tmp_arg1); - if (_mb->size - _mb->offset < 16) { - ClauseFail(); - } - if (BIT_OFFSET(_mb->offset) != 0) { - _result = erts_bs_get_integer_2(c_p, 16, 0, _mb); - } else { - _result = make_small(get_int16(_mb->base+BYTE_OFFSET(_mb->offset))); - _mb->offset += 16; + do_bs_get_integer_16: + { + ErlBinMatchBuffer *_mb; + Eterm _result; + _mb = ms_matchbuffer(bs_get_integer_16_context); + if (_mb->size - _mb->offset < 16) { + ClauseFail(); + } + if (BIT_OFFSET(_mb->offset) != 0) { + _result = erts_bs_get_integer_2(c_p, 16, 0, _mb); + } else { + _result = make_small(get_int16(_mb->base+BYTE_OFFSET(_mb->offset))); + _mb->offset += 16; + } + StoreBifResult(1, _result); } - StoreBifResult(1, _result); } - OpCase(i_bs_get_integer_32_rfId): { - tmp_arg1 = r(0); + { + Eterm bs_get_integer_32_context; + + OpCase(i_bs_get_integer_32_rfId): + bs_get_integer_32_context = r(0); goto do_bs_get_integer_32; - } + - OpCase(i_bs_get_integer_32_xfId): { - tmp_arg1 = xb(Arg(0)); + OpCase(i_bs_get_integer_32_xfId): + bs_get_integer_32_context = xb(Arg(0)); I++; - } - do_bs_get_integer_32: { - ErlBinMatchBuffer *_mb; - Uint32 _integer; - Eterm _result; - _mb = ms_matchbuffer(tmp_arg1); - if (_mb->size - _mb->offset < 32) { ClauseFail(); } - if (BIT_OFFSET(_mb->offset) != 0) { - _integer = erts_bs_get_unaligned_uint32(_mb); - } else { - _integer = get_int32(_mb->base + _mb->offset/8); - } - _mb->offset += 32; + + do_bs_get_integer_32: + { + ErlBinMatchBuffer *_mb; + Uint32 _integer; + Eterm _result; + _mb = ms_matchbuffer(bs_get_integer_32_context); + if (_mb->size - _mb->offset < 32) { ClauseFail(); } + if (BIT_OFFSET(_mb->offset) != 0) { + _integer = erts_bs_get_unaligned_uint32(_mb); + } else { + _integer = get_int32(_mb->base + _mb->offset/8); + } + _mb->offset += 32; #if !defined(ARCH_64) || HALFWORD_HEAP - if (IS_USMALL(0, _integer)) { + if (IS_USMALL(0, _integer)) { #endif - _result = make_small(_integer); + _result = make_small(_integer); #if !defined(ARCH_64) || HALFWORD_HEAP - } else { - TestHeap(BIG_UINT_HEAP_SIZE, Arg(1)); - _result = uint_to_big((Uint) _integer, HTOP); - HTOP += BIG_UINT_HEAP_SIZE; - HEAP_SPACE_VERIFIED(0); - } + } else { + TestHeap(BIG_UINT_HEAP_SIZE, Arg(1)); + _result = uint_to_big((Uint) _integer, HTOP); + HTOP += BIG_UINT_HEAP_SIZE; + HEAP_SPACE_VERIFIED(0); + } #endif - StoreBifResult(2, _result); + StoreBifResult(2, _result); + } } /* Operands: Size Live Fail Flags Dst */ @@ -4062,54 +4105,64 @@ apply_bif_or_nif_epilogue: StoreBifResult(3, result); } - /* Operands: MatchContext Fail Dst */ + { + Eterm get_utf8_context; + + /* Operands: MatchContext Fail Dst */ OpCase(i_bs_get_utf8_rfd): { - tmp_arg1 = r(0); - goto do_bs_get_utf8; - } + get_utf8_context = r(0); + goto do_bs_get_utf8; + } OpCase(i_bs_get_utf8_xfd): { - tmp_arg1 = xb(Arg(0)); - I++; - } + get_utf8_context = xb(Arg(0)); + I++; + } - /* - * tmp_arg1 = match_context - * Operands: Fail Dst - */ + /* + * get_utf8_context = match_context + * Operands: Fail Dst + */ - do_bs_get_utf8: { - Eterm result = erts_bs_get_utf8(ms_matchbuffer(tmp_arg1)); - if (is_non_value(result)) { - ClauseFail(); + do_bs_get_utf8: { + Eterm result = erts_bs_get_utf8(ms_matchbuffer(get_utf8_context)); + if (is_non_value(result)) { + ClauseFail(); + } + StoreBifResult(1, result); } - StoreBifResult(1, result); } - /* Operands: MatchContext Fail Flags Dst */ + { + Eterm get_utf16_context; + + /* Operands: MatchContext Fail Flags Dst */ OpCase(i_bs_get_utf16_rfId): { - tmp_arg1 = r(0); - goto do_bs_get_utf16; - } + get_utf16_context = r(0); + goto do_bs_get_utf16; + } OpCase(i_bs_get_utf16_xfId): { - tmp_arg1 = xb(Arg(0)); - I++; - } + get_utf16_context = xb(Arg(0)); + I++; + } - /* - * tmp_arg1 = match_context - * Operands: Fail Flags Dst - */ - do_bs_get_utf16: { - Eterm result = erts_bs_get_utf16(ms_matchbuffer(tmp_arg1), Arg(1)); - if (is_non_value(result)) { - ClauseFail(); + /* + * get_utf16_context = match_context + * Operands: Fail Flags Dst + */ + do_bs_get_utf16: { + Eterm result = erts_bs_get_utf16(ms_matchbuffer(get_utf16_context), + Arg(1)); + if (is_non_value(result)) { + ClauseFail(); + } + StoreBifResult(2, result); } - StoreBifResult(2, result); } { + Eterm context_to_binary_context; ErlBinMatchBuffer* mb; ErlSubBin* sb; Uint size; @@ -4118,27 +4171,29 @@ apply_bif_or_nif_epilogue: Uint hole_size; OpCase(bs_context_to_binary_r): { - tmp_arg1 = x0; + context_to_binary_context = x0; I -= 2; goto do_context_to_binary; } /* Unfortunately, inlining can generate this instruction. */ OpCase(bs_context_to_binary_y): { - tmp_arg1 = yb(Arg(0)); + context_to_binary_context = yb(Arg(0)); goto do_context_to_binary0; } OpCase(bs_context_to_binary_x): { - tmp_arg1 = xb(Arg(0)); + context_to_binary_context = xb(Arg(0)); do_context_to_binary0: I--; } do_context_to_binary: - if (is_boxed(tmp_arg1) && header_is_bin_matchstate(*boxed_val(tmp_arg1))) { - ErlBinMatchState* ms = (ErlBinMatchState *) boxed_val(tmp_arg1); + if (is_boxed(context_to_binary_context) && + header_is_bin_matchstate(*boxed_val(context_to_binary_context))) { + ErlBinMatchState* ms; + ms = (ErlBinMatchState *) boxed_val(context_to_binary_context); mb = &ms->mb; offs = ms->save_offset[0]; size = mb->size - offs; @@ -4147,17 +4202,17 @@ apply_bif_or_nif_epilogue: Next(2); OpCase(i_bs_get_binary_all_reuse_rfI): { - tmp_arg1 = x0; + context_to_binary_context = x0; goto do_bs_get_binary_all_reuse; } OpCase(i_bs_get_binary_all_reuse_xfI): { - tmp_arg1 = xb(Arg(0)); + context_to_binary_context = xb(Arg(0)); I++; } do_bs_get_binary_all_reuse: - mb = ms_matchbuffer(tmp_arg1); + mb = ms_matchbuffer(context_to_binary_context); size = mb->size - mb->offset; if (size % Arg(1) != 0) { ClauseFail(); @@ -4166,7 +4221,7 @@ apply_bif_or_nif_epilogue: do_bs_get_binary_all_reuse_common: orig = mb->orig; - sb = (ErlSubBin *) boxed_val(tmp_arg1); + sb = (ErlSubBin *) boxed_val(context_to_binary_context); hole_size = 1 + header_arity(sb->thing_word) - ERL_SUB_BIN_SIZE; sb->thing_word = HEADER_SUB_BIN; sb->size = BYTE_OFFSET(size); @@ -4182,12 +4237,14 @@ apply_bif_or_nif_epilogue: } { + Eterm match_string_context; + OpCase(i_bs_match_string_rfII): { - tmp_arg1 = r(0); + match_string_context = r(0); goto do_bs_match_string; } OpCase(i_bs_match_string_xfII): { - tmp_arg1 = xb(Arg(0)); + match_string_context = xb(Arg(0)); I++; } @@ -4202,7 +4259,7 @@ apply_bif_or_nif_epilogue: PreFetch(3, next); bits = Arg(1); bytes = (byte *) Arg(2); - mb = ms_matchbuffer(tmp_arg1); + mb = ms_matchbuffer(match_string_context); if (mb->size - mb->offset < bits) { ClauseFail(); } -- cgit v1.2.3 From 55eef00e9e0331bddd277194509c6094e8306211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 19 Nov 2010 16:46:58 +0100 Subject: Eliminate use of GetArg1() in the select_val instruction Instead of having one i_select_val_sfI instruction that uses the GetArg1() macro to fetch the controlling expression, use three separate instructions for each of the register types. That will save one word when selecting on the {x,0} register. It should also be slightly faster since a conditional branch is eliminated. Although it seems that the BEAM compiler will never generate a constant controlling expression (even with optimizations turned off), we still make sure that they will work by evaluating the select_val instruction at load time. Handle the select_tuple_arity instruction in the same way. --- erts/emulator/beam/beam_debug.c | 8 ++- erts/emulator/beam/beam_emu.c | 26 +++++-- erts/emulator/beam/beam_load.c | 33 ++++++--- erts/emulator/beam/ops.tab | 20 +++--- erts/emulator/test/beam_literals_SUITE.erl | 7 +- .../literal_case_expression.S | 80 +++++++++++++++++++++- 6 files changed, 147 insertions(+), 27 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 6c16c24d0d..46b831fa88 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -555,7 +555,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) unpacked = ap; ap = addr + size; switch (op) { - case op_i_select_val_sfI: + case op_i_select_val_rfI: + case op_i_select_val_xfI: + case op_i_select_val_yfI: { int n = ap[-1]; @@ -567,7 +569,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; - case op_i_select_tuple_arity_sfI: + case op_i_select_tuple_arity_rfI: + case op_i_select_tuple_arity_xfI: + case op_i_select_tuple_arity_yfI: { int n = ap[-1]; diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 09f6fc8cef..6cd7fa78e0 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1865,9 +1865,19 @@ void process_main(void) { Eterm select_val; - OpCase(i_select_tuple_arity_sfI): - GetArg1(0, select_val); + OpCase(i_select_tuple_arity_xfI): + select_val = xb(Arg(0)); + goto do_select_tuple_arity; + OpCase(i_select_tuple_arity_yfI): + select_val = yb(Arg(0)); + goto do_select_tuple_arity; + + OpCase(i_select_tuple_arity_rfI): + select_val = r(0); + I--; + + do_select_tuple_arity: if (is_tuple(select_val)) { select_val = *tuple_val(select_val); goto do_binary_search; @@ -1875,9 +1885,17 @@ void process_main(void) SET_I((BeamInstr *) Arg(1)); Goto(*I); + OpCase(i_select_val_xfI): + select_val = xb(Arg(0)); + goto do_binary_search; - OpCase(i_select_val_sfI): - GetArg1(0, select_val); + OpCase(i_select_val_yfI): + select_val = yb(Arg(0)); + goto do_binary_search; + + OpCase(i_select_val_rfI): + select_val = r(0); + I--; do_binary_search: { diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 73f057929e..54c8ad0eb1 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3282,7 +3282,6 @@ const_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, int i; ASSERT(Size.type == TAG_u); - ASSERT(S.type == TAG_q); NEW_GENOP(stp, op); op->next = NULL; @@ -3293,18 +3292,32 @@ const_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, * Search for a literal matching the controlling expression. */ - if (S.type == TAG_q) { - Eterm expr = stp->literals[S.val].term; - for (i = 0; i < Size.val; i += 2) { - if (Rest[i].type == TAG_q) { - Eterm term = stp->literals[Rest[i].val].term; - if (eq(term, expr)) { - ASSERT(Rest[i+1].type == TAG_f); - op->a[0] = Rest[i+1]; - return op; + switch (S.type) { + case TAG_q: + { + Eterm expr = stp->literals[S.val].term; + for (i = 0; i < Size.val; i += 2) { + if (Rest[i].type == TAG_q) { + Eterm term = stp->literals[Rest[i].val].term; + if (eq(term, expr)) { + ASSERT(Rest[i+1].type == TAG_f); + op->a[0] = Rest[i+1]; + return op; + } } } } + break; + case TAG_i: + case TAG_a: + for (i = 0; i < Size.val; i += 2) { + if (Rest[i].val == S.val && Rest[i].type == S.type) { + ASSERT(Rest[i+1].type == TAG_f); + op->a[0] = Rest[i+1]; + return op; + } + } + break; } /* diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index f629cc80b6..45b2e197b4 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -124,7 +124,7 @@ init Y1 | init Y2 => init2 Y1 Y2 # Selecting values -select_val S=q Fail=f Size=u Rest=* => const_select_val(S, Fail, Size, Rest) +select_val S=aiq Fail=f Size=u Rest=* => const_select_val(S, Fail, Size, Rest) select_val S=s Fail=f Size=u Rest=* | use_jump_tab(Size, Rest) => \ gen_jump_tab(S, Fail, Size, Rest) @@ -139,26 +139,30 @@ is_integer TypeFail=f S | select_val S=s Fail=f Size=u Rest=* | \ select_val S=s Fail=f Size=u Rest=* | mixed_types(Size, Rest) => \ gen_split_values(S, Fail, Fail, Size, Rest) -is_integer Fail=f S | select_val S=s Fail=f Size=u Rest=* | \ +is_integer Fail=f S | select_val S=d Fail=f Size=u Rest=* | \ fixed_size_values(Size, Rest) => gen_select_val(S, Fail, Size, Rest) -is_atom Fail=f S | select_val S=s Fail=f Size=u Rest=* | \ +is_atom Fail=f S | select_val S=d Fail=f Size=u Rest=* | \ fixed_size_values(Size, Rest) => gen_select_val(S, Fail, Size, Rest) select_val S=s Fail=f Size=u Rest=* | floats_or_bignums(Size, Rest) => \ gen_select_literals(S, Fail, Size, Rest) -select_val S=s Fail=f Size=u Rest=* | fixed_size_values(Size, Rest) => \ +select_val S=d Fail=f Size=u Rest=* | fixed_size_values(Size, Rest) => \ gen_select_val(S, Fail, Size, Rest) -is_tuple Fail=f S | select_tuple_arity S=s Fail=f Size=u Rest=* => \ +is_tuple Fail=f S | select_tuple_arity S=d Fail=f Size=u Rest=* => \ gen_select_tuple_arity(S, Fail, Size, Rest) -select_tuple_arity S=s Fail=f Size=u Rest=* => \ +select_tuple_arity S=d Fail=f Size=u Rest=* => \ gen_select_tuple_arity(S, Fail, Size, Rest) -i_select_val s f I -i_select_tuple_arity s f I +i_select_val r f I +i_select_val x f I +i_select_val y f I +i_select_tuple_arity r f I +i_select_tuple_arity x f I +i_select_tuple_arity y f I i_jump_on_val_zero s f I i_jump_on_val s f I I diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 2238e89748..f56d7ac1c5 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -406,10 +406,15 @@ fconv_2(F) when is_float(F) -> literal_case_expression(Config) when is_list(Config) -> ?line DataDir = ?config(data_dir, Config), ?line Src = filename:join(DataDir, "literal_case_expression"), - ?line {ok,literal_case_expression=Mod,Code} = compile:file(Src, [from_asm,binary]), + ?line {ok,literal_case_expression=Mod,Code} = + compile:file(Src, [from_asm,binary]), ?line {module,Mod} = code:load_binary(Mod, Src, Code), ?line ok = Mod:x(), ?line ok = Mod:y(), + ?line ok = Mod:zi1(), + ?line ok = Mod:zi2(), + ?line ok = Mod:za1(), + ?line ok = Mod:za2(), ?line true = code:delete(Mod), ?line code:purge(Mod), ok. diff --git a/erts/emulator/test/beam_literals_SUITE_data/literal_case_expression.S b/erts/emulator/test/beam_literals_SUITE_data/literal_case_expression.S index c0ffe9ab53..bfdfc079dc 100644 --- a/erts/emulator/test/beam_literals_SUITE_data/literal_case_expression.S +++ b/erts/emulator/test/beam_literals_SUITE_data/literal_case_expression.S @@ -1,10 +1,11 @@ {module, literal_case_expression}. %% version = 0 -{exports, [{module_info,0},{module_info,1},{x,0},{y,0}]}. +{exports, [{module_info,0},{module_info,1},{x,0},{y,0}, + {zi1,0},{zi2,0},{za1,0},{za2,0}]}. {attributes, []}. -{labels, 15}. +{labels, 32}. {function, x, 0, 2}. @@ -52,6 +53,81 @@ {label,10}. {case_end,{float,34.0000}}. +{function, zi1, 0, 16}. + {label,15}. + {func_info,{atom,literal_case_expression},{atom,zi1},0}. + {label,16}. + {test,is_integer,{f,19},[{integer,42}]}. + {select_val,{integer,42}, + {f,18}, + {list,[{integer,42}, + {f,17}, + {integer,1000}, + {f,18}]}}. + {label,17}. + {move,{atom,ok},{x,0}}. + return. + {label,18}. + {move,{atom,error},{x,0}}. + return. + {label,19}. + {case_end,{integer,42}}. + +{function, zi2, 0, 16}. + {label,20}. + {func_info,{atom,literal_case_expression},{atom,zi2},0}. + {label,21}. + {test,is_integer,{f,23},[{integer,42}]}. + {select_val,{integer,42}, + {f,23}, + {list,[{integer,42}, + {f,22}, + {integer,1000}, + {f,23}]}}. + {label,22}. + {move,{atom,ok},{x,0}}. + return. + {label,23}. + {move,{atom,error},{x,0}}. + return. + +{function, za1, 0, 25}. + {label,24}. + {func_info,{atom,literal_case_expression},{atom,za1},0}. + {label,25}. + {test,is_atom,{f,28},[{atom,x}]}. + {select_val,{atom,x}, + {f,27}, + {list,[{atom,a}, + {f,27}, + {atom,x}, + {f,26}]}}. + {label,26}. + {move,{atom,ok},{x,0}}. + return. + {label,27}. + {move,{atom,error},{x,0}}. + return. + {label,28}. + {case_end,{atom,x}}. + +{function, za2, 0, 30}. + {label,29}. + {func_info,{atom,literal_case_expression},{atom,za2},0}. + {label,30}. + {test,is_atom,{f,32},[{atom,x}]}. + {select_val,{atom,x}, + {f,32}, + {list,[{atom,a}, + {f,32}, + {atom,x}, + {f,31}]}}. + {label,31}. + {move,{atom,ok},{x,0}}. + return. + {label,32}. + {move,{atom,error},{x,0}}. + return. {function, module_info, 0, 12}. {label,11}. -- cgit v1.2.3 From 2233398336a35c7160e82efa8ee218a4277739cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Dec 2010 14:34:28 +0100 Subject: Eliminate use of GetArg1() in the jump_on_val* instructions --- erts/emulator/beam/beam_debug.c | 8 +++++-- erts/emulator/beam/beam_emu.c | 51 ++++++++++++++++++++++++++++++----------- erts/emulator/beam/ops.tab | 9 ++++++-- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c index 46b831fa88..2855241b91 100644 --- a/erts/emulator/beam/beam_debug.c +++ b/erts/emulator/beam/beam_debug.c @@ -584,7 +584,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; - case op_i_jump_on_val_sfII: + case op_i_jump_on_val_rfII: + case op_i_jump_on_val_xfII: + case op_i_jump_on_val_yfII: { int n; for (n = ap[-2]; n > 0; n--) { @@ -594,7 +596,9 @@ print_op(int to, void *to_arg, int op, int size, BeamInstr* addr) } } break; - case op_i_jump_on_val_zero_sfI: + case op_i_jump_on_val_zero_rfI: + case op_i_jump_on_val_zero_xfI: + case op_i_jump_on_val_zero_yfI: { int n; for (n = ap[-1]; n > 0; n--) { diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 6cd7fa78e0..1b9fc86871 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1946,15 +1946,26 @@ void process_main(void) } } - OpCase(i_jump_on_val_zero_sfI): { - Eterm index; + Eterm jump_on_val_zero_index; + + OpCase(i_jump_on_val_zero_yfI): + jump_on_val_zero_index = yb(Arg(0)); + goto do_jump_on_val_zero_index; + + OpCase(i_jump_on_val_zero_xfI): + jump_on_val_zero_index = xb(Arg(0)); + goto do_jump_on_val_zero_index; - GetArg1(0, index); - if (is_small(index)) { - index = signed_val(index); - if (index < Arg(2)) { - SET_I((BeamInstr *) (&Arg(3))[index]); + OpCase(i_jump_on_val_zero_rfI): + jump_on_val_zero_index = r(0); + I--; + + do_jump_on_val_zero_index: + if (is_small(jump_on_val_zero_index)) { + jump_on_val_zero_index = signed_val(jump_on_val_zero_index); + if (jump_on_val_zero_index < Arg(2)) { + SET_I((BeamInstr *) (&Arg(3))[jump_on_val_zero_index]); Goto(*I); } } @@ -1962,15 +1973,27 @@ void process_main(void) Goto(*I); } - OpCase(i_jump_on_val_sfII): { - Eterm index; + Eterm jump_on_val_index; + + + OpCase(i_jump_on_val_yfII): + jump_on_val_index = yb(Arg(0)); + goto do_jump_on_val_index; + + OpCase(i_jump_on_val_xfII): + jump_on_val_index = xb(Arg(0)); + goto do_jump_on_val_index; + + OpCase(i_jump_on_val_rfII): + jump_on_val_index = r(0); + I--; - GetArg1(0, index); - if (is_small(index)) { - index = (Uint) (signed_val(index) - Arg(3)); - if (index < Arg(2)) { - SET_I((BeamInstr *) (&Arg(4))[index]); + do_jump_on_val_index: + if (is_small(jump_on_val_index)) { + jump_on_val_index = (Uint) (signed_val(jump_on_val_index) - Arg(3)); + if (jump_on_val_index < Arg(2)) { + SET_I((BeamInstr *) (&Arg(4))[jump_on_val_index]); Goto(*I); } } diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 45b2e197b4..f158fa9543 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -164,8 +164,13 @@ i_select_tuple_arity r f I i_select_tuple_arity x f I i_select_tuple_arity y f I -i_jump_on_val_zero s f I -i_jump_on_val s f I I +i_jump_on_val_zero r f I +i_jump_on_val_zero x f I +i_jump_on_val_zero y f I + +i_jump_on_val r f I I +i_jump_on_val x f I I +i_jump_on_val y f I I jump Target | label Lbl | same_label(Target, Lbl) => label Lbl -- cgit v1.2.3 From ec2fcc7aefec2f4ede4f789098f5093cd2fe00b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Dec 2010 11:09:51 +0100 Subject: Eliminate use of GetArg1() in the fast_element instruction Use separate instructions for each register type. --- erts/emulator/beam/beam_emu.c | 42 +++++++++++++++++++++++++----------------- erts/emulator/beam/beam_load.c | 22 +++++++++++----------- erts/emulator/beam/ops.tab | 5 ++++- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 1b9fc86871..bdc730e6c1 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1492,24 +1492,32 @@ void process_main(void) c_p->freason = BADARG; goto lb_Cl_error; - OpCase(i_fast_element_jIsd): { - Eterm tuple; - - /* - * Inlined version of element/2 for even more speed. - * The first argument is an untagged integer >= 1. - * The second argument is guaranteed to be a register operand. - */ - GetArg1(2, tuple); - if (is_tuple(tuple)) { - Eterm* tp = tuple_val(tuple); - Eterm pos = Arg(1); - if (pos <= arityval(*tp)) { - Eterm result = tp[pos]; - StoreBifResult(3, result); - } - } + { + Eterm fast_element_tuple; + + OpCase(i_fast_element_rjId): + fast_element_tuple = r(0); + + do_fast_element: + if (is_tuple(fast_element_tuple)) { + Eterm* tp = tuple_val(fast_element_tuple); + Eterm pos = Arg(1); /* Untagged integer >= 1 */ + if (pos <= arityval(*tp)) { + Eterm result = tp[pos]; + StoreBifResult(2, result); + } + } goto badarg; + + OpCase(i_fast_element_xjId): + fast_element_tuple = xb(Arg(0)); + I++; + goto do_fast_element; + + OpCase(i_fast_element_yjId): + fast_element_tuple = yb(Arg(0)); + I++; + goto do_fast_element; } OpCase(catch_yf): diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 54c8ad0eb1..4233e26f54 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2308,23 +2308,23 @@ gen_element(LoaderState* stp, GenOpArg Fail, GenOpArg Index, GenOp* op; NEW_GENOP(stp, op); - op->op = genop_i_element_4; op->arity = 4; - op->a[0] = Fail; - op->a[1] = Index; - op->a[2] = Tuple; - op->a[3] = Dst; op->next = NULL; - /* - * If safe, generate a faster instruction. - */ - if (Index.type == TAG_i && Index.val > 0 && (Tuple.type == TAG_r || Tuple.type == TAG_x || Tuple.type == TAG_y)) { op->op = genop_i_fast_element_4; - op->a[1].type = TAG_u; - op->a[1].val = Index.val; + op->a[0] = Tuple; + op->a[1] = Fail; + op->a[2].type = TAG_u; + op->a[2].val = Index.val; + op->a[3] = Dst; + } else { + op->op = genop_i_element_4; + op->a[0] = Fail; + op->a[1] = Index; + op->a[2] = Tuple; + op->a[3] = Dst; } return op; diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index f158fa9543..491f8f1d90 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -920,7 +920,10 @@ node x node y %hot -i_fast_element j I s d +i_fast_element r j I d +i_fast_element x j I d +i_fast_element y j I d + i_element j s s d bif1 f b s d -- cgit v1.2.3 From 3694076f5a68cc78e9ccd6c67651bc0f761fc94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Dec 2010 13:57:24 +0100 Subject: Eliminate use of GetArg2() in the i_element instruction Use separate instructions for each register type. --- erts/emulator/beam/beam_emu.c | 48 ++++++++++++++++++++++++++---------------- erts/emulator/beam/beam_load.c | 6 +++--- erts/emulator/beam/ops.tab | 4 +++- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index bdc730e6c1..fdb7d86c78 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1467,24 +1467,36 @@ void process_main(void) goto find_func_info; } - OpCase(i_element_jssd): { - Eterm index; - Eterm tuple; - - /* - * Inlined version of element/2 for speed. - */ - GetArg2(1, index, tuple); - if (is_small(index) && is_tuple(tuple)) { - Eterm* tp = tuple_val(tuple); - - if ((signed_val(index) >= 1) && - (signed_val(index) <= arityval(*tp))) { - Eterm result = tp[signed_val(index)]; - StoreBifResult(3, result); - } - } - } + { + Eterm element_index; + Eterm element_tuple; + + OpCase(i_element_xjsd): + element_tuple = xb(Arg(0)); + I++; + goto do_element; + + OpCase(i_element_yjsd): + element_tuple = yb(Arg(0)); + I++; + goto do_element; + + OpCase(i_element_rjsd): + element_tuple = r(0); + /* Fall through */ + + do_element: + GetArg1(1, element_index); + if (is_small(element_index) && is_tuple(element_tuple)) { + Eterm* tp = tuple_val(element_tuple); + + if ((signed_val(element_index) >= 1) && + (signed_val(element_index) <= arityval(*tp))) { + Eterm result = tp[signed_val(element_index)]; + StoreBifResult(2, result); + } + } + } /* Fall through */ OpCase(badarg_j): diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 4233e26f54..02aef95a52 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2321,9 +2321,9 @@ gen_element(LoaderState* stp, GenOpArg Fail, GenOpArg Index, op->a[3] = Dst; } else { op->op = genop_i_element_4; - op->a[0] = Fail; - op->a[1] = Index; - op->a[2] = Tuple; + op->a[0] = Tuple; + op->a[1] = Fail; + op->a[2] = Index; op->a[3] = Dst; } diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 491f8f1d90..edc44f966b 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -924,7 +924,9 @@ i_fast_element r j I d i_fast_element x j I d i_fast_element y j I d -i_element j s s d +i_element r j s d +i_element x j s d +i_element y j s d bif1 f b s d bif1_body b s d -- cgit v1.2.3 From 5cf1e739a5599943c1ac1d40d0577f83f5e0e62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 9 Dec 2010 20:57:27 +0100 Subject: Eliminate use of GetArg1() in the badmatch and case_end instructions Create separate instructions for each register type. The "badmatch x(0)" and "case_end x(0)" (which are very common) will only require a single word each, compared to two words when GetArg1() is used. --- erts/emulator/beam/beam_emu.c | 30 ++++++++++++++++++++++++++---- erts/emulator/beam/ops.tab | 14 ++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index fdb7d86c78..ea813ef09f 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -3040,10 +3040,21 @@ void process_main(void) goto find_func_info; } - OpCase(badmatch_s): { + { Eterm badmatch_val; - GetArg1(0, badmatch_val); + OpCase(badmatch_y): + badmatch_val = yb(Arg(0)); + goto do_badmatch; + + OpCase(badmatch_x): + badmatch_val = xb(Arg(0)); + goto do_badmatch; + + OpCase(badmatch_r): + badmatch_val = r(0); + + do_badmatch: c_p->fvalue = badmatch_val; c_p->freason = BADMATCH; } @@ -3244,11 +3255,22 @@ void process_main(void) StoreBifResult(1, result); } - OpCase(case_end_s): { Eterm case_end_val; - GetArg1(0, case_end_val); + OpCase(case_end_x): + case_end_val = xb(Arg(0)); + goto do_case_end; + + OpCase(case_end_y): + case_end_val = yb(Arg(0)); + goto do_case_end; + + OpCase(case_end_r): + case_end_val = r(0); + I--; + + do_case_end: c_p->fvalue = case_end_val; c_p->freason = EXC_CASE_CLAUSE; goto find_func_info; diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index edc44f966b..c10b3e8d52 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -250,11 +250,17 @@ is_number Fail Literal=q => move Literal x | is_number Fail x jump f -case_end Literal=q => move Literal x | case_end x -badmatch Literal=q => move Literal x | badmatch x +case_end Literal=cq => move Literal x | case_end x +badmatch Literal=cq => move Literal x | badmatch x + +case_end r +case_end x +case_end y + +badmatch r +badmatch x +badmatch y -case_end s -badmatch s if_end raise s s -- cgit v1.2.3 From d5ab5485430c00734a79068fe0eee7bd4f87cf00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 9 Dec 2010 21:31:08 +0100 Subject: Eliminate the specific move_sd instruction The move_sd specific instruction is no longer used since there are specific move instructions covering all possible permutations of operands. Also eliminate the move_cy instruction because it is almost never generated by the compiler. --- erts/emulator/beam/ops.tab | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index c10b3e8d52..0b2e2dca83 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -279,6 +279,11 @@ move2 x y x y move2 y x y x move2 x x x x +# The compiler almost never generates a "move Literal y(Y)" instruction, +# so let's cheat if we encounter one. +move S=n D=y => init D +move S=c D=y => move S x | move x D + %macro:move Move -pack -gen_dest move x x move x y @@ -289,15 +294,10 @@ move r x move r y move c r move c x -move c y move n x move n r move y y -%cold -move s d -%hot - # Receive operations. loop_rec Fail Src | smp_mark_target_label(Fail) => i_loop_rec Fail Src -- cgit v1.2.3 From 92f1409c0e9b986780be483976de3cbbff3bab34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 16 Dec 2010 11:15:11 +0100 Subject: Eliminate the "put_list c n Dst" instructions Since the literal (constant) pool was introduced in R12, the BEAM compiler will never generate a "put_list Const [] Dst" instruction (it will instead generate a "move [Const] Dst" instruction). --- erts/emulator/beam/ops.tab | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 0b2e2dca83..426cdef24d 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -376,16 +376,21 @@ i_put_tuple r I i_put_tuple x I i_put_tuple y I +# +# The instruction "put_list Const [] Dst" will not be generated by +# the current BEAM compiler. But until R15A, play it safe by handling +# that instruction with the following transformation. +# +put_list Const=c n Dst => move Const x | put_list x n Dst + %macro:put_list PutList -pack -gen_dest put_list x n x put_list y n x put_list x x x put_list y x x -put_list c n x put_list x x r put_list y r r -put_list c n r put_list y y x put_list x y x -- cgit v1.2.3 From bc0a998391ce2720f2c6099c809a45094d099fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 9 Dec 2010 20:39:36 +0100 Subject: Introduce a few more specialized put_list instructions --- erts/emulator/beam/ops.tab | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 426cdef24d..04e2e72b0d 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -401,6 +401,13 @@ put_list y y r put_list y r x put_list r n x +put_list x r x +put_list x y r +put_list y x r +put_list y x x + +put_list x r r + # put_list SrcReg Constant Dst put_list r c r put_list r c x @@ -428,7 +435,6 @@ put_list c y x put_list c y y %cold -put_list x r r put_list s s d %hot -- cgit v1.2.3 From b166f8975387d7ef07409e841d45c2cd74c2282e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Dec 2010 16:04:05 +0100 Subject: Introduce a special instruction for select_val with two values The new instruction will save one word (because no size operand is needed), and is slightly faster. Handle select_tuple_arity in the same way. --- erts/emulator/beam/beam_emu.c | 47 ++++++++++++++++++++++++++++++++++++++++++ erts/emulator/beam/beam_load.c | 27 ++++++++++++++++++++++++ erts/emulator/beam/ops.tab | 9 ++++++++ 3 files changed, 83 insertions(+) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index ea813ef09f..afba17f7bd 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1882,6 +1882,53 @@ void process_main(void) NextPF(0, next); } + + { + Eterm select_val2; + + OpCase(i_select_tuple_arity2_yfAfAf): + select_val2 = yb(Arg(0)); + goto do_select_tuple_arity2; + + OpCase(i_select_tuple_arity2_xfAfAf): + select_val2 = xb(Arg(0)); + goto do_select_tuple_arity2; + + OpCase(i_select_tuple_arity2_rfAfAf): + select_val2 = r(0); + I--; + + do_select_tuple_arity2: + if (is_not_tuple(select_val2)) { + goto select_val2_fail; + } + select_val2 = *tuple_val(select_val2); + goto do_select_val2; + + OpCase(i_select_val2_yfcfcf): + select_val2 = yb(Arg(0)); + goto do_select_val2; + + OpCase(i_select_val2_xfcfcf): + select_val2 = xb(Arg(0)); + goto do_select_val2; + + OpCase(i_select_val2_rfcfcf): + select_val2 = r(0); + I--; + + do_select_val2: + if (select_val2 == Arg(2)) { + I += 2; + } else if (select_val2 == Arg(4)) { + I += 4; + } + + select_val2_fail: + SET_I((BeamInstr *) Arg(1)); + Goto(*I); + } + { Eterm select_val; diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 02aef95a52..2d57c8a218 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2978,6 +2978,21 @@ gen_select_tuple_arity(LoaderState* stp, GenOpArg S, GenOpArg Fail, ASSERT(op->a[i].val < op->a[i+2].val); } #endif + + /* + * Use a special-cased instruction if there are only two values. + */ + if (size == 2) { + op->op = genop_i_select_tuple_arity2_6; + op->arity--; + op->a[2].type = TAG_u; + op->a[2].val = arityval(op->a[3].val); + op->a[3] = op->a[4]; + op->a[4].type = TAG_u; + op->a[4].val = arityval(op->a[5].val); + op->a[5] = op->a[6]; + } + return op; } @@ -3228,6 +3243,18 @@ gen_select_val(LoaderState* stp, GenOpArg S, GenOpArg Fail, } #endif + /* + * Use a special-cased instruction if there are only two values. + */ + if (size == 2) { + op->op = genop_i_select_val2_6; + op->arity--; + op->a[2] = op->a[3]; + op->a[3] = op->a[4]; + op->a[4] = op->a[5]; + op->a[5] = op->a[6]; + } + return op; } diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 04e2e72b0d..6db55e1402 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -160,6 +160,15 @@ select_tuple_arity S=d Fail=f Size=u Rest=* => \ i_select_val r f I i_select_val x f I i_select_val y f I + +i_select_val2 r f c f c f +i_select_val2 x f c f c f +i_select_val2 y f c f c f + +i_select_tuple_arity2 r f A f A f +i_select_tuple_arity2 x f A f A f +i_select_tuple_arity2 y f A f A f + i_select_tuple_arity r f I i_select_tuple_arity x f I i_select_tuple_arity y f I -- cgit v1.2.3 From 74d7bd100b742a803c8de82c9c997308cf871038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Dec 2010 15:27:37 +0100 Subject: Optimize addition of a small integer to a variable Introduce a new i_increment/4 to optimize the addition of a register and a small integer. This instruction saves two instruction words compared to the standard instructions (an i_fetch/2 instruction followed by a i_plus/3 instruction) and will also be slightly faster. --- erts/emulator/beam/beam_emu.c | 46 ++++++++++++++++++++++++++++++ erts/emulator/beam/beam_load.c | 46 ++++++++++++++++++++++++++++++ erts/emulator/beam/ops.tab | 20 ++++++++++++- erts/emulator/test/beam_literals_SUITE.erl | 37 ++++++++++++++++++++++-- 4 files changed, 146 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index afba17f7bd..741ba8fb93 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1276,6 +1276,52 @@ void process_main(void) #define STORE_ARITH_RESULT(res) StoreBifResult(2, (res)); #define ARITH_FUNC(name) erts_gc_##name + { + Eterm increment_reg_val; + Eterm increment_val; + Uint live; + Eterm result; + + OpCase(i_increment_yIId): + increment_reg_val = yb(Arg(0)); + goto do_increment; + + OpCase(i_increment_xIId): + increment_reg_val = xb(Arg(0)); + goto do_increment; + + OpCase(i_increment_rIId): + increment_reg_val = r(0); + I--; + + do_increment: + increment_val = Arg(1); + if (is_small(increment_reg_val)) { + Sint i = signed_val(increment_reg_val) + increment_val; + ASSERT(MY_IS_SSMALL(i) == IS_SSMALL(i)); + if (MY_IS_SSMALL(i)) { + result = make_small(i); + store_result: + StoreBifResult(3, result); + } + } + + live = Arg(2); + SWAPOUT; + reg[0] = r(0); + reg[live] = increment_reg_val; + reg[live+1] = make_small(increment_val); + result = erts_gc_mixed_plus(c_p, reg, live); + r(0) = reg[0]; + SWAPIN; + ERTS_HOLE_CHECK(c_p); + if (is_value(result)) { + goto store_result; + } + ASSERT(c_p->freason != BADMATCH || is_value(c_p->fvalue)); + goto find_func_info; + } + OpCase(i_plus_jId): { Eterm result; diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 2d57c8a218..e6448931eb 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -2787,6 +2787,52 @@ gen_skip_bits2(LoaderState* stp, GenOpArg Fail, GenOpArg Ms, return op; } +static GenOp* +gen_increment(LoaderState* stp, GenOpArg Reg, GenOpArg Integer, + GenOpArg Live, GenOpArg Dst) +{ + GenOp* op; + + NEW_GENOP(stp, op); + op->op = genop_i_increment_4; + op->arity = 4; + op->next = NULL; + op->a[0] = Reg; + op->a[1].type = TAG_u; + op->a[1].val = Integer.val; + op->a[2] = Live; + op->a[3] = Dst; + return op; +} + +static GenOp* +gen_increment_from_minus(LoaderState* stp, GenOpArg Reg, GenOpArg Integer, + GenOpArg Live, GenOpArg Dst) +{ + GenOp* op; + + NEW_GENOP(stp, op); + op->op = genop_i_increment_4; + op->arity = 4; + op->next = NULL; + op->a[0] = Reg; + op->a[1].type = TAG_u; + op->a[1].val = -Integer.val; + op->a[2] = Live; + op->a[3] = Dst; + return op; +} + +/* + * Test whether the negation of the given number is small. + */ +static int +negation_is_small(LoaderState* stp, GenOpArg Int) +{ + return Int.type == TAG_i && IS_SSMALL(-Int.val); +} + + static int smp(LoaderState* stp) { diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 6db55e1402..029d7b512c 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -1371,7 +1371,21 @@ apply I apply_last I P # -# New GCing arithmetic instructions. +# Optimize addition and subtraction of small literals using +# the i_increment/4 instruction (in bodies, not in guards). +# + +gc_bif2 p Live u$bif:erlang:splus/2 Int=i Reg=d Dst => \ + gen_increment(Reg, Int, Live, Dst) +gc_bif2 p Live u$bif:erlang:splus/2 Reg=d Int=i Dst => \ + gen_increment(Reg, Int, Live, Dst) + +gc_bif2 p Live u$bif:erlang:sminus/2 Reg=d Int=i Dst | \ + negation_is_small(Int) => \ + gen_increment_from_minus(Reg, Int, Live, Dst) + +# +# GCing arithmetic instructions. # gc_bif2 Fail I u$bif:erlang:splus/2 S1 S2 Dst=d => i_fetch S1 S2 | i_plus Fail I Dst @@ -1394,6 +1408,10 @@ gc_bif1 Fail I u$bif:erlang:bnot/1 Src Dst=d => i_int_bnot Fail Src I Dst gc_bif1 Fail I u$bif:erlang:sminus/1 Src Dst=d => i_fetch i Src | i_minus Fail I Dst gc_bif1 Fail I u$bif:erlang:splus/1 Src Dst=d => i_fetch i Src | i_plus Fail I Dst +i_increment r I I d +i_increment x I I d +i_increment y I I d + i_plus j I d i_minus j I d i_times j I d diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index f56d7ac1c5..1eda939cf8 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -23,7 +23,8 @@ matching_bigs/1, matching_more_bigs/1, matching_bigs_and_smalls/1, badmatch/1, case_clause/1, receiving/1, literal_type_tests/1, - put_list/1, fconv/1, literal_case_expression/1]). + put_list/1, fconv/1, literal_case_expression/1, + increment/1]). -include("test_server.hrl"). @@ -32,7 +33,7 @@ all(suite) -> matching_bigs, matching_more_bigs, matching_bigs_and_smalls, badmatch, case_clause, receiving, literal_type_tests, - put_list, fconv, literal_case_expression]. + put_list, fconv, literal_case_expression, increment]. putting(doc) -> "Test creating lists and tuples containing big number literals."; putting(Config) when is_list(Config) -> @@ -419,6 +420,38 @@ literal_case_expression(Config) when is_list(Config) -> ?line code:purge(Mod), ok. +%% Test the i_increment instruction. +increment(Config) when is_list(Config) -> + %% In the 32-bit emulator, Neg32 can be represented as a small, + %% but -Neg32 cannot. Therefore the i_increment instruction must + %% not be used in the subtraction that follows (since i_increment + %% cannot handle a bignum literal). + Neg32 = -(1 bsl 27), + Big32 = id(1 bsl 32), + Result32 = (1 bsl 32) + (1 bsl 27), + ?line Result32 = Big32 + (1 bsl 27), + ?line Result32 = Big32 - Neg32, + + %% Same thing, but for the 64-bit emulator. + Neg64 = -(1 bsl 59), + Big64 = id(1 bsl 64), + Result64 = (1 bsl 64) + (1 bsl 59), + ?line Result64 = Big64 + (1 bsl 59), + ?line Result64 = Big64 - Neg64, + + %% Test error handling for the i_increment instruction. + Bad = id(bad), + ?line {'EXIT',{badarith,_}} = (catch Bad + 42), + + %% Small operands, but a big result. + Res32 = 1 bsl 27, + Small32 = id(Res32-1), + ?line Res32 = Small32 + 1, + Res64 = 1 bsl 59, + Small64 = id(Res64-1), + ?line Res64 = Small64 + 1, + ok. + %% Help functions. chksum(Term) -> -- cgit v1.2.3 From 40dd4f87b3567d087bbcb071404b871af3601241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 10 Dec 2010 06:07:06 +0100 Subject: Optimize and clean-up the exact equality/non-equality instructions The is_eq_exact/3 and is_ne_exact/3 instructions are commonly used with one immediate or literal operand. Introduce three new specialized instructions: i_is_eq_exact_literal/3 i_is_ne_exact_immed/3 i_is_ne_exact_literal/3 The i_is_ne_exact_literal/3 instruction is not very frequently used, but its existence is justified because we removed in a a previous commit the special instruction for matching bignums and we now use i_is_ne_exact_literal/3 instead. For consistency, rename the existing is_eq_immed/3 instruction to is_eq_exact_immed/3. While at it, remove the optimization of an is_eq/3 instruction with an immediate operand because that optimization is already done by the compiler. --- erts/emulator/beam/beam_emu.c | 47 +++++++++++++++++++++++++++++++++++++++++++ erts/emulator/beam/ops.tab | 46 ++++++++++++++++++++++++++++++------------ 2 files changed, 80 insertions(+), 13 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 741ba8fb93..b90613079a 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -738,6 +738,7 @@ extern int count_instructions; } while (0) #define EqualImmed(X, Y, Action) if (X != Y) { Action; } +#define NotEqualImmed(X, Y, Action) if (X == Y) { Action; } #define IsFloat(Src, Fail) if (is_not_float(Src)) { Fail; } @@ -1385,6 +1386,52 @@ void process_main(void) } Next(1); + { + Eterm is_eq_exact_lit_val; + + OpCase(i_is_eq_exact_literal_xfc): + is_eq_exact_lit_val = xb(Arg(0)); + I++; + goto do_is_eq_exact_literal; + + OpCase(i_is_eq_exact_literal_yfc): + is_eq_exact_lit_val = yb(Arg(0)); + I++; + goto do_is_eq_exact_literal; + + OpCase(i_is_eq_exact_literal_rfc): + is_eq_exact_lit_val = r(0); + + do_is_eq_exact_literal: + if (!eq(Arg(1), is_eq_exact_lit_val)) { + ClauseFail(); + } + Next(2); + } + + { + Eterm is_ne_exact_lit_val; + + OpCase(i_is_ne_exact_literal_xfc): + is_ne_exact_lit_val = xb(Arg(0)); + I++; + goto do_is_ne_exact_literal; + + OpCase(i_is_ne_exact_literal_yfc): + is_ne_exact_lit_val = yb(Arg(0)); + I++; + goto do_is_ne_exact_literal; + + OpCase(i_is_ne_exact_literal_rfc): + is_ne_exact_lit_val = r(0); + + do_is_ne_exact_literal: + if (eq(Arg(1), is_ne_exact_lit_val)) { + ClauseFail(); + } + Next(2); + } + OpCase(i_move_call_only_fcr): { r(0) = Arg(1); } diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 029d7b512c..9b3d1da018 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -339,31 +339,51 @@ i_wait_error_locked send # -# Comparisions. +# Optimized comparisons with one immediate/literal operand. # -is_eq_exact Lbl=f R=rxy C=ian => i_is_eq_immed Lbl R C -is_eq Lbl=f R=rxy C=an => i_is_eq_immed Lbl R C +is_eq_exact Lbl R=rxy C=ian => i_is_eq_exact_immed Lbl R C +is_eq_exact Lbl R=rxy C=q => i_is_eq_exact_literal R Lbl C + +is_ne_exact Lbl R=rxy C=ian => i_is_ne_exact_immed Lbl R C +is_ne_exact Lbl R=rxy C=q => i_is_ne_exact_literal R Lbl C + +%macro: i_is_eq_exact_immed EqualImmed -fail_action +i_is_eq_exact_immed f r c +i_is_eq_exact_immed f x c +i_is_eq_exact_immed f y c + +i_is_eq_exact_literal r f c +i_is_eq_exact_literal x f c +i_is_eq_exact_literal y f c + +%macro: i_is_ne_exact_immed NotEqualImmed -fail_action +i_is_ne_exact_immed f r c +i_is_ne_exact_immed f x c +i_is_ne_exact_immed f y c + +i_is_ne_exact_literal r f c +i_is_ne_exact_literal x f c +i_is_ne_exact_literal y f c + +# +# All other comparisons. +# + +is_eq_exact Lbl S1 S2 => i_fetch S1 S2 | i_is_eq_exact Lbl +is_ne_exact Lbl S1 S2 => i_fetch S1 S2 | i_is_ne_exact Lbl is_ge Lbl S1 S2 => i_fetch S1 S2 | i_is_ge Lbl is_lt Lbl S1 S2 => i_fetch S1 S2 | i_is_lt Lbl is_eq Lbl S1 S2 => i_fetch S1 S2 | i_is_eq Lbl is_ne Lbl S1 S2 => i_fetch S1 S2 | i_is_ne Lbl -is_eq_exact Lbl=f S1 S2 => i_fetch S1 S2 | i_is_eq_exact Lbl -is_ne_exact Lbl S1 S2 => i_fetch S1 S2 | i_is_ne_exact Lbl - +i_is_eq_exact f +i_is_ne_exact f i_is_lt f i_is_ge f i_is_eq f i_is_ne f -i_is_eq_exact f -i_is_ne_exact f - -%macro: i_is_eq_immed EqualImmed -fail_action -i_is_eq_immed f r c -i_is_eq_immed f x c -i_is_eq_immed f y c # # Putting things. -- cgit v1.2.3 From 51ddd2047c70bce67c8644d85f5d5de72842c320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 10 Dec 2010 07:57:01 +0100 Subject: Combine a move + jump sequence into the move_jump instruction That will save one word and small amount of time for each occurrence. --- erts/emulator/beam/beam_emu.c | 5 +++++ erts/emulator/beam/ops.tab | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index b90613079a..edb4d61ed2 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -688,6 +688,11 @@ extern int count_instructions; SET_I((BeamInstr *) CallDest); \ Dispatch(); +#define MoveJump(Src) \ + r(0) = (Src); \ + SET_I((BeamInstr *) Arg(0)); \ + Goto(*I); + #define GetList(Src, H, T) do { \ Eterm* tmp_ptr = list_val(Src); \ H = CAR(tmp_ptr); \ diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 9b3d1da018..ac63b352ef 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -279,6 +279,14 @@ system_limit j move R R => +move C=cxy r | jump Lbl => move_jump Lbl C + +%macro: move_jump MoveJump -nonext +move_jump f n +move_jump f c +move_jump f x +move_jump f y + move X1=x Y1=y | move X2=x Y2=y => move2 X1 Y1 X2 Y2 move Y1=y X1=x | move Y2=y X2=x => move2 Y1 X1 Y2 X2 move X1=x X2=x | move X3=x X4=x => move2 X1 X2 X3 X4 -- cgit v1.2.3 From d8a47b34744be64db10a458991bf340328af8f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 16 Dec 2010 08:22:11 +0100 Subject: Introduce a few more variations of the move instructions Frequency counts show that move Const x(1) move Const x(2) are very common. --- erts/emulator/beam/beam_emu.c | 11 +++++++++++ erts/emulator/beam/ops.tab | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index edb4d61ed2..16741aa2d7 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1520,6 +1520,17 @@ void process_main(void) NextPF(1, next); } + OpCase(move_x1_c): { + x(1) = Arg(0); + Next(1); + } + + OpCase(move_x2_c): { + x(2) = Arg(0); + Next(1); + } + + OpCase(return): { SET_I(c_p->cp); /* diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index ac63b352ef..e861f97e7a 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -291,6 +291,12 @@ move X1=x Y1=y | move X2=x Y2=y => move2 X1 Y1 X2 Y2 move Y1=y X1=x | move Y2=y X2=x => move2 Y1 X1 Y2 X2 move X1=x X2=x | move X3=x X4=x => move2 X1 X2 X3 X4 +move C=aiq X=x==1 => move_x1 C +move C=aiq X=x==2 => move_x2 C + +move_x1 c +move_x2 c + %macro: move2 Move2 -pack move2 x y x y move2 y x y x -- cgit v1.2.3 From 90881100cf32c76145c90a089d70f55f61dbf819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 16 Dec 2010 13:33:24 +0100 Subject: erl_posix_msg: Reduce memory footprint Since the error messages in the erl_posix_msg module are presumably used very seldom, save memory by using binaries instead of strings. --- lib/stdlib/src/erl_posix_msg.erl | 285 ++++++++++++++++++++------------------- 1 file changed, 144 insertions(+), 141 deletions(-) diff --git a/lib/stdlib/src/erl_posix_msg.erl b/lib/stdlib/src/erl_posix_msg.erl index fe981b23a7..909cc1d102 100644 --- a/lib/stdlib/src/erl_posix_msg.erl +++ b/lib/stdlib/src/erl_posix_msg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,143 +24,146 @@ -spec message(atom()) -> string(). -message(e2big) -> "argument list too long"; -message(eacces) -> "permission denied"; -message(eaddrinuse) -> "address already in use"; -message(eaddrnotavail) -> "can't assign requested address"; -message(eadv) -> "advertise error"; -message(eafnosupport) -> "address family not supported by protocol family"; -message(eagain) -> "resource temporarily unavailable"; -message(ealign) -> "EALIGN"; -message(ealready) -> "operation already in progress"; -message(ebade) -> "bad exchange descriptor"; -message(ebadf) -> "bad file number"; -message(ebadfd) -> "file descriptor in bad state"; -message(ebadmsg) -> "not a data message"; -message(ebadr) -> "bad request descriptor"; -message(ebadrpc) -> "RPC structure is bad"; -message(ebadrqc) -> "bad request code"; -message(ebadslt) -> "invalid slot"; -message(ebfont) -> "bad font file format"; -message(ebusy) -> "file busy"; -message(echild) -> "no children"; -message(echrng) -> "channel number out of range"; -message(ecomm) -> "communication error on send"; -message(econnaborted) -> "software caused connection abort"; -message(econnrefused) -> "connection refused"; -message(econnreset) -> "connection reset by peer"; -message(edeadlk) -> "resource deadlock avoided"; -message(edeadlock) -> "resource deadlock avoided"; -message(edestaddrreq) -> "destination address required"; -message(edirty) -> "mounting a dirty fs w/o force"; -message(edom) -> "math argument out of range"; -message(edotdot) -> "cross mount point"; -message(edquot) -> "disk quota exceeded"; -message(eduppkg) -> "duplicate package name"; -message(eexist) -> "file already exists"; -message(efault) -> "bad address in system call argument"; -message(efbig) -> "file too large"; -message(ehostdown) -> "host is down"; -message(ehostunreach) -> "host is unreachable"; -message(eidrm) -> "identifier removed"; -message(einit) -> "initialization error"; -message(einprogress) -> "operation now in progress"; -message(eintr) -> "interrupted system call"; -message(einval) -> "invalid argument"; -message(eio) -> "I/O error"; -message(eisconn) -> "socket is already connected"; -message(eisdir) -> "illegal operation on a directory"; -message(eisnam) -> "is a name file"; -message(elbin) -> "ELBIN"; -message(el2hlt) -> "level 2 halted"; -message(el2nsync) -> "level 2 not synchronized"; -message(el3hlt) -> "level 3 halted"; -message(el3rst) -> "level 3 reset"; -message(elibacc) -> "can not access a needed shared library"; -message(elibbad) -> "accessing a corrupted shared library"; -message(elibexec) -> "can not exec a shared library directly"; -message(elibmax) -> - "attempting to link in more shared libraries than system limit"; -message(elibscn) -> ".lib section in a.out corrupted"; -message(elnrng) -> "link number out of range"; -message(eloop) -> "too many levels of symbolic links"; -message(emfile) -> "too many open files"; -message(emlink) -> "too many links"; -message(emsgsize) -> "message too long"; -message(emultihop) -> "multihop attempted"; -message(enametoolong) -> "file name too long"; -message(enavail) -> "not available"; -message(enet) -> "ENET"; -message(enetdown) -> "network is down"; -message(enetreset) -> "network dropped connection on reset"; -message(enetunreach) -> "network is unreachable"; -message(enfile) -> "file table overflow"; -message(enoano) -> "anode table overflow"; -message(enobufs) -> "no buffer space available"; -message(enocsi) -> "no CSI structure available"; -message(enodata) -> "no data available"; -message(enodev) -> "no such device"; -message(enoent) -> "no such file or directory"; -message(enoexec) -> "exec format error"; -message(enolck) -> "no locks available"; -message(enolink) -> "link has be severed"; -message(enomem) -> "not enough memory"; -message(enomsg) -> "no message of desired type"; -message(enonet) -> "machine is not on the network"; -message(enopkg) -> "package not installed"; -message(enoprotoopt) -> "bad proocol option"; -message(enospc) -> "no space left on device"; -message(enosr) -> "out of stream resources or not a stream device"; -message(enosym) -> "unresolved symbol name"; -message(enosys) -> "function not implemented"; -message(enotblk) -> "block device required"; -message(enotconn) -> "socket is not connected"; -message(enotdir) -> "not a directory"; -message(enotempty) -> "directory not empty"; -message(enotnam) -> "not a name file"; -message(enotsock) -> "socket operation on non-socket"; -message(enotsup) -> "operation not supported"; -message(enotty) -> "inappropriate device for ioctl"; -message(enotuniq) -> "name not unique on network"; -message(enxio) -> "no such device or address"; -message(eopnotsupp) -> "operation not supported on socket"; -message(eperm) -> "not owner"; -message(epfnosupport) -> "protocol family not supported"; -message(epipe) -> "broken pipe"; -message(eproclim) -> "too many processes"; -message(eprocunavail) -> "bad procedure for program"; -message(eprogmismatch) -> "program version wrong"; -message(eprogunavail) -> "RPC program not available"; -message(eproto) -> "protocol error"; -message(eprotonosupport) -> "protocol not suppored"; -message(eprototype) -> "protocol wrong type for socket"; -message(erange) -> "math result unrepresentable"; -message(erefused) -> "EREFUSED"; -message(eremchg) -> "remote address changed"; -message(eremdev) -> "remote device"; -message(eremote) -> "pathname hit remote file system"; -message(eremoteio) -> "remote i/o error"; -message(eremoterelease) -> "EREMOTERELEASE"; -message(erofs) -> "read-only file system"; -message(erpcmismatch) -> "RPC version is wrong"; -message(erremote) -> "object is remote"; -message(eshutdown) -> "can't send after socket shutdown"; -message(esocktnosupport) -> "socket type not supported"; -message(espipe) -> "invalid seek"; -message(esrch) -> "no such process"; -message(esrmnt) -> "srmount error"; -message(estale) -> "stale remote file handle"; -message(esuccess) -> "Error 0"; -message(etime) -> "timer expired"; -message(etimedout) -> "connection timed out"; -message(etoomanyrefs) -> "too many references: can't splice"; -message(etxtbsy) -> "text file or pseudo-device busy"; -message(euclean) -> "structure needs cleaning"; -message(eunatch) -> "protocol driver not attached"; -message(eusers) -> "too many users"; -message(eversion) -> "version mismatch"; -message(ewouldblock) -> "operation would block"; -message(exdev) -> "cross-domain link"; -message(exfull) -> "message tables full"; -message(nxdomain) -> "non-existing domain"; -message(_) -> "unknown POSIX error". +message(T) -> + binary_to_list(message_1(T)). + +message_1(e2big) -> <<"argument list too long">>; +message_1(eacces) -> <<"permission denied">>; +message_1(eaddrinuse) -> <<"address already in use">>; +message_1(eaddrnotavail) -> <<"can't assign requested address">>; +message_1(eadv) -> <<"advertise error">>; +message_1(eafnosupport) -> <<"address family not supported by protocol family">>; +message_1(eagain) -> <<"resource temporarily unavailable">>; +message_1(ealign) -> <<"EALIGN">>; +message_1(ealready) -> <<"operation already in progress">>; +message_1(ebade) -> <<"bad exchange descriptor">>; +message_1(ebadf) -> <<"bad file number">>; +message_1(ebadfd) -> <<"file descriptor in bad state">>; +message_1(ebadmsg) -> <<"not a data message">>; +message_1(ebadr) -> <<"bad request descriptor">>; +message_1(ebadrpc) -> <<"RPC structure is bad">>; +message_1(ebadrqc) -> <<"bad request code">>; +message_1(ebadslt) -> <<"invalid slot">>; +message_1(ebfont) -> <<"bad font file format">>; +message_1(ebusy) -> <<"file busy">>; +message_1(echild) -> <<"no children">>; +message_1(echrng) -> <<"channel number out of range">>; +message_1(ecomm) -> <<"communication error on send">>; +message_1(econnaborted) -> <<"software caused connection abort">>; +message_1(econnrefused) -> <<"connection refused">>; +message_1(econnreset) -> <<"connection reset by peer">>; +message_1(edeadlk) -> <<"resource deadlock avoided">>; +message_1(edeadlock) -> <<"resource deadlock avoided">>; +message_1(edestaddrreq) -> <<"destination address required">>; +message_1(edirty) -> <<"mounting a dirty fs w/o force">>; +message_1(edom) -> <<"math argument out of range">>; +message_1(edotdot) -> <<"cross mount point">>; +message_1(edquot) -> <<"disk quota exceeded">>; +message_1(eduppkg) -> <<"duplicate package name">>; +message_1(eexist) -> <<"file already exists">>; +message_1(efault) -> <<"bad address in system call argument">>; +message_1(efbig) -> <<"file too large">>; +message_1(ehostdown) -> <<"host is down">>; +message_1(ehostunreach) -> <<"host is unreachable">>; +message_1(eidrm) -> <<"identifier removed">>; +message_1(einit) -> <<"initialization error">>; +message_1(einprogress) -> <<"operation now in progress">>; +message_1(eintr) -> <<"interrupted system call">>; +message_1(einval) -> <<"invalid argument">>; +message_1(eio) -> <<"I/O error">>; +message_1(eisconn) -> <<"socket is already connected">>; +message_1(eisdir) -> <<"illegal operation on a directory">>; +message_1(eisnam) -> <<"is a name file">>; +message_1(elbin) -> <<"ELBIN">>; +message_1(el2hlt) -> <<"level 2 halted">>; +message_1(el2nsync) -> <<"level 2 not synchronized">>; +message_1(el3hlt) -> <<"level 3 halted">>; +message_1(el3rst) -> <<"level 3 reset">>; +message_1(elibacc) -> <<"can not access a needed shared library">>; +message_1(elibbad) -> <<"accessing a corrupted shared library">>; +message_1(elibexec) -> <<"can not exec a shared library directly">>; +message_1(elibmax) -> + <<"attempting to link in more shared libraries than system limit">>; +message_1(elibscn) -> <<".lib section in a.out corrupted">>; +message_1(elnrng) -> <<"link number out of range">>; +message_1(eloop) -> <<"too many levels of symbolic links">>; +message_1(emfile) -> <<"too many open files">>; +message_1(emlink) -> <<"too many links">>; +message_1(emsgsize) -> <<"message too long">>; +message_1(emultihop) -> <<"multihop attempted">>; +message_1(enametoolong) -> <<"file name too long">>; +message_1(enavail) -> <<"not available">>; +message_1(enet) -> <<"ENET">>; +message_1(enetdown) -> <<"network is down">>; +message_1(enetreset) -> <<"network dropped connection on reset">>; +message_1(enetunreach) -> <<"network is unreachable">>; +message_1(enfile) -> <<"file table overflow">>; +message_1(enoano) -> <<"anode table overflow">>; +message_1(enobufs) -> <<"no buffer space available">>; +message_1(enocsi) -> <<"no CSI structure available">>; +message_1(enodata) -> <<"no data available">>; +message_1(enodev) -> <<"no such device">>; +message_1(enoent) -> <<"no such file or directory">>; +message_1(enoexec) -> <<"exec format error">>; +message_1(enolck) -> <<"no locks available">>; +message_1(enolink) -> <<"link has be severed">>; +message_1(enomem) -> <<"not enough memory">>; +message_1(enomsg) -> <<"no message of desired type">>; +message_1(enonet) -> <<"machine is not on the network">>; +message_1(enopkg) -> <<"package not installed">>; +message_1(enoprotoopt) -> <<"bad proocol option">>; +message_1(enospc) -> <<"no space left on device">>; +message_1(enosr) -> <<"out of stream resources or not a stream device">>; +message_1(enosym) -> <<"unresolved symbol name">>; +message_1(enosys) -> <<"function not implemented">>; +message_1(enotblk) -> <<"block device required">>; +message_1(enotconn) -> <<"socket is not connected">>; +message_1(enotdir) -> <<"not a directory">>; +message_1(enotempty) -> <<"directory not empty">>; +message_1(enotnam) -> <<"not a name file">>; +message_1(enotsock) -> <<"socket operation on non-socket">>; +message_1(enotsup) -> <<"operation not supported">>; +message_1(enotty) -> <<"inappropriate device for ioctl">>; +message_1(enotuniq) -> <<"name not unique on network">>; +message_1(enxio) -> <<"no such device or address">>; +message_1(eopnotsupp) -> <<"operation not supported on socket">>; +message_1(eperm) -> <<"not owner">>; +message_1(epfnosupport) -> <<"protocol family not supported">>; +message_1(epipe) -> <<"broken pipe">>; +message_1(eproclim) -> <<"too many processes">>; +message_1(eprocunavail) -> <<"bad procedure for program">>; +message_1(eprogmismatch) -> <<"program version wrong">>; +message_1(eprogunavail) -> <<"RPC program not available">>; +message_1(eproto) -> <<"protocol error">>; +message_1(eprotonosupport) -> <<"protocol not suppored">>; +message_1(eprototype) -> <<"protocol wrong type for socket">>; +message_1(erange) -> <<"math result unrepresentable">>; +message_1(erefused) -> <<"EREFUSED">>; +message_1(eremchg) -> <<"remote address changed">>; +message_1(eremdev) -> <<"remote device">>; +message_1(eremote) -> <<"pathname hit remote file system">>; +message_1(eremoteio) -> <<"remote i/o error">>; +message_1(eremoterelease) -> <<"EREMOTERELEASE">>; +message_1(erofs) -> <<"read-only file system">>; +message_1(erpcmismatch) -> <<"RPC version is wrong">>; +message_1(erremote) -> <<"object is remote">>; +message_1(eshutdown) -> <<"can't send after socket shutdown">>; +message_1(esocktnosupport) -> <<"socket type not supported">>; +message_1(espipe) -> <<"invalid seek">>; +message_1(esrch) -> <<"no such process">>; +message_1(esrmnt) -> <<"srmount error">>; +message_1(estale) -> <<"stale remote file handle">>; +message_1(esuccess) -> <<"Error 0">>; +message_1(etime) -> <<"timer expired">>; +message_1(etimedout) -> <<"connection timed out">>; +message_1(etoomanyrefs) -> <<"too many references: can't splice">>; +message_1(etxtbsy) -> <<"text file or pseudo-device busy">>; +message_1(euclean) -> <<"structure needs cleaning">>; +message_1(eunatch) -> <<"protocol driver not attached">>; +message_1(eusers) -> <<"too many users">>; +message_1(eversion) -> <<"version mismatch">>; +message_1(ewouldblock) -> <<"operation would block">>; +message_1(exdev) -> <<"cross-domain link">>; +message_1(exfull) -> <<"message tables full">>; +message_1(nxdomain) -> <<"non-existing domain">>; +message_1(_) -> <<"unknown POSIX error">>. -- cgit v1.2.3 From 3f1fce3929cc0cc68d7e5b1ce543bd3f20a31e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 14 Jan 2011 16:00:36 +0100 Subject: c: Reduce memory footprint Use a binary instead of a string for the help text. --- lib/stdlib/src/c.erl | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl index d04d8f191f..235ea939a8 100644 --- a/lib/stdlib/src/c.erl +++ b/lib/stdlib/src/c.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -42,31 +42,31 @@ -spec help() -> 'ok'. help() -> - format("bt(Pid) -- stack backtrace for a process\n" - "c(File) -- compile and load code in \n" - "cd(Dir) -- change working directory\n" - "flush() -- flush any messages sent to the shell\n" - "help() -- help info\n" - "i() -- information about the system\n" - "ni() -- information about the networked system\n" - "i(X,Y,Z) -- information about pid \n" - "l(Module) -- load or reload module\n" - "lc([File]) -- compile a list of Erlang modules\n" - "ls() -- list files in the current directory\n" - "ls(Dir) -- list files in directory \n" - "m() -- which modules are loaded\n" - "m(Mod) -- information about module \n" - "memory() -- memory allocation information\n" - "memory(T) -- memory allocation information of type \n" - "nc(File) -- compile and load code in on all nodes\n" - "nl(Module) -- load module on all nodes\n" - "pid(X,Y,Z) -- convert X,Y,Z to a Pid\n" - "pwd() -- print working directory\n" - "q() -- quit - shorthand for init:stop()\n" - "regs() -- information about registered processes\n" - "nregs() -- information about all registered processes\n" - "xm(M) -- cross reference check a module\n" - "y(File) -- generate a Yecc parser\n"). + io:put_chars(<<"bt(Pid) -- stack backtrace for a process\n" + "c(File) -- compile and load code in \n" + "cd(Dir) -- change working directory\n" + "flush() -- flush any messages sent to the shell\n" + "help() -- help info\n" + "i() -- information about the system\n" + "ni() -- information about the networked system\n" + "i(X,Y,Z) -- information about pid \n" + "l(Module) -- load or reload module\n" + "lc([File]) -- compile a list of Erlang modules\n" + "ls() -- list files in the current directory\n" + "ls(Dir) -- list files in directory \n" + "m() -- which modules are loaded\n" + "m(Mod) -- information about module \n" + "memory() -- memory allocation information\n" + "memory(T) -- memory allocation information of type \n" + "nc(File) -- compile and load code in on all nodes\n" + "nl(Module) -- load module on all nodes\n" + "pid(X,Y,Z) -- convert X,Y,Z to a Pid\n" + "pwd() -- print working directory\n" + "q() -- quit - shorthand for init:stop()\n" + "regs() -- information about registered processes\n" + "nregs() -- information about all registered processes\n" + "xm(M) -- cross reference check a module\n" + "y(File) -- generate a Yecc parser\n">>). %% c(FileName) %% Compile a file/module. -- cgit v1.2.3 From 0fd3723a4d5a13ac381c36c14e5fb513363f68dd Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 17 Jan 2011 15:42:39 +0100 Subject: OTP-9031 - SSH did not handle the error reason enetunreach when trying to open a IPv6 connection. --- lib/ssh/doc/src/notes.xml | 16 +++++++++++++++- lib/ssh/src/ssh_acceptor.erl | 6 +++++- lib/ssh/src/ssh_transport.erl | 4 +++- lib/ssh/vsn.mk | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 9bedd446f4..8e422792c9 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20042010 + 20042011 Ericsson AB. All Rights Reserved. @@ -29,6 +29,20 @@ notes.xml
+
Ssh 2.0.4 +
Fixed Bugs and Malfunctions + + +

+ SSH did not handle the error reason enetunreach + when trying to open a IPv6 connection.

+

+ Own Id: OTP-9031

+
+
+
+
+
Ssh 2.0.3
Fixed Bugs and Malfunctions diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl index 9060626ab3..59fbd24cf5 100644 --- a/lib/ssh/src/ssh_acceptor.erl +++ b/lib/ssh/src/ssh_acceptor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -55,6 +55,10 @@ acceptor_init(Parent, Port, Address, SockOpts, Opts, AcceptTimeout) -> do_socket_listen(Callback, Port, Opts) -> case Callback:listen(Port, Opts) of + {error, nxdomain} -> + Callback:listen(Port, lists:delete(inet6, Opts)); + {error, enetunreach} -> + Callback:listen(Port, lists:delete(inet6, Opts)); {error, eafnosupport} -> Callback:listen(Port, lists:delete(inet6, Opts)); Other -> diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl index e79ccdda0c..de3e29e2f1 100644 --- a/lib/ssh/src/ssh_transport.erl +++ b/lib/ssh/src/ssh_transport.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -169,6 +169,8 @@ do_connect(Callback, Address, Port, SocketOpts, Timeout) -> Callback:connect(Address, Port, lists:delete(inet6, Opts), Timeout); {error, eafnosupport} -> Callback:connect(Address, Port, lists:delete(inet6, Opts), Timeout); + {error, enetunreach} -> + Callback:connect(Address, Port, lists:delete(inet6, Opts), Timeout); Other -> Other end. diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index db03168ad9..51f9f47446 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,5 +1,5 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 2.0.3 +SSH_VSN = 2.0.4 APP_VSN = "ssh-$(SSH_VSN)" -- cgit v1.2.3 From 02e0f98ab537b002f2ccb1092d9e7310d9e15c58 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Mon, 3 Jan 2011 15:07:55 +0200 Subject: Fix errors in the handling of 'and'/'or' guards Apart from the obvious bug in the negative evaluation of an 'and' guard, Dialyzer handled dont_know cases rather single-mindedly towards the positive branch. This patch allows for negative results as well and does some clever guesses to narrow them down. It was constructed similarly to the handling of the 'not' guard. --- lib/dialyzer/src/dialyzer_dataflow.erl | 47 +++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 0e51ce059c..1723380c8c 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -2250,24 +2250,30 @@ handle_guard_and(Guard, Map, Env, Eval, State) -> catch throw:{fail, _} -> bind_guard(Arg2, Map, Env, pos, State) end, {Map2, Type2} = - try bind_guard(Arg1, Map, Env, neg, State) - catch throw:{fail, _} -> bind_guard(Arg2, Map, Env, pos, State) + try bind_guard(Arg2, Map, Env, neg, State) + catch throw:{fail, _} -> bind_guard(Arg1, Map, Env, pos, State) end, case t_is_atom(false, Type1) orelse t_is_atom(false, Type2) of true -> {join_maps([Map1, Map2], Map), t_atom(false)}; false -> throw({fail, none}) end; dont_know -> - True = t_atom(true), {Map1, Type1} = bind_guard(Arg1, Map, Env, dont_know, State), - case t_is_none(t_inf(Type1, t_boolean())) of - true -> throw({fail, none}); + {Map2, Type2} = bind_guard(Arg2, Map, Env, dont_know, State), + Bool1 = t_inf(Type1, t_boolean()), + Bool2 = t_inf(Type2, t_boolean()), + case t_is_none(Bool1) orelse t_is_none(Bool2) of + true -> throw({fatal_fail, none}); false -> - {Map2, Type2} = bind_guard(Arg2, Map1, Env, Eval, State), - case t_is_none(t_inf(Type2, t_boolean())) of - true -> throw({fail, none}); - false -> {Map2, True} - end + NewMap = join_maps([Map1, Map2], Map), + NewType = + case {t_atom_vals(Bool1), t_atom_vals(Bool2)} of + {['true'] , ['true'] } -> t_atom(true); + {['false'], _ } -> t_atom(false); + {_ , ['false']} -> t_atom(false); + {_ , _ } -> t_boolean() + end, + {NewMap, NewType} end end. @@ -2303,11 +2309,22 @@ handle_guard_or(Guard, Map, Env, Eval, State) -> end end; dont_know -> - {Map1, Bool1} = bind_guard(Arg1, Map, Env, dont_know, State), - {Map2, Bool2} = bind_guard(Arg2, Map, Env, dont_know, State), - case t_is_boolean(Bool1) andalso t_is_boolean(Bool2) of - true -> {join_maps([Map1, Map2], Map), t_sup(Bool1, Bool2)}; - false -> throw({fail, none}) + {Map1, Type1} = bind_guard(Arg1, Map, Env, dont_know, State), + {Map2, Type2} = bind_guard(Arg2, Map, Env, dont_know, State), + Bool1 = t_inf(Type1, t_boolean()), + Bool2 = t_inf(Type2, t_boolean()), + case t_is_none(Bool1) orelse t_is_none(Bool2) of + true -> throw({fatal_fail, none}); + false -> + NewMap = join_maps([Map1, Map2], Map), + NewType = + case {t_atom_vals(Bool1), t_atom_vals(Bool2)} of + {['false'], ['false']} -> t_atom(false); + {['true'] , _ } -> t_atom(true); + {_ , ['true'] } -> t_atom(true); + {_ , _ } -> t_boolean() + end, + {NewMap, NewType} end end. -- cgit v1.2.3 From 271ee9372e07feafae6af35ccc783946371d50bd Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Fri, 14 Jan 2011 15:36:01 +0200 Subject: Fix warnings about guards containing not The wording of warnings about unsatisfiable guards that used 'not' was incorrect (the 'not' was not mentioned and it appeared as "Guard test is_atom(atom()) can never succeed"). --- lib/dialyzer/src/dialyzer.erl | 2 + lib/dialyzer/src/dialyzer_dataflow.erl | 69 +++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index 471f9fccd2..550bf76823 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -325,6 +325,8 @@ message_to_string({guard_fail, [Arg1, Infix, Arg2]}) -> io_lib:format("Guard test ~s ~s ~s can never succeed\n", [Arg1, Infix, Arg2]); message_to_string({guard_fail, [Guard, Args]}) -> io_lib:format("Guard test ~w~s can never succeed\n", [Guard, Args]); +message_to_string({neg_guard_fail, [Guard, Args]}) -> + io_lib:format("Guard test not(~w~s) can never succeed\n", [Guard, Args]); message_to_string({guard_fail_pat, [Pat, Type]}) -> io_lib:format("Clause guard cannot succeed. The ~s was matched" " against the type ~s\n", [Pat, Type]); diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 1723380c8c..2ffbcd3e82 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -1457,6 +1457,7 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, false -> WarnType = case Msg of {guard_fail, _} -> ?WARN_MATCHING; + {neg_guard_fail, _} -> ?WARN_MATCHING; {opaque_guard, _} -> ?WARN_OPAQUE end, state__add_warning(State1, WarnType, FailGuard, Msg); @@ -1869,8 +1870,8 @@ handle_guard_gen_fun({M, F, A}, Guard, Map, Env, Eval, State) -> true -> %% Is this an error-bif? case t_is_none(erl_bif_types:type(M, F, A)) of - true -> signal_guard_fail(Guard, As, State); - false -> signal_guard_fatal_fail(Guard, As, State) + true -> signal_guard_fail(Eval, Guard, As, State); + false -> signal_guard_fatal_fail(Eval, Guard, As, State) end; false -> BifArgs = case erl_bif_types:arg_types(M, F, A) of @@ -1887,7 +1888,7 @@ handle_guard_gen_fun({M, F, A}, Guard, Map, Env, Eval, State) -> case t_is_none(Ret) of true -> case Eval =:= pos of - true -> signal_guard_fail(Guard, As, State); + true -> signal_guard_fail(Eval, Guard, As, State); false -> throw({fail, none}) end; false -> {Map2, Ret} @@ -1900,7 +1901,7 @@ handle_guard_type_test(Guard, F, Map, Env, Eval, State) -> case bind_type_test(Eval, F, ArgType, State) of error -> ?debug("Type test: ~w failed\n", [F]), - signal_guard_fail(Guard, [ArgType], State); + signal_guard_fail(Eval, Guard, [ArgType], State); {ok, NewArgType, Ret} -> ?debug("Type test: ~w succeeded, NewType: ~s, Ret: ~s\n", [F, t_to_string(NewArgType), t_to_string(Ret)]), @@ -1963,18 +1964,19 @@ handle_guard_comp(Guard, Comp, Map, Env, Eval, State) -> true when Eval =:= pos -> {Map, t_atom(true)}; true when Eval =:= dont_know -> {Map, t_atom(true)}; true when Eval =:= neg -> {Map, t_atom(true)}; - false when Eval =:= pos -> signal_guard_fail(Guard, ArgTypes, State); + false when Eval =:= pos -> + signal_guard_fail(Eval, Guard, ArgTypes, State); false when Eval =:= dont_know -> {Map, t_atom(false)}; false when Eval =:= neg -> {Map, t_atom(false)} end; {literal, var} when IsInt1 andalso IsInt2 andalso (Eval =:= pos) -> case bind_comp_literal_var(Arg1, Arg2, Type2, Comp, Map1) of - error -> signal_guard_fail(Guard, ArgTypes, State); + error -> signal_guard_fail(Eval, Guard, ArgTypes, State); {ok, NewMap} -> {NewMap, t_atom(true)} end; {var, literal} when IsInt1 andalso IsInt2 andalso (Eval =:= pos) -> case bind_comp_literal_var(Arg2, Arg1, Type1, invert_comp(Comp), Map1) of - error -> signal_guard_fail(Guard, ArgTypes, State); + error -> signal_guard_fail(Eval, Guard, ArgTypes, State); {ok, NewMap} -> {NewMap, t_atom(true)} end; {_, _} -> @@ -2014,7 +2016,7 @@ handle_guard_is_function(Guard, Map, Env, Eval, State) -> [FunType0, ArityType0] = ArgTypes0, ArityType = t_inf(ArityType0, t_integer()), case t_is_none(ArityType) of - true -> signal_guard_fail(Guard, ArgTypes0, State); + true -> signal_guard_fail(Eval, Guard, ArgTypes0, State); false -> FunTypeConstr = case t_number_vals(ArityType) of @@ -2026,7 +2028,7 @@ handle_guard_is_function(Guard, Map, Env, Eval, State) -> case t_is_none(FunType) of true -> case Eval of - pos -> signal_guard_fail(Guard, ArgTypes0, State); + pos -> signal_guard_fail(Eval, Guard, ArgTypes0, State); neg -> {Map1, t_atom(false)}; dont_know -> {Map1, t_atom(false)} end; @@ -2062,7 +2064,7 @@ handle_guard_is_record(Guard, Map, Env, Eval, State) -> case t_is_none(Type) of true -> case Eval of - pos -> signal_guard_fail(Guard, + pos -> signal_guard_fail(Eval, Guard, [RecType, t_from_term(Tag), t_from_term(Arity)], State); @@ -2095,7 +2097,7 @@ handle_guard_eq(Guard, Map, Env, Eval, State) -> Eval =:= pos -> ArgTypes = [t_from_term(cerl:concrete(Arg1)), t_from_term(cerl:concrete(Arg2))], - signal_guard_fail(Guard, ArgTypes, State) + signal_guard_fail(Eval, Guard, ArgTypes, State) end end; {literal, _} when Eval =:= pos -> @@ -2150,7 +2152,7 @@ handle_guard_eqeq(Guard, Map, Env, Eval, State) -> Eval =:= pos -> ArgTypes = [t_from_term(cerl:concrete(Arg1)), t_from_term(cerl:concrete(Arg2))], - signal_guard_fail(Guard, ArgTypes, State) + signal_guard_fail(Eval, Guard, ArgTypes, State) end end; {literal, _} when Eval =:= pos -> @@ -2172,7 +2174,7 @@ bind_eqeq_guard(Guard, Arg1, Arg2, Map, Env, Eval, State) -> case Eval of neg -> {Map2, t_atom(false)}; dont_know -> {Map2, t_atom(false)}; - pos -> signal_guard_fail(Guard, [Type1, Type2], State) + pos -> signal_guard_fail(Eval, Guard, [Type1, Type2], State) end; false -> case Eval of @@ -2199,29 +2201,29 @@ bind_eqeq_guard(Guard, Arg1, Arg2, Map, Env, Eval, State) -> end. bind_eqeq_guard_lit_other(Guard, Arg1, Arg2, Map, Env, State) -> - %% Assumes positive evaluation + Eval = dont_know, case cerl:concrete(Arg1) of true -> {_, Type} = MT = bind_guard(Arg2, Map, Env, pos, State), case t_is_atom(true, Type) of true -> MT; false -> - {_, Type0} = bind_guard(Arg2, Map, Env, dont_know, State), - signal_guard_fail(Guard, [Type0, t_atom(true)], State) + {_, Type0} = bind_guard(Arg2, Map, Env, Eval, State), + signal_guard_fail(Eval, Guard, [Type0, t_atom(true)], State) end; false -> {Map1, Type} = bind_guard(Arg2, Map, Env, neg, State), case t_is_atom(false, Type) of true -> {Map1, t_atom(true)}; false -> - {_, Type0} = bind_guard(Arg2, Map, Env, dont_know, State), - signal_guard_fail(Guard, [Type0, t_atom(true)], State) + {_, Type0} = bind_guard(Arg2, Map, Env, Eval, State), + signal_guard_fail(Eval, Guard, [Type0, t_atom(true)], State) end; Term -> LitType = t_from_term(Term), - {Map1, Type} = bind_guard(Arg2, Map, Env, dont_know, State), + {Map1, Type} = bind_guard(Arg2, Map, Env, Eval, State), case t_is_subtype(LitType, Type) of - false -> signal_guard_fail(Guard, [Type, LitType], State); + false -> signal_guard_fail(Eval, Guard, [Type, LitType], State); true -> case cerl:is_c_var(Arg2) of true -> {enter_type(Arg2, LitType, Map1), t_atom(true)}; @@ -2366,10 +2368,12 @@ bind_guard_list([G|Gs], Map, Env, Eval, State, Acc) -> bind_guard_list([], Map, _Env, _Eval, _State, Acc) -> {Map, lists:reverse(Acc)}. --spec signal_guard_fail(cerl:c_call(), [erl_types:erl_type()], state()) -> - no_return(). +-type eval() :: 'pos' | 'neg' | 'dont_know'. -signal_guard_fail(Guard, ArgTypes, State) -> +-spec signal_guard_fail(eval(), cerl:c_call(), [erl_types:erl_type()], + state()) -> no_return(). + +signal_guard_fail(Eval, Guard, ArgTypes, State) -> Args = cerl:call_args(Guard), F = cerl:atom_val(cerl:call_name(Guard)), MFA = {cerl:atom_val(cerl:call_module(Guard)), F, length(Args)}, @@ -2382,7 +2386,7 @@ signal_guard_fail(Guard, ArgTypes, State) -> atom_to_list(F), format_args_1([Arg2], [ArgType2], State)]}; false -> - mk_guard_msg(F, Args, ArgTypes, State) + mk_guard_msg(Eval, F, Args, ArgTypes, State) end, throw({fail, {Guard, Msg}}). @@ -2397,20 +2401,25 @@ is_infix_op({erlang, '>=', 2}) -> true; is_infix_op({M, F, A}) when is_atom(M), is_atom(F), is_integer(A), 0 =< A, A =< 255 -> false. --spec signal_guard_fatal_fail(cerl:c_call(), [erl_types:erl_type()], state()) -> - no_return(). +-spec signal_guard_fatal_fail(eval(), cerl:c_call(), [erl_types:erl_type()], + state()) -> no_return(). -signal_guard_fatal_fail(Guard, ArgTypes, State) -> +signal_guard_fatal_fail(Eval, Guard, ArgTypes, State) -> Args = cerl:call_args(Guard), F = cerl:atom_val(cerl:call_name(Guard)), - Msg = mk_guard_msg(F, Args, ArgTypes, State), + Msg = mk_guard_msg(Eval, F, Args, ArgTypes, State), throw({fatal_fail, {Guard, Msg}}). -mk_guard_msg(F, Args, ArgTypes, State) -> +mk_guard_msg(Eval, F, Args, ArgTypes, State) -> FArgs = [F, format_args(Args, ArgTypes, State)], case any_has_opaque_subtype(ArgTypes) of true -> {opaque_guard, FArgs}; - false -> {guard_fail, FArgs} + false -> + case Eval of + neg -> {neg_guard_fail, FArgs}; + pos -> {guard_fail, FArgs}; + dont_know -> {guard_fail, FArgs} + end end. bind_guard_case_clauses(Arg, Clauses, Map, Env, Eval, State) -> -- cgit v1.2.3 From 5b8609d544911b60a1c384b11d96c147128a848d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 18 Jan 2011 16:45:50 +0100 Subject: Lower the maximum arity from 256 to 255 Historically, for no good reason, a function is allowed to have from 0 to 256 arguments. Thus, the number of arguments *almost* fits into a byte. HiPE only supports up to 255 arguments (because it assumes that the function arity fits into a single byte), and fixing that limitation would require ugly special-case handling. In Dialyzer, the arity type is defined to be a byte (i.e. 0..255). Since no-one uses functions with 256 arguments anyway, lower the limit to 255. --- erts/emulator/beam/erl_vm.h | 4 ++-- system/doc/efficiency_guide/advanced.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h index 48fa99934e..5b42a2ce11 100644 --- a/erts/emulator/beam/erl_vm.h +++ b/erts/emulator/beam/erl_vm.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -47,7 +47,7 @@ #define SEQ_TRACE 1 #define CONTEXT_REDS 2000 /* Swap process out after this number */ -#define MAX_ARG 256 /* Max number of arguments allowed */ +#define MAX_ARG 255 /* Max number of arguments allowed */ #define MAX_REG 1024 /* Max number of x(N) registers used */ /* Scheduler stores data for temporary heaps if diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml index 2383e3cf3d..8126b93a2d 100644 --- a/system/doc/efficiency_guide/advanced.xml +++ b/system/doc/efficiency_guide/advanced.xml @@ -4,7 +4,7 @@
- 20012010 + 20012011 Ericsson AB. All Rights Reserved. @@ -200,7 +200,7 @@ On 64-bit architectures: 4 words for a reference from the current local node, an the maximum number of Erlang ports available, and operating system specific settings and limits. Number of arguments to a function or fun - 256 + 255
-- cgit v1.2.3 From 19baa213c5a69d4cd0fbe3e430a6c08a78e7acbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 18 Jan 2011 16:56:04 +0100 Subject: Refuse to compile functions with too many arguments --- lib/stdlib/src/erl_lint.erl | 22 +++++++++++++++++----- lib/stdlib/test/erl_lint_SUITE.erl | 22 +++++++++++++++++++--- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 0c2d3db8ec..cfb9f0ca98 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -60,6 +60,10 @@ value_option(Flag, Default, On, OnVal, Off, OffVal, Opts) -> (_Opt, Def) -> Def end, Default, Opts). +%% The maximum number of arguments allowed for a function. + +-define(MAX_ARGUMENTS, 255). + %% The error and warning info structures, {Line,Module,Descriptor}, %% are kept in their seperate fields in the lint state record together %% with the name of the file (when a new file is entered, marked by @@ -226,6 +230,9 @@ format_error({obsolete_guard, {F, A}}) -> io_lib:format("~p/~p obsolete", [F, A]); format_error({reserved_for_future,K}) -> io_lib:format("atom ~w: future reserved keyword - rename or quote", [K]); +format_error({too_many_arguments,Arity}) -> + io_lib:format("too many arguments (~w) - " + "maximum allowed is ~w", [Arity,?MAX_ARGUMENTS]); %% --- patterns and guards --- format_error(illegal_pattern) -> "illegal pattern"; format_error(illegal_bin_pattern) -> @@ -1307,13 +1314,18 @@ define_function(Line, Name, Arity, St0) -> true -> add_error(Line, {redefine_function,NA}, St1); false -> - St2 = St1#lint{defined=gb_sets:add_element(NA, St1#lint.defined)}, - case imported(Name, Arity, St2) of - {yes,_M} -> add_error(Line, {define_import,NA}, St2); - no -> St2 + St2 = function_check_max_args(Line, Arity, St1), + St3 = St2#lint{defined=gb_sets:add_element(NA, St2#lint.defined)}, + case imported(Name, Arity, St3) of + {yes,_M} -> add_error(Line, {define_import,NA}, St3); + no -> St3 end end. +function_check_max_args(Line, Arity, St) when Arity > ?MAX_ARGUMENTS -> + add_error(Line, {too_many_arguments,Arity}, St); +function_check_max_args(_, _, St) -> St. + %% clauses([Clause], VarTable, State) -> {VarTable, State}. clauses(Cs, Vt, St) -> diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index d0c0d68b4a..c4158abf32 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -54,7 +54,8 @@ otp_7550/1, otp_8051/1, format_warn/1, - on_load/1, on_load_successful/1, on_load_failing/1 + on_load/1, on_load_successful/1, on_load_failing/1, + too_many_arguments/1 ]). % Default timetrap timeout (set in init_per_testcase). @@ -77,7 +78,7 @@ all(suite) -> otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, otp_5878, otp_5917, otp_6585, otp_6885, export_all, bif_clash, behaviour_basic, behaviour_multiple, otp_7550, otp_8051, format_warn, - on_load]. + on_load,too_many_arguments]. unused_vars_warn(suite) -> [unused_vars_warn_basic, unused_vars_warn_lc, unused_vars_warn_rec, @@ -2913,6 +2914,21 @@ on_load_failing(Config) when is_list(Config) -> ?line [] = run(Config, Ts), ok. +too_many_arguments(doc) -> + "Test that too many arguments is not accepted."; +too_many_arguments(suite) -> []; +too_many_arguments(Config) when is_list(Config) -> + Ts = [{too_many_1, + <<"f(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_) -> ok.">>, + [], + {errors, + [{1,erl_lint,{too_many_arguments,256}}],[]}} + ], + + ?line [] = run(Config, Ts), + ok. + + run(Config, Tests) -> F = fun({N,P,Ws,E}, BadL) -> case catch run_test(Config, P, Ws) of -- cgit v1.2.3 From 0a0c3227283db6db232aa93886e73ebd0fae8f20 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 10:40:00 +0100 Subject: Added updated modules to the appup file. --- lib/ssh/src/ssh.appup.src | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 9c806bcd03..3bd86a2a01 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,11 +19,25 @@ {"%VSN%", [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ], [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ] }. -- cgit v1.2.3 From 38336b83da9a6698b00db6e17a8ee597f86e7a1d Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 10:50:48 +0100 Subject: Added updated modules to the appup file. --- lib/ssh/src/ssh.appup.src | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 9c806bcd03..501da8ceb9 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,11 +19,33 @@ {"%VSN%", [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ], [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ] }. -- cgit v1.2.3 From 1bff9d79218bcb3c44737cb2bfefac85c6f0322f Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:06:46 +0100 Subject: Updated year in license. --- lib/ssh/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index acadfdc3b4..865b7e9b95 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20042010 + 20042011 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From 07647272d13eba11304790b4cb964efae3c722a3 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:10:15 +0100 Subject: Changed year in copyright header. --- lib/ssh/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 8d73c033be..2867de338c 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20042010 + 20042011 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From c921fa494f7af964fb20aa344fbeefaf8f06d48e Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:23:33 +0100 Subject: Updated notes file. --- lib/ssh/doc/src/notes.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 8e422792c9..af667b1a71 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -32,6 +32,14 @@
Ssh 2.0.4
Fixed Bugs and Malfunctions + +

In some cases SSH returned {error, normal} when a channel was terminated + unexpectedly. This has now been changed to {error, channel_closed}.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-8987 Aux Id: seq11748

+

SSH did not handle the error reason enetunreach @@ -41,6 +49,23 @@

+
Improvements and New Features + + +

+ It is now possible to use SSH to sign and verify binary data.

+

+ Own Id: OTP-8986

+
+ +

+ SSH now ensures that the .ssh directory exists before trying + to access files located in that directory.

+

+ Own Id: OTP-9010

+
+
+
Ssh 2.0.3 -- cgit v1.2.3 From 1a9b4c4e0a799a3573f28f005da8b6a35a53fadc Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:25:16 +0100 Subject: Updated notes file. --- lib/ssh/doc/src/notes.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 2867de338c..af667b1a71 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -40,6 +40,13 @@

Own Id: OTP-8987 Aux Id: seq11748

+ +

+ SSH did not handle the error reason enetunreach + when trying to open a IPv6 connection.

+

+ Own Id: OTP-9031

+
Improvements and New Features @@ -50,9 +57,16 @@

Own Id: OTP-8986

+ +

+ SSH now ensures that the .ssh directory exists before trying + to access files located in that directory.

+

+ Own Id: OTP-9010

+
-
+
Ssh 2.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 378c3d37b5b81bcee64351b752f109d89e7205ef Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:27:05 +0100 Subject: Updated notes file. --- lib/ssh/doc/src/notes.xml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 865b7e9b95..af667b1a71 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -30,8 +30,33 @@
Ssh 2.0.4 +
Fixed Bugs and Malfunctions + + +

In some cases SSH returned {error, normal} when a channel was terminated + unexpectedly. This has now been changed to {error, channel_closed}.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-8987 Aux Id: seq11748

+
+ +

+ SSH did not handle the error reason enetunreach + when trying to open a IPv6 connection.

+

+ Own Id: OTP-9031

+
+
+
Improvements and New Features + +

+ It is now possible to use SSH to sign and verify binary data.

+

+ Own Id: OTP-8986

+

SSH now ensures that the .ssh directory exists before trying @@ -41,7 +66,7 @@

-
+
Ssh 2.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 28ecd6a36a3203d2e99a724039109ee612a26296 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:31:21 +0100 Subject: Updated appup file. --- lib/ssh/src/ssh.appup.src | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 9c806bcd03..501da8ceb9 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,11 +19,33 @@ {"%VSN%", [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ], [ - {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, + {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, + {load_module, ssh, soft_purge, soft_purge, []}, + {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ] }. -- cgit v1.2.3 From afdb12f28b7b66452dd0bd83c8f539aee4e61ed9 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 12:35:08 +0100 Subject: Updated appup file. --- lib/ssh/src/ssh.appup.src | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 3bd86a2a01..501da8ceb9 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -22,10 +22,14 @@ {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, {load_module, ssh, soft_purge, soft_purge, []}, {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, {load_module, ssh, soft_purge, soft_purge, []}, {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ], @@ -33,10 +37,14 @@ {"2.0.3", [{load_module, ssh_file, soft_purge, soft_purge, []}, {load_module, ssh, soft_purge, soft_purge, []}, {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}, {load_module, ssh, soft_purge, soft_purge, []}, {load_module, ssh_rsa, soft_purge, soft_purge, []}, + {load_module, ssh_acceptor, soft_purge, soft_purge, []}, + {load_module, ssh_transport, soft_purge, soft_purge, []}, {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ] -- cgit v1.2.3 From 1a6611c383fd0c85fecfd70e04e4e4525c0a55b1 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 16:26:27 +0100 Subject: OTP-9035 - More tests added so that Orber does not try to run IPv6 tests on a machine than cannot handle that. This only affect test code and not the application. --- lib/orber/test/orber_test_lib.erl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl index b95cf4b0ec..132f02bb78 100644 --- a/lib/orber/test/orber_test_lib.erl +++ b/lib/orber/test/orber_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -126,13 +126,22 @@ version_ok() -> _ -> case gen_tcp:listen(0, [{reuseaddr, true}, inet6]) of {ok, LSock} -> - gen_tcp:close(LSock), - true; + {ok, Port} = inet:port(LSock), + case gen_tcp:connect(Hostname, Port, [inet6]) of + {error, _} -> + gen_tcp:close(LSock), + {skipped, "Inet cannot handle IPv6"}; + {ok, Socket} -> + gen_tcp:close(Socket), + gen_tcp:close(LSock), + true + end; {error, _} -> {skipped, "Inet cannot handle IPv6"} end end end. + %%------------------------------------------------------------ %% function : get_host %% Arguments: Family - inet | inet6 -- cgit v1.2.3 From c6238ffaa4ef8bbe0aff8fde402a3254e746d3cc Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 20 Jan 2011 17:00:32 +0100 Subject: Skip ssl and public key tests if crypto fails to start --- lib/public_key/test/pkits_SUITE.erl | 10 +++++++--- lib/public_key/test/public_key_SUITE.erl | 11 +++++++---- lib/ssl/test/ssl_basic_SUITE.erl | 31 +++++++++++++++++-------------- lib/ssl/test/ssl_packet_SUITE.erl | 23 +++++++++++++---------- lib/ssl/test/ssl_payload_SUITE.erl | 17 ++++++++++------- lib/ssl/test/ssl_session_cache_SUITE.erl | 32 ++++++++++++++++++-------------- lib/ssl/test/ssl_to_openssl_SUITE.erl | 26 +++++++++++++++----------- 7 files changed, 87 insertions(+), 63 deletions(-) diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index 1d75e1aed2..e3cc694110 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -587,8 +587,12 @@ fin_per_testcase(_Func, Config) -> Config. init_per_suite(Config) -> - crypto:start(), - Config. + case crypto:start() of + ok -> + Config; + _ -> + {skip, "Crypto did not start"} + end. end_per_suite(_Config) -> crypto:stop(). diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 88cfbcf2b6..3bd81a04ea 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -41,9 +41,12 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - crypto:start(), - Config. - + case crypto:start() of + ok -> + Config; + _ -> + {skip, "Crypto did not start"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ %% Config - [tuple()] diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index d3e846f60b..a75e9b4272 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -48,20 +48,23 @@ %%-------------------------------------------------------------------- init_per_suite(Config0) -> Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2), - crypto:start(), - application:start(public_key), - ssl:start(), - - %% make rsa certs using oppenssl - Result = - (catch make_certs:all(?config(data_dir, Config0), - ?config(priv_dir, Config0))), - test_server:format("Make certs ~p~n", [Result]), - - Config1 = ssl_test_lib:make_dsa_cert(Config0), - Config = ssl_test_lib:cert_options(Config1), - [{watchdog, Dog} | Config]. - + case crypto:start() of + ok -> + application:start(public_key), + ssl:start(), + + %% make rsa certs using oppenssl + Result = + (catch make_certs:all(?config(data_dir, Config0), + ?config(priv_dir, Config0))), + test_server:format("Make certs ~p~n", [Result]), + + Config1 = ssl_test_lib:make_dsa_cert(Config0), + Config = ssl_test_lib:cert_options(Config1), + [{watchdog, Dog} | Config]; + _ -> + {skip, "Crypto did not start"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ %% Config - [tuple()] diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index 88d2d99ef8..2fe17e1399 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -53,15 +53,18 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - crypto:start(), - application:start(public_key), - ssl:start(), - Result = - (catch make_certs:all(?config(data_dir, Config), - ?config(priv_dir, Config))), - test_server:format("Make certs ~p~n", [Result]), - ssl_test_lib:cert_options(Config). - + case crypto:start() of + ok -> + application:start(public_key), + ssl:start(), + Result = + (catch make_certs:all(?config(data_dir, Config), + ?config(priv_dir, Config))), + test_server:format("Make certs ~p~n", [Result]), + ssl_test_lib:cert_options(Config); + _ -> + {skip, "Crypto did not start"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ %% Config - [tuple()] diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index d80df0bfbd..76cc86c986 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,12 +37,15 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - crypto:start(), - application:start(public_key), - ssl:start(), - make_certs:all(?config(data_dir, Config), ?config(priv_dir, Config)), - ssl_test_lib:cert_options(Config). - + case crypto:start() of + ok -> + application:start(public_key), + ssl:start(), + make_certs:all(?config(data_dir, Config), ?config(priv_dir, Config)), + ssl_test_lib:cert_options(Config); + _ -> + {skip, "Crypto did not start"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ %% Config - [tuple()] diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index 0f39759d97..a8828b26e3 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -47,19 +47,23 @@ %%-------------------------------------------------------------------- init_per_suite(Config0) -> Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2), - crypto:start(), - application:start(public_key), - ssl:start(), - - %% make rsa certs using oppenssl - Result = - (catch make_certs:all(?config(data_dir, Config0), - ?config(priv_dir, Config0))), - test_server:format("Make certs ~p~n", [Result]), - - Config1 = ssl_test_lib:make_dsa_cert(Config0), - Config = ssl_test_lib:cert_options(Config1), - [{watchdog, Dog} | Config]. + case crypto:start() of + ok -> + application:start(public_key), + ssl:start(), + + %% make rsa certs using oppenssl + Result = + (catch make_certs:all(?config(data_dir, Config0), + ?config(priv_dir, Config0))), + test_server:format("Make certs ~p~n", [Result]), + + Config1 = ssl_test_lib:make_dsa_cert(Config0), + Config = ssl_test_lib:cert_options(Config1), + [{watchdog, Dog} | Config]; + _ -> + {skip, "Crypto did not start"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index 46ad0c17b6..86d384ee52 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,16 +50,20 @@ init_per_suite(Config0) -> false -> {skip, "Openssl not found"}; _ -> - crypto:start(), - application:start(public_key), - ssl:start(), - Result = - (catch make_certs:all(?config(data_dir, Config0), - ?config(priv_dir, Config0))), - test_server:format("Make certs ~p~n", [Result]), - Config1 = ssl_test_lib:make_dsa_cert(Config0), - Config = ssl_test_lib:cert_options(Config1), - [{watchdog, Dog} | Config] + case crypto:start() of + ok -> + application:start(public_key), + ssl:start(), + Result = + (catch make_certs:all(?config(data_dir, Config0), + ?config(priv_dir, Config0))), + test_server:format("Make certs ~p~n", [Result]), + Config1 = ssl_test_lib:make_dsa_cert(Config0), + Config = ssl_test_lib:cert_options(Config1), + [{watchdog, Dog} | Config]; + _ -> + {skip, "Crypto did not start"} + end end. %%-------------------------------------------------------------------- -- cgit v1.2.3 From 18ca34b08868d5c045a854b022a4d9fb3fa727a0 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Jan 2011 17:58:42 +0100 Subject: Add test cases for test spec ordering of testcases in spec --- lib/common_test/test/ct_testspec_1_SUITE.erl | 154 ++++++++++++++++++++++++++- 1 file changed, 153 insertions(+), 1 deletion(-) diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index dc399bfb4c..f592d697bd 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -73,7 +73,13 @@ all(suite) -> subgroup_all_testcases, skip_subgroup_all_testcases, subgroup_testcase, skip_subgroup_testcase, sub_skipped_by_top, - testcase_in_multiple_groups]. + testcase_in_multiple_groups, + order_of_tests_in_multiple_dirs, + order_of_tests_in_multiple_suites, + order_of_suites_in_multiple_dirs, + order_of_groups_in_multiple_dirs, + order_of_groups_in_multiple_suites + ]. %%-------------------------------------------------------------------- %% TEST CASES @@ -365,6 +371,74 @@ testcase_in_multiple_groups(Config) when is_list(Config) -> setup_and_execute(testcase_in_multiple_groups, TestSpec, Config). +%%%----------------------------------------------------------------- +%%% + +order_of_tests_in_multiple_dirs(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir2,groups_22_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], + + setup_and_execute(order_of_tests_in_multiple_dirs, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_tests_in_multiple_suites(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir1,groups_11_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], + + setup_and_execute(order_of_tests_in_multiple_suites, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_suites_in_multiple_dirs(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{suites,TestDir1,groups_12_SUITE}, + {suites,TestDir2,groups_22_SUITE}, + {suites,TestDir1,groups_11_SUITE}], + + setup_and_execute(order_of_suites_in_multiple_dirs, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_groups_in_multiple_dirs(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{groups,TestDir1,groups_12_SUITE,test_group_1a}, + {groups,TestDir2,groups_22_SUITE,test_group_1a}, + {groups,TestDir1,groups_12_SUITE,test_group_1b}], + + setup_and_execute(order_of_groups_in_multiple_dirs, TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_groups_in_multiple_suites(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{groups,TestDir1,groups_12_SUITE,test_group_1a}, + {groups,TestDir1,groups_11_SUITE,test_group_1a}, + {groups,TestDir1,groups_12_SUITE,test_group_1b}], + + setup_and_execute(order_of_groups_in_multiple_suites, TestSpec, Config). + %%%----------------------------------------------------------------- %%% HELP FUNCTIONS %%%----------------------------------------------------------------- @@ -428,6 +502,84 @@ events_to_check(_, 0) -> events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). + +test_events(order_of_tests_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,testcase_1a, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {ct_test_support_eh,tc_start,{groups_22_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,testcase_1b, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {ct_test_support_eh,stop_logging,[]} + ]; +test_events(order_of_tests_in_multiple_suites) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, + {ct_test_support_eh,stop_logging,[]} + ]; +test_events(order_of_suites_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_22_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_22_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,stop_logging,[]}]; +test_events(order_of_groups_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + + {ct_test_support_eh,stop_logging,[]}]; +test_events(order_of_groups_in_multiple_suites) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + + {ct_test_support_eh,stop_logging,[]}]; test_events(_) -> [ ]. -- cgit v1.2.3 From b4c3711c6daa2f171f56b984235969e223ce8f9c Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Thu, 20 Jan 2011 19:12:01 +0200 Subject: Add a --fullpath option to Dialyzer This change adds a --fullpath option to Dialyzer, which makes the warning messages contain the full path of the corresponding file. Original patch submitted by Magnus Henoch (legoscia) on 15/9/2010 and cooked to death in the 'pu' branch all this time. The patch was essentially correct and most of it has been used as is, but there have been some changes to make the code slightly prettier, avoid some code duplication, and add documentation to dialyzer's doc files and to its help message. --- lib/dialyzer/doc/manual.txt | 4 +++- lib/dialyzer/doc/src/dialyzer.xml | 6 ++++-- lib/dialyzer/src/dialyzer.erl | 23 +++++++++++++++++------ lib/dialyzer/src/dialyzer.hrl | 14 ++++++++------ lib/dialyzer/src/dialyzer_cl.erl | 14 +++++++++----- lib/dialyzer/src/dialyzer_cl_parse.erl | 11 +++++++++-- lib/dialyzer/src/dialyzer_options.erl | 12 +++++++++++- 7 files changed, 61 insertions(+), 23 deletions(-) diff --git a/lib/dialyzer/doc/manual.txt b/lib/dialyzer/doc/manual.txt index cc6f9130c7..1d7a1a6222 100644 --- a/lib/dialyzer/doc/manual.txt +++ b/lib/dialyzer/doc/manual.txt @@ -129,7 +129,7 @@ Usage: dialyzer [--help] [--version] [--shell] [--quiet] [--verbose] [--apps applications] [-o outfile] [--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--no_native] + [--no_native] [--fullpath] Options: files_or_dirs (for backwards compatibility also as: -c files_or_dirs) @@ -231,6 +231,8 @@ Options: Bypass the native code compilation of some key files that Dialyzer heuristically performs when dialyzing many files; this avoids the compilation time but it may result in (much) longer analysis time. + --fullpath + Display the full path names of files for which warnings are emitted. --gui Use the gs-based GUI. --wx diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 01a7e478bc..8813d51f1f 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -71,7 +71,7 @@ [--apps applications] [-o outfile] [--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--no_native] + [--no_native] [--fullpath] ]]>

Options:

@@ -198,10 +198,12 @@ heuristically performs when dialyzing many files; this avoids the compilation time but it may result in (much) longer analysis time. + + Display the full path names of files for which warnings are emitted. Use the gs-based GUI. - Use the wx-based GUI.. + Use the wx-based GUI.

* denotes that multiple occurrences of these options are possible.

diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index 471f9fccd2..f4b3cff19c 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -2,7 +2,7 @@ %%----------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,8 @@ gui/0, gui/1, plt_info/1, - format_warning/1]). + format_warning/1, + format_warning/2]). -include("dialyzer.hrl"). @@ -48,6 +49,8 @@ %% - run/1: Erlang interface for a command line-like analysis %% - gui/0/1: Erlang interface for the gui. %% - format_warning/1: Get the string representation of a warning. +%% - format_warning/1: Likewise, but with an option whether +%% to display full path names or not %% - plt_info/1: Get information of the specified plt. %%-------------------------------------------------------------------- @@ -281,11 +284,19 @@ cl_check_log(Output) -> -spec format_warning(dial_warning()) -> string(). -format_warning({_Tag, {File, Line}, Msg}) when is_list(File), - is_integer(Line) -> - BaseName = filename:basename(File), +format_warning(W) -> + format_warning(W, basename). + +-spec format_warning(dial_warning(), fopt()) -> string(). + +format_warning({_Tag, {File, Line}, Msg}, FOpt) when is_list(File), + is_integer(Line) -> + F = case FOpt of + fullpath -> File; + basename -> filename:basename(File) + end, String = lists:flatten(message_to_string(Msg)), - lists:flatten(io_lib:format("~s:~w: ~s", [BaseName, Line, String])). + lists:flatten(io_lib:format("~s:~w: ~s", [F, Line, String])). %%----------------------------------------------------------------------------- diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl index 1d98574585..aa3f703af2 100644 --- a/lib/dialyzer/src/dialyzer.hrl +++ b/lib/dialyzer/src/dialyzer.hrl @@ -2,7 +2,7 @@ %%% %%% %CopyrightBegin% %%% -%%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %%% %%% The contents of this file are subject to the Erlang Public License, %%% Version 1.1, (the "License"); you may not use this file except in @@ -31,7 +31,7 @@ -define(RET_DISCREPANCIES, 2). -type dial_ret() :: ?RET_NOTHING_SUSPICIOUS - | ?RET_INTERNAL_ERROR + | ?RET_INTERNAL_ERROR | ?RET_DISCREPANCIES. %%-------------------------------------------------------------------- @@ -87,7 +87,7 @@ %%-------------------------------------------------------------------- %% THIS TYPE SHOULD ONE DAY DISAPPEAR -- IT DOES NOT BELONG HERE %%-------------------------------------------------------------------- - + -type ordset(T) :: [T] . %% XXX: temporarily %%-------------------------------------------------------------------- @@ -102,6 +102,8 @@ -type dial_define() :: {atom(), term()}. -type dial_option() :: {atom(), term()}. -type dial_options() :: [dial_option()]. +-type fopt() :: 'basename' | 'fullpath'. +-type format() :: 'formatted' | 'raw'. -type label() :: non_neg_integer(). -type rep_mode() :: 'quiet' | 'normal' | 'verbose'. -type start_from() :: 'byte_code' | 'src_code'. @@ -137,10 +139,10 @@ erlang_mode = false :: boolean(), use_contracts = true :: boolean(), output_file = none :: 'none' | file:filename(), - output_format = formatted :: 'raw' | 'formatted', + output_format = formatted :: format(), + filename_opt = basename :: fopt(), callgraph_file = "" :: file:filename(), - check_plt = true :: boolean() - }). + check_plt = true :: boolean()}). -record(contract, {contracts = [] :: [contract_pair()], args = [] :: [erl_types:erl_type()], diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl index 1987c1732c..86f1ba4696 100644 --- a/lib/dialyzer/src/dialyzer_cl.erl +++ b/lib/dialyzer/src/dialyzer_cl.erl @@ -2,7 +2,7 @@ %%------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -46,7 +46,8 @@ legal_warnings = ordsets:new() :: [dial_warn_tag()], mod_deps = dict:new() :: dict(), output = standard_io :: io:device(), - output_format = formatted :: 'raw' | 'formatted', + output_format = formatted :: format(), + filename_opt = basename :: fopt(), output_plt = none :: 'none' | file:filename(), plt_info = none :: 'none' | dialyzer_plt:plt_info(), report_mode = normal :: rep_mode(), @@ -532,8 +533,10 @@ hc(Mod) -> new_state() -> #cl_state{}. -init_output(State0, #options{output_file = OutFile, output_format = OutFormat}) -> - State = State0#cl_state{output_format = OutFormat}, +init_output(State0, #options{output_file = OutFile, + output_format = OutFormat, + filename_opt = FOpt}) -> + State = State0#cl_state{output_format = OutFormat, filename_opt = FOpt}, case OutFile =:= none of true -> State; @@ -766,6 +769,7 @@ print_warnings(#cl_state{stored_warnings = []}) -> ok; print_warnings(#cl_state{output = Output, output_format = Format, + filename_opt = FOpt, stored_warnings = Warnings}) -> PrWarnings = process_warnings(Warnings), case PrWarnings of @@ -773,7 +777,7 @@ print_warnings(#cl_state{output = Output, [_|_] -> S = case Format of formatted -> - [dialyzer:format_warning(W) || W <- PrWarnings]; + [dialyzer:format_warning(W, FOpt) || W <- PrWarnings]; raw -> [io_lib:format("~p. \n", [W]) || W <- PrWarnings] end, diff --git a/lib/dialyzer/src/dialyzer_cl_parse.erl b/lib/dialyzer/src/dialyzer_cl_parse.erl index 5ca7599b35..f9baf36822 100644 --- a/lib/dialyzer/src/dialyzer_cl_parse.erl +++ b/lib/dialyzer/src/dialyzer_cl_parse.erl @@ -2,7 +2,7 @@ %%----------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -133,6 +133,9 @@ cl(["-o"++Output|T]) -> cl(["--raw"|T]) -> put(dialyzer_output_format, raw), cl(T); +cl(["--fullpath"|T]) -> + put(dialyzer_filename_opt, fullpath), + cl(T); cl(["-pa", Path|T]) -> case code:add_patha(Path) of true -> cl(T); @@ -243,6 +246,7 @@ init() -> put(dialyzer_options_defines, DefaultOpts#options.defines), put(dialyzer_options_files, DefaultOpts#options.files), put(dialyzer_output_format, formatted), + put(dialyzer_filename_opt, basename), put(dialyzer_options_check_plt, DefaultOpts#options.check_plt), ok. @@ -281,6 +285,7 @@ cl_options() -> {files_rec, get(dialyzer_options_files_rec)}, {output_file, get(dialyzer_output)}, {output_format, get(dialyzer_output_format)}, + {filename_opt, get(dialyzer_filename_opt)}, {analysis_type, get(dialyzer_options_analysis_type)}, {get_warnings, get(dialyzer_options_get_warnings)}, {callgraph_file, get(dialyzer_callgraph_file)} @@ -335,7 +340,7 @@ help_message() -> [--apps applications] [-o outfile] [--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--no_native] + [--no_native] [--fullpath] Options: files_or_dirs (for backwards compatibility also as: -c files_or_dirs) Use Dialyzer from the command line to detect defects in the @@ -437,6 +442,8 @@ Options: Bypass the native code compilation of some key files that Dialyzer heuristically performs when dialyzing many files; this avoids the compilation time but it may result in (much) longer analysis time. + --fullpath + Display the full path names of files for which warnings are emitted. --gui Use the gs-based GUI. --wx diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl index 2c0afa6e2b..b5cefd16ca 100644 --- a/lib/dialyzer/src/dialyzer_options.erl +++ b/lib/dialyzer/src/dialyzer_options.erl @@ -2,7 +2,7 @@ %%----------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -169,6 +169,9 @@ build_options([{OptionName, Value} = Term|Rest], Options) -> output_format -> assert_output_format(Value), build_options(Rest, Options#options{output_format = Value}); + filename_opt -> + assert_filename_opt(Value), + build_options(Rest, Options#options{filename_opt = Value}); output_plt -> assert_filename(Value), build_options(Rest, Options#options{output_plt = Value}); @@ -218,6 +221,13 @@ assert_output_format(formatted) -> assert_output_format(Term) -> bad_option("Illegal value for output_format", Term). +assert_filename_opt(basename) -> + ok; +assert_filename_opt(fullpath) -> + ok; +assert_filename_opt(Term) -> + bad_option("Illegal value for filename_opt", Term). + assert_plt_op(#options{analysis_type = OldVal}, #options{analysis_type = NewVal}) -> case is_plt_mode(OldVal) andalso is_plt_mode(NewVal) of -- cgit v1.2.3 From 418f30e5c2f64802075c1bc3188935aa91cd8d4e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 1 Oct 2010 17:30:36 +0200 Subject: Refactor code to make it easier to debug --- lib/common_test/src/ct_framework.erl | 46 ++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 3bbb338121..dde9739dc6 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -938,27 +938,7 @@ get_all(Mod, ConfTests) -> [{?MODULE,error_in_suite,[[{error,What}]]}]; SeqsAndTCs -> %% expand group references in all() using ConfTests - Expand = - fun({group,Name}) -> - FindConf = - fun({conf,Props,_,_,_}) -> - case proplists:get_value(name, Props) of - Name -> true; - _ -> false - end - end, - case lists:filter(FindConf, ConfTests) of - [ConfTest|_] -> - ConfTest; - [] -> - E = "Invalid reference to group "++ - atom_to_list(Name)++" in "++ - atom_to_list(Mod)++":all/0", - throw({error,list_to_atom(E)}) - end; - (SeqOrTC) -> SeqOrTC - end, - case catch lists:map(Expand, SeqsAndTCs) of + case catch expand_groups(SeqsAndTCs, ConfTests, Mod) of {error,_} = Error -> [{?MODULE,error_in_suite,[[Error]]}]; Tests -> @@ -973,6 +953,30 @@ get_all(Mod, ConfTests) -> [{?MODULE,error_in_suite,[[{error,Reason}]]}] end. +expand_groups([H | T], ConfTests, Mod) -> + [expand_groups(H, ConfTests, Mod) | expand_groups(T, ConfTests, Mod)]; +expand_groups([], _ConfTests, _Mod) -> + []; +expand_groups({group,Name}, ConfTests, Mod) -> + FindConf = + fun({conf,Props,_,_,_}) -> + case proplists:get_value(name, Props) of + Name -> true; + _ -> false + end + end, + case lists:filter(FindConf, ConfTests) of + [ConfTest|_] -> + expand_groups(ConfTest, ConfTests, Mod); + [] -> + E = "Invalid reference to group "++ + atom_to_list(Name)++" in "++ + atom_to_list(Mod)++":all/0", + throw({error,list_to_atom(E)}) + end; +expand_groups(SeqOrTC, _ConfTests, _Mod) -> + SeqOrTC. + %%!============================================================ %%! The support for sequences by means of using sequences/0 -- cgit v1.2.3 From 7629d083e321a964d3f1cd05b5af746d62dfb5fb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 1 Oct 2010 17:31:02 +0200 Subject: Add support for external groups. --- lib/common_test/src/ct_framework.erl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index dde9739dc6..1c4ee7bd49 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -760,20 +760,28 @@ find(Mod, Name, all, [{Name1,Props,Tests} | Gs], Known, Defs, true) find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) when is_atom(Name1) -> find(Mod, Name, TCs, [expand(Mod, Name1, Defs) | Gs], Known, Defs, Found); -find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, Found) +find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, false) when is_atom(Name1), is_list(Tests) -> - find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, Found); + find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, false); + +find(Mod, Name, TCs, [{Name1,Groups} | Gs], Known, Defs, true) + when is_atom(Name1), is_list(Groups) -> + ExternalDefs = Name1:groups(), + ExternalGroup = proplists:get_value(group, Groups), + ExternalTCs = find(Name1, ExternalGroup, TCs, Groups, + [], ExternalDefs, false), + ExternalTCs ++ find(Mod, Name, TCs, Gs, Known, Defs, true); find(Mod, Name, TCs, [TC | Gs], Known, Defs, false) when is_atom(TC) -> find(Mod, Name, TCs, Gs, Known, Defs, false); find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + [{Mod, TC} | find(Mod, Name, TCs, Gs, Known, Defs, true)]; -find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, true) +find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, Found) when is_atom(ExternalTC), is_atom(Case) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; + [TC | find(Mod, Name, TCs, Gs, Known, Defs, Found)]; find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> Where = if length(Known) == 0 -> -- cgit v1.2.3 From a65da791a0ad23805ab756c25df0220b47b740a2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 5 Oct 2010 17:50:58 +0200 Subject: Fix bug when groups refer to groups in the groups/0 function --- lib/common_test/src/ct_framework.erl | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 1c4ee7bd49..b554749f7a 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -694,12 +694,12 @@ get_suite(Mod, Group={conf,Props,_Init,TCs,_End}) -> %% init/end functions for top groups will be executed case catch proplists:get_value(name, element(2, hd(ConfTests))) of Name -> % top group - ConfTests; + delete_subs(ConfTests, ConfTests); _ -> [] end; false -> - ConfTests + delete_subs(ConfTests, ConfTests) end end; _ -> @@ -716,7 +716,22 @@ get_suite(Mod, Name) -> find_groups(Mod, Name, TCs, GroupDefs) -> Found = find(Mod, Name, TCs, GroupDefs, [], GroupDefs, false), Trimmed = trim(Found), - delete_subs(Trimmed, Trimmed). + %% I cannot find a reason to why this function is called, + %% It deletes any group which is referenced in any other + %% group. i.e. + %% groups() -> + %% [{test, [], [testcase1]}, + %% {testcases, [], [{group, test}]}]. + %% Would be changed to + %% groups() -> + %% [{testcases, [], [testcase1]}]. + %% instead of what I believe is correct: + %% groups() -> + %% [{test, [], [testcase1]}, + %% {testcases, [], [testcase1]}]. + %% Have to double check with peppe + delete_subs(Trimmed, Trimmed), + Trimmed. find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) -> cyclic_test(Mod, Name, Known), @@ -800,7 +815,7 @@ find(_Mod, _Name, _TCs, [], _Known, _Defs, false) -> find(_Mod, _Name, _TCs, [], _Known, _Defs, _Found) -> []. -delete_subs([Conf | Confs], All) -> +delete_subs([{conf, _,_,_,_} = Conf | Confs], All) -> All1 = delete_conf(Conf, All), case is_sub(Conf, All1) of true -> @@ -808,7 +823,8 @@ delete_subs([Conf | Confs], All) -> false -> delete_subs(Confs, All) end; - +delete_subs([_Else | Confs], All) -> + delete_subs(Confs, All); delete_subs([], All) -> All. @@ -900,7 +916,9 @@ make_all_conf(Mod) -> [] -> {error,{invalid_group_spec,Mod}}; ConfTests -> - [{conf,Props,Init,all,End} || {conf,Props,Init,_,End} <- ConfTests] + [{conf,Props,Init,all,End} || + {conf,Props,Init,_,End} + <- delete_subs(ConfTests, ConfTests)] end end. @@ -950,7 +968,7 @@ get_all(Mod, ConfTests) -> {error,_} = Error -> [{?MODULE,error_in_suite,[[Error]]}]; Tests -> - Tests + delete_subs(Tests, Tests) end end; Skip = {skip,_Reason} -> -- cgit v1.2.3 From 96a540b6b219290a8248ef25ec23c1d331f8e953 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Dec 2010 10:57:40 +0100 Subject: Add possibility to get all testdata --- lib/common_test/src/ct_util.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index b5ab4cbb6e..1b60820565 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -268,6 +268,9 @@ loop(Mode,TestData,StartDir) -> TestData1 = lists:keydelete(Key,1,TestData), return(From,ok), loop(Mode,[New|TestData1],StartDir); + {{get_testdata, all}, From} -> + return(From, TestData), + loop(From, TestData, StartDir); {{get_testdata,Key},From} -> case lists:keysearch(Key,1,TestData) of {value,{Key,Val}} -> -- cgit v1.2.3 From ab085b4bbdefd42b456f03dee47f6c51059a8192 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:28:27 +0100 Subject: Change format of remote groups to {group, Module, GroupName}, note that this is an unsupported feature --- lib/common_test/src/ct_framework.erl | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index b554749f7a..3050aec0c5 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -733,7 +733,8 @@ find_groups(Mod, Name, TCs, GroupDefs) -> delete_subs(Trimmed, Trimmed), Trimmed. -find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) -> +find(Mod, all, _TCs, [{Name,Props,Tests} | Gs], Known, Defs, _) + when is_atom(Name), is_list(Props), is_list(Tests) -> cyclic_test(Mod, Name, Known), [make_conf(Mod, Name, Props, find(Mod, all, all, Tests, [Name | Known], Defs, true)) | @@ -755,9 +756,8 @@ find(Mod, Name, TCs, [{Name,Props,Tests} | _Gs], Known, Defs, false) find(Mod, Name, TCs, [{Name1,Props,Tests} | Gs], Known, Defs, false) when is_atom(Name1), is_list(Props), is_list(Tests) -> cyclic_test(Mod, Name1, Known), - [make_conf(Mod, Name1, Props, - find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false)) | - find(Mod, Name, TCs, Gs, [], Defs, false)]; + find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false) ++ + find(Mod, Name, TCs, Gs, [], Defs, false); find(Mod, Name, _TCs, [{Name,_Props,_Tests} | _Gs], _Known, _Defs, true) when is_atom(Name) -> @@ -772,31 +772,32 @@ find(Mod, Name, all, [{Name1,Props,Tests} | Gs], Known, Defs, true) find(Mod, Name, all, Tests, [Name1 | Known], Defs, true)) | find(Mod, Name, all, Gs, [], Defs, true)]; -find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) when is_atom(Name1) -> +find(Mod, Name, TCs, [{group,Name1} | Gs], Known, Defs, Found) + when is_atom(Name1) -> find(Mod, Name, TCs, [expand(Mod, Name1, Defs) | Gs], Known, Defs, Found); -find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, false) - when is_atom(Name1), is_list(Tests) -> - find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, false); +%% Undocumented remote group feature, use with caution +find(Mod, Name, TCs, [{group, ExtMod, ExtGrp} | Gs], Known, Defs, true) + when is_atom(ExtMod), is_atom(ExtGrp) -> + ExternalDefs = ExtMod:groups(), + ExternalTCs = find(ExtMod, ExtGrp, TCs, [{group, ExtGrp}], + [], ExternalDefs, false), + ExternalTCs ++ find(Mod, Name, TCs, Gs, Known, Defs, true); -find(Mod, Name, TCs, [{Name1,Groups} | Gs], Known, Defs, true) - when is_atom(Name1), is_list(Groups) -> - ExternalDefs = Name1:groups(), - ExternalGroup = proplists:get_value(group, Groups), - ExternalTCs = find(Name1, ExternalGroup, TCs, Groups, - [], ExternalDefs, false), - ExternalTCs ++ find(Mod, Name, TCs, Gs, Known, Defs, true); +find(Mod, Name, TCs, [{Name1,Tests} | Gs], Known, Defs, Found) + when is_atom(Name1), is_list(Tests) -> + find(Mod, Name, TCs, [{Name1,[],Tests} | Gs], Known, Defs, Found); -find(Mod, Name, TCs, [TC | Gs], Known, Defs, false) when is_atom(TC) -> +find(Mod, Name, TCs, [_TC | Gs], Known, Defs, false) -> find(Mod, Name, TCs, Gs, Known, Defs, false); find(Mod, Name, TCs, [TC | Gs], Known, Defs, true) when is_atom(TC) -> [{Mod, TC} | find(Mod, Name, TCs, Gs, Known, Defs, true)]; -find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, Found) +find(Mod, Name, TCs, [{ExternalTC, Case} = TC | Gs], Known, Defs, true) when is_atom(ExternalTC), is_atom(Case) -> - [TC | find(Mod, Name, TCs, Gs, Known, Defs, Found)]; + [TC | find(Mod, Name, TCs, Gs, Known, Defs, true)]; find(Mod, _Name, _TCs, [BadTerm | _Gs], Known, _Defs, _Found) -> Where = if length(Known) == 0 -> -- cgit v1.2.3 From 15ef1d31ecce6127926fa577850927d3228d4664 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:37:45 +0100 Subject: Add kill_slavenodes/0 as an exported function --- lib/test_server/src/test_server_ctrl.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 2ab7b799fc..00278c0165 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -168,6 +168,7 @@ cross_cover_analyse/1, cross_cover_analyse/2, trc/1, stop_trace/0]). -export([testcase_callback/1]). -export([set_random_seed/1]). +-export([kill_slavenodes/0]). %%% TEST_SERVER INTERFACE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -export([output/2, print/2, print/3, print_timestamp/2]). @@ -525,6 +526,9 @@ testcase_callback(ModFunc) -> set_random_seed(Seed) -> controller_call({set_random_seed,Seed}). +kill_slavenodes() -> + controller_call(kill_slavenodes). + get_hosts() -> get(test_server_hosts). -- cgit v1.2.3 From 3497ba3257b23e0c230ae1c4b25ae5f52bd050b5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:39:17 +0100 Subject: Update ts to work with common test instead of test_server --- lib/test_server/src/ts.erl | 17 ++++++---- lib/test_server/src/ts_run.erl | 74 ++++++++++++++++++++++++++++-------------- 2 files changed, 59 insertions(+), 32 deletions(-) diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl index fcd955345f..befa6bf7f1 100644 --- a/lib/test_server/src/ts.erl +++ b/lib/test_server/src/ts.erl @@ -249,7 +249,7 @@ run_some([Spec|Specs], Opts) -> run(Testspec) when is_atom(Testspec) -> Options=check_test_get_opts(Testspec, []), File = atom_to_list(Testspec), - run_test(File, ["SPEC current.spec NAME ",File], Options); + run_test(File, [{spec,[File++".spec"]}], Options); %% This can be used from command line, e.g. %% erl -s ts run all_tests @@ -293,11 +293,11 @@ run(List, Opts) when is_list(List), is_list(Opts) -> run(Testspec, Config) when is_atom(Testspec), is_list(Config) -> Options=check_test_get_opts(Testspec, Config), File=atom_to_list(Testspec), - run_test(File, ["SPEC current.spec NAME ", File], Options); + run_test(File, [{spec,[File++".spec"]}], Options); %% Runs one module in a spec (interactive) run(Testspec, Mod) when is_atom(Testspec), is_atom(Mod) -> run_test({atom_to_list(Testspec), Mod}, - ["SPEC current.spec NAME ", atom_to_list(Mod)], + [{suite,Mod}], [interactive]). %% run/3 @@ -305,20 +305,23 @@ run(Testspec, Mod) when is_atom(Testspec), is_atom(Mod) -> run(Testspec,Mod,Config) when is_atom(Testspec), is_atom(Mod), is_list(Config) -> Options=check_test_get_opts(Testspec, Config), run_test({atom_to_list(Testspec), Mod}, - ["SPEC current.spec NAME ", atom_to_list(Mod)], + [{suite,Mod}], Options); %% Runs one testcase in a module. run(Testspec, Mod, Case) when is_atom(Testspec), is_atom(Mod), is_atom(Case) -> Options=check_test_get_opts(Testspec, []), - Args = ["CASE ",atom_to_list(Mod)," ",atom_to_list(Case)], + Args = [{suite,atom_to_list(Mod)},{testcase,atom_to_list(Case)}], run_test(atom_to_list(Testspec), Args, Options). %% run/4 %% Run one testcase in a module with Options. -run(Testspec, Mod, Case, Config) when is_atom(Testspec), is_atom(Mod), is_atom(Case), is_list(Config) -> +run(Testspec, Mod, Case, Config) when is_atom(Testspec), + is_atom(Mod), + is_atom(Case), + is_list(Config) -> Options=check_test_get_opts(Testspec, Config), - Args = ["CASE ",atom_to_list(Mod), " ",atom_to_list(Case)], + Args = [{suite,atom_to_list(Mod)}, {testcase,atom_to_list(Case)}], run_test(atom_to_list(Testspec), Args, Options). %% Check testspec to be valid and get possible Options diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index 888ac98973..d0262b34cd 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -63,32 +63,13 @@ run(File, Args0, Options, Vars0) -> _ -> {false, fun run_interactive/3} end, - HandleTopcase = case member(keep_topcase, Options) of - true -> [fun copy_topcase/3]; - false -> [fun remove_original_topcase/3, - fun init_topcase/3] - end, - MakefileHooks = [fun make_make/3, - fun add_make_testcase/3], - MakeLoop = fun(V, Sp, St) -> make_loop(MakefileHooks, V, Sp, St) end, Hooks = [fun init_state/3, - fun read_spec_file/3] ++ - HandleTopcase ++ - [fun run_preinits/3, - fun find_makefiles/3, - MakeLoop, - fun make_test_suite/3, - fun add_topcase_to_spec/3, - fun write_spec_file/3, + fun run_preinits/3, fun make_command/3, Runner], - Args = make_test_server_args(Args0,Options,Vars), + Args = make_common_test_args(Args0,Options,Vars), St = #state{file=File,test_server_args=Args,batch=Batch}, R = execute(Hooks, Vars, [], St), - case Batch of - true -> ts_reports:make_index(); - false -> ok % ts_reports:make_index() is run on the test_server node - end, case R of {ok,_,_,_} -> ok; Error -> Error @@ -457,6 +438,7 @@ backslashify([]) -> []. make_command(Vars, Spec, State) -> + {ok,Cwd} = file:get_cwd(), TestDir = State#state.test_dir, TestPath = filename:nativename(TestDir), Erl = case os:getenv("TS_RUN_VALGRIND") of @@ -487,7 +469,7 @@ make_command(Vars, Spec, State) -> {value,{erl_start_args,Args}} -> Args; false -> "" end, - CrashFile = State#state.file ++ "_erl_crash.dump", + CrashFile = filename:join(Cwd,State#state.file ++ "_erl_crash.dump"), case filelib:is_file(CrashFile) of true -> io:format("ts_run: Deleting dump: ~s\n",[CrashFile]), @@ -495,7 +477,8 @@ make_command(Vars, Spec, State) -> false -> ok end, - Cmd = [Erl, Naming, "test_server -pa ", $", TestPath, $", + %% NOTE: Do not use ' in these commands as it wont work on windows + Cmd = [Erl, Naming, "test_server" " -rsh ", ts_lib:var(rsh_name, Vars), " -env PATH \"", backslashify(lists:flatten([TestPath, path_separator(), @@ -505,15 +488,19 @@ make_command(Vars, Spec, State) -> %% uncomment the line below to disable exception formatting %% " -test_server_format_exception false", " -boot start_sasl -sasl errlog_type error", - " -s test_server_ctrl run_test ", State#state.test_server_args, + " -eval \"file:set_cwd(\\\"",TestDir,"\\\")\" " + " -eval \"ct:run_test(", + backslashify(lists:flatten(State#state.test_server_args)),")\"" " ", ExtraArgs], {ok, Vars, Spec, State#state{command=lists:flatten(Cmd)}}. + run_batch(Vars, _Spec, State) -> process_flag(trap_exit, true), Command = State#state.command ++ " -noinput -s erlang halt", ts_lib:progress(Vars, 1, "Command: ~s~n", [Command]), + io:format(user, "Command: ~s~n",[Command]), Port = open_port({spawn, Command}, [stream, in, eof]), tricky_print_data(Port). @@ -554,7 +541,7 @@ is_testnode_dead([{"test_server",_}|_]) -> false; is_testnode_dead([_|T]) -> is_testnode_dead(T). run_interactive(Vars, _Spec, State) -> - Command = State#state.command ++ " -s ts_reports make_index", + Command = State#state.command, ts_lib:progress(Vars, 1, "Command: ~s~n", [Command]), case ts_lib:var(os, Vars) of "Windows 95" -> @@ -604,6 +591,43 @@ path_separator() -> end. +make_common_test_args(Args0, Options, _Vars) -> + Trace = + case lists:keysearch(trace,1,Options) of + {value,{trace,TI}} when is_tuple(TI); is_tuple(hd(TI)) -> + ok = file:write_file(?tracefile,io_lib:format("~p.~n",[TI])), + [{ct_trace,?tracefile}]; + {value,{trace,TIFile}} when is_atom(TIFile) -> + [{ct_trace,atom_to_list(TIFile)}]; + {value,{trace,TIFile}} -> + [{ct_trace,TIFile}]; + false -> + [] + end, + Cover = + case lists:keysearch(cover,1,Options) of + {value,{cover,_App,File,_Analyse}} -> + [{cover,to_list(File)}]; + false -> + [] + end, + + Logdir = case lists:keysearch(logdir, 1, Options) of + {value,{logdir, _}} -> + []; + false -> + [{logdir,"../test_server"}] + end, + + ConfigFile = case lists:keysearch(config, 1, Options) of + {value, {config, _}} -> + []; + false -> + [{config, "../test_server/ts.config"}] + end, + + io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++ConfigFile++Options]). + make_test_server_args(Args0,Options,Vars) -> Parameters = case ts_lib:var(os, Vars) of -- cgit v1.2.3 From 1365fbbf644cf2409f39f5614828fed9b3ec1af7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:40:13 +0100 Subject: Add ts_install_scb which is a common_test SCB that handles making of test modules. --- lib/test_server/src/Makefile | 5 +- lib/test_server/src/ts_install_scb.erl | 306 +++++++++++++++++++++++++++++++++ 2 files changed, 309 insertions(+), 2 deletions(-) create mode 100644 lib/test_server/src/ts_install_scb.erl diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile index 3dca55178d..6f1c6fd167 100644 --- a/lib/test_server/src/Makefile +++ b/lib/test_server/src/Makefile @@ -57,7 +57,8 @@ TS_MODULES= \ ts_erl_config \ ts_autoconf_win32 \ ts_autoconf_vxworks \ - ts_install + ts_install \ + ts_install_scb TARGET_MODULES= $(MODULES:%=$(EBIN)/%) TS_TARGET_MODULES= $(TS_MODULES:%=$(EBIN)/%) @@ -136,7 +137,7 @@ release_tests_spec: opt $(INSTALL_DIR) $(RELEASE_PATH)/test_server $(INSTALL_DATA) $(ERL_FILES) $(TS_ERL_FILES) \ $(HRL_FILES) $(INTERNAL_HRL_FILES) $(TS_HRL_FILES) \ - $(TARGET_FILES) $(TS_TARGET_FILES) \ + $(TS_TARGET_FILES) \ $(AUTOCONF_FILES) $(C_FILES) $(COVER_FILES) $(CONFIG) \ $(RELEASE_PATH)/test_server $(INSTALL_SCRIPT) $(PROGRAMS) $(RELEASE_PATH)/test_server diff --git a/lib/test_server/src/ts_install_scb.erl b/lib/test_server/src/ts_install_scb.erl new file mode 100644 index 0000000000..33710c7bfd --- /dev/null +++ b/lib/test_server/src/ts_install_scb.erl @@ -0,0 +1,306 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc TS Installed SCB +%%% +%%% This module does what the ts:install/0 command combined with the make +%%% parts of the ts:run/x command did. + +-module(ts_install_scb). + +%% Suite Callbacks +-export([init/1]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/4]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/4]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/4]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/4]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/4]). + +-export([on_tc_fail/3]). +-export([on_tc_skip/3]). + +-export([terminate/1]). + +-include_lib("kernel/include/file.hrl"). + +-type proplist() :: list({atom(),term()}). +-type config() :: proplist(). +-type reason() :: term(). +-type skip_or_fail() :: {skip, reason()} | + {auto_skip, reason()} | + {fail, reason()}. + +-record(state, { ts_conf_dir, target_system, install_opts, nodenames, nodes }). + +%% @doc Always called before any other callback function. +-spec init(Opts :: proplist()) -> + {Id :: term(), State :: #state{}}. +init(Opts) -> +% ct:log("CurrWD: ~p",[file:get_cwd()]), + Nodenames = proplists:get_value(nodenames, Opts, 0), + Nodes = proplists:get_value(nodes, Opts, 0), + TSConfDir = proplists:get_value(ts_conf_dir, Opts), + TargetSystem = proplists:get_value(target_system, Opts, install_local), + InstallOpts = proplists:get_value(install_opts, Opts, []), + {?MODULE, #state{ nodenames = Nodenames, + nodes = Nodes, + ts_conf_dir = TSConfDir, + target_system = TargetSystem, + install_opts = InstallOpts }}. + +%% @doc Called before init_per_suite is called. +-spec pre_init_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_suite(Suite,Config,#state{ ts_conf_dir = undefined} = State) -> + DataDir = proplists:get_value(data_dir, Config), + ParentDir = filename:join( + lists:reverse( + tl(lists:reverse(filename:split(DataDir))))), + TSConfDir = filename:join([ParentDir, "..","test_server"]), + pre_init_per_suite(Suite, Config, State#state{ ts_conf_dir = TSConfDir }); +pre_init_per_suite(_Suite,Config,State) -> +% ct:log("pre_init_per_suite(~p,~p,~p)",[_Suite,Config,State]), + DataDir = proplists:get_value(data_dir, Config), + try +% install(State#state.ts_conf_dir, +% State#state.target_system, +% State#state.install_opts), + + {ok,Variables} = + file:consult(filename:join(State#state.ts_conf_dir,"variables")), + + %% Make the stuff in all_SUITE_data if it exists + AllDir = filename:join(DataDir,"../all_SUITE_data"), + case filelib:is_dir(AllDir) of + true -> + make_non_erlang(AllDir,Variables); + false -> + ok + end, + + make_non_erlang(DataDir, Variables), + + {lists:keystore(nodenames, 1, Config, + {nodenames,generate_nodenames(State#state.nodenames)}), + State} + catch Error:Reason -> + Stack = erlang:get_stacktrace(), + ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), + {fail,{?MODULE,{Error,Reason, Stack}}} + end. + +%% @doc Called after init_per_suite. +-spec post_init_per_suite(Suite :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_suite(_Suite,_Config,Return,State) -> + test_server_ctrl:kill_slavenodes(), + {Return, State}. + +%% @doc Called before end_per_suite. +-spec pre_end_per_suite(Suite :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_suite(_Suite,Config,State) -> + {Config, State}. + +%% @doc Called after end_per_suite. +-spec post_end_per_suite(Suite :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_suite(_Suite,_Config,Return,State) -> + {Return, State}. + +%% @doc Called before each init_per_group. +-spec pre_init_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_group(_Group,Config,State) -> + {Config, State}. + +%% @doc Called after each init_per_group. +-spec post_init_per_group(Group :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_group(_Group,_Config,Return,State) -> + {Return, State}. + +%% @doc Called after each end_per_group. +-spec pre_end_per_group(Group :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_group(_Group,Config,State) -> + {Config, State}. + +%% @doc Called after each end_per_group. +-spec post_end_per_group(Group :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_group(_Group,_Config,Return,State) -> + {Return, State}. + +%% @doc Called before each test case. +-spec pre_init_per_testcase(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_testcase(_TC,Config,State) -> + {Config, State}. + +%% @doc Called after each test case. +-spec post_end_per_testcase(TC :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_testcase(_TC,_Config,Return,State) -> + {Return, State}. + +%% @doc Called after a test case failed. +-spec on_tc_fail(TC :: init_per_suite | end_per_suite | + init_per_group | end_per_group | atom(), + Reason :: term(), State :: #state{}) -> + NewState :: #state{}. +on_tc_fail(_TC, _Reason, State) -> + State. + +%% @doc Called when a test case is skipped. +-spec on_tc_skip(TC :: end_per_suite | init_per_group | end_per_group | atom(), + {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), + Reason :: term()}}} | + {tc_user_skip, {skipped, Reason :: term()}}, + State :: #state{}) -> + NewState :: #state{}. +on_tc_skip(_TC, _Reason, State) -> + State. + +%% @doc Called when the scope of the SCB is done. +-spec terminate(State :: #state{}) -> + term(). +terminate(_State) -> +% ct:log("Terminate called"), + ok. + +%%% ============================================================================ +%%% Local functions +%%% ============================================================================ +%% Install the test environment +install(ConfDir, TargetSystem, InstallOpts) -> + {ok,CurrWD} = file:get_cwd(), + try + ConfVars = filename:join(ConfDir, "variables"), + ConfVarsIn = filename:join(ConfDir, "conf_vars.in"), + Configure = filename:join(ConfDir, "configure"), + case has_changed([ConfVars],[ConfVarsIn, Configure]) of + true -> + file:set_cwd(ConfDir), + ts_install:install(TargetSystem, InstallOpts); + false -> + ct:log("Already installed!",[]) + end + after + file:set_cwd(CurrWD) + end. + +%% Configure and run all the Makefiles in the data dirs of the suite +%% in question +make_non_erlang(DataDir, Variables) -> + {ok,CurrWD} = file:get_cwd(), + try + file:set_cwd(DataDir), + MakeCommand = proplists:get_value(make_command,Variables), + + FirstMakefile = filename:join(DataDir,"Makefile.first"), + case filelib:is_regular(FirstMakefile) of + true -> + ct:log("Making ~p",[FirstMakefile]), + ok = ts_make:make( + MakeCommand, DataDir, filename:basename(FirstMakefile)); + false -> + ok + end, + + MakefileSrc = filename:join(DataDir,"Makefile.src"), + MakefileDest = filename:join(DataDir,"Makefile"), + case filelib:is_regular(MakefileSrc) of + true -> + ok = ts_lib:subst_file(MakefileSrc,MakefileDest,Variables), + ct:log("Making ~p",[MakefileDest]), + ok = ts_make:make([{makefile,"Makefile"},{data_dir,DataDir} + | Variables]); + false -> + ok + end + after + file:set_cwd(CurrWD), + timer:sleep(100) + end. + +%% Check if the source files have been changed after the dest files +has_changed(Dest, Source) -> + [] == [D || D <- Dest, S <- Source, get_mtime(D) > get_mtime(S)]. + +get_mtime(File) -> + case file:read_file_info(File) of + {ok,#file_info{ mtime = MTime }} -> + MTime; + _Else -> + {{0,0,0},{0,0,0}} + end. + + +%% Copied from test_server_ctrl.erl +generate_nodenames(Num) -> + {ok,Name} = inet:gethostname(), + generate_nodenames2(Num, [Name], []). + +generate_nodenames2(0, _Hosts, Acc) -> + Acc; +generate_nodenames2(N, Hosts, Acc) -> + Host=lists:nth((N rem (length(Hosts)))+1, Hosts), + Name=list_to_atom(temp_nodename("nod", []) ++ "@" ++ Host), + generate_nodenames2(N-1, Hosts, [Name|Acc]). + +temp_nodename([], Acc) -> + lists:flatten(Acc); +temp_nodename([Chr|Base], Acc) -> + {A,B,C} = erlang:now(), + New = [Chr | integer_to_list(Chr bxor A bxor B+A bxor C+B)], + temp_nodename(Base, [New|Acc]). -- cgit v1.2.3 From eb5eb98cfba9854870b061abf50027a025e6dc5d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 15 Dec 2010 16:10:37 +0100 Subject: Add release/tests/test_server to path --- lib/test_server/src/ts_run.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index d0262b34cd..557aa0ef3a 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -488,6 +488,7 @@ make_command(Vars, Spec, State) -> %% uncomment the line below to disable exception formatting %% " -test_server_format_exception false", " -boot start_sasl -sasl errlog_type error", + " -pz ",Cwd, " -eval \"file:set_cwd(\\\"",TestDir,"\\\")\" " " -eval \"ct:run_test(", backslashify(lists:flatten(State#state.test_server_args)),")\"" -- cgit v1.2.3 From 64b1a505c46cb51c7ba3f0588a89fb7bc712aa9a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 11 Jan 2011 14:03:49 +0100 Subject: Update ts scb to add nodenames in all pre_init clauses --- lib/test_server/src/ts_install_scb.erl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/test_server/src/ts_install_scb.erl b/lib/test_server/src/ts_install_scb.erl index 33710c7bfd..3ba8795764 100644 --- a/lib/test_server/src/ts_install_scb.erl +++ b/lib/test_server/src/ts_install_scb.erl @@ -19,8 +19,9 @@ %%% @doc TS Installed SCB %%% -%%% This module does what the ts:install/0 command combined with the make -%%% parts of the ts:run/x command did. +%%% This module does what the make parts of the ts:run/x command did, +%%% but not the Makefile.first parts! So they have to be done by ts or +%%% manually!! -module(ts_install_scb). @@ -106,9 +107,7 @@ pre_init_per_suite(_Suite,Config,State) -> make_non_erlang(DataDir, Variables), - {lists:keystore(nodenames, 1, Config, - {nodenames,generate_nodenames(State#state.nodenames)}), - State} + {add_node_name(Config, State), State} catch Error:Reason -> Stack = erlang:get_stacktrace(), ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), @@ -148,7 +147,7 @@ post_end_per_suite(_Suite,_Config,Return,State) -> State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. pre_init_per_group(_Group,Config,State) -> - {Config, State}. + {add_node_name(Config, State), State}. %% @doc Called after each init_per_group. -spec post_init_per_group(Group :: atom(), @@ -182,7 +181,7 @@ post_end_per_group(_Group,_Config,Return,State) -> State :: #state{}) -> {config() | skip_or_fail(), NewState :: #state{}}. pre_init_per_testcase(_TC,Config,State) -> - {Config, State}. + {add_node_name(Config, State), State}. %% @doc Called after each test case. -spec post_end_per_testcase(TC :: atom(), @@ -285,6 +284,17 @@ get_mtime(File) -> {{0,0,0},{0,0,0}} end. +%% Add a nodename to config if it does not exist +add_node_name(Config, State) -> + case proplists:get_value(nodenames, Config) of + undefined -> + lists:keystore( + nodenames, 1, Config, + {nodenames,generate_nodenames(State#state.nodenames)}); + _Else -> + Config + end. + %% Copied from test_server_ctrl.erl generate_nodenames(Num) -> -- cgit v1.2.3 From b192aefadc64f13fe802dbe78eeb85a2bdba43f3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 13 Jan 2011 11:00:44 +0100 Subject: Update ts to start common test with both ts.config and ts.PLATFORM.config --- lib/test_server/src/ts_run.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index 557aa0ef3a..68d731925f 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -411,6 +411,15 @@ write_spec_file(Vars, Spec, _State) -> MoreConfig = io_lib:format("~p.\n", [{config,Conf}]), file:write_file("current.spec", [DiskLess,Hosts,MoreConfig,SpecFile]). +get_config_files() -> + TSConfig = "ts.config", + [TSConfig | case os:type() of + {unix,_} -> ["ts.unix.config"]; + {win32,_} -> ["ts.win32.config"]; + vxworks -> ["ts.vxworks.config"]; + _ -> [] + end]. + consult_config() -> {ok,Conf} = file:consult("ts.config"), case os:type() of @@ -624,7 +633,8 @@ make_common_test_args(Args0, Options, _Vars) -> {value, {config, _}} -> []; false -> - [{config, "../test_server/ts.config"}] + [{config, [filename:join("../test_server",File) + || File <- get_config_files()]}] end, io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++ConfigFile++Options]). -- cgit v1.2.3 From 30245f345d7427cbbf0042f840f38f8c46cd2f51 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Jan 2011 11:50:28 +0100 Subject: Update minimal build target to include runtime_tools and common_test --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index f5ffc6f166..00bcf27ee3 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -51,7 +51,7 @@ else # -------------- # ERTS_SUB_DIRECTORIES = stdlib sasl kernel compiler - OTHER_SUB_DIRECTORIES = tools test_server + OTHER_SUB_DIRECTORIES = tools test_server common_test runtime_tools ifdef BUILD_ALL ifeq ($(findstring win32,$(TARGET)),win32) # BUILD_ALL on win32 OTHER_SUB_DIRECTORIES += \ -- cgit v1.2.3 From 241a3f7d0a85c4bbc69cf4ee3e40016610647bbf Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Jan 2011 15:41:16 +0100 Subject: Update so that cover is skipper for applications without a .cover file --- lib/test_server/src/ts_run.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index 68d731925f..d1e0e2e99c 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -616,6 +616,9 @@ make_common_test_args(Args0, Options, _Vars) -> end, Cover = case lists:keysearch(cover,1,Options) of + {value,{cover, App, none, _Analyse}} -> + io:format("No cover file found for ~p~n",[App]), + []; {value,{cover,_App,File,_Analyse}} -> [{cover,to_list(File)}]; false -> -- cgit v1.2.3 From 4e28e50fbfbccba4d35197e21337655107ff0247 Mon Sep 17 00:00:00 2001 From: Ulf Wiger Date: Mon, 25 Oct 2010 16:35:06 +0200 Subject: Track parents when expanding #xmlElement records The function xmerl_lib:expand_content/1 is mainly for expanding Simple XML, but can also handle xmerl records. This patch fixes an omission that caused expand_content/1 to not maintain the 'parents' list when expanding #xmlElement{} records. No test cases written, since the xmerl test suites have not yet been released. --- lib/xmerl/src/xmerl_lib.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/xmerl/src/xmerl_lib.erl b/lib/xmerl/src/xmerl_lib.erl index 7b76a76a33..1b3a7e57f0 100644 --- a/lib/xmerl/src/xmerl_lib.erl +++ b/lib/xmerl/src/xmerl_lib.erl @@ -148,9 +148,10 @@ expand_element(Element) -> expand_element(Element, Pos, Parents) -> expand_element(Element, Pos, Parents, false). -expand_element(E = #xmlElement{}, Pos, Parents, Norm) -> - Content = expand_content(E#xmlElement.content, 1, Parents, Norm), - Attrs = expand_attributes(E#xmlElement.attributes, 1, []), +expand_element(E = #xmlElement{name = N}, Pos, Parents, Norm) -> + NewParents = [{N,Pos}|Parents], + Content = expand_content(E#xmlElement.content, 1, NewParents, Norm), + Attrs = expand_attributes(E#xmlElement.attributes, 1, NewParents), E#xmlElement{pos = Pos, parents = Parents, attributes = Attrs, -- cgit v1.2.3 From ac303885b1301762f772fcb7337fdfdc97c111d6 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 24 Jan 2011 14:43:56 +0100 Subject: Changed crypto start test so that it works as intended --- lib/public_key/test/pkits_SUITE.erl | 5 ++--- lib/public_key/test/public_key_SUITE.erl | 4 ++-- lib/ssl/test/ssl_basic_SUITE.erl | 4 ++-- lib/ssl/test/ssl_packet_SUITE.erl | 4 ++-- lib/ssl/test/ssl_payload_SUITE.erl | 4 ++-- lib/ssl/test/ssl_session_cache_SUITE.erl | 4 ++-- lib/ssl/test/ssl_to_openssl_SUITE.erl | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index e3cc694110..a20f4e72c6 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -129,7 +129,6 @@ private_certificate_extensions(Config) when is_list(Config) -> run(private_certificate_extensions()). run() -> - catch crypto:start(), Tests = [signature_verification(), validity_periods(), @@ -587,7 +586,7 @@ fin_per_testcase(_Func, Config) -> Config. init_per_suite(Config) -> - case crypto:start() of + case application:start(crypto) of ok -> Config; _ -> @@ -595,7 +594,7 @@ init_per_suite(Config) -> end. end_per_suite(_Config) -> - crypto:stop(). + application:stop(crypto). error(Format, Args, File0, Line) -> File = filename:basename(File0), diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 3bd81a04ea..1bc1c8ec75 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -41,7 +41,7 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - case crypto:start() of + case application:start(crypto) of ok -> Config; _ -> @@ -54,7 +54,7 @@ init_per_suite(Config) -> %% Description: Cleanup after the whole suite %%-------------------------------------------------------------------- end_per_suite(_Config) -> - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index a75e9b4272..6a1b83d344 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -48,7 +48,7 @@ %%-------------------------------------------------------------------- init_per_suite(Config0) -> Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2), - case crypto:start() of + case application:start(crypto) of ok -> application:start(public_key), ssl:start(), @@ -73,7 +73,7 @@ init_per_suite(Config0) -> %%-------------------------------------------------------------------- end_per_suite(_Config) -> ssl:stop(), - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index 2fe17e1399..b1e585e39e 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -53,7 +53,7 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - case crypto:start() of + case application:start(crypto) of ok -> application:start(public_key), ssl:start(), @@ -73,7 +73,7 @@ init_per_suite(Config) -> %%-------------------------------------------------------------------- end_per_suite(_Config) -> ssl:stop(), - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index 76cc86c986..b19d1f286f 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -37,7 +37,7 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - case crypto:start() of + case application:start(crypto) of ok -> application:start(public_key), ssl:start(), @@ -54,7 +54,7 @@ init_per_suite(Config) -> %%-------------------------------------------------------------------- end_per_suite(_Config) -> ssl:stop(), - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index a8828b26e3..5aac9bb4e3 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -47,7 +47,7 @@ %%-------------------------------------------------------------------- init_per_suite(Config0) -> Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2), - case crypto:start() of + case application:start(crypto) of ok -> application:start(public_key), ssl:start(), @@ -73,7 +73,7 @@ init_per_suite(Config0) -> %%-------------------------------------------------------------------- end_per_suite(_Config) -> ssl:stop(), - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index 86d384ee52..0cbaafd99c 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -50,7 +50,7 @@ init_per_suite(Config0) -> false -> {skip, "Openssl not found"}; _ -> - case crypto:start() of + case application:start(crypto) of ok -> application:start(public_key), ssl:start(), @@ -74,7 +74,7 @@ init_per_suite(Config0) -> %%-------------------------------------------------------------------- end_per_suite(_Config) -> ssl:stop(), - crypto:stop(). + application:stop(crypto). %%-------------------------------------------------------------------- %% Function: init_per_testcase(TestCase, Config) -> Config -- cgit v1.2.3 From 98e954dfaf707895f1558d51a1ea9fd22812e161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 24 Jan 2011 17:36:57 +0100 Subject: Mention that "-detached" implies "-noinput" Clarify that specifying "-noinput" is unnecessary if the "-detached" flag is given. --- erts/doc/src/erl.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 77bd952d41..1e6e290f6b 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -231,7 +231,8 @@

Starts the Erlang runtime system detached from the system - console. Useful for running daemons and backgrounds processes.

+ console. Useful for running daemons and backgrounds processes. Implies + .

-- cgit v1.2.3 From 701918817ce0e9ea3d49b54d250066da76095010 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 25 Jan 2011 13:24:55 +0100 Subject: Update remote loading to only load a certain number of modules at a time to prevent memory usage explosion --- lib/tools/src/cover.erl | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index c4d1bd1d2f..4cc78403e1 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -972,14 +972,25 @@ remote_start(MainNode) -> {error,{already_started,Pid}} end. -%% Load a set of cover compiled modules on remote nodes -remote_load_compiled(Nodes,Compiled0) -> - Compiled = lists:map(fun get_data_for_remote_loading/1,Compiled0), +%% Load a set of cover compiled modules on remote nodes, +%% We do it ?MAX_MODS modules at a time so that we don't +%% run out of memory on the cover_server node. +-define(MAX_MODS, 10). +remote_load_compiled(Nodes,Compiled) -> + remote_load_compiled(Nodes, Compiled, [], 0). +remote_load_compiled(_Nodes, [], [], _ModNum) -> + ok; +remote_load_compiled(Nodes, Compiled, Acc, ModNum) + when Compiled == []; ModNum == ?MAX_MODS -> lists:foreach( fun(Node) -> - remote_call(Node,{remote,load_compiled,Compiled}) + remote_call(Node,{remote,load_compiled,Acc}) end, - Nodes). + Nodes), + remote_load_compiled(Nodes, Compiled, [], 0); +remote_load_compiled(Nodes, [MF | Rest], Acc, ModNum) -> + remote_load_compiled( + Nodes, Rest, [get_data_for_remote_loading(MF) | Acc], ModNum + 1). %% Read all data needed for loading a cover compiled module on a remote node %% Binary is the beam code for the module and InitialTable is the initial @@ -993,8 +1004,8 @@ get_data_for_remote_loading({Module,File}) -> %% Create a match spec which returns the clause info {Module,InitInfo} and %% all #bump keys for the given module with 0 number of calls. ms(Module) -> - ets:fun2ms(fun({Module,InitInfo}) -> - {Module,InitInfo}; + ets:fun2ms(fun({Mod,InitInfo}) -> + {Mod,InitInfo}; ({Key,_}) when is_record(Key,bump),Key#bump.module=:=Module -> {Key,0} end). -- cgit v1.2.3 From c8ce455e3cd307a564a92161b9e082bcc3672f94 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 25 Jan 2011 14:42:03 +0100 Subject: Update escrips to allow the -n or -compile(native) flag, which compiles the code within the escript with the +native flag. You need an HiPE enabled emulator for this to work. --- erts/doc/src/escript.xml | 8 +++++++- lib/stdlib/src/escript.erl | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 44c9a5ac68..588508aae6 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -153,7 +153,10 @@ halt(1).

Execution of interpreted code is slower than compiled code. If much of the execution takes place in interpreted code it may be worthwhile to compile it, even though the compilation - itself will take a little while.

+ itself will take a little while. It is also possible to supply + native instead of compile, this will compile the script + using the native flag, again depending on the characteristics + of the escript this could or could not be worth while.

As mentioned earlier, it is possible to have a script which contains precompiled beam code. In a precompiled @@ -397,6 +400,9 @@ ok Warnings and errors (if any) are written to the standard output, but the script will not be run. The exit status will be 0 if there were no errors, and 127 otherwise. + + -n + Compile the escript using the +native flag.

diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl index 7cb02afb11..0d2d23180a 100644 --- a/lib/stdlib/src/escript.erl +++ b/lib/stdlib/src/escript.erl @@ -31,7 +31,7 @@ %%----------------------------------------------------------------------- --type mode() :: 'compile' | 'debug' | 'interpret' | 'run'. +-type mode() :: 'native' | 'compile' | 'debug' | 'interpret' | 'run'. -type source() :: 'archive' | 'beam' | 'text'. -record(state, {file :: file:filename(), @@ -304,7 +304,11 @@ parse_and_run(File, Args, Options) -> false -> case lists:member("i", Options) of true -> interpret; - false -> Mode + false -> + case lists:member("n", Options) of + true -> native; + false -> Mode + end end end end, @@ -321,6 +325,14 @@ parse_and_run(File, Args, Options) -> _Other -> fatal("There were compilation errors.") end; + native -> + case compile:forms(FormsOrBin, [report,native]) of + {ok, Module, BeamBin} -> + {module, Module} = code:load_binary(Module, File, BeamBin), + run(Module, Args); + _Other -> + fatal("There were compilation errors.") + end; debug -> case compile:forms(FormsOrBin, [report, debug_info]) of {ok,Module,BeamBin} -> @@ -664,7 +676,7 @@ epp_parse_file2(Epp, S, Forms, Parsed) -> {attribute,Ln,mode,NewMode} -> S2 = S#state{mode = NewMode}, if - NewMode =:= compile; NewMode =:= interpret; NewMode =:= debug -> + NewMode =:= compile; NewMode =:= interpret; NewMode =:= debug; NewMode =:= native -> epp_parse_file(Epp, S2, [Form | Forms]); true -> Args = lists:flatten(io_lib:format("illegal mode attribute: ~p", [NewMode])), -- cgit v1.2.3 From 8f3148df7809a67a8ebf7a9762f4c85c2611a9f3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 26 Jan 2011 20:09:09 +0100 Subject: Refactor cover to prepare it for making analysis parallel --- lib/tools/src/cover.erl | 321 ++++++++++++++++++++++++++---------------------- 1 file changed, 171 insertions(+), 150 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 4cc78403e1..128aa84831 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -500,6 +500,8 @@ remote_call(Node,Request) -> Return end. +remote_reply(Proc,Reply) when is_pid(Proc) -> + Proc ! {?SERVER,Reply}; remote_reply(MainNode,Reply) -> {?SERVER,MainNode} ! {?SERVER,Reply}. @@ -593,40 +595,10 @@ main_process_loop(State) -> end; {From, {export,OutFile,Module}} -> - case file:open(OutFile,[write,binary,raw]) of - {ok,Fd} -> - Reply = - case Module of - '_' -> - export_info(State#main_state.imported), - collect(State#main_state.nodes), - do_export_table(State#main_state.compiled, - State#main_state.imported, - Fd); - _ -> - export_info(Module,State#main_state.imported), - case is_loaded(Module, State) of - {loaded, File} -> - [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), - collect(Module, Clauses, - State#main_state.nodes), - do_export_table([{Module,File}],[],Fd); - {imported, File, ImportFiles} -> - %% don't know if I should allow this - - %% export a module which is only imported - Imported = [{Module,File,ImportFiles}], - do_export_table([],Imported,Fd); - _NotLoaded -> - {error,{not_cover_compiled,Module}} - end - end, - file:close(Fd), - reply(From, Reply); - {error,Reason} -> - reply(From, {error, {cant_open_file,OutFile,Reason}}) - - end, + spawn(fun() -> + io:format(user, "EXPORTING: ~p to ~p~n",[Module, OutFile]), + do_export(Module, OutFile, From, State) + end), main_process_loop(State); {From, {import,File}} -> @@ -692,107 +664,95 @@ main_process_loop(State) -> unregister(?SERVER), reply(From, ok); - {From, {Request, Module}} -> - case is_loaded(Module, State) of - {loaded, File} -> - {Reply,State1} = - case Request of - {analyse, Analysis, Level} -> - analyse_info(Module,State#main_state.imported), + {From, {{analyse, Analysis, Level}, Module}} -> + S = try + Loaded = is_loaded(Module, State), + analyse_info(Module,State#main_state.imported), + C = case Loaded of + {loaded, _File} -> [{Module,Clauses}] = ets:lookup(?COVER_TABLE,Module), collect(Module,Clauses,State#main_state.nodes), - R = do_analyse(Module, Analysis, Level, Clauses), - {R,State}; - - {analyse_to_file, OutFile, Opts} -> - R = case find_source(File) of - {beam,_BeamFile} -> - {error,no_source_code_found}; - ErlFile -> - Imported = State#main_state.imported, - analyse_info(Module,Imported), - [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), - collect(Module, Clauses, - State#main_state.nodes), - HTML = lists:member(html,Opts), - do_analyse_to_file(Module,OutFile, - ErlFile,HTML) - end, - {R,State}; - - is_compiled -> - {{file, File},State}; - - reset -> - R = do_reset_main_node(Module, - State#main_state.nodes), - Imported = - remove_imported(Module, - State#main_state.imported), - {R,State#main_state{imported=Imported}} - end, - reply(From, Reply), - main_process_loop(State1); - - {imported,File,_ImportFiles} -> - {Reply,State1} = - case Request of - {analyse, Analysis, Level} -> - analyse_info(Module,State#main_state.imported), + Clauses; + _ -> [{Module,Clauses}] = ets:lookup(?COLLECTION_TABLE,Module), - R = do_analyse(Module, Analysis, Level, Clauses), - {R,State}; - - {analyse_to_file, OutFile, Opts} -> - R = case find_source(File) of - {beam,_BeamFile} -> - {error,no_source_code_found}; - ErlFile -> - Imported = State#main_state.imported, - analyse_info(Module,Imported), - HTML = lists:member(html,Opts), - do_analyse_to_file(Module,OutFile, - ErlFile,HTML) - end, - {R,State}; - - is_compiled -> - {false,State}; - - reset -> - R = do_reset_collection_table(Module), - Imported = - remove_imported(Module, - State#main_state.imported), - {R,State#main_state{imported=Imported}} + Clauses end, - reply(From, Reply), - main_process_loop(State1); - - NotLoaded -> - Reply = - case Request of - is_compiled -> - false; - _ -> - {error, {not_cover_compiled,Module}} - end, - Compiled = - case NotLoaded of - unloaded -> - do_clear(Module), - remote_unload(State#main_state.nodes,[Module]), - update_compiled([Module], - State#main_state.compiled); - false -> - State#main_state.compiled + R = do_analyse(Module, Analysis, Level, C), + reply(From, R), + State + catch throw:Reason -> + reply(From,{error, {not_cover_compiled,Module}}), + not_loaded(Module, Reason, State) + end, + main_process_loop(S); + + {From, {{analyse_to_file, OutFile, Opts},Module}} -> + S = try + Loaded = is_loaded(Module, State), + File = case Loaded of + {loaded, File0} -> + [{Module,Clauses}] = + ets:lookup(?COVER_TABLE,Module), + collect(Module, Clauses, + State#main_state.nodes), + File0; + {imported, File0, _} -> + File0 + end, + case find_source(File) of + {beam,_BeamFile} -> + reply(From, {error,no_source_code_found}), + State; + ErlFile -> + analyse_info(Module,State#main_state.imported), + HTML = lists:member(html,Opts), + R = do_analyse_to_file(Module,OutFile, + ErlFile,HTML), + reply(From, R), + State + end + catch throw:Reason -> + reply(From,{error, {not_cover_compiled,Module}}), + not_loaded(Module, Reason, State) + end, + main_process_loop(S); + + {From, {is_compiled, Module}} -> + S = try is_loaded(Module, State) of + {loaded, File} -> + reply(From,{file, File}), + State; + {imported,_File,_ImportFiles} -> + reply(From,false), + State + catch throw:Reason -> + reply(From,false), + not_loaded(Module, Reason, State) + end, + main_process_loop(S); + + {From, {reset, Module}} -> + S = try + Loaded = is_loaded(Module,State), + R = case Loaded of + {loaded, _File} -> + do_reset_main_node( + Module, State#main_state.nodes); + {imported, _File, _} -> + do_reset_collection_table(Module) end, - reply(From, Reply), - main_process_loop(State#main_state{compiled=Compiled}) - end; + Imported = + remove_imported(Module, + State#main_state.imported), + reply(From, R), + State#main_state{imported=Imported} + catch throw:Reason -> + reply(From,{error, {not_cover_compiled,Module}}), + not_loaded(Module, Reason, State) + end, + main_process_loop(S); {'EXIT',Pid,_Reason} -> %% Exit is trapped on the main node only, so this will only happen @@ -807,10 +767,6 @@ main_process_loop(State) -> main_process_loop(State) end. - - - - %%%---------------------------------------------------------------------- %%% cover_server on remote node %%%---------------------------------------------------------------------- @@ -843,6 +799,10 @@ remote_process_loop(State) -> remote_process_loop(State); {remote,collect,Module,CollectorPid} -> + self() ! {remote,collect,Module,CollectorPid, ?SERVER}; + + {remote,collect,Module,CollectorPid,From} -> +% spawn(?MODULE, do_remote_collect, [Module, CollectorPid]), MS = case Module of '_' -> ets:fun2ms(fun({M,C}) when is_atom(M) -> C end); @@ -865,7 +825,7 @@ remote_process_loop(State) -> end, AllClauses), CollectorPid ! done, - remote_reply(State#remote_state.main_node, ok), + remote_reply(From, ok), remote_process_loop(State); {remote,stop} -> @@ -1028,27 +988,37 @@ remote_reset(Module,Nodes) -> %% Collect data from remote nodes - used for analyse or stop(Node) remote_collect(Module,Nodes,Stop) -> - CollectorPid = spawn(fun() -> collector_proc(length(Nodes)) end), - lists:foreach( - fun(Node) -> - remote_call(Node,{remote,collect,Module,CollectorPid}), - if Stop -> remote_call(Node,{remote,stop}); - true -> ok - end - end, - Nodes). + Pids = lists:map( + fun(Node) -> + spawn(fun() -> + do_collection(Node, Module, Stop) + end) + end, + Nodes), + RefsNPids = [{erlang:monitor(process, Pid),Pid} || Pid <- Pids], + lists:foreach(fun({Ref,Pid}) -> + receive + {'DOWN', Ref, process, Pid, _} -> + ok + end + end,RefsNPids). + +do_collection(Node, Module, Stop) -> + CollectorPid = spawn(fun collector_proc/0), + remote_call(Node,{remote,collect,Module,CollectorPid, self()}), + if Stop -> remote_call(Node,{remote,stop}); + true -> ok + end. %% Process which receives chunks of data from remote nodes - either when %% analysing or when stopping cover on the remote nodes. -collector_proc(0) -> - ok; -collector_proc(N) -> +collector_proc() -> receive {chunk,Chunk} -> insert_in_collection_table(Chunk), - collector_proc(N); + collector_proc(); done -> - collector_proc(N-1) + ok end. insert_in_collection_table([{Key,Val}|Chunk]) -> @@ -1063,7 +1033,13 @@ insert_in_collection_table(Key,Val) -> ets:update_counter(?COLLECTION_TABLE, Key,Val); false -> - ets:insert(?COLLECTION_TABLE,{Key,Val}) + %% Make sure that there are no race conditions from ets:member + case ets:insert_new(?COLLECTION_TABLE,{Key,Val}) of + false -> + insert_in_collection_table(Key,Val); + _ -> + ok + end end. @@ -1164,14 +1140,14 @@ is_loaded(Module, State) -> {ok, File} -> case code:which(Module) of ?TAG -> {loaded, File}; - _ -> unloaded + _ -> throw(unloaded) end; false -> case get_file(Module,State#main_state.imported) of {ok,File,ImportFiles} -> {imported, File, ImportFiles}; false -> - false + throw(not_loaded) end end. @@ -2038,6 +2014,42 @@ fill2() -> ".| ". fill3() -> "| ". %%%--Export-------------------------------------------------------------- +do_export(Module, OutFile, From, State) -> + case file:open(OutFile,[write,binary,raw]) of + {ok,Fd} -> + Reply = + case Module of + '_' -> + export_info(State#main_state.imported), + collect(State#main_state.nodes), + do_export_table(State#main_state.compiled, + State#main_state.imported, + Fd); + _ -> + export_info(Module,State#main_state.imported), + try is_loaded(Module, State) of + {loaded, File} -> + [{Module,Clauses}] = + ets:lookup(?COVER_TABLE,Module), + collect(Module, Clauses, + State#main_state.nodes), + do_export_table([{Module,File}],[],Fd); + {imported, File, ImportFiles} -> + %% don't know if I should allow this - + %% export a module which is only imported + Imported = [{Module,File,ImportFiles}], + do_export_table([],Imported,Fd) + catch throw:_ -> + {error,{not_cover_compiled,Module}} + end + end, + file:close(Fd), + reply(From, Reply); + {error,Reason} -> + reply(From, {error, {cant_open_file,OutFile,Reason}}) + + end. + do_export_table(Compiled, Imported, Fd) -> ModList = merge(Imported,Compiled), write_module_data(ModList,Fd). @@ -2164,6 +2176,15 @@ do_clear(Module) -> ets:match_delete(?COVER_TABLE, {#bump{module=Module},'_'}), ets:match_delete(?COLLECTION_TABLE, {#bump{module=Module},'_'}). +not_loaded(Module, unloaded, State) -> + do_clear(Module), + remote_unload(State#main_state.nodes,[Module]), + Compiled = update_compiled([Module], + State#main_state.compiled), + State#main_state{ compiled = Compiled }; +not_loaded(_Module,_Else, State) -> + State. + %%%--Div----------------------------------------------------------------- -- cgit v1.2.3 From 3a4ed77a4b8d29ec6889e60a56e440c7db440628 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 26 Jan 2011 20:21:34 +0100 Subject: Update cover to allow multiple analyse and analyze_to_file calls at the same time. For each call a seperate process will be spawned to handle the request. --- lib/tools/src/cover.erl | 86 ++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 128aa84831..b8cb8e58cf 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -596,7 +596,6 @@ main_process_loop(State) -> {From, {export,OutFile,Module}} -> spawn(fun() -> - io:format(user, "EXPORTING: ~p to ~p~n",[Module, OutFile]), do_export(Module, OutFile, From, State) end), main_process_loop(State); @@ -667,20 +666,11 @@ main_process_loop(State) -> {From, {{analyse, Analysis, Level}, Module}} -> S = try Loaded = is_loaded(Module, State), - analyse_info(Module,State#main_state.imported), - C = case Loaded of - {loaded, _File} -> - [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), - collect(Module,Clauses,State#main_state.nodes), - Clauses; - _ -> - [{Module,Clauses}] = - ets:lookup(?COLLECTION_TABLE,Module), - Clauses - end, - R = do_analyse(Module, Analysis, Level, C), - reply(From, R), + spawn(fun() -> + do_parallel_analysis( + Module, Analysis, Level, + Loaded, From, State) + end), State catch throw:Reason -> reply(From,{error, {not_cover_compiled,Module}}), @@ -691,28 +681,12 @@ main_process_loop(State) -> {From, {{analyse_to_file, OutFile, Opts},Module}} -> S = try Loaded = is_loaded(Module, State), - File = case Loaded of - {loaded, File0} -> - [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), - collect(Module, Clauses, - State#main_state.nodes), - File0; - {imported, File0, _} -> - File0 - end, - case find_source(File) of - {beam,_BeamFile} -> - reply(From, {error,no_source_code_found}), - State; - ErlFile -> - analyse_info(Module,State#main_state.imported), - HTML = lists:member(html,Opts), - R = do_analyse_to_file(Module,OutFile, - ErlFile,HTML), - reply(From, R), - State - end + spawn(fun() -> + do_parallel_analysis_to_file( + Module, OutFile, Opts, + Loaded, From, State) + end), + State catch throw:Reason -> reply(From,{error, {not_cover_compiled,Module}}), not_loaded(Module, Reason, State) @@ -1842,6 +1816,22 @@ find_source(File0) -> end end. +do_parallel_analysis(Module, Analysis, Level, Loaded, From, State) -> + analyse_info(Module,State#main_state.imported), + C = case Loaded of + {loaded, _File} -> + [{Module,Clauses}] = + ets:lookup(?COVER_TABLE,Module), + collect(Module,Clauses,State#main_state.nodes), + Clauses; + _ -> + [{Module,Clauses}] = + ets:lookup(?COLLECTION_TABLE,Module), + Clauses + end, + R = do_analyse(Module, Analysis, Level, C), + reply(From, R). + %% do_analyse(Module, Analysis, Level, Clauses)-> {ok,Answer} | {error,Error} %% Clauses = [{Module,Function,Arity,Clause,Lines}] do_analyse(Module, Analysis, line, _Clauses) -> @@ -1918,6 +1908,28 @@ merge_functions([{_MFA,R}|Functions], MFun, Result) -> merge_functions([], _MFun, Result) -> Result. +do_parallel_analysis_to_file(Module, OutFile, Opts, Loaded, From, State) -> + File = case Loaded of + {loaded, File0} -> + [{Module,Clauses}] = + ets:lookup(?COVER_TABLE,Module), + collect(Module, Clauses, + State#main_state.nodes), + File0; + {imported, File0, _} -> + File0 + end, + case find_source(File) of + {beam,_BeamFile} -> + reply(From, {error,no_source_code_found}); + ErlFile -> + analyse_info(Module,State#main_state.imported), + HTML = lists:member(html,Opts), + R = do_analyse_to_file(Module,OutFile, + ErlFile,HTML), + reply(From, R) + end. + %% do_analyse_to_file(Module,OutFile,ErlFile) -> {ok,OutFile} | {error,Error} %% Module = atom() %% OutFile = ErlFile = string() -- cgit v1.2.3 From a5bb09b0a8a6aac4e47c19b5abdbbb8f54e14133 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 26 Jan 2011 20:26:57 +0100 Subject: Make the call to cover parallel so that the test_server takes advantage of the new cool parallel cover features. --- lib/test_server/src/test_server.erl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index ee121e5bb6..1045fa9a9b 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -470,7 +470,7 @@ cover_analyse(Analyse,Modules) -> overview -> fun(_) -> undefined end end, - R = lists:map( + R = pmap( fun(M) -> case cover:analyse(M,module) of {ok,{M,{Cov,NotCov}}} -> @@ -486,6 +486,23 @@ cover_analyse(Analyse,Modules) -> stick_all_sticky(node(),Sticky), R. +pmap(Fun,List) -> + Collector = self(), + Pids = lists:map(fun(E) -> + spawn(fun() -> + Collector ! {res,self(),Fun(E)} + end) + end, List), + lists:map(fun(Pid) -> + receive + {res,Pid,Res} -> + Res + end + end, Pids). + + + + unstick_all_sticky(Node) -> lists:filter( -- cgit v1.2.3 From 3163804a22daa8e123078291496778963e16f7fe Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 27 Jan 2011 10:09:22 +0100 Subject: Update suite callback test timeout so that beam debug test runs do not timeout --- lib/common_test/test/ct_suite_callback_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 6d61fbb21d..adb950614e 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(TestCase, Config) -> suite() -> - [{timetrap,{seconds,15}}]. + [{timetrap,{seconds,20}}]. all() -> all(suite). -- cgit v1.2.3 From 976ce69a8ada40e6b2e4664fc48d5f430e4ea1f2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 27 Jan 2011 11:14:07 +0100 Subject: Remove io printout warnings when exporting an imported module --- lib/tools/src/cover.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index b8cb8e58cf..689a702d52 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -1034,14 +1034,15 @@ analyse_info(Module,Imported) -> export_info(_Module,[]) -> ok; -export_info(Module,Imported) -> - imported_info("Export",Module,Imported). +export_info(_Module,_Imported) -> + %% Do not print that the export includes imported modules + ok. export_info([]) -> ok; -export_info(Imported) -> - AllImportFiles = get_all_importfiles(Imported,[]), - io:format("Export includes data from imported files\n~p\n",[AllImportFiles]). +export_info(_Imported) -> + %% Do not print that the export includes imported modules + ok. get_all_importfiles([{_M,_F,ImportFiles}|Imported],Acc) -> NewAcc = do_get_all_importfiles(ImportFiles,Acc), -- cgit v1.2.3 From a74c4f6e655543c70179b8dc507d51e5603c7e30 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 27 Jan 2011 12:08:46 +0100 Subject: Update remote collect to handle multiple requests at once --- lib/tools/src/cover.erl | 53 ++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 689a702d52..48ab91db9c 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -776,30 +776,9 @@ remote_process_loop(State) -> self() ! {remote,collect,Module,CollectorPid, ?SERVER}; {remote,collect,Module,CollectorPid,From} -> -% spawn(?MODULE, do_remote_collect, [Module, CollectorPid]), - MS = - case Module of - '_' -> ets:fun2ms(fun({M,C}) when is_atom(M) -> C end); - _ -> ets:fun2ms(fun({M,C}) when M=:=Module -> C end) - end, - AllClauses = lists:flatten(ets:select(?COVER_TABLE,MS)), - - %% Sending clause by clause in order to avoid large lists - lists:foreach( - fun({M,F,A,C,_L}) -> - Pattern = - {#bump{module=M, function=F, arity=A, clause=C}, '_'}, - Bumps = ets:match_object(?COVER_TABLE, Pattern), - %% Reset - lists:foreach(fun({Bump,_N}) -> - ets:insert(?COVER_TABLE, {Bump,0}) - end, - Bumps), - CollectorPid ! {chunk,Bumps} - end, - AllClauses), - CollectorPid ! done, - remote_reply(From, ok), + spawn(fun() -> + do_collect(Module, CollectorPid, From) + end), remote_process_loop(State); {remote,stop} -> @@ -828,6 +807,30 @@ remote_process_loop(State) -> end. +do_collect(Module, CollectorPid, From) -> + MS = + case Module of + '_' -> ets:fun2ms(fun({M,C}) when is_atom(M) -> C end); + _ -> ets:fun2ms(fun({M,C}) when M=:=Module -> C end) + end, + AllClauses = lists:flatten(ets:select(?COVER_TABLE,MS)), + + %% Sending clause by clause in order to avoid large lists + lists:foreach( + fun({M,F,A,C,_L}) -> + Pattern = + {#bump{module=M, function=F, arity=A, clause=C}, '_'}, + Bumps = ets:match_object(?COVER_TABLE, Pattern), + %% Reset + lists:foreach(fun({Bump,_N}) -> + ets:insert(?COVER_TABLE, {Bump,0}) + end, + Bumps), + CollectorPid ! {chunk,Bumps} + end, + AllClauses), + CollectorPid ! done, + remote_reply(From, ok). reload_originals([{Module,_File}|Compiled]) -> do_reload_original(Module), @@ -938,7 +941,7 @@ get_data_for_remote_loading({Module,File}) -> %% Create a match spec which returns the clause info {Module,InitInfo} and %% all #bump keys for the given module with 0 number of calls. ms(Module) -> - ets:fun2ms(fun({Mod,InitInfo}) -> + ets:fun2ms(fun({Mod,InitInfo}) when Mod =:= Module -> {Mod,InitInfo}; ({Key,_}) when is_record(Key,bump),Key#bump.module=:=Module -> {Key,0} -- cgit v1.2.3 From a3971dd8d2379fafd76bdaebc3c8b1e71b4e411a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 27 Jan 2011 12:09:17 +0100 Subject: Add process debug tags --- lib/tools/src/cover.erl | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 48ab91db9c..f6f976e0af 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -114,6 +114,8 @@ true -> ?BLOCK(Expr) end). +-define(SPAWN_DBG(Tag,Value),put(Tag,Value)). + -include_lib("stdlib/include/ms_transform.hrl"). %%%---------------------------------------------------------------------- @@ -127,7 +129,10 @@ start() -> case whereis(?SERVER) of undefined -> Starter = self(), - Pid = spawn(fun() -> init_main(Starter) end), + Pid = spawn(fun() -> + ?SPAWN_DBG(start,[]), + init_main(Starter) + end), Ref = erlang:monitor(process,Pid), Return = receive @@ -596,6 +601,7 @@ main_process_loop(State) -> {From, {export,OutFile,Module}} -> spawn(fun() -> + ?SPAWN_DBG(export,{OutFile, Module}), do_export(Module, OutFile, From, State) end), main_process_loop(State); @@ -667,6 +673,7 @@ main_process_loop(State) -> S = try Loaded = is_loaded(Module, State), spawn(fun() -> + ?SPAWN_DBG(analyse,{Module,Analysis, Level}), do_parallel_analysis( Module, Analysis, Level, Loaded, From, State) @@ -682,6 +689,8 @@ main_process_loop(State) -> S = try Loaded = is_loaded(Module, State), spawn(fun() -> + ?SPAWN_DBG(analyse_to_file, + {Module,OutFile, Opts}), do_parallel_analysis_to_file( Module, OutFile, Opts, Loaded, From, State) @@ -777,6 +786,8 @@ remote_process_loop(State) -> {remote,collect,Module,CollectorPid,From} -> spawn(fun() -> + ?SPAWN_DBG(remote_collect, + {Module, CollectorPid, From}), do_collect(Module, CollectorPid, From) end), remote_process_loop(State); @@ -894,7 +905,10 @@ remote_start(MainNode) -> case whereis(?SERVER) of undefined -> Starter = self(), - Pid = spawn(fun() -> init_remote(Starter,MainNode) end), + Pid = spawn(fun() -> + ?SPAWN_DBG(remote_start,{MainNode}), + init_remote(Starter,MainNode) + end), Ref = erlang:monitor(process,Pid), Return = receive @@ -968,6 +982,8 @@ remote_collect(Module,Nodes,Stop) -> Pids = lists:map( fun(Node) -> spawn(fun() -> + ?SPAWN_DBG(remote_collect, + {Module, Nodes, Stop}), do_collection(Node, Module, Stop) end) end, @@ -990,6 +1006,7 @@ do_collection(Node, Module, Stop) -> %% Process which receives chunks of data from remote nodes - either when %% analysing or when stopping cover on the remote nodes. collector_proc() -> + ?SPAWN_DBG(collector_proc, []), receive {chunk,Chunk} -> insert_in_collection_table(Chunk), -- cgit v1.2.3 From 2697ce88a724423905e264fedd304bb703a50689 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Sun, 30 Jan 2011 20:34:48 +0200 Subject: Sanitize the specs of the code module After the addition of unicode_binary() to the file:filename() type, dialyzer started complaining about erroneous or incomplete specs in some functions of the 'code' module. The culprit was hard-coded information in erl_bif_types for functions of this module, which were not updated. Since these functions have proper specs these days and code duplication (pun intended) is never a good idea, their type information was removed from erl_bif_types. While doing this, some erroneous comments were fixed in the code module and also made sure that the code now runs without dialyzer warnings even when the -Wunmatched_returns option is used. Some cleanups were applied to erl_bif_types too. --- lib/hipe/cerl/erl_bif_types.erl | 197 +++------------------------------------- lib/kernel/src/code.erl | 129 +++++++++++++------------- 2 files changed, 76 insertions(+), 250 deletions(-) diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 309c118107..adddd88ae3 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -191,127 +191,19 @@ type(binary, referenced_byte_size, 1, Xs) -> strict(arg_types(binary, referenced_byte_size, 1), Xs, fun(_) -> t_non_neg_integer() end); %%-- code --------------------------------------------------------------------- -type(code, add_path, 1, Xs) -> - strict(arg_types(code, add_path, 1), Xs, - fun (_) -> - t_sup(t_atom('true'), - t_tuple([t_atom('error'), t_atom('bad_directory')])) - end); -type(code, add_patha, 1, Xs) -> - type(code, add_path, 1, Xs); -type(code, add_paths, 1, Xs) -> - strict(arg_types(code, add_paths, 1), Xs, fun(_) -> t_atom('ok') end); -type(code, add_pathsa, 1, Xs) -> - type(code, add_paths, 1, Xs); -type(code, add_pathsz, 1, Xs) -> - type(code, add_paths, 1, Xs); -type(code, add_pathz, 1, Xs) -> - type(code, add_path, 1, Xs); -type(code, all_loaded, 0, _) -> - t_list(t_tuple([t_atom(), t_code_loaded_fname_or_status()])); -type(code, compiler_dir, 0, _) -> - t_string(); -type(code, del_path, 1, Xs) -> - strict(arg_types(code, del_path, 1), Xs, - fun (_) -> - t_sup(t_boolean(), - t_tuple([t_atom('error'), t_atom('bad_name')])) - end); -type(code, delete, 1, Xs) -> - strict(arg_types(code, delete, 1), Xs, fun (_) -> t_boolean() end); -type(code, ensure_loaded, 1, Xs) -> - type(code, load_file, 1, Xs); type(code, get_chunk, 2, Xs) -> strict(arg_types(code, get_chunk, 2), Xs, fun (_) -> t_sup(t_binary(), t_atom('undefined')) end); -type(code, get_object_code, 1, Xs) -> - strict(arg_types(code, get_object_code, 1), Xs, - fun (_) -> - t_sup(t_tuple([t_atom(), t_binary(), t_string()]), - t_atom('error')) - end); -type(code, get_path, 0, _) -> - t_list(t_string()); -type(code, is_loaded, 1, Xs) -> - strict(arg_types(code, is_loaded, 1), Xs, - fun (_) -> - t_sup([t_tuple([t_atom('file'), t_code_loaded_fname_or_status()]), - t_atom('false')]) - end); -type(code, is_sticky, 1, Xs) -> - strict(arg_types(code, is_sticky, 1), Xs, fun (_) -> t_boolean() end); type(code, is_module_native, 1, Xs) -> strict(arg_types(code, is_module_native, 1), Xs, fun (_) -> t_sup(t_boolean(), t_atom('undefined')) end); -type(code, lib_dir, 0, _) -> - t_string(); -type(code, lib_dir, 1, Xs) -> - strict(arg_types(code, lib_dir, 1), Xs, - fun (_) -> - t_sup(t_string(), - t_tuple([t_atom('error'), t_atom('bad_name')])) - end); -type(code, load_abs, 1, Xs) -> - strict(arg_types(code, load_abs, 1), Xs, - fun ([_File]) -> t_code_load_return(t_atom()) end); % XXX: cheating -type(code, load_abs, 2, Xs) -> - strict(arg_types(code, load_abs, 2), Xs, - fun ([_File,Mod]) -> t_code_load_return(Mod) end); -type(code, load_binary, 3, Xs) -> - strict(arg_types(code, load_binary, 3), Xs, - fun ([Mod,_File,_Bin]) -> t_code_load_return(Mod) end); -type(code, load_file, 1, Xs) -> - strict(arg_types(code, load_file, 1), Xs, - fun ([Mod]) -> t_code_load_return(Mod) end); -type(code, load_native_partial, 2, Xs) -> - strict(arg_types(code, load_native_partial, 2), Xs, - fun ([Mod,_Bin]) -> t_code_load_return(Mod) end); -type(code, load_native_sticky, 3, Xs) -> - strict(arg_types(code, load_native_sticky, 3), Xs, - fun ([Mod,_Bin,_]) -> t_code_load_return(Mod) end); type(code, module_md5, 1, Xs) -> strict(arg_types(code, module_md5, 1), Xs, fun (_) -> t_sup(t_binary(), t_atom('undefined')) end); type(code, make_stub_module, 3, Xs) -> strict(arg_types(code, make_stub_module, 3), Xs, fun ([Mod,_,_]) -> Mod end); -type(code, priv_dir, 1, Xs) -> - strict(arg_types(code, priv_dir, 1), Xs, - fun (_) -> - t_sup(t_string(), t_tuple([t_atom('error'), t_atom('bad_name')])) - end); -type(code, purge, 1, Xs) -> - type(code, delete, 1, Xs); -type(code, rehash, 0, _) -> t_atom('ok'); -type(code, replace_path, 2, Xs) -> - strict(arg_types(code, replace_path, 2), Xs, - fun (_) -> - t_sup([t_atom('true'), - t_tuple([t_atom('error'), t_atom('bad_name')]), - t_tuple([t_atom('error'), t_atom('bad_directory')]), - t_tuple([t_atom('error'), - t_tuple([t_atom('badarg'), t_any()])])]) - end); -type(code, root_dir, 0, _) -> - t_string(); -type(code, set_path, 1, Xs) -> - strict(arg_types(code, set_path, 1), Xs, - fun (_) -> - t_sup([t_atom('true'), - t_tuple([t_atom('error'), t_atom('bad_path')]), - t_tuple([t_atom('error'), t_atom('bad_directory')])]) - end); -type(code, soft_purge, 1, Xs) -> - type(code, delete, 1, Xs); -type(code, stick_mod, 1, Xs) -> - strict(arg_types(code, stick_mod, 1), Xs, fun (_) -> t_atom('true') end); -type(code, unstick_mod, 1, Xs) -> - type(code, stick_mod, 1, Xs); -type(code, which, 1, Xs) -> - strict(arg_types(code, which, 1), Xs, - fun (_) -> - t_sup([t_code_loaded_fname_or_status(), - t_atom('non_existing')]) - end); +type(code, rehash, 0, _) -> + t_atom('ok'); %%-- erl_ddll ----------------------------------------------------------------- type(erl_ddll, demonitor, 1, Xs) -> type(erlang, demonitor, 1, Xs); @@ -3334,80 +3226,16 @@ arg_types(binary, part, 3) -> arg_types(binary, referenced_byte_size, 1) -> [t_binary()]; %%------- code ---------------------------------------------------------------- -arg_types(code, add_path, 1) -> - [t_string()]; -arg_types(code, add_patha, 1) -> - arg_types(code, add_path, 1); -arg_types(code, add_paths, 1) -> - [t_list(t_string())]; -arg_types(code, add_pathsa, 1) -> - arg_types(code, add_paths, 1); -arg_types(code, add_pathsz, 1) -> - arg_types(code, add_paths, 1); -arg_types(code, add_pathz, 1) -> - arg_types(code, add_path, 1); -arg_types(code, all_loaded, 0) -> - []; -arg_types(code, compiler_dir, 0) -> - []; -arg_types(code, del_path, 1) -> - [t_sup(t_string(), t_atom())]; % OBS: differs from add_path/1 -arg_types(code, delete, 1) -> - [t_atom()]; -arg_types(code, ensure_loaded, 1) -> - arg_types(code, load_file, 1); arg_types(code, get_chunk, 2) -> [t_binary(), t_string()]; -arg_types(code, get_object_code, 1) -> - [t_atom()]; -arg_types(code, get_path, 0) -> - []; -arg_types(code, is_loaded, 1) -> - [t_atom()]; -arg_types(code, is_sticky, 1) -> - [t_atom()]; arg_types(code, is_module_native, 1) -> [t_atom()]; -arg_types(code, lib_dir, 0) -> - []; -arg_types(code, lib_dir, 1) -> - [t_atom()]; -arg_types(code, load_abs, 1) -> - [t_string()]; -arg_types(code, load_abs, 2) -> - [t_code_loaded_fname_or_status(), t_atom()]; -arg_types(code, load_binary, 3) -> - [t_atom(), t_code_loaded_fname_or_status(), t_binary()]; -arg_types(code, load_file, 1) -> - [t_atom()]; -arg_types(code, load_native_partial, 2) -> - [t_atom(), t_binary()]; -arg_types(code, load_native_sticky, 3) -> - [t_atom(), t_binary(), t_sup(t_binary(), t_atom('false'))]; arg_types(code, module_md5, 1) -> [t_binary()]; arg_types(code, make_stub_module, 3) -> [t_atom(), t_binary(), t_tuple([t_list(), t_list()])]; -arg_types(code, priv_dir, 1) -> - [t_atom()]; -arg_types(code, purge, 1) -> - arg_types(code, delete, 1); arg_types(code, rehash, 0) -> []; -arg_types(code, replace_path, 2) -> - [t_atom(), t_string()]; -arg_types(code, root_dir, 0) -> - []; -arg_types(code, set_path, 1) -> - [t_list(t_string())]; -arg_types(code, soft_purge, 1) -> - arg_types(code, delete, 1); -arg_types(code, stick_mod, 1) -> - [t_atom()]; -arg_types(code, unstick_mod, 1) -> - arg_types(code, stick_mod, 1); -arg_types(code, which, 1) -> - [t_atom()]; %%------- erl_ddll ------------------------------------------------------------ arg_types(erl_ddll, demonitor, 1) -> arg_types(erlang, demonitor, 1); @@ -3536,9 +3364,9 @@ arg_types(erlang, atom_to_binary, 2) -> arg_types(erlang, atom_to_list, 1) -> [t_atom()]; arg_types(erlang, binary_part, 2) -> - [t_binary(), t_tuple([t_integer(),t_integer()])]; + [t_binary(), t_tuple([t_non_neg_integer(), t_integer()])]; arg_types(erlang, binary_part, 3) -> - [t_binary(), t_integer(), t_integer()]; + [t_binary(), t_non_neg_integer(), t_integer()]; arg_types(erlang, binary_to_atom, 2) -> [t_binary(), t_encoding_a2b()]; arg_types(erlang, binary_to_existing_atom, 2) -> @@ -3801,9 +3629,10 @@ arg_types(erlang, nodes, 1) -> arg_types(erlang, now, 0) -> []; arg_types(erlang, open_port, 2) -> + ArgT = t_sup(t_unicode_string(), t_binary()), [t_sup(t_atom(), t_sup([t_tuple([t_atom('spawn'), t_string()]), t_tuple([t_atom('spawn_driver'), t_string()]), - t_tuple([t_atom('spawn_executable'), t_sup(t_unicode_string(),t_binary())]), + t_tuple([t_atom('spawn_executable'), ArgT]), t_tuple([t_atom('fd'), t_integer(), t_integer()])])), t_list(t_sup(t_sup([t_atom('stream'), t_atom('exit_status'), @@ -3819,8 +3648,8 @@ arg_types(erlang, open_port, 2) -> t_tuple([t_atom('line'), t_integer()]), t_tuple([t_atom('cd'), t_string()]), t_tuple([t_atom('env'), t_list(t_tuple(2))]), % XXX: More - t_tuple([t_atom('args'), t_list(t_sup(t_unicode_string(),t_binary()))]), - t_tuple([t_atom('arg0'),t_sup(t_unicode_string(),t_binary())])])))]; + t_tuple([t_atom('args'), t_list(ArgT)]), + t_tuple([t_atom('arg0'), ArgT])])))]; arg_types(erlang, phash, 2) -> [t_any(), t_pos_integer()]; arg_types(erlang, phash2, 1) -> @@ -4643,10 +4472,10 @@ t_endian() -> %% ===================================================================== t_binary_part() -> - t_tuple([t_non_neg_integer(),t_integer()]). + t_tuple([t_non_neg_integer(), t_integer()]). t_binary_canonical_part() -> - t_tuple([t_non_neg_integer(),t_non_neg_integer()]). + t_tuple([t_non_neg_integer(), t_non_neg_integer()]). t_binary_pattern() -> t_sup([t_binary(), @@ -4654,10 +4483,10 @@ t_binary_pattern() -> t_binary_compiled_pattern()]). t_binary_compiled_pattern() -> - t_tuple([t_atom('cp'),t_binary()]). + t_tuple([t_atom('cp'), t_binary()]). t_binary_options() -> - t_list(t_tuple([t_atom('scope'),t_binary_part()])). + t_list(t_tuple([t_atom('scope'), t_binary_part()])). %% ===================================================================== %% HTTP types documented in R12B-4 diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index feb5131aad..b0f99305f2 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -72,39 +72,42 @@ %% User interface. %% -%% objfile_extension() -> ".beam" -%% set_path(Dir*) -> true -%% get_path() -> Dir* -%% add_path(Dir) -> true | {error, What} -%% add_patha(Dir) -> true | {error, What} -%% add_pathz(Dir) -> true | {error, What} -%% add_paths(DirList) -> true | {error, What} -%% add_pathsa(DirList) -> true | {error, What} -%% add_pathsz(DirList) -> true | {error, What} -%% del_path(Dir) -> true | {error, What} -%% replace_path(Name,Dir) -> true | {error, What} -%% load_file(File) -> {error,What} | {module, Mod} -%% load_abs(File) -> {error,What} | {module, Mod} -%% load_abs(File,Mod) -> {error,What} | {module, Mod} -%% load_binary(Mod,File,Bin) -> {error,What} | {module,Mod} -%% ensure_loaded(Module) -> {error,What} | {module, Mod} -%% delete(Module) -%% purge(Module) kills all procs running old code -%% soft_purge(Module) -> true | false -%% is_loaded(Module) -> {file, File} | false -%% all_loaded() -> {Module, File}* -%% get_object_code(Mod) -> error | {Mod, Bin, Filename} -%% stop() -> true -%% root_dir() -%% compiler_dir() -%% lib_dir() -%% priv_dir(Name) -%% stick_dir(Dir) -> ok | error -%% unstick_dir(Dir) -> ok | error -%% is_sticky(Module) -> true | false -%% which(Module) -> Filename -%% set_primary_archive((FileName, Bin, FileInfo) -> ok | {error, Reason} -%% clash() -> -> print out +%% objfile_extension() -> ".beam" +%% get_path() -> [Dir] +%% set_path([Dir]) -> true | {error, bad_directory | bad_path} +%% add_path(Dir) -> true | {error, bad_directory} +%% add_patha(Dir) -> true | {error, bad_directory} +%% add_pathz(Dir) -> true | {error, bad_directory} +%% add_paths([Dir]) -> ok +%% add_pathsa([Dir]) -> ok +%% add_pathsz([Dir]) -> ok +%% del_path(Dir) -> boolean() | {error, bad_name} +%% replace_path(Name, Dir) -> true | replace_path_error() +%% load_file(Module) -> {module, Module} | {error, What :: atom()} +%% load_abs(File) -> {module, Module} | {error, What :: atom()} +%% load_abs(File, Module) -> {module, Module} | {error, What :: atom()} +%% load_binary(Module, File, Bin)-> {module, Module} | {error, What :: atom()} +%% ensure_loaded(Module) -> {module, Module} | {error, What :: atom()} +%% delete(Module) -> boolean() +%% purge(Module) -> boolean() kills all procs running old code +%% soft_purge(Module) -> boolean() +%% is_loaded(Module) -> {file, loaded_filename()} | false +%% all_loaded() -> [{Module, loaded_filename()}] +%% get_object_code(Module) -> {Module, Bin, Filename} | error +%% stop() -> no_return() +%% root_dir() -> Dir +%% compiler_dir() -> Dir +%% lib_dir() -> Dir +%% lib_dir(Application) -> Dir | {error, bad_name} +%% priv_dir(Application) -> Dir | {error, bad_name} +%% stick_dir(Dir) -> ok | error +%% unstick_dir(Dir) -> ok | error +%% stick_mod(Module) -> true +%% unstick_mod(Module) -> true +%% is_sticky(Module) -> boolean() +%% which(Module) -> Filename | loaded_ret_atoms() | non_existing +%% set_primary_archive((FileName, Bin, FileInfo) -> ok | {error, Reason} +%% clash() -> ok prints out number of clashes %%---------------------------------------------------------------------------- %% Some types for basic exported functions of this module @@ -120,7 +123,7 @@ %% User interface %%---------------------------------------------------------------------------- --spec objfile_extension() -> file:filename(). +-spec objfile_extension() -> nonempty_string(). objfile_extension() -> init:objfile_extension(). @@ -138,21 +141,21 @@ load_abs(File) when is_list(File); is_atom(File) -> call({load_abs,File,[]}). %% XXX Filename is also an atom(), e.g. 'cover_compiled' -spec load_abs(Filename :: loaded_filename(), Module :: atom()) -> load_ret(). -load_abs(File,M) when (is_list(File) orelse is_atom(File)), is_atom(M) -> +load_abs(File, M) when (is_list(File) orelse is_atom(File)), is_atom(M) -> call({load_abs,File,M}). %% XXX Filename is also an atom(), e.g. 'cover_compiled' -spec load_binary(Module :: atom(), Filename :: loaded_filename(), Binary :: binary()) -> load_ret(). -load_binary(Mod,File,Bin) +load_binary(Mod, File, Bin) when is_atom(Mod), (is_list(File) orelse is_atom(File)), is_binary(Bin) -> call({load_binary,Mod,File,Bin}). -spec load_native_partial(Module :: atom(), Binary :: binary()) -> load_ret(). -load_native_partial(Mod,Bin) when is_atom(Mod), is_binary(Bin) -> +load_native_partial(Mod, Bin) when is_atom(Mod), is_binary(Bin) -> call({load_native_partial,Mod,Bin}). -spec load_native_sticky(Module :: atom(), Binary :: binary(), WholeModule :: 'false' | binary()) -> load_ret(). -load_native_sticky(Mod,Bin,WholeModule) +load_native_sticky(Mod, Bin, WholeModule) when is_atom(Mod), is_binary(Bin), (is_binary(WholeModule) orelse WholeModule =:= false) -> call({load_native_sticky,Mod,Bin,WholeModule}). @@ -160,7 +163,7 @@ load_native_sticky(Mod,Bin,WholeModule) -spec delete(Module :: atom()) -> boolean(). delete(Mod) when is_atom(Mod) -> call({delete,Mod}). --spec purge/1 :: (Module :: atom()) -> boolean(). +-spec purge(Module :: atom()) -> boolean(). purge(Mod) when is_atom(Mod) -> call({purge,Mod}). -spec soft_purge(Module :: atom()) -> boolean(). @@ -195,7 +198,7 @@ lib_dir(App, SubDir) when is_atom(App), is_atom(SubDir) -> call({dir,{lib_dir,Ap compiler_dir() -> call({dir,compiler_dir}). %% XXX is_list() is for backwards compatibility -- take out in future version --spec priv_dir(Appl :: atom()) -> file:filename() | {'error', 'bad_name'}. +-spec priv_dir(App :: atom()) -> file:filename() | {'error', 'bad_name'}. priv_dir(App) when is_atom(App) ; is_list(App) -> call({dir,{priv_dir,App}}). -spec stick_dir(Directory :: file:filename()) -> 'ok' | 'error'. @@ -220,13 +223,14 @@ set_path(PathList) when is_list(PathList) -> call({set_path,PathList}). -spec get_path() -> [file:filename()]. get_path() -> call(get_path). --spec add_path(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}. +-type add_path_ret() :: 'true' | {'error', 'bad_directory'}. +-spec add_path(Directory :: file:filename()) -> add_path_ret(). add_path(Dir) when is_list(Dir) -> call({add_path,last,Dir}). --spec add_pathz(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}. +-spec add_pathz(Directory :: file:filename()) -> add_path_ret(). add_pathz(Dir) when is_list(Dir) -> call({add_path,last,Dir}). --spec add_patha(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}. +-spec add_patha(Directory :: file:filename()) -> add_path_ret(). add_patha(Dir) when is_list(Dir) -> call({add_path,first,Dir}). -spec add_paths(Directories :: [file:filename()]) -> 'ok'. @@ -243,8 +247,8 @@ del_path(Name) when is_list(Name) ; is_atom(Name) -> call({del_path,Name}). -type replace_path_error() :: {'error', 'bad_directory' | 'bad_name' | {'badarg',_}}. -spec replace_path(Name:: atom(), Dir :: file:filename()) -> 'true' | replace_path_error(). -replace_path(Name, Dir) when (is_atom(Name) or is_list(Name)) and - (is_atom(Dir) or is_list(Dir)) -> +replace_path(Name, Dir) when (is_atom(Name) orelse is_list(Name)), + (is_atom(Dir) orelse is_list(Dir)) -> call({replace_path,Name,Dir}). -spec rehash() -> 'ok'. @@ -275,21 +279,14 @@ start_link(Flags) -> do_start(Flags) -> %% The following module_info/1 calls are here to ensure - %% that the modules are loaded prior to their use elsewhere in + %% that these modules are loaded prior to their use elsewhere in %% the code_server. %% Otherwise a deadlock may occur when the code_server is starting. - code_server:module_info(module), - packages:module_info(module), + code_server = code_server:module_info(module), + packages = packages:module_info(module), catch hipe_unified_loader:load_hipe_modules(), - gb_sets:module_info(module), - gb_trees:module_info(module), - - ets:module_info(module), - os:module_info(module), - binary:module_info(module), - unicode:module_info(module), - filename:module_info(module), - lists:module_info(module), + Modules2 = [gb_sets, gb_trees, ets, os, binary, unicode, filename, lists], + lists:foreach(fun (M) -> M = M:module_info(module) end, Modules2), Mode = get_mode(Flags), case init:get_argument(root) of @@ -297,7 +294,7 @@ do_start(Flags) -> Root = filename:join([Root0]), % Normalize. Use filename case code_server:start_link([Root,Mode]) of {ok,_Pid} = Ok2 -> - if + if Mode =:= interactive -> case lists:member(stick, Flags) of true -> do_stick_dirs(); @@ -306,14 +303,14 @@ do_start(Flags) -> true -> ok end, - % Quietly load the native code for all modules loaded so far. + %% Quietly load native code for all modules loaded so far catch load_native_code_for_all_loaded(), Ok2; Other -> Other end; Other -> - error_logger:error_msg("Can not start code server ~w ~n",[Other]), + error_logger:error_msg("Can not start code server ~w ~n", [Other]), {error, crash} end. @@ -330,7 +327,7 @@ do_s(Lib) -> %% The return value is intentionally ignored. Missing %% directories is not a fatal error. (In embedded systems, %% there is usually no compiler directory.) - stick_dir(filename:append(Dir, "ebin")), + _ = stick_dir(filename:append(Dir, "ebin")), ok end. @@ -428,7 +425,7 @@ where_is_file(Path, File) when is_list(Path), is_list(File) -> -spec set_primary_archive(ArchiveFile :: file:filename(), ArchiveBin :: binary(), - FileInfo :: #file_info{}) + FileInfo :: file:file_info()) -> 'ok' | {'error', atom()}. set_primary_archive(ArchiveFile0, ArchiveBin, #file_info{} = FileInfo) @@ -485,13 +482,13 @@ filter(Ext, _, {ok,Files}) -> filter2(Ext, length(Ext), Files). filter2(_Ext, _Extlen, []) -> []; -filter2(Ext, Extlen,[File|Tail]) -> - case has_ext(Ext,Extlen, File) of +filter2(Ext, Extlen, [File|Tail]) -> + case has_ext(Ext, Extlen, File) of true -> [File | filter2(Ext, Extlen, Tail)]; false -> filter2(Ext, Extlen, Tail) end. -has_ext(Ext, Extlen,File) -> +has_ext(Ext, Extlen, File) -> L = length(File), case catch lists:nthtail(L - Extlen, File) of Ext -> true; -- cgit v1.2.3 From 877935818cc41f74626f9a304acf3ec493ae8542 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 1 Feb 2011 19:21:35 +0100 Subject: Split the cover ets tables into two tables, one with the clause info and one with the bump info. This will make it faster to search the tables when analyzing and exporting data. Also made cover export more parallel in how data is collected from the different nodes and also how data is read from ets. This should make the performance of cover much better on machines with multiple CPUs. --- lib/test_server/src/test_server.erl | 4 -- lib/tools/src/cover.erl | 125 +++++++++++++++++++----------------- lib/tools/test/cover_SUITE.erl | 13 +++- 3 files changed, 77 insertions(+), 65 deletions(-) diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index 1045fa9a9b..da2e48488e 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -499,10 +499,6 @@ pmap(Fun,List) -> Res end end, Pids). - - - - unstick_all_sticky(Node) -> lists:filter( diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index f6f976e0af..a2e8288227 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -100,8 +100,10 @@ }). -define(COVER_TABLE, 'cover_internal_data_table'). +-define(COVER_CLAUSE_TABLE, 'cover_internal_clause_table'). -define(BINARY_TABLE, 'cover_binary_code_table'). -define(COLLECTION_TABLE, 'cover_collected_remote_data_table'). +-define(COLLECTION_CLAUSE_TABLE, 'cover_collected_remote_clause_table'). -define(TAG, cover_compiled). -define(SERVER, cover_server). @@ -517,8 +519,10 @@ remote_reply(MainNode,Reply) -> init_main(Starter) -> register(?SERVER,self()), ets:new(?COVER_TABLE, [set, public, named_table]), + ets:new(?COVER_CLAUSE_TABLE, [set, public, named_table]), ets:new(?BINARY_TABLE, [set, named_table]), ets:new(?COLLECTION_TABLE, [set, public, named_table]), + ets:new(?COLLECTION_CLAUSE_TABLE, [set, public, named_table]), process_flag(trap_exit,true), Starter ! {?SERVER,started}, main_process_loop(#main_state{}). @@ -757,6 +761,7 @@ main_process_loop(State) -> init_remote(Starter,MainNode) -> register(?SERVER,self()), ets:new(?COVER_TABLE, [set, public, named_table]), + ets:new(?COVER_CLAUSE_TABLE, [set, public, named_table]), Starter ! {self(),started}, remote_process_loop(#remote_state{main_node=MainNode}). @@ -819,27 +824,27 @@ remote_process_loop(State) -> end. do_collect(Module, CollectorPid, From) -> - MS = + AllClauses = case Module of - '_' -> ets:fun2ms(fun({M,C}) when is_atom(M) -> C end); - _ -> ets:fun2ms(fun({M,C}) when M=:=Module -> C end) + '_' -> ets:tab2list(?COVER_CLAUSE_TABLE); + _ -> ets:lookup(?COVER_CLAUSE_TABLE, Module) end, - AllClauses = lists:flatten(ets:select(?COVER_TABLE,MS)), %% Sending clause by clause in order to avoid large lists - lists:foreach( - fun({M,F,A,C,_L}) -> - Pattern = - {#bump{module=M, function=F, arity=A, clause=C}, '_'}, - Bumps = ets:match_object(?COVER_TABLE, Pattern), - %% Reset - lists:foreach(fun({Bump,_N}) -> - ets:insert(?COVER_TABLE, {Bump,0}) - end, - Bumps), - CollectorPid ! {chunk,Bumps} - end, - AllClauses), + pmap( + fun({_Mod,Clauses}) -> + pmap(fun({M,F,A,C,_L}) -> + Pattern = + {#bump{module=M, function=F, arity=A, clause=C}, '_'}, + Bumps = ets:match_object(?COVER_TABLE, Pattern), + %% Reset + lists:foreach(fun({Bump,_N}) -> + ets:insert(?COVER_TABLE, {Bump,0}) + end, + Bumps), + CollectorPid ! {chunk,Bumps} + end,Clauses) + end,AllClauses), CollectorPid ! done, remote_reply(From, ok). @@ -880,6 +885,9 @@ load_compiled([{Module,File,Binary,InitialTable}|Compiled],Acc) -> load_compiled([],Acc) -> Acc. +insert_initial_data([Item|Items]) when is_atom(element(1,Item)) -> + ets:insert(?COVER_CLAUSE_TABLE, Item), + insert_initial_data(Items); insert_initial_data([Item|Items]) -> ets:insert(?COVER_TABLE, Item), insert_initial_data(Items); @@ -949,15 +957,15 @@ remote_load_compiled(Nodes, [MF | Rest], Acc, ModNum) -> get_data_for_remote_loading({Module,File}) -> [{Module,Binary}] = ets:lookup(?BINARY_TABLE,Module), %%! The InitialTable list will be long if the module is big - what to do?? - InitialTable = ets:select(?COVER_TABLE,ms(Module)), - {Module,File,Binary,InitialTable}. + InitialBumps = ets:select(?COVER_TABLE,ms(Module)), + InitialClauses = ets:lookup(?COVER_CLAUSE_TABLE,Module), + + {Module,File,Binary,InitialBumps ++ InitialClauses}. %% Create a match spec which returns the clause info {Module,InitInfo} and %% all #bump keys for the given module with 0 number of calls. ms(Module) -> - ets:fun2ms(fun({Mod,InitInfo}) when Mod =:= Module -> - {Mod,InitInfo}; - ({Key,_}) when is_record(Key,bump),Key#bump.module=:=Module -> + ets:fun2ms(fun({Key,_}) when Key#bump.module=:=Module -> {Key,0} end). @@ -979,22 +987,12 @@ remote_reset(Module,Nodes) -> %% Collect data from remote nodes - used for analyse or stop(Node) remote_collect(Module,Nodes,Stop) -> - Pids = lists:map( - fun(Node) -> - spawn(fun() -> - ?SPAWN_DBG(remote_collect, - {Module, Nodes, Stop}), - do_collection(Node, Module, Stop) - end) - end, - Nodes), - RefsNPids = [{erlang:monitor(process, Pid),Pid} || Pid <- Pids], - lists:foreach(fun({Ref,Pid}) -> - receive - {'DOWN', Ref, process, Pid, _} -> - ok - end - end,RefsNPids). + pmap(fun(Node) -> + ?SPAWN_DBG(remote_collect, + {Module, Nodes, Stop}), + do_collection(Node, Module, Stop) + end, + Nodes). do_collection(Node, Module, Stop) -> CollectorPid = spawn(fun collector_proc/0), @@ -1241,7 +1239,7 @@ do_compile_beam(Module,Beam) -> %% Store info about all function clauses in database InitInfo = reverse(Vars#vars.init_info), - ets:insert(?COVER_TABLE, {Module, InitInfo}), + ets:insert(?COVER_CLAUSE_TABLE, {Module, InitInfo}), %% Store binary code so it can be loaded on remote nodes ets:insert(?BINARY_TABLE, {Module, Binary}), @@ -1775,9 +1773,8 @@ common_elems(L1, L2) -> %% Collect data for all modules collect(Nodes) -> %% local node - MS = ets:fun2ms(fun({M,C}) when is_atom(M) -> {M,C} end), - AllClauses = ets:select(?COVER_TABLE,MS), - move_modules(AllClauses), + AllClauses = ets:tab2list(?COVER_CLAUSE_TABLE), + pmap(fun move_modules/1,AllClauses), %% remote nodes remote_collect('_',Nodes,false). @@ -1785,7 +1782,7 @@ collect(Nodes) -> %% Collect data for one module collect(Module,Clauses,Nodes) -> %% local node - move_modules([{Module,Clauses}]), + move_modules({Module,Clauses}), %% remote nodes remote_collect(Module,Nodes,false). @@ -1793,12 +1790,9 @@ collect(Module,Clauses,Nodes) -> %% When analysing, the data from the local ?COVER_TABLE is moved to the %% ?COLLECTION_TABLE. Resetting data in ?COVER_TABLE -move_modules([{Module,Clauses}|AllClauses]) -> - ets:insert(?COLLECTION_TABLE,{Module,Clauses}), - move_clauses(Clauses), - move_modules(AllClauses); -move_modules([]) -> - ok. +move_modules({Module,Clauses}) -> + ets:insert(?COLLECTION_CLAUSE_TABLE,{Module,Clauses}), + move_clauses(Clauses). move_clauses([{M,F,A,C,_L}|Clauses]) -> Pattern = {#bump{module=M, function=F, arity=A, clause=C}, '_'}, @@ -1842,12 +1836,12 @@ do_parallel_analysis(Module, Analysis, Level, Loaded, From, State) -> C = case Loaded of {loaded, _File} -> [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), + ets:lookup(?COVER_CLAUSE_TABLE,Module), collect(Module,Clauses,State#main_state.nodes), Clauses; _ -> [{Module,Clauses}] = - ets:lookup(?COLLECTION_TABLE,Module), + ets:lookup(?COLLECTION_CLAUSE_TABLE,Module), Clauses end, R = do_analyse(Module, Analysis, Level, C), @@ -1933,7 +1927,7 @@ do_parallel_analysis_to_file(Module, OutFile, Opts, Loaded, From, State) -> File = case Loaded of {loaded, File0} -> [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), + ets:lookup(?COVER_CLAUSE_TABLE,Module), collect(Module, Clauses, State#main_state.nodes), File0; @@ -2063,7 +2057,7 @@ do_export(Module, OutFile, From, State) -> try is_loaded(Module, State) of {loaded, File} -> [{Module,Clauses}] = - ets:lookup(?COVER_TABLE,Module), + ets:lookup(?COVER_CLAUSE_TABLE,Module), collect(Module, Clauses, State#main_state.nodes), do_export_table([{Module,File}],[],Fd); @@ -2099,7 +2093,7 @@ merge([],ModuleList) -> write_module_data([{Module,File}|ModList],Fd) -> write({file,Module,File},Fd), - [Clauses] = ets:lookup(?COLLECTION_TABLE,Module), + [Clauses] = ets:lookup(?COLLECTION_CLAUSE_TABLE,Module), write(Clauses,Fd), ModuleData = ets:match_object(?COLLECTION_TABLE,{#bump{module=Module},'_'}), do_write_module_data(ModuleData,Fd), @@ -2149,7 +2143,7 @@ do_import_to_table(Fd,ImportFile,Imported,DontImport) -> {Module,Clauses} -> case lists:member(Module,DontImport) of false -> - ets:insert(?COLLECTION_TABLE,{Module,Clauses}); + ets:insert(?COLLECTION_CLAUSE_TABLE,{Module,Clauses}); true -> ok end, @@ -2183,14 +2177,14 @@ do_reset_main_node(Module,Nodes) -> remote_reset(Module,Nodes). do_reset_collection_table(Module) -> - ets:delete(?COLLECTION_TABLE,Module), + ets:delete(?COLLECTION_CLAUSE_TABLE,Module), ets:match_delete(?COLLECTION_TABLE, {#bump{module=Module},'_'}). %% do_reset(Module) -> ok %% The reset is done on a per-clause basis to avoid building %% long lists in the case of very large modules do_reset(Module) -> - [{Module,Clauses}] = ets:lookup(?COVER_TABLE, Module), + [{Module,Clauses}] = ets:lookup(?COVER_CLAUSE_TABLE, Module), do_reset2(Clauses). do_reset2([{M,F,A,C,_L}|Clauses]) -> @@ -2205,7 +2199,7 @@ do_reset2([]) -> ok. do_clear(Module) -> - ets:match_delete(?COVER_TABLE, {Module,'_'}), + ets:match_delete(?COVER_CLAUSE_TABLE, {Module,'_'}), ets:match_delete(?COVER_TABLE, {#bump{module=Module},'_'}), ets:match_delete(?COLLECTION_TABLE, {#bump{module=Module},'_'}). @@ -2245,3 +2239,18 @@ escape_lt_and_gt1([],Acc) -> lists:reverse(Acc); escape_lt_and_gt1([H|T],Acc) -> escape_lt_and_gt1(T,[H|Acc]). + +pmap(Fun,List) -> + Collector = self(), + Pids = lists:map(fun(E) -> + spawn_link(fun() -> + ?SPAWN_DBG(pmap,E), + Collector ! {res,self(),Fun(E)} + end) + end, List), + lists:map(fun(Pid) -> + receive + {res,Pid,Res} -> + Res + end + end, Pids). diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index b9ccd62d0b..4beb433839 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -18,7 +18,7 @@ %% -module(cover_SUITE). --export([all/1]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([start/1, compile/1, analyse/1, misc/1, stop/1, distribution/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, @@ -49,6 +49,13 @@ all(suite) -> "Can't run cover test."} end. +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + %cover:stop(), + ok. + start(suite) -> []; start(Config) when is_list(Config) -> ?line ok = file:set_cwd(?config(data_dir, Config)), @@ -381,8 +388,8 @@ export_import(Config) when is_list(Config) -> ?line {ok,a} = cover:compile(a), ?line ?t:capture_start(), ?line ok = cover:export("all_exported"), - ?line [Text2] = ?t:capture_get(), - ?line "Export includes data from imported files"++_ = lists:flatten(Text2), + ?line [] = ?t:capture_get(), +% ?line "Export includes data from imported files"++_ = lists:flatten(Text2), ?line ?t:capture_stop(), ?line ok = cover:stop(), ?line ok = cover:import("all_exported"), -- cgit v1.2.3 From 8749970bd0163623cddebf46fa6438f75042d40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Feb 2011 10:10:56 +0100 Subject: v3_kernel_pp: Eliminate warning --- lib/compiler/src/v3_kernel_pp.erl | 46 ++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl index a300dd283f..18cb3edc20 100644 --- a/lib/compiler/src/v3_kernel_pp.erl +++ b/lib/compiler/src/v3_kernel_pp.erl @@ -50,28 +50,34 @@ format(Node) -> format(Node, #ctxt{}). format(Node, Ctxt) -> case canno(Node) of -%% [] -> -%% format_1(Node, Ctxt); -%% [L,{file,_}] when is_integer(L) -> -%% format_1(Node, Ctxt); -%% #k{a=Anno}=K when Anno =/= [] -> -%% format(setelement(2, Node, K#k{a=[]}), Ctxt); -%% List -> -%% format_anno(List, Ctxt, fun (Ctxt1) -> -%% format_1(Node, Ctxt1) -%% end); - _ -> - format_1(Node, Ctxt) + [] -> + format_1(Node, Ctxt); + [L,{file,_}] when is_integer(L) -> + format_1(Node, Ctxt); + #k{a=Anno}=K when Anno =/= [] -> + format(setelement(2, Node, K#k{a=[]}), Ctxt); + List -> + format_anno(List, Ctxt, fun (Ctxt1) -> + format_1(Node, Ctxt1) + end) end. -%% format_anno(Anno, Ctxt0, ObjFun) -> -%% Ctxt1 = ctxt_bump_indent(Ctxt0, 1), -%% ["( ", -%% ObjFun(Ctxt0), -%% nl_indent(Ctxt1), -%% "-| ",io_lib:write(Anno), -%% " )"]. - +format_anno(Anno, Ctxt0, ObjFun) -> + case annotations_enabled() of + true -> + Ctxt1 = ctxt_bump_indent(Ctxt0, 1), + ["( ", + ObjFun(Ctxt0), + nl_indent(Ctxt1), + "-| ",io_lib:write(Anno), + " )"]; + false -> + ObjFun(Ctxt0) + end. + +%% By default, don't show annotations since they clutter up the output. +annotations_enabled() -> + false. %% format_1(Kexpr, Context) -> string(). -- cgit v1.2.3 From 99f7b4e9acba5525f5390526bbb4baf17625c43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Feb 2011 10:20:20 +0100 Subject: v3_kernel_pp: Add support for pretty-printing #k_literal{} records --- lib/compiler/src/v3_kernel_pp.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl index 18cb3edc20..9bd13f7032 100644 --- a/lib/compiler/src/v3_kernel_pp.erl +++ b/lib/compiler/src/v3_kernel_pp.erl @@ -113,6 +113,8 @@ format_1(#k_bin_int{size=Sz,unit=U,flags=Fs,val=Val,next=Next}, Ctxt) -> [format_bin_seg_1(S, Ctxt), format_bin_seg(Next, ctxt_bump_indent(Ctxt, 2))]; format_1(#k_bin_end{}, _Ctxt) -> "#<>#"; +format_1(#k_literal{val=Term}, _Ctxt) -> + io_lib:format("~p", [Term]); format_1(#k_local{name=N,arity=A}, Ctxt) -> "local " ++ format_fa_pair({N,A}, Ctxt); format_1(#k_remote{mod=M,name=N,arity=A}, _Ctxt) -> -- cgit v1.2.3 From 9e2aa4739c22ae5af6e1d8c4fed19a979beadf8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Feb 2011 10:21:37 +0100 Subject: compiler Makefile: Turn warnings into errors We want to ensure that the compiler applications is kept free of warnings. --- lib/compiler/src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile index 0f6d2f6193..9da9253f5b 100644 --- a/lib/compiler/src/Makefile +++ b/lib/compiler/src/Makefile @@ -118,7 +118,9 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE) ifeq ($(NATIVE_LIBS_ENABLED),yes) ERL_COMPILE_FLAGS += +native endif -ERL_COMPILE_FLAGS += +inline +warn_unused_import -I../../stdlib/include -I$(EGEN) -W +ERL_COMPILE_FLAGS += +inline +warn_unused_import \ + +warnings_as_errors \ + -I../../stdlib/include -I$(EGEN) -W # ---------------------------------------------------- # Targets -- cgit v1.2.3 From e24ae469ca5c2814dfd133da1e6882b84a7db95b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 2 Feb 2011 10:52:54 +0100 Subject: Add aync_analyse_to_file function to cover --- lib/tools/src/cover.erl | 56 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index a2e8288227..50a812aa09 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -61,6 +61,9 @@ analyse/1, analyse/2, analyse/3, analyze/1, analyze/2, analyze/3, analyse_to_file/1, analyse_to_file/2, analyse_to_file/3, analyze_to_file/1, analyze_to_file/2, analyze_to_file/3, + async_analyse_to_file/1,async_analyse_to_file/2, + async_analyse_to_file/3, async_analyze_to_file/1, + async_analyze_to_file/2, async_analyze_to_file/3, export/1, export/2, import/1, modules/0, imported/0, imported_modules/0, which_nodes/0, is_compiled/1, reset/1, reset/0, @@ -389,6 +392,30 @@ analyze_to_file(Module, OptOrOut) -> analyse_to_file(Module, OptOrOut). analyze_to_file(Module, OutFile, Options) -> analyse_to_file(Module, OutFile, Options). +async_analyse_to_file(Module) -> + do_spawn(?MODULE,analyse_to_file, [Module]). +async_analyse_to_file(Module, OutFileOrOpts) -> + do_spawn(?MODULE, analyse_to_file, [Module, OutFileOrOpts]). +async_analyse_to_file(Module, OutFile, Options) -> + do_spawn(?MODULE, analyse_to_file, [Module, OutFile, Options]). + +do_spawn(M,F,A) -> + spawn(fun() -> + case apply(M,F,A) of + {ok, _} -> + ok; + {error, Reason} -> + exit(Reason) + end + end). + +async_analyze_to_file(Module) -> + async_analyse_to_file(Module). +async_analyze_to_file(Module, OutFileOrOpts) -> + async_analyse_to_file(Module, OutFileOrOpts). +async_analyze_to_file(Module, OutFile, Options) -> + async_analyse_to_file(Module, OutFile, Options). + outfilename(Module,Opts) -> case lists:member(html,Opts) of true -> @@ -824,7 +851,7 @@ remote_process_loop(State) -> end. do_collect(Module, CollectorPid, From) -> - AllClauses = + AllMods = case Module of '_' -> ets:tab2list(?COVER_CLAUSE_TABLE); _ -> ets:lookup(?COVER_CLAUSE_TABLE, Module) @@ -833,21 +860,24 @@ do_collect(Module, CollectorPid, From) -> %% Sending clause by clause in order to avoid large lists pmap( fun({_Mod,Clauses}) -> - pmap(fun({M,F,A,C,_L}) -> - Pattern = - {#bump{module=M, function=F, arity=A, clause=C}, '_'}, - Bumps = ets:match_object(?COVER_TABLE, Pattern), - %% Reset - lists:foreach(fun({Bump,_N}) -> - ets:insert(?COVER_TABLE, {Bump,0}) - end, - Bumps), - CollectorPid ! {chunk,Bumps} - end,Clauses) - end,AllClauses), + lists:map(fun(Clause) -> + send_collected_data(Clause, CollectorPid) + end,Clauses) + end,AllMods), CollectorPid ! done, remote_reply(From, ok). +send_collected_data({M,F,A,C,_L}, CollectorPid) -> + Pattern = + {#bump{module=M, function=F, arity=A, clause=C}, '_'}, + Bumps = ets:match_object(?COVER_TABLE, Pattern), + %% Reset + lists:foreach(fun({Bump,_N}) -> + ets:insert(?COVER_TABLE, {Bump,0}) + end, + Bumps), + CollectorPid ! {chunk,Bumps}. + reload_originals([{Module,_File}|Compiled]) -> do_reload_original(Module), reload_originals(Compiled); -- cgit v1.2.3 From cb119ebc0e923b6b85a8352ef71012eb431b54d5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 2 Feb 2011 10:52:42 +0100 Subject: Update documentation to reflect performance enhancement changes of cover --- lib/tools/doc/src/cover.xml | 29 +++++++++++++++++++++++++++++ lib/tools/doc/src/cover_chapter.xml | 7 +++++++ lib/tools/src/cover.erl | 34 ++++++++++++++++++++++++---------- 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/lib/tools/doc/src/cover.xml b/lib/tools/doc/src/cover.xml index 323bd0dda8..0a3302bda5 100644 --- a/lib/tools/doc/src/cover.xml +++ b/lib/tools/doc/src/cover.xml @@ -270,6 +270,8 @@ defaults to function.

If Module is not Cover compiled, the function returns {error,{not_cover_compiled,Module}}.

+

HINT: It is possible to issue multiple analyse_to_file commands at + the same time.

@@ -307,6 +309,33 @@ .beam file, or in ../src relative to that directory. If no source code is found, ,{error,no_source_code_found} is returned.

+

HINT: It is possible to issue multiple analyse_to_file commands at + the same time.

+ +
+ + async_analyse_to_file(Module) -> + async_analyse_to_file(Module,Options) -> + async_analyse_to_file(Module, OutFile) -> + async_analyse_to_file(Module, OutFile, Options) -> pid() + Asynchronous call to analyse_to_file. + + Module = atom() + OutFile = string() + Options = [Option] + Option = html + Error = {not_cover_compiled,Module} | {file,File,Reason} | no_source_code_found | not_main_node +  File = string() +  Reason = term() + + +

This function works exactly the same way as + analyse_to_file except + that it is asynchronous instead of synchronous. The spawned process + will link with the caller when created. If an Error occurs + while doing the cover analysis the process will crash with the same + error reason as analyse_to_file + would return.

diff --git a/lib/tools/doc/src/cover_chapter.xml b/lib/tools/doc/src/cover_chapter.xml index b4f7919183..92a790c34e 100644 --- a/lib/tools/doc/src/cover_chapter.xml +++ b/lib/tools/doc/src/cover_chapter.xml @@ -403,6 +403,13 @@ ok database contains information about each executable line in each Cover compiled module, performance decreases proportionally to the size and number of the Cover compiled modules.

+

To improve performance when analysing cover results it is possible + to do multiple calls to analyse + and analyse_to_file + at once. You can also use the + async_analyse_to_file + convenience function. +

diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index 50a812aa09..cc4f75f2e8 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -35,23 +35,37 @@ %% remote_process_loop/1. %% %% TABLES -%% Each nodes has an ets table named 'cover_internal_data_table' -%% (?COVER_TABLE). This table contains the coverage data and is -%% continously updated when cover compiled code is executed. +%% Each nodes has two tables: cover_internal_data_table (?COVER_TABLE) and. +%% cover_internal_clause_table (?COVER_CLAUSE_TABLE). +%% ?COVER_TABLE contains the bump data i.e. the data about which lines +%% have been executed how many times. +%% ?COVER_CLAUSE_TABLE contains information about which clauses in which modules +%% cover is currently collecting statistics. %% -%% The main node owns a table named -%% 'cover_collected_remote_data_table' (?COLLECTION_TABLE). This table -%% contains data which is collected from remote nodes (either when a -%% remote node is stopped with cover:stop/1 or when analysing. When -%% analysing, data is even moved from the ?COVER_TABLE on the main -%% node to the ?COLLECTION_TABLE. +%% The main node owns tables named +%% 'cover_collected_remote_data_table' (?COLLECTION_TABLE) and +%% 'cover_collected_remote_clause_table' (?COLLECTION_CLAUSE_TABLE). +%% These tables contain data which is collected from remote nodes (either when a +%% remote node is stopped with cover:stop/1 or when analysing). When +%% analysing, data is even moved from the COVER tables on the main +%% node to the COLLECTION tables. %% %% The main node also has a table named 'cover_binary_code_table' %% (?BINARY_TABLE). This table contains the binary code for each cover %% compiled module. This is necessary so that the code can be loaded %% on remote nodes that are started after the compilation. %% - +%% PARELLALISM +%% To take advantage of SMP when doing the cover analysis both the data +%% collection and analysis has been parallelized. One process is spawned for +%% each node when collecting data, and on the remote node when collecting data +%% one process is spawned per module. +%% +%% When analyzing data it is possible to issue multiple analyse(_to_file)/X +%% calls at once. They are however all calls (for backwardscompatability +%% reasons) so the user of cover will have to spawn several processes to to the +%% calls ( or use async_analyse_to_file ). +%% %% External exports -export([start/0, start/1, -- cgit v1.2.3 From 64c8d865a359703077a65d102069272315b17843 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Thu, 3 Feb 2011 15:08:58 +0200 Subject: Fix translation of bs_add's fail labels --- lib/hipe/icode/hipe_beam_to_icode.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl index 920c94d85c..d7eb035551 100644 --- a/lib/hipe/icode/hipe_beam_to_icode.erl +++ b/lib/hipe/icode/hipe_beam_to_icode.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -918,7 +918,7 @@ trans_fun([{bs_add, {f,Lbl}, [Old,New,Unit], Res}|Instructions], Env) -> Succ = mk_label(new), [hipe_icode:mk_primop([Temp], '*', [NewVar, hipe_icode:mk_const(Unit)], - hipe_icode:label_name(Succ), Lbl), + hipe_icode:label_name(Succ), map_label(Lbl)), Succ] end end, @@ -930,7 +930,7 @@ trans_fun([{bs_add, {f,Lbl}, [Old,New,Unit], Res}|Instructions], Env) -> [FailLbl, hipe_icode:mk_fail([hipe_icode:mk_const(badarg)], error)]}; true -> - {Lbl, []} + {map_label(Lbl), []} end, IsPos = [hipe_icode:mk_if('>=', [Temp, hipe_icode:mk_const(0)], -- cgit v1.2.3 From fff4ba0282e42e2942acebff9c10a274075c1c62 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 24 Nov 2010 10:53:56 +0100 Subject: HALFWORD ETS relative terms In halfword emulator, make ETS use a variant of the internal term format that uses relative offsets instead of absolute pointers. This will allow storage in high memory (>4G). Preprocessor macros (like list_val_rel(TERM,BASE)) are used to make normal (fullword) emulator almost completely unchanged while still reusing most of the code. --- erts/emulator/beam/big.c | 6 +- erts/emulator/beam/big.h | 6 +- erts/emulator/beam/copy.c | 111 ++++++---- erts/emulator/beam/erl_bif_lists.c | 2 +- erts/emulator/beam/erl_binary.h | 17 +- erts/emulator/beam/erl_db.c | 31 ++- erts/emulator/beam/erl_db_hash.c | 22 +- erts/emulator/beam/erl_db_tree.c | 307 ++++++++++++-------------- erts/emulator/beam/erl_db_util.c | 268 +++++++++++++++++----- erts/emulator/beam/erl_db_util.h | 57 ++--- erts/emulator/beam/erl_monitors.c | 18 +- erts/emulator/beam/erl_nif.c | 2 +- erts/emulator/beam/erl_node_container_utils.h | 15 ++ erts/emulator/beam/erl_term.c | 47 ++-- erts/emulator/beam/erl_term.h | 154 ++++++++++--- erts/emulator/beam/global.h | 48 +++- erts/emulator/beam/utils.c | 251 ++++++++++++--------- erts/emulator/sys/common/erl_mseg.c | 2 + erts/emulator/sys/unix/sys_float.c | 5 - lib/stdlib/test/ets_SUITE.erl | 10 +- 20 files changed, 884 insertions(+), 495 deletions(-) diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c index ff15d834ab..57964b31e4 100644 --- a/erts/emulator/beam/big.c +++ b/erts/emulator/beam/big.c @@ -1558,7 +1558,7 @@ Eterm erts_sint64_to_big(Sint64 x, Eterm **hpp) ** Convert a bignum to a double float */ int -big_to_double(Eterm x, double* resp) +big_to_double(Wterm x, double* resp) { double d = 0.0; Eterm* xp = big_val(x); @@ -1725,7 +1725,7 @@ static Eterm big_norm(Eterm *x, dsize_t xl, short sign) /* ** Compare bignums */ -int big_comp(Eterm x, Eterm y) +int big_comp(Wterm x, Wterm y) { Eterm* xp = big_val(x); Eterm* yp = big_val(y); @@ -2060,7 +2060,7 @@ static Eterm B_plus_minus(ErtsDigit *x, dsize_t xl, short xsgn, /* ** Add bignums */ -Eterm big_plus(Eterm x, Eterm y, Eterm *r) +Eterm big_plus(Wterm x, Wterm y, Eterm *r) { Eterm* xp = big_val(x); Eterm* yp = big_val(y); diff --git a/erts/emulator/beam/big.h b/erts/emulator/beam/big.h index 25466cd3c2..294e1d50fb 100644 --- a/erts/emulator/beam/big.h +++ b/erts/emulator/beam/big.h @@ -120,7 +120,7 @@ char *erts_big_to_string(Eterm x, char *buf, Uint buf_sz); Eterm small_times(Sint, Sint, Eterm*); -Eterm big_plus(Eterm, Eterm, Eterm*); +Eterm big_plus(Wterm, Wterm, Eterm*); Eterm big_minus(Eterm, Eterm, Eterm*); Eterm big_times(Eterm, Eterm, Eterm*); Eterm big_div(Eterm, Eterm, Eterm*); @@ -137,9 +137,9 @@ Eterm big_bxor(Eterm, Eterm, Eterm*); Eterm big_bnot(Eterm, Eterm*); Eterm big_lshift(Eterm, Sint, Eterm*); -int big_comp (Eterm, Eterm); +int big_comp (Wterm, Wterm); int big_ucomp (Eterm, Eterm); -int big_to_double(Eterm x, double* resp); +int big_to_double(Wterm x, double* resp); Eterm small_to_big(Sint, Eterm*); Eterm uint_to_big(Uint, Eterm*); Eterm uword_to_big(UWord, Eterm*); diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c index 8bee47232e..d582b479cc 100644 --- a/erts/emulator/beam/copy.c +++ b/erts/emulator/beam/copy.c @@ -72,8 +72,11 @@ copy_object(Eterm obj, Process* to) * Return the "flat" size of the object. */ -Uint -size_object(Eterm obj) +#if HALFWORD_HEAP +Uint size_object_rel(Eterm obj, Eterm* base) +#else +Uint size_object(Eterm obj) +#endif { Uint sum = 0; Eterm* ptr; @@ -84,7 +87,7 @@ size_object(Eterm obj) switch (primary_tag(obj)) { case TAG_PRIMARY_LIST: sum += 2; - ptr = list_val(obj); + ptr = list_val_rel(obj,base); obj = *ptr++; if (!IS_CONST(obj)) { ESTACK_PUSH(s, obj); @@ -93,11 +96,11 @@ size_object(Eterm obj) break; case TAG_PRIMARY_BOXED: { - Eterm hdr = *boxed_val(obj); + Eterm hdr = *boxed_val_rel(obj,base); ASSERT(is_header(hdr)); switch (hdr & _TAG_HEADER_MASK) { case ARITYVAL_SUBTAG: - ptr = tuple_val(obj); + ptr = tuple_val_rel(obj,base); arity = header_arity(hdr); sum += arity + 1; if (arity == 0) { /* Empty tuple -- unusual. */ @@ -113,7 +116,7 @@ size_object(Eterm obj) break; case FUN_SUBTAG: { - Eterm* bptr = fun_val(obj); + Eterm* bptr = fun_val_rel(obj,base); ErlFunThing* funp = (ErlFunThing *) bptr; unsigned eterms = 1 /* creator */ + funp->num_free; unsigned sz = thing_arityval(hdr); @@ -136,7 +139,7 @@ size_object(Eterm obj) Uint bitoffs; Uint extra_bytes; Eterm hdr; - ERTS_GET_REAL_BIN(obj, real_bin, offset, bitoffs, bitsize); + ERTS_GET_REAL_BIN_REL(obj, real_bin, offset, bitoffs, bitsize, base); if ((bitsize + bitoffs) > 8) { sum += ERL_SUB_BIN_SIZE; extra_bytes = 2; @@ -146,11 +149,11 @@ size_object(Eterm obj) } else { extra_bytes = 0; } - hdr = *binary_val(real_bin); + hdr = *binary_val_rel(real_bin,base); if (thing_subtag(hdr) == REFC_BINARY_SUBTAG) { sum += PROC_BIN_SIZE; } else { - sum += heap_bin_size(binary_size(obj)+extra_bytes); + sum += heap_bin_size(binary_size_rel(obj,base)+extra_bytes); } goto pop_next; } @@ -181,8 +184,12 @@ size_object(Eterm obj) /* * Copy a structure to a heap. */ -Eterm -copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) +#if HALFWORD_HEAP +Eterm copy_struct_rel(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap, + Eterm* src_base, Eterm* dst_base) +#else +Eterm copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) +#endif { char* hstart; Uint hsize; @@ -214,7 +221,10 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) /* Copy the object onto the heap */ switch (primary_tag(obj)) { - case TAG_PRIMARY_LIST: argp = &res; goto L_copy_list; + case TAG_PRIMARY_LIST: + argp = &res; + objp = list_val_rel(obj,src_base); + goto L_copy_list; case TAG_PRIMARY_BOXED: argp = &res; goto L_copy_boxed; default: erl_exit(ERTS_ABORT_EXIT, @@ -231,32 +241,46 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) hp++; break; case TAG_PRIMARY_LIST: - objp = list_val(obj); + objp = list_val_rel(obj,src_base); + #if !HALFWORD_HEAP || defined(DEBUG) if (in_area(objp,hstart,hsize)) { + ASSERT(!HALFWORD_HEAP); hp++; break; } + #endif argp = hp++; /* Fall through */ L_copy_list: tailp = argp; - while (is_list(obj)) { - objp = list_val(obj); + for (;;) { tp = tailp; - elem = *objp; + elem = CAR(objp); if (IS_CONST(elem)) { - *(hbot-2) = elem; - tailp = hbot-1; hbot -= 2; + CAR(hbot) = elem; + tailp = &CDR(hbot); } else { - *htop = elem; - tailp = htop+1; + CAR(htop) = elem; + #if HALFWORD_HEAP + CDR(htop) = CDR(objp); + *tailp = make_list_rel(htop,dst_base); + htop += 2; + goto L_copy; + #else + tailp = &CDR(htop); htop += 2; + #endif + } + ASSERT(!HALFWORD_HEAP || tp < hp || tp >= hbot); + *tp = make_list_rel(tailp - 1, dst_base); + obj = CDR(objp); + if (!is_list(obj)) { + break; } - *tp = make_list(tailp - 1); - obj = *(objp+1); + objp = list_val_rel(obj,src_base); } switch (primary_tag(obj)) { case TAG_PRIMARY_IMMED1: *tailp = obj; goto L_copy; @@ -268,21 +292,24 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) } case TAG_PRIMARY_BOXED: - if (in_area(boxed_val(obj),hstart,hsize)) { + #if !HALFWORD_HEAP || defined(DEBUG) + if (in_area(boxed_val_rel(obj,src_base),hstart,hsize)) { + ASSERT(!HALFWORD_HEAP); hp++; break; } + #endif argp = hp++; L_copy_boxed: - objp = boxed_val(obj); + objp = boxed_val_rel(obj, src_base); hdr = *objp; switch (hdr & _TAG_HEADER_MASK) { case ARITYVAL_SUBTAG: { int const_flag = 1; /* assume constant tuple */ i = arityval(hdr); - *argp = make_tuple(htop); + *argp = make_tuple_rel(htop, dst_base); tp = htop; /* tp is pointer to new arity value */ *htop++ = *objp++; /* copy arity value */ while (i--) { @@ -311,7 +338,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) while (i--) { *tp++ = *objp++; } - *argp = make_binary(hbot); + *argp = make_binary_rel(hbot, dst_base); pb = (ProcBin*) hbot; erts_refc_inc(&pb->val->refc, 2); pb->next = off_heap->first; @@ -338,7 +365,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) extra_bytes = 0; } real_size = size+extra_bytes; - objp = binary_val(real_bin); + objp = binary_val_rel(real_bin,src_base); if (thing_subtag(*objp) == HEAP_BINARY_SUBTAG) { ErlHeapBin* from = (ErlHeapBin *) objp; ErlHeapBin* to; @@ -368,7 +395,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) off_heap->first = (struct erl_off_heap_header*) to; OH_OVERHEAD(off_heap, to->size / sizeof(Eterm)); } - *argp = make_binary(hbot); + *argp = make_binary_rel(hbot, dst_base); if (extra_bytes != 0) { ErlSubBin* res; hbot -= ERL_SUB_BIN_SIZE; @@ -380,7 +407,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) res->offs = 0; res->is_writable = 0; res->orig = *argp; - *argp = make_binary(hbot); + *argp = make_binary_rel(hbot, dst_base); } break; } @@ -400,7 +427,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) off_heap->first = (struct erl_off_heap_header*) funp; erts_refc_inc(&funp->fe->refc, 2); #endif - *argp = make_fun(tp); + *argp = make_fun_rel(tp, dst_base); } break; case EXTERNAL_PID_SUBTAG: @@ -420,7 +447,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) off_heap->first = (struct erl_off_heap_header*)etp; erts_refc_inc(&etp->node->refc, 2); - *argp = make_external(tp); + *argp = make_external_rel(tp, dst_base); } break; case BIN_MATCHSTATE_SUBTAG: @@ -430,7 +457,7 @@ copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) i = thing_arityval(hdr)+1; hbot -= i; tp = hbot; - *argp = make_boxed(hbot); + *argp = make_boxed_rel(hbot, dst_base); while (i--) { *tp++ = *objp++; } @@ -885,12 +912,21 @@ Eterm copy_struct_lazy(Process *from, Eterm orig, Uint offs) * * NOTE: Assumes that term is a tuple (ptr is an untagged tuple ptr). */ -Eterm -copy_shallow(Eterm* ptr, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) +#if HALFWORD_HEAP +Eterm copy_shallow_rel(Eterm* ptr, Uint sz, Eterm** hpp, ErlOffHeap* off_heap, + Eterm* src_base) +#else +Eterm copy_shallow(Eterm* ptr, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) +#endif { Eterm* tp = ptr; Eterm* hp = *hpp; - Sint offs = hp - tp; + const Eterm res = make_tuple(hp); +#if HALFWORD_HEAP + const Sint offs = COMPRESS_POINTER(hp - (tp - src_base)); +#else + const Sint offs = (hp - tp) * sizeof(Eterm); +#endif while (sz--) { Eterm val = *tp++; @@ -901,7 +937,7 @@ copy_shallow(Eterm* ptr, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) break; case TAG_PRIMARY_LIST: case TAG_PRIMARY_BOXED: - *hp++ = offset_ptr(val, offs); + *hp++ = byte_offset_ptr(val, offs); break; case TAG_PRIMARY_HEADER: *hp++ = val; @@ -958,7 +994,8 @@ copy_shallow(Eterm* ptr, Uint sz, Eterm** hpp, ErlOffHeap* off_heap) } } *hpp = hp; - return make_tuple(ptr + offs); + + return res; } /* Move all terms in heap fragments into heap. The terms must be guaranteed to diff --git a/erts/emulator/beam/erl_bif_lists.c b/erts/emulator/beam/erl_bif_lists.c index ce13469801..d4dc3867ad 100644 --- a/erts/emulator/beam/erl_bif_lists.c +++ b/erts/emulator/beam/erl_bif_lists.c @@ -378,7 +378,7 @@ keyfind(int Bif, Process* p, Eterm Key, Eterm Pos, Eterm List) Eterm *tuple_ptr = tuple_val(term); if (pos <= arityval(*tuple_ptr)) { Eterm element = tuple_ptr[pos]; - if (cmp(Key, element) == 0) { + if (CMP(Key, element) == 0) { return term; } } diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h index bdf0fe23fc..3093fb8856 100644 --- a/erts/emulator/beam/erl_binary.h +++ b/erts/emulator/beam/erl_binary.h @@ -71,6 +71,7 @@ typedef struct erl_heap_bin { */ #define binary_size(Bin) (binary_val(Bin)[1]) +#define binary_size_rel(Bin,BasePtr) (binary_val_rel(Bin,BasePtr)[1]) #define binary_bitsize(Bin) \ ((*binary_val(Bin) == HEADER_SUB_BIN) ? \ @@ -93,9 +94,12 @@ typedef struct erl_heap_bin { * Bitsize: output variable (Uint) */ -#define ERTS_GET_BINARY_BYTES(Bin,Bytep,Bitoffs,Bitsize) \ +#define ERTS_GET_BINARY_BYTES(Bin,Bytep,Bitoffs,Bitsize) \ + ERTS_GET_BINARY_BYTES_REL(Bin,Bytep,Bitoffs,Bitsize,NULL) + +#define ERTS_GET_BINARY_BYTES_REL(Bin,Bytep,Bitoffs,Bitsize,BasePtr) \ do { \ - Eterm* _real_bin = binary_val(Bin); \ + Eterm* _real_bin = binary_val_rel(Bin,BasePtr); \ Uint _offs = 0; \ Bitoffs = Bitsize = 0; \ if (*_real_bin == HEADER_SUB_BIN) { \ @@ -103,7 +107,7 @@ do { \ _offs = _sb->offs; \ Bitoffs = _sb->bitoffs; \ Bitsize = _sb->bitsize; \ - _real_bin = binary_val(_sb->orig); \ + _real_bin = binary_val_rel(_sb->orig,BasePtr); \ } \ if (*_real_bin == HEADER_PROC_BIN) { \ Bytep = ((ProcBin *) _real_bin)->bytes + _offs; \ @@ -125,9 +129,12 @@ do { \ * BitSize: Extra bit size (Uint) */ -#define ERTS_GET_REAL_BIN(Bin, RealBin, ByteOffset, BitOffset, BitSize) \ +#define ERTS_GET_REAL_BIN(Bin, RealBin, ByteOffset, BitOffset, BitSize) \ + ERTS_GET_REAL_BIN_REL(Bin, RealBin, ByteOffset, BitOffset, BitSize, NULL) + +#define ERTS_GET_REAL_BIN_REL(Bin, RealBin, ByteOffset, BitOffset, BitSize, BasePtr) \ do { \ - ErlSubBin* _sb = (ErlSubBin *) binary_val(Bin); \ + ErlSubBin* _sb = (ErlSubBin *) binary_val_rel(Bin,BasePtr); \ if (_sb->thing_word == HEADER_SUB_BIN) { \ RealBin = _sb->orig; \ ByteOffset = _sb->offs; \ diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 3173d3510e..3115e647af 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -910,7 +910,8 @@ BIF_RETTYPE ets_update_counter_3(BIF_ALIST_3) Eterm upop; Eterm* tpl; Sint position; - Eterm incr, warp, oldcnt; + Eterm incr, warp; + Wterm oldcnt; if (is_not_list(iter)) { goto finalize; @@ -985,7 +986,7 @@ BIF_RETTYPE ets_update_counter_3(BIF_ALIST_3) Eterm* tpl = tuple_val(CAR(list_val(iter))); Sint position = signed_val(tpl[1]); Eterm incr = tpl[2]; - Eterm oldcnt = handle.dbterm->tpl[position]; + Wterm oldcnt = db_do_read_element(&handle,position); Eterm newcnt = db_add_counter(&htop, oldcnt, incr); if (newcnt == NIL) { @@ -998,9 +999,9 @@ BIF_RETTYPE ets_update_counter_3(BIF_ALIST_3) if (arityval(*tpl) == 4) { /* Maybe warp it */ Eterm threshold = tpl[3]; - if ((cmp(incr,make_small(0)) < 0) ? /* negative increment? */ - (cmp(newcnt,threshold) < 0) : /* if negative, check if below */ - (cmp(newcnt,threshold) > 0)) { /* else check if above threshold */ + if ((CMP(incr,make_small(0)) < 0) ? /* negative increment? */ + (CMP(newcnt,threshold) < 0) : /* if negative, check if below */ + (CMP(newcnt,threshold) > 0)) { /* else check if above threshold */ newcnt = tpl[4]; } @@ -3490,11 +3491,25 @@ static void set_heir(Process* me, DbTable* tb, Eterm heir, UWord heir_data) if (!is_immed(heir_data)) { DeclareTmpHeap(tmp,2,me); + Eterm wrap_tpl; + int size; + DbTerm* dbterm; + Eterm* top; + ErlOffHeap tmp_offheap; UseTmpHeap(2,me); - /* Make a dummy 1-tuple around data to use db_get_term() */ - heir_data = (UWord) db_store_term(&tb->common, NULL, 0, - TUPLE1(tmp,heir_data)); + /* Make a dummy 1-tuple around data to use DbTerm */ + wrap_tpl = TUPLE1(tmp,heir_data); + size = size_object(wrap_tpl); + // SVERK: Must be low memory + dbterm = erts_db_alloc(ERTS_ALC_T_DB_TERM, (DbTable *)tb, + (sizeof(DbTerm) + sizeof(Eterm)*(size-1))); + dbterm->size = size; + top = dbterm->tpl; + tmp_offheap.first = NULL; + copy_struct(wrap_tpl, size, &top, &tmp_offheap); + dbterm->first_oh = tmp_offheap.first; + heir_data = (UWord)dbterm; UnUseTmpHeap(2,me); ASSERT(!is_immed(heir_data)); } diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c index 1e50fee554..ced6629c43 100644 --- a/erts/emulator/beam/erl_db_hash.c +++ b/erts/emulator/beam/erl_db_hash.c @@ -258,12 +258,6 @@ static ERTS_INLINE Sint next_slot_w(DbTableHash* tb, Uint ix, } -/* - * tplp is an untagged pointer to a tuple we know is large enough - * and dth is a pointer to a DbTableHash. - */ -#define GETKEY(dth, tplp) (*((tplp) + (dth)->common.keypos)) - /* * Some special binary flags */ @@ -434,6 +428,9 @@ static ERTS_INLINE void try_shrink(DbTableHash* tb) } } +#define EQ_REL(x,y,y_base) \ + (is_same(x,NULL,y,y_base) || (is_not_both_immed((x),(y)) && eq_rel((x),(y),y_base))) + /* Is this a live object (not pseodo-deleted) with the specified key? */ static ERTS_INLINE int has_live_key(DbTableHash* tb, HashDbTerm* b, @@ -443,7 +440,7 @@ static ERTS_INLINE int has_live_key(DbTableHash* tb, HashDbTerm* b, else { Eterm itemKey = GETKEY(tb, b->dbterm.tpl); ASSERT(!is_header(itemKey)); - return EQ(key,itemKey); + return EQ_REL(key, itemKey, b->dbterm.tpl); } } @@ -456,7 +453,7 @@ static ERTS_INLINE int has_key(DbTableHash* tb, HashDbTerm* b, else { Eterm itemKey = GETKEY(tb, b->dbterm.tpl); ASSERT(!is_header(itemKey)); - return EQ(key,itemKey); + return EQ_REL(key, itemKey, b->dbterm.tpl); } } @@ -696,9 +693,7 @@ static int db_first_hash(Process *p, DbTable *tbl, Eterm *ret) } } if (list != NULL) { - Eterm key = GETKEY(tb, list->dbterm.tpl); - - COPY_OBJECT(key, p, ret); + *ret = db_copy_key(p, tbl, &list->dbterm); RUNLOCK_HASH(lck); } else { @@ -746,7 +741,7 @@ static int db_next_hash(Process *p, DbTable *tbl, Eterm key, Eterm *ret) *ret = am_EOT; } else { - COPY_OBJECT(GETKEY(tb, b->dbterm.tpl), p, ret); + *ret = db_copy_key(p, tbl, &b->dbterm); RUNLOCK_HASH(lck); } return DB_ERROR_NONE; @@ -2695,6 +2690,9 @@ static int db_lookup_dbterm_hash(DbTable *tbl, Eterm key, DbUpdateHandle* handle handle->dbterm = &b->dbterm; handle->mustResize = 0; handle->new_size = b->dbterm.size; + #if HALFWORD_HEAP + handle->new_tuple = handle->dbterm->tpl; + #endif handle->lck = lck; /* KEEP hval WLOCKED, db_finalize_dbterm_hash will WUNLOCK */ return 1; diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index 8108494fc5..c74ccdc119 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -48,9 +48,6 @@ #include "erl_db_tree.h" - - -#define GETKEY(dtt, tplp) (*((tplp) + (dtt)->common.keypos)) #define GETKEY_WITH_POS(Keypos, Tplp) (*((Tplp) + Keypos)) #define NITEMS(tb) ((int)erts_smp_atomic_read(&(tb)->common.nitems)) @@ -282,7 +279,7 @@ struct select_delete_context { /* ** Forward declarations */ -static TreeDbTerm *linkout_tree(DbTableTree *tb, Eterm key); +static TreeDbTerm *linkout_tree(DbTableTree *tb, Eterm key, Eterm* key_base); static TreeDbTerm *linkout_object_tree(DbTableTree *tb, Eterm object); static int do_free_tree_cont(DbTableTree *tb, int num_left); @@ -293,15 +290,15 @@ static int delsub(TreeDbTerm **this); static TreeDbTerm *slot_search(Process *p, DbTableTree *tb, Sint slot); static TreeDbTerm *find_node(DbTableTree *tb, Eterm key); static TreeDbTerm **find_node2(DbTableTree *tb, Eterm key); -static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack*, Eterm key); -static TreeDbTerm *find_prev(DbTableTree *tb, DbTreeStack*, Eterm key); +static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack*, Eterm key, Eterm* kbase); +static TreeDbTerm *find_prev(DbTableTree *tb, DbTreeStack*, Eterm key, Eterm* kbase); static TreeDbTerm *find_next_from_pb_key(DbTableTree *tb, DbTreeStack*, Eterm key); static TreeDbTerm *find_prev_from_pb_key(DbTableTree *tb, DbTreeStack*, Eterm key); static void traverse_backwards(DbTableTree *tb, DbTreeStack*, - Eterm lastkey, + Eterm lastkey, Eterm* lk_base, int (*doit)(DbTableTree *tb, TreeDbTerm *, void *, @@ -309,7 +306,7 @@ static void traverse_backwards(DbTableTree *tb, void *context); static void traverse_forward(DbTableTree *tb, DbTreeStack*, - Eterm lastkey, + Eterm lastkey, Eterm* lk_base, int (*doit)(DbTableTree *tb, TreeDbTerm *, void *, @@ -317,8 +314,8 @@ static void traverse_forward(DbTableTree *tb, void *context); static int key_given(DbTableTree *tb, Eterm pattern, TreeDbTerm **ret, Eterm *partly_bound_key); -static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key); -static Sint do_cmp_partly_bound(Eterm a, Eterm b, int *done); +static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key, Eterm* bk_base); +static Sint do_cmp_partly_bound(Eterm a, Eterm b, Eterm* b_base, int *done); static int analyze_pattern(DbTableTree *tb, Eterm pattern, struct mp_info *mpi); @@ -492,9 +489,6 @@ static int db_first_tree(Process *p, DbTable *tbl, Eterm *ret) DbTableTree *tb = &tbl->tree; DbTreeStack* stack; TreeDbTerm *this; - Eterm e; - Eterm *hp; - Uint sz; if (( this = tb->root ) == NULL) { *ret = am_EOT; @@ -513,13 +507,7 @@ static int db_first_tree(Process *p, DbTable *tbl, Eterm *ret) stack->slot = 1; release_stack(tb,stack); } - e = GETKEY(tb, this->dbterm.tpl); - sz = size_object(e); - - hp = HAlloc(p, sz); - - *ret = copy_struct(e,sz,&hp,&MSO(p)); - + *ret = db_copy_key(p, tbl, &this->dbterm); return DB_ERROR_NONE; } @@ -528,26 +516,17 @@ static int db_next_tree(Process *p, DbTable *tbl, Eterm key, Eterm *ret) DbTableTree *tb = &tbl->tree; DbTreeStack* stack; TreeDbTerm *this; - Eterm e; - Eterm *hp; - Uint sz; if (is_atom(key) && key == am_EOT) return DB_ERROR_BADKEY; stack = get_any_stack(tb); - this = find_next(tb, stack, key); + this = find_next(tb, stack, key, NULL); release_stack(tb,stack); if (this == NULL) { *ret = am_EOT; return DB_ERROR_NONE; } - e = GETKEY(tb, this->dbterm.tpl); - sz = size_object(e); - - hp = HAlloc(p, sz); - - *ret = copy_struct(e,sz,&hp,&MSO(p)); - + *ret = db_copy_key(p, tbl, &this->dbterm); return DB_ERROR_NONE; } @@ -556,9 +535,6 @@ static int db_last_tree(Process *p, DbTable *tbl, Eterm *ret) DbTableTree *tb = &tbl->tree; TreeDbTerm *this; DbTreeStack* stack; - Eterm e; - Eterm *hp; - Uint sz; if (( this = tb->root ) == NULL) { *ret = am_EOT; @@ -577,13 +553,7 @@ static int db_last_tree(Process *p, DbTable *tbl, Eterm *ret) stack->slot = NITEMS(tb); release_stack(tb,stack); } - e = GETKEY(tb, this->dbterm.tpl); - sz = size_object(e); - - hp = HAlloc(p, sz); - - *ret = copy_struct(e,sz,&hp,&MSO(p)); - + *ret = db_copy_key(p, tbl, &this->dbterm); return DB_ERROR_NONE; } @@ -592,27 +562,33 @@ static int db_prev_tree(Process *p, DbTable *tbl, Eterm key, Eterm *ret) DbTableTree *tb = &tbl->tree; TreeDbTerm *this; DbTreeStack* stack; - Eterm e; - Eterm *hp; - Uint sz; if (is_atom(key) && key == am_EOT) return DB_ERROR_BADKEY; stack = get_any_stack(tb); - this = find_prev(tb, stack, key); + this = find_prev(tb, stack, key, NULL); release_stack(tb,stack); if (this == NULL) { *ret = am_EOT; return DB_ERROR_NONE; } - e = GETKEY(tb, this->dbterm.tpl); - sz = size_object(e); + *ret = db_copy_key(p, tbl, &this->dbterm); + return DB_ERROR_NONE; +} - hp = HAlloc(p, sz); +static ERTS_INLINE int cmp_key(DbTableTree* tb, Eterm key, Eterm* key_base, + TreeDbTerm* obj) +{ + return cmp_rel(key, key_base, + GETKEY(tb,obj->dbterm.tpl), obj->dbterm.tpl); +} - *ret = copy_struct(e,sz,&hp,&MSO(p)); - - return DB_ERROR_NONE; +static ERTS_INLINE int cmp_key_eq(DbTableTree* tb, Eterm key, Eterm* key_base, + TreeDbTerm* obj) +{ + Eterm obj_key = GETKEY(tb,obj->dbterm.tpl); + return is_same(key, key_base, obj_key, obj->dbterm.tpl) + || cmp_rel(key, key_base, obj_key, obj->dbterm.tpl) == 0; } static int db_put_tree(DbTable *tbl, Eterm obj, int key_clash_fail) @@ -646,8 +622,8 @@ static int db_put_tree(DbTable *tbl, Eterm obj, int key_clash_fail) (*this)->balance = 0; (*this)->left = (*this)->right = NULL; break; - } else if ((c = cmp(key,GETKEY(tb,(*this)->dbterm.tpl))) < 0) { - /* go left */ + } else if ((c = cmp_key(tb, key, NULL, *this)) < 0) { + /* go lefts */ dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; this = &((*this)->left); @@ -801,7 +777,7 @@ static int db_erase_tree(DbTable *tbl, Eterm key, Eterm *ret) *ret = am_true; - if ((res = linkout_tree(tb, key)) != NULL) { + if ((res = linkout_tree(tb, key, NULL)) != NULL) { free_term(tb, res); } return DB_ERROR_NONE; @@ -993,15 +969,15 @@ static int db_select_continue_tree(Process *p, stack = get_any_stack(tb); if (chunk_size) { if (reverse) { - traverse_backwards(tb, stack, lastkey, &doit_select_chunk, &sc); + traverse_backwards(tb, stack, lastkey, NULL, &doit_select_chunk, &sc); } else { - traverse_forward(tb, stack, lastkey, &doit_select_chunk, &sc); + traverse_forward(tb, stack, lastkey, NULL, &doit_select_chunk, &sc); } } else { if (reverse) { - traverse_forward(tb, stack, lastkey, &doit_select, &sc); + traverse_forward(tb, stack, lastkey, NULL, &doit_select, &sc); } else { - traverse_backwards(tb, stack, lastkey, &doit_select, &sc); + traverse_backwards(tb, stack, lastkey, NULL, &doit_select, &sc); } } release_stack(tb,stack); @@ -1026,10 +1002,9 @@ static int db_select_continue_tree(Process *p, } key = GETKEY(tb, sc.lastobj); - - sz = size_object(key); + sz = size_object_rel(key,sc.lastobj); hp = HAlloc(p, 9 + sz); - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); continuation = TUPLE8 (hp, tptr[1], @@ -1050,8 +1025,8 @@ static int db_select_continue_tree(Process *p, key = GETKEY(tb, sc.lastobj); if (chunk_size) { if (end_condition != NIL && - ((!reverse && cmp_partly_bound(end_condition,key) < 0) || - (reverse && cmp_partly_bound(end_condition,key) > 0))) { + ((!reverse && cmp_partly_bound(end_condition,key,sc.lastobj) < 0) || + (reverse && cmp_partly_bound(end_condition,key,sc.lastobj) > 0))) { /* done anyway */ if (!sc.got) { RET_TO_BIF(am_EOT, DB_ERROR_NONE); @@ -1063,16 +1038,16 @@ static int db_select_continue_tree(Process *p, } } else { if (end_condition != NIL && - ((!reverse && cmp_partly_bound(end_condition,key) > 0) || - (reverse && cmp_partly_bound(end_condition,key) < 0))) { + ((!reverse && cmp_partly_bound(end_condition,key,sc.lastobj) > 0) || + (reverse && cmp_partly_bound(end_condition,key,sc.lastobj) < 0))) { /* done anyway */ RET_TO_BIF(sc.accum,DB_ERROR_NONE); } } /* Not done yet, let's trap. */ - sz = size_object(key); + sz = size_object_rel(key,sc.lastobj); hp = HAlloc(p, 9 + sz); - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); continuation = TUPLE8 (hp, tptr[1], @@ -1099,6 +1074,7 @@ static int db_select_tree(Process *p, DbTable *tbl, struct select_context sc; struct mp_info mpi; Eterm lastkey = THE_NON_VALUE; + Eterm* lk_base = NULL; Eterm key; Eterm continuation; unsigned sz; @@ -1140,7 +1116,7 @@ static int db_select_tree(Process *p, DbTable *tbl, sc.all_objects = mpi.all_objects; if (!mpi.got_partial && mpi.some_limitation && - cmp(mpi.least,mpi.most) == 0) { + CMP(mpi.least,mpi.most) == 0) { doit_select(tb,mpi.save_term,&sc,0 /* direction doesn't matter */); RET_TO_BIF(sc.accum,DB_ERROR_NONE); } @@ -1150,20 +1126,20 @@ static int db_select_tree(Process *p, DbTable *tbl, if (mpi.some_limitation) { if ((this = find_prev_from_pb_key(tb, stack, mpi.least)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.most; } - - traverse_forward(tb, stack, lastkey, &doit_select, &sc); + traverse_forward(tb, stack, lastkey, lk_base, &doit_select, &sc); } else { if (mpi.some_limitation) { if ((this = find_next_from_pb_key(tb, stack, mpi.most)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.least; } - - traverse_backwards(tb, stack, lastkey, &doit_select, &sc); + traverse_backwards(tb, stack, lastkey, lk_base, &doit_select, &sc); } release_stack(tb,stack); #ifdef HARDDEBUG @@ -1176,9 +1152,9 @@ static int db_select_tree(Process *p, DbTable *tbl, } key = GETKEY(tb, sc.lastobj); - sz = size_object(key); + sz = size_object_rel(key, sc.lastobj); hp = HAlloc(p, 9 + sz + PROC_BIN_SIZE); - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); if (mpi.all_objects) (mpi.mp)->flags |= BIN_FLAG_ALL_OBJECTS; mpb=db_make_mp_binary(p,mpi.mp,&hp); @@ -1259,7 +1235,7 @@ static int db_select_count_continue_tree(Process *p, } stack = get_any_stack(tb); - traverse_backwards(tb, stack, lastkey, &doit_select_count, &sc); + traverse_backwards(tb, stack, lastkey, NULL, &doit_select_count, &sc); release_stack(tb,stack); BUMP_REDS(p, 1000 - sc.max); @@ -1269,12 +1245,12 @@ static int db_select_count_continue_tree(Process *p, } key = GETKEY(tb, sc.lastobj); if (end_condition != NIL && - (cmp_partly_bound(end_condition,key) > 0)) { + (cmp_partly_bound(end_condition,key,sc.lastobj) > 0)) { /* done anyway */ RET_TO_BIF(make_small(sc.got),DB_ERROR_NONE); } /* Not done yet, let's trap. */ - sz = size_object(key); + sz = size_object_rel(key, sc.lastobj); if (IS_USMALL(0, sc.got)) { hp = HAlloc(p, sz + 6); egot = make_small(sc.got); @@ -1284,7 +1260,7 @@ static int db_select_count_continue_tree(Process *p, egot = uint_to_big(sc.got, hp); hp += BIG_UINT_HEAP_SIZE; } - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); continuation = TUPLE5 (hp, tptr[1], @@ -1307,6 +1283,7 @@ static int db_select_count_tree(Process *p, DbTable *tbl, struct select_count_context sc; struct mp_info mpi; Eterm lastkey = THE_NON_VALUE; + Eterm* lk_base = NULL; Eterm key; Eterm continuation; unsigned sz; @@ -1347,7 +1324,7 @@ static int db_select_count_tree(Process *p, DbTable *tbl, sc.all_objects = mpi.all_objects; if (!mpi.got_partial && mpi.some_limitation && - cmp(mpi.least,mpi.most) == 0) { + CMP(mpi.least,mpi.most) == 0) { doit_select_count(tb,mpi.save_term,&sc,0 /* dummy */); RET_TO_BIF(erts_make_integer(sc.got,p),DB_ERROR_NONE); } @@ -1356,11 +1333,12 @@ static int db_select_count_tree(Process *p, DbTable *tbl, if (mpi.some_limitation) { if ((this = find_next_from_pb_key(tb, stack, mpi.most)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.least; } - traverse_backwards(tb, stack, lastkey, &doit_select_count, &sc); + traverse_backwards(tb, stack, lastkey, lk_base, &doit_select_count, &sc); release_stack(tb,stack); BUMP_REDS(p, 1000 - sc.max); if (sc.max > 0) { @@ -1368,7 +1346,7 @@ static int db_select_count_tree(Process *p, DbTable *tbl, } key = GETKEY(tb, sc.lastobj); - sz = size_object(key); + sz = size_object_rel(key, sc.lastobj); if (IS_USMALL(0, sc.got)) { hp = HAlloc(p, sz + PROC_BIN_SIZE + 6); egot = make_small(sc.got); @@ -1378,7 +1356,7 @@ static int db_select_count_tree(Process *p, DbTable *tbl, egot = uint_to_big(sc.got, hp); hp += BIG_UINT_HEAP_SIZE; } - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); if (mpi.all_objects) (mpi.mp)->flags |= BIN_FLAG_ALL_OBJECTS; mpb = db_make_mp_binary(p,mpi.mp,&hp); @@ -1409,6 +1387,7 @@ static int db_select_chunk_tree(Process *p, DbTable *tbl, struct select_context sc; struct mp_info mpi; Eterm lastkey = THE_NON_VALUE; + Eterm* lk_base = NULL; Eterm key; Eterm continuation; unsigned sz; @@ -1450,7 +1429,7 @@ static int db_select_chunk_tree(Process *p, DbTable *tbl, sc.all_objects = mpi.all_objects; if (!mpi.got_partial && mpi.some_limitation && - cmp(mpi.least,mpi.most) == 0) { + CMP(mpi.least,mpi.most) == 0) { doit_select(tb,mpi.save_term,&sc, 0 /* direction doesn't matter */); if (sc.accum != NIL) { hp=HAlloc(p, 3); @@ -1465,20 +1444,20 @@ static int db_select_chunk_tree(Process *p, DbTable *tbl, if (mpi.some_limitation) { if ((this = find_next_from_pb_key(tb, stack, mpi.most)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.least; } - - traverse_backwards(tb, stack, lastkey, &doit_select_chunk, &sc); + traverse_backwards(tb, stack, lastkey, lk_base, &doit_select_chunk, &sc); } else { if (mpi.some_limitation) { if ((this = find_prev_from_pb_key(tb, stack, mpi.least)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.most; } - - traverse_forward(tb, stack, lastkey, &doit_select_chunk, &sc); + traverse_forward(tb, stack, lastkey, lk_base, &doit_select_chunk, &sc); } release_stack(tb,stack); @@ -1503,9 +1482,9 @@ static int db_select_chunk_tree(Process *p, DbTable *tbl, } key = GETKEY(tb, sc.lastobj); - sz = size_object(key); + sz = size_object_rel(key, sc.lastobj); hp = HAlloc(p, 9 + sz + PROC_BIN_SIZE); - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); if (mpi.all_objects) (mpi.mp)->flags |= BIN_FLAG_ALL_OBJECTS; mpb = db_make_mp_binary(p,mpi.mp,&hp); @@ -1528,9 +1507,9 @@ static int db_select_chunk_tree(Process *p, DbTable *tbl, } key = GETKEY(tb, sc.lastobj); - sz = size_object(key); + sz = size_object_rel(key, sc.lastobj); hp = HAlloc(p, 9 + sz + PROC_BIN_SIZE); - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastobj, NULL); if (mpi.all_objects) (mpi.mp)->flags |= BIN_FLAG_ALL_OBJECTS; @@ -1606,7 +1585,7 @@ static int db_select_delete_continue_tree(Process *p, sc.keypos = tb->common.keypos; ASSERT(!erts_smp_atomic_read(&tb->is_stack_busy)); - traverse_backwards(tb, &tb->static_stack, lastkey, &doit_select_delete, &sc); + traverse_backwards(tb, &tb->static_stack, lastkey, NULL, &doit_select_delete, &sc); BUMP_REDS(p, 1000 - sc.max); @@ -1615,11 +1594,11 @@ static int db_select_delete_continue_tree(Process *p, } key = GETKEY(tb, (sc.lastterm)->dbterm.tpl); if (end_condition != NIL && - cmp_partly_bound(end_condition,key) > 0) { /* done anyway */ + cmp_partly_bound(end_condition,key,sc.lastterm->dbterm.tpl) > 0) { /* done anyway */ RET_TO_BIF(erts_make_integer(sc.accum,p),DB_ERROR_NONE); } /* Not done yet, let's trap. */ - sz = size_object(key); + sz = size_object_rel(key, sc.lastterm->dbterm.tpl); if (IS_USMALL(0, sc.accum)) { hp = HAlloc(p, sz + 6); eaccsum = make_small(sc.accum); @@ -1629,7 +1608,7 @@ static int db_select_delete_continue_tree(Process *p, eaccsum = uint_to_big(sc.accum, hp); hp += BIG_UINT_HEAP_SIZE; } - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastterm->dbterm.tpl, NULL); continuation = TUPLE5 (hp, tptr[1], @@ -1650,6 +1629,7 @@ static int db_select_delete_tree(Process *p, DbTable *tbl, struct select_delete_context sc; struct mp_info mpi; Eterm lastkey = THE_NON_VALUE; + Eterm* lk_base = NULL; Eterm key; Eterm continuation; unsigned sz; @@ -1693,7 +1673,7 @@ static int db_select_delete_tree(Process *p, DbTable *tbl, sc.mp = mpi.mp; if (!mpi.got_partial && mpi.some_limitation && - cmp(mpi.least,mpi.most) == 0) { + CMP(mpi.least,mpi.most) == 0) { doit_select_delete(tb,mpi.save_term,&sc, 0 /* direction doesn't matter */); RET_TO_BIF(erts_make_integer(sc.accum,p),DB_ERROR_NONE); @@ -1702,11 +1682,12 @@ static int db_select_delete_tree(Process *p, DbTable *tbl, if (mpi.some_limitation) { if ((this = find_next_from_pb_key(tb, &tb->static_stack, mpi.most)) != NULL) { lastkey = GETKEY(tb, this->dbterm.tpl); + lk_base = this->dbterm.tpl; } sc.end_condition = mpi.least; } - traverse_backwards(tb, &tb->static_stack, lastkey, &doit_select_delete, &sc); + traverse_backwards(tb, &tb->static_stack, lastkey, lk_base, &doit_select_delete, &sc); BUMP_REDS(p, 1000 - sc.max); if (sc.max > 0) { @@ -1714,7 +1695,7 @@ static int db_select_delete_tree(Process *p, DbTable *tbl, } key = GETKEY(tb, (sc.lastterm)->dbterm.tpl); - sz = size_object(key); + sz = size_object_rel(key, sc.lastterm->dbterm.tpl); if (IS_USMALL(0, sc.accum)) { hp = HAlloc(p, sz + PROC_BIN_SIZE + 6); eaccsum = make_small(sc.accum); @@ -1724,7 +1705,7 @@ static int db_select_delete_tree(Process *p, DbTable *tbl, eaccsum = uint_to_big(sc.accum, hp); hp += BIG_UINT_HEAP_SIZE; } - key = copy_struct(key, sz, &hp, &MSO(p)); + key = copy_struct_rel(key, sz, &hp, &MSO(p), sc.lastterm->dbterm.tpl, NULL); mpb = db_make_mp_binary(p,mpi.mp,&hp); continuation = TUPLE5 @@ -1842,7 +1823,7 @@ do_db_tree_foreach_offheap(TreeDbTerm *tdbt, } static TreeDbTerm *linkout_tree(DbTableTree *tb, - Eterm key) + Eterm key, Eterm* key_base) { TreeDbTerm **tstack[STACK_NEED]; int tpos = 0; @@ -1865,7 +1846,7 @@ static TreeDbTerm *linkout_tree(DbTableTree *tb, for (;;) { if (!*this) { /* Failure */ return NULL; - } else if ((c = cmp(key,GETKEY(tb,(*this)->dbterm.tpl))) < 0) { + } else if ((c = cmp_key(tb, key, key_base, *this)) < 0) { dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; this = &((*this)->left); @@ -1929,7 +1910,7 @@ static TreeDbTerm *linkout_object_tree(DbTableTree *tb, for (;;) { if (!*this) { /* Failure */ return NULL; - } else if ((c = cmp(key,GETKEY(tb,(*this)->dbterm.tpl))) < 0) { + } else if ((c = cmp_key(tb,key,NULL,*this)) < 0) { dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; this = &((*this)->left); @@ -2324,14 +2305,15 @@ done: * Find next and previous in sort order */ -static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack* stack, Eterm key) +static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack* stack, + Eterm key, Eterm* key_base) { TreeDbTerm *this; TreeDbTerm *tmp; Sint c; if(( this = TOP_NODE(stack)) != NULL) { - if (!CMP_EQ(GETKEY(tb, this->dbterm.tpl),key)) { + if (!cmp_key_eq(tb,key,key_base,this)) { /* Start from the beginning */ stack->pos = stack->slot = 0; } @@ -2341,14 +2323,14 @@ static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack* stack, Eterm key) return NULL; for (;;) { PUSH_NODE(stack, this); - if (( c = cmp(GETKEY(tb, this->dbterm.tpl),key) ) < 0) { + if (( c = cmp_key(tb,key,key_base,this) ) > 0) { if (this->right == NULL) /* We are at the previos and the element does not exist */ break; else this = this->right; - } else if (c > 0) { + } else if (c < 0) { if (this->left == NULL) /* Done */ return this; else @@ -2381,14 +2363,15 @@ static TreeDbTerm *find_next(DbTableTree *tb, DbTreeStack* stack, Eterm key) return this; } -static TreeDbTerm *find_prev(DbTableTree *tb, DbTreeStack* stack, Eterm key) +static TreeDbTerm *find_prev(DbTableTree *tb, DbTreeStack* stack, + Eterm key, Eterm* key_base) { TreeDbTerm *this; TreeDbTerm *tmp; Sint c; if(( this = TOP_NODE(stack)) != NULL) { - if (!CMP_EQ(GETKEY(tb, this->dbterm.tpl),key)) { + if (!cmp_key_eq(tb,key,key_base,this)) { /* Start from the beginning */ stack->pos = stack->slot = 0; } @@ -2398,14 +2381,14 @@ static TreeDbTerm *find_prev(DbTableTree *tb, DbTreeStack* stack, Eterm key) return NULL; for (;;) { PUSH_NODE(stack, this); - if (( c = cmp(GETKEY(tb, this->dbterm.tpl),key) ) > 0) { + if (( c = cmp_key(tb,key,key_base,this) ) < 0) { if (this->left == NULL) /* We are at the next and the element does not exist */ break; else this = this->left; - } else if (c < 0) { + } else if (c > 0) { if (this->right == NULL) /* Done */ return this; else @@ -2451,7 +2434,8 @@ static TreeDbTerm *find_next_from_pb_key(DbTableTree *tb, DbTreeStack* stack, return NULL; for (;;) { PUSH_NODE(stack, this); - if (( c = cmp_partly_bound(key,GETKEY(tb, this->dbterm.tpl)) ) >= 0) { + if (( c = cmp_partly_bound(key,GETKEY(tb, this->dbterm.tpl), + this->dbterm.tpl) ) >= 0) { if (this->right == NULL) { do { tmp = POP_NODE(stack); @@ -2484,7 +2468,8 @@ static TreeDbTerm *find_prev_from_pb_key(DbTableTree *tb, DbTreeStack* stack, return NULL; for (;;) { PUSH_NODE(stack, this); - if (( c = cmp_partly_bound(key,GETKEY(tb, this->dbterm.tpl)) ) <= 0) { + if (( c = cmp_partly_bound(key,GETKEY(tb, this->dbterm.tpl), + this->dbterm.tpl) ) <= 0) { if (this->left == NULL) { do { tmp = POP_NODE(stack); @@ -2514,12 +2499,11 @@ static TreeDbTerm *find_node(DbTableTree *tb, Eterm key) Sint res; DbTreeStack* stack = get_static_stack(tb); - if(!stack || EMPTY_NODE(stack) - || !CMP_EQ(GETKEY(tb, ( this = TOP_NODE(stack) )->dbterm.tpl), key)) { + if(!stack || EMPTY_NODE(stack) + || !cmp_key_eq(tb, key, NULL, (this=TOP_NODE(stack)))) { this = tb->root; - while (this != NULL && - ( res = cmp(key, GETKEY(tb, this->dbterm.tpl)) ) != 0) { + while (this != NULL && (res = cmp_key(tb,key,NULL,this)) != 0) { if (res < 0) this = this->left; else @@ -2541,8 +2525,7 @@ static TreeDbTerm **find_node2(DbTableTree *tb, Eterm key) Sint res; this = &tb->root; - while ((*this) != NULL && - ( res = cmp(key, GETKEY(tb, (*this)->dbterm.tpl)) ) != 0) { + while ((*this) != NULL && (res = cmp_key(tb, key, NULL, *this)) != 0) { if (res < 0) this = &((*this)->left); else @@ -2565,6 +2548,9 @@ static int db_lookup_dbterm_tree(DbTable *tbl, Eterm key, DbUpdateHandle* handle handle->mustResize = 0; handle->bp = (void**) pp; handle->new_size = (*pp)->dbterm.size; + #if HALFWORD_HEAP + handle->new_tuple = handle->dbterm->tpl; + #endif return 1; } @@ -2589,7 +2575,7 @@ static void db_finalize_dbterm_tree(DbUpdateHandle* handle) */ static void traverse_backwards(DbTableTree *tb, DbTreeStack* stack, - Eterm lastkey, + Eterm lastkey, Eterm* lk_base, int (*doit)(DbTableTree *, TreeDbTerm *, void *, @@ -2608,15 +2594,16 @@ static void traverse_backwards(DbTableTree *tb, this = this->right; } this = TOP_NODE(stack); - next = find_prev(tb, stack, GETKEY(tb, this->dbterm.tpl)); + next = find_prev(tb, stack, GETKEY(tb, this->dbterm.tpl), + this->dbterm.tpl); if (!((*doit)(tb, this, context, 0))) return; } else { - next = find_prev(tb, stack, lastkey); + next = find_prev(tb, stack, lastkey, lk_base); } while ((this = next) != NULL) { - next = find_prev(tb, stack, GETKEY(tb, this->dbterm.tpl)); + next = find_prev(tb, stack, GETKEY(tb, this->dbterm.tpl), this->dbterm.tpl); if (!((*doit)(tb, this, context, 0))) return; } @@ -2627,7 +2614,7 @@ static void traverse_backwards(DbTableTree *tb, */ static void traverse_forward(DbTableTree *tb, DbTreeStack* stack, - Eterm lastkey, + Eterm lastkey, Eterm* lk_base, int (*doit)(DbTableTree *, TreeDbTerm *, void *, @@ -2646,15 +2633,15 @@ static void traverse_forward(DbTableTree *tb, this = this->left; } this = TOP_NODE(stack); - next = find_next(tb, stack, GETKEY(tb, this->dbterm.tpl)); + next = find_next(tb, stack, GETKEY(tb, this->dbterm.tpl), this->dbterm.tpl); if (!((*doit)(tb, this, context, 1))) return; } else { - next = find_next(tb, stack, lastkey); + next = find_next(tb, stack, lastkey, lk_base); } while ((this = next) != NULL) { - next = find_next(tb, stack, GETKEY(tb, this->dbterm.tpl)); + next = find_next(tb, stack, GETKEY(tb, this->dbterm.tpl), this->dbterm.tpl); if (!((*doit)(tb, this, context, 1))) return; } @@ -2680,7 +2667,7 @@ static int key_given(DbTableTree *tb, Eterm pattern, TreeDbTerm **ret, if (( this = find_node(tb, key) ) == NULL) { return -1; } - *ret = this; + *ret = this; return 1; } else if (partly_bound != NULL && key != am_Underscore && db_is_variable(key) < 0) @@ -2691,7 +2678,7 @@ static int key_given(DbTableTree *tb, Eterm pattern, TreeDbTerm **ret, -static Sint do_cmp_partly_bound(Eterm a, Eterm b, int *done) +static Sint do_cmp_partly_bound(Eterm a, Eterm b, Eterm* b_base, int *done) { Eterm* aa; Eterm* bb; @@ -2705,44 +2692,44 @@ static Sint do_cmp_partly_bound(Eterm a, Eterm b, int *done) *done = 1; return 0; } - if (a == b) + if (is_same(a,NULL,b,b_base)) return 0; switch (a & _TAG_PRIMARY_MASK) { case TAG_PRIMARY_LIST: if (!is_list(b)) { - return cmp(a,b); + return cmp_rel(a,NULL,b,b_base); } aa = list_val(a); - bb = list_val(b); + bb = list_val_rel(b,b_base); while (1) { - if ((j = do_cmp_partly_bound(*aa++, *bb++, done)) != 0 || *done) + if ((j = do_cmp_partly_bound(*aa++, *bb++, b_base, done)) != 0 || *done) return j; if (*aa==*bb) return 0; if (is_not_list(*aa) || is_not_list(*bb)) - return do_cmp_partly_bound(*aa, *bb, done); + return do_cmp_partly_bound(*aa, *bb, b_base, done); aa = list_val(*aa); - bb = list_val(*bb); + bb = list_val_rel(*bb,b_base); } case TAG_PRIMARY_BOXED: if ((b & _TAG_PRIMARY_MASK) != TAG_PRIMARY_BOXED) { - return cmp(a,b); + return cmp_rel(a,NULL,b,b_base); } a_hdr = ((*boxed_val(a)) & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE; - b_hdr = ((*boxed_val(b)) & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE; + b_hdr = ((*boxed_val_rel(b,b_base)) & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE; if (a_hdr != b_hdr) { - return cmp(a, b); + return cmp_rel(a, NULL, b, b_base); } if (a_hdr == (_TAG_HEADER_ARITYVAL >> _TAG_PRIMARY_SIZE)) { aa = tuple_val(a); - bb = tuple_val(b); + bb = tuple_val_rel(b, b_base); /* compare the arities */ i = arityval(*aa); /* get the arity*/ if (i < arityval(*bb)) return(-1); if (i > arityval(*bb)) return(1); while (i--) { - if ((j = do_cmp_partly_bound(*++aa, *++bb, done)) != 0 + if ((j = do_cmp_partly_bound(*++aa, *++bb, b_base, done)) != 0 || *done) return j; } @@ -2750,14 +2737,14 @@ static Sint do_cmp_partly_bound(Eterm a, Eterm b, int *done) } /* Drop through */ default: - return cmp(a, b); + return cmp_rel(a, NULL, b, b_base); } } -static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key) +static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key, Eterm* bk_base) { int done = 0; - Sint ret = do_cmp_partly_bound(partly_bound_key, bound_key, &done); + Sint ret = do_cmp_partly_bound(partly_bound_key, bound_key, bk_base, &done); #ifdef HARDDEBUG erts_fprintf(stderr,"\ncmp_partly_bound: %T", partly_bound_key); if (ret < 0) @@ -2766,7 +2753,7 @@ static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key) erts_fprintf(stderr," > "); else erts_fprintf(stderr," == "); - erts_fprintf(stderr,"%T\n",bound_key); + erts_fprintf(stderr,"%T\n",bound_key); // SVERK: printing rterm #endif return ret; } @@ -2853,7 +2840,7 @@ static int do_partly_bound_can_match_lesser(Eterm a, Eterm b, if (not_eq_tags(a,b)) { *done = 1; - return (cmp(a, b) < 0) ? 1 : 0; + return (CMP(a, b) < 0) ? 1 : 0; } /* we now know that tags are the same */ @@ -2889,7 +2876,7 @@ static int do_partly_bound_can_match_lesser(Eterm a, Eterm b, bb = list_val(*bb); } default: - if((i = cmp(a, b)) != 0) { + if((i = CMP(a, b)) != 0) { *done = 1; } return (i < 0) ? 1 : 0; @@ -2924,7 +2911,7 @@ static int do_partly_bound_can_match_greater(Eterm a, Eterm b, if (not_eq_tags(a,b)) { *done = 1; - return (cmp(a, b) > 0) ? 1 : 0; + return (CMP(a, b) > 0) ? 1 : 0; } /* we now know that tags are the same */ @@ -2960,7 +2947,7 @@ static int do_partly_bound_can_match_greater(Eterm a, Eterm b, bb = list_val(*bb); } default: - if((i = cmp(a, b)) != 0) { + if((i = CMP(a, b)) != 0) { *done = 1; } return (i > 0) ? 1 : 0; @@ -2983,12 +2970,12 @@ static int doit_select(DbTableTree *tb, TreeDbTerm *this, void *ptr, if (sc->end_condition != NIL && ((forward && cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) < 0) || + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) < 0) || (!forward && cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) > 0))) { + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) > 0))) { return 0; } ret = db_prog_match_and_copy(&tb->common,sc->p,sc->mp,sc->all_objects, @@ -3020,8 +3007,8 @@ static int doit_select_count(DbTableTree *tb, TreeDbTerm *this, void *ptr, /* Always backwards traversing */ if (sc->end_condition != NIL && (cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) > 0)) { + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) > 0)) { return 0; } ret = db_prog_match_and_copy(&tb->common, sc->p, sc->mp, 0, @@ -3047,12 +3034,12 @@ static int doit_select_chunk(DbTableTree *tb, TreeDbTerm *this, void *ptr, if (sc->end_condition != NIL && ((forward && cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) < 0) || + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) < 0) || (!forward && cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) > 0))) { + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) > 0))) { return 0; } @@ -3090,14 +3077,14 @@ static int doit_select_delete(DbTableTree *tb, TreeDbTerm *this, void *ptr, if (sc->end_condition != NIL && cmp_partly_bound(sc->end_condition, - GETKEY_WITH_POS(sc->keypos, - this->dbterm.tpl)) > 0) + GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), + this->dbterm.tpl) > 0) return 0; ret = db_prog_match_and_copy(&tb->common, sc->p, sc->mp, 0, &this->dbterm, NULL, 0); if (ret == am_true) { key = GETKEY(sc->tb, this->dbterm.tpl); - linkout_tree(sc->tb, key); + linkout_tree(sc->tb, key, this->dbterm.tpl); sc->erase_lastterm = 1; ++sc->accum; } diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 2852fb93fe..cff208ffa7 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -422,9 +422,10 @@ get_match_pseudo_process(Process *c_p, Uint heap_size) mpsp = match_pseudo_process; cleanup_match_pseudo_process(mpsp, 0); #endif - if (heap_size > ERTS_DEFAULT_MS_HEAP_SIZE) + if (heap_size > ERTS_DEFAULT_MS_HEAP_SIZE) { mpsp->heap = (Eterm *) erts_alloc(ERTS_ALC_T_DB_MS_RUN_HEAP, heap_size*sizeof(Uint)); + } else { ASSERT(mpsp->heap == &mpsp->default_heap[0]); } @@ -467,23 +468,6 @@ erts_match_set_release_result(Process* c_p) static erts_smp_atomic_t trace_control_word; - -Eterm -erts_ets_copy_object(Eterm obj, Process* to) -{ - Uint size = size_object(obj); - Eterm* hp = HAlloc(to, size); - Eterm res; - - res = copy_struct(obj, size, &hp, &MSO(to)); -#ifdef DEBUG - if (eq(obj, res) == 0) { - erl_exit(1, "copy not equal to source\n"); - } -#endif - return res; -} - /* This needs to be here, before the bif table... */ static Eterm db_set_trace_control_word_fake_1(Process *p, Eterm val); @@ -1609,7 +1593,7 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) /* ** Execution of the match program, this is Pam. ** May return THE_NON_VALUE, which is a bailout. -** the para meter 'arity' is only used if 'term' is actually an array, +** the parameter 'arity' is only used if 'term' is actually an array, ** i.e. 'DCOMP_TRACE' was specified */ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, @@ -1639,6 +1623,7 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, Eterm (*bif)(Process*, ...); int fail_label; int atomic_trace; + Eterm* base = is_immed(term) ? NULL : termp; #ifdef DMC_DEBUG Uint *heap_fence; Uint *eheap_fence; @@ -1646,6 +1631,8 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, Uint save_op; #endif /* DMC_DEBUG */ + ASSERT(base==NULL); // SVERK: base not used for now, maybe remove + mpsp = get_match_pseudo_process(c_p, prog->heap_size); psp = &mpsp->process; @@ -1740,9 +1727,9 @@ restart: hp[n] = dpm_array_to_list(psp, termp, arity); break; case matchTuple: /* *ep is a tuple of arity n */ - if (!is_tuple(*ep)) + if (!is_tuple_rel(*ep,base)) FAIL(); - ep = tuple_val(*ep); + ep = tuple_val_rel(*ep,base); n = *pc++; if (arityval(*ep) != n) FAIL(); @@ -1750,9 +1737,9 @@ restart: break; case matchPushT: /* *ep is a tuple of arity n, push ptr to first element */ - if (!is_tuple(*ep)) + if (!is_tuple_rel(*ep,base)) FAIL(); - tp = tuple_val(*ep); + tp = tuple_val_rel(*ep,base); n = *pc++; if (arityval(*tp) != n) FAIL(); @@ -1762,12 +1749,12 @@ restart: case matchList: if (!is_list(*ep)) FAIL(); - ep = list_val(*ep); + ep = list_val_rel(*ep,base); break; case matchPushL: if (!is_list(*ep)) FAIL(); - *sp++ = list_val(*ep); + *sp++ = list_val_rel(*ep,base); ++ep; break; case matchPop: @@ -1779,37 +1766,37 @@ restart: break; case matchCmp: n = *pc++; - if (!eq(hp[n],*ep)) + if (!eq_rel(hp[n],*ep,base)) FAIL(); ++ep; break; case matchEqBin: t = (Eterm) *pc++; - if (!eq(*ep,t)) + if (!eq_rel(t,*ep,base)) FAIL(); ++ep; break; case matchEqFloat: - if (!is_float(*ep)) + if (!is_float_rel(*ep,base)) FAIL(); - if (memcmp(float_val(*ep) + 1, pc, sizeof(double))) + if (memcmp(float_val_rel(*ep,base) + 1, pc, sizeof(double))) FAIL(); pc += TermWords(2); ++ep; break; case matchEqRef: - if (!is_ref(*ep)) + if (!is_ref_rel(*ep,base)) FAIL(); - if (!eq(*ep, make_internal_ref((Uint *) pc))) + if (!eq_rel(make_internal_ref((Uint *) pc), *ep, base)) FAIL(); i = thing_arityval(*((Uint *) pc)); pc += TermWords(i+1); ++ep; break; case matchEqBig: - if (!is_big(*ep)) + if (!is_big_rel(*ep,base)) FAIL(); - tp = big_val(*ep); + tp = big_val_rel(*ep,base); { Eterm *epc = (Eterm *) pc; if (*tp != *epc) @@ -1825,7 +1812,8 @@ restart: ++ep; break; case matchEq: - t = (Eterm) *pc++; + t = (Eterm) *pc++; + ASSERT(is_immed(t)); if (t != *ep++) FAIL(); break; @@ -1909,7 +1897,8 @@ restart: *esp++ = hp[*pc++]; break; case matchPushExpr: - *esp++ = term; + ASSERT(is_tuple_rel(term,base)); + *esp++ = make_tuple(tuple_val_rel(term,base)); break; case matchPushArrayAsList: n = arity; /* Only happens when 'term' is an array */ @@ -2327,13 +2316,13 @@ void db_free_dmc_err_info(DMCErrInfo *ei){ ** Store bignum in *hpp and increase *hpp accordingly. ** *hpp is assumed to be large enough to hold the result. */ -Eterm db_add_counter(Eterm** hpp, Eterm counter, Eterm incr) +Eterm db_add_counter(Eterm** hpp, Wterm counter, Eterm incr) { DeclareTmpHeapNoproc(big_tmp,2); Eterm res; Sint ires; - Eterm arg1; - Eterm arg2; + Wterm arg1; + Wterm arg2; if (is_both_small(counter,incr)) { ires = signed_val(counter) + signed_val(incr); @@ -2374,6 +2363,44 @@ Eterm db_add_counter(Eterm** hpp, Eterm counter, Eterm incr) } } +/* Must be called to read elements after db_lookup_dbterm. +** Will decompress if needed. +** HEALFWORD_HEAP: Will convert from relative to Wterm format if needed. +*/ +Wterm db_do_read_element(DbUpdateHandle* handle, Sint position) +{ +#if HALFWORD_HEAP + Eterm elem = handle->new_tuple[position]; + Eterm* base = handle->dbterm->tpl; + + if (elem == THE_NON_VALUE) { + elem = handle->dbterm->tpl[position]; + ASSERT(is_value(elem)); + } + else if (handle->new_tuple != handle->dbterm->tpl + || handle->tb->common.compress) { + base = NULL; + } + if (!is_header(elem)) { + return is_immed(elem) ? elem : rterm2wterm(elem, base); + } +#else + Eterm elem = handle->dbterm->tpl[position]; + if (!is_header(elem)) { + return elem; + } +#endif + + ASSERT(((DbTableCommon*)handle->tb)->compress); + ASSERT(!handle->mustResize); + handle->dbterm = db_alloc_tmp_uncompressed((DbTableCommon*)handle->tb, handle->dbterm); + handle->mustResize = 1; +#if HALFWORD_HEAP + handle->new_tuple = handle->dbterm->tpl; +#endif + return handle->dbterm->tpl[position]; +} + /* ** Update one element: ** handle: Initialized by db_lookup_dbterm() @@ -2385,6 +2412,61 @@ void db_do_update_element(DbUpdateHandle* handle, Sint position, Eterm newval) { +#if HALFWORD_HEAP + Eterm oldval = handle->new_tuple[position]; + Eterm* old_base; + Uint newval_sz; + Uint oldval_sz; + + if (is_both_immed(newval,oldval)) { + handle->new_tuple[position] = newval; +#ifdef DEBUG_CLONE + if (handle->dbterm->debug_clone) { + handle->dbterm->debug_clone[position] = newval; + } +#endif + return; + } + + if (handle->tb->common.compress) { + if (!handle->mustResize) { + handle->dbterm = db_alloc_tmp_uncompressed(&handle->tb->common, + handle->dbterm); + handle->mustResize = 1; + handle->new_tuple = handle->dbterm->tpl; + oldval = handle->dbterm->tpl[position]; + } + old_base = NULL; + } + else { + if (handle->new_tuple == handle->dbterm->tpl) { + int i = header_arity(handle->new_tuple[0]); + handle->new_tuple = erts_alloc(ERTS_ALC_T_TMP, (i+1)*sizeof(Eterm)); + handle->new_tuple[0] = handle->dbterm->tpl[0]; + for ( ; i ; i--) { + handle->new_tuple[i] = THE_NON_VALUE; + } + } + if (handle->new_tuple[position] == THE_NON_VALUE) { + oldval = handle->dbterm->tpl[position]; + old_base = handle->dbterm->tpl; + } + else { + old_base = NULL; + } + } + oldval_sz = is_immed(oldval) ? 0 : size_object_rel(oldval,old_base); + newval_sz = is_immed(newval) ? 0 : size_object(newval); + + handle->new_size = handle->new_size - oldval_sz + newval_sz; + + /* write new value in old dbterm, finalize will make a flat copy */ + handle->new_tuple[position] = newval; + handle->mustResize = 1; + + +#else /****** !HALFWORD_HEAP ******/ + Eterm oldval = handle->dbterm->tpl[position]; Eterm* newp; Eterm* oldp; @@ -2425,7 +2507,7 @@ void db_do_update_element(DbUpdateHandle* handle, oldval_sz = header_arity(*oldp) + 1; if (oldval_sz == newval_sz) { /* "self contained" terms of same size, do memcpy */ - sys_memcpy(oldp, newp, newval_sz*sizeof(Eterm)); + sys_memcpy(oldp, newp, newval_sz*sizeof(Eterm)); return; } goto both_size_set; @@ -2440,7 +2522,7 @@ void db_do_update_element(DbUpdateHandle* handle, newval_sz = is_immed(newval) ? 0 : size_object(newval); new_size_set: - + oldval_sz = is_immed(oldval) ? 0 : size_object(oldval); both_size_set: @@ -2449,6 +2531,7 @@ both_size_set: /* write new value in old dbterm, finalize will make a flat copy */ handle->dbterm->tpl[position] = newval; handle->mustResize = 1; +#endif /* !HALFWORD_HEAP */ } static ERTS_INLINE byte* db_realloc_term(DbTableCommon* tb, void* old, @@ -2547,7 +2630,7 @@ static void* copy_to_comp(DbTableCommon* tb, Eterm obj, DbTerm* dest, tpl[arity + 1] = alloc_size; tmp_offheap.first = NULL; - tpl[tb->keypos] = copy_struct(key, size_object(key), &top.ep, &tmp_offheap); + tpl[tb->keypos] = copy_struct_rel(key, size_object(key), &top.ep, &tmp_offheap, NULL, tpl); dest->first_oh = tmp_offheap.first; for (i=1; i<=arity; i++) { if (i != tb->keypos) { @@ -2566,7 +2649,7 @@ static void* copy_to_comp(DbTableCommon* tb, Eterm obj, DbTerm* dest, Eterm* dbg_top = erts_alloc(ERTS_ALC_T_DB_TERM, dest->size * sizeof(Eterm)); dest->debug_clone = dbg_top; tmp_offheap.first = dest->first_oh; - copy_struct(obj, dest->size, &dbg_top, &tmp_offheap); + copy_struct_rel(obj, dest->size, &dbg_top, &tmp_offheap, NULL, dbg_top); dest->first_oh = tmp_offheap.first; ASSERT(dbg_top == dest->debug_clone + dest->size); } @@ -2613,7 +2696,7 @@ void* db_store_term(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj) newp->size = size; top = newp->tpl; tmp_offheap.first = NULL; - copy_struct(obj, size, &top, &tmp_offheap); + copy_struct_rel(obj, size, &top, &tmp_offheap, NULL, top); newp->first_oh = tmp_offheap.first; #ifdef DEBUG_CLONE newp->debug_clone = NULL; @@ -2652,7 +2735,7 @@ void* db_store_term_comp(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj) top = copy_to_comp(tb, obj, newp, new_sz); ASSERT(top <= basep + new_sz); - // SVERK: realloc? + /* ToDo: Maybe realloc if ((basep+new_sz) - top) > WASTED_SPACE_LIMIT */ return basep; } @@ -2660,6 +2743,66 @@ void* db_store_term_comp(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj) void db_finalize_resize(DbUpdateHandle* handle, Uint offset) { +#if HALFWORD_HEAP + DbTable* tbl = handle->tb; + DbTerm* newDbTerm; + Uint alloc_sz = offset + + (tbl->common.compress ? + db_size_dbterm_comp(&tbl->common, make_tuple(handle->dbterm->tpl)) : + sizeof(DbTerm)+sizeof(Eterm)*(handle->new_size-1)); + byte* newp = erts_db_alloc(ERTS_ALC_T_DB_TERM, tbl, alloc_sz); + byte* oldp = *(handle->bp); + + sys_memcpy(newp, oldp, offset); /* copy only hash/tree header */ + *(handle->bp) = newp; + newDbTerm = (DbTerm*) (newp + offset); + newDbTerm->size = handle->new_size; + + /* make a flat copy */ + + if (tbl->common.compress) { + copy_to_comp(&tbl->common, make_tuple(handle->dbterm->tpl), + newDbTerm, alloc_sz); + db_free_tmp_uncompressed(handle->dbterm); + } + else { + ErlOffHeap tmp_offheap; + int i, arity = header_arity(handle->dbterm->tpl[0]); + Eterm* top = newDbTerm->tpl + arity + 1; + + ASSERT(handle->new_tuple != handle->dbterm->tpl); + tmp_offheap.first = NULL; + + newDbTerm->tpl[0] = handle->dbterm->tpl[0]; + for (i=1; i<=arity; i++) { + Eterm* tpl; + Eterm* src_base; + + + if (handle->new_tuple[i] == THE_NON_VALUE) { + tpl = handle->dbterm->tpl; + src_base = tpl; + } + else { + tpl = handle->new_tuple; + src_base = NULL; + } + newDbTerm->tpl[i] = copy_struct_rel(tpl[i], + size_object_rel(tpl[i],src_base), + &top, &tmp_offheap, src_base, + newDbTerm->tpl); + } + + newDbTerm->first_oh = tmp_offheap.first; +#ifdef DEBUG_CLONE + newDbTerm->debug_clone = NULL; +#endif + ASSERT((byte*)top <= (newp + alloc_sz)); + ASSERT(handle->new_tuple != handle->dbterm->tpl); + erts_free(ERTS_ALC_T_TMP, handle->new_tuple); + } + +#else /***** !HALFWORD_HEAP *****/ DbTable* tbl = handle->tb; DbTerm* newDbTerm; Uint alloc_sz = offset + @@ -2694,6 +2837,7 @@ void db_finalize_resize(DbUpdateHandle* handle, Uint offset) #endif ASSERT((byte*)top <= (newp + alloc_sz)); } +#endif } Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, @@ -2705,9 +2849,9 @@ Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, hp[0] = bp->tpl[0]; *hpp += arity + 1; - hp[tb->keypos] = copy_struct(bp->tpl[tb->keypos], - size_object(bp->tpl[tb->keypos]), - hpp, off_heap); + hp[tb->keypos] = copy_struct_rel(bp->tpl[tb->keypos], + size_object_rel(bp->tpl[tb->keypos], bp->tpl), + hpp, off_heap, bp->tpl, NULL); for (i=arity; i>0; i--) { if (i != tb->keypos) { if (is_immed(bp->tpl[i])) { @@ -2721,7 +2865,7 @@ Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, } ASSERT((*hpp - hp) <= bp->size); #ifdef DEBUG_CLONE - ASSERT(eq(make_tuple(hp),make_tuple(bp->debug_clone))); + ASSERT(eq_rel(make_tuple(hp),make_tuple(bp->debug_clone),bp->debug_clone)); #endif return make_tuple(hp); } @@ -2744,14 +2888,14 @@ Eterm db_copy_element_from_ets(DbTableCommon* tb, Process* p, hp += extra; HRelease(p, endp, hp); #ifdef DEBUG_CLONE - ASSERT(eq(copy,obj->debug_clone[pos])); + ASSERT(eq_rel(copy, obj->debug_clone[pos], obj->debug_clone)); #endif return copy; } else { - Uint sz = size_object(obj->tpl[pos]); + Uint sz = size_object_rel(obj->tpl[pos], obj->tpl); *hpp = HAlloc(p, sz + extra); - return copy_struct(obj->tpl[pos], sz, hpp, &MSO(p)); + return copy_struct_rel(obj->tpl[pos], sz, hpp, &MSO(p), obj->tpl, NULL); } } @@ -2765,7 +2909,7 @@ void db_cleanup_offheap_comp(DbTerm* obj) ProcBin tmp; for (u.hdr = obj->first_oh; u.hdr; u.hdr = u.hdr->next) { - if ((UWord)u.voidp % sizeof(UWord) != 0) { /* unaligned ptr */ + if ((UWord)u.voidp % sizeof(Uint) != 0) { /* unaligned ptr */ sys_memcpy(&tmp, u.voidp, sizeof(tmp)); /* Warning, must pass (void*)-variable to memcpy. Otherwise it will cause Bus error on Sparc due to false compile time assumptions @@ -4744,6 +4888,23 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, if (tb->compress) { obj = db_alloc_tmp_uncompressed(tb, obj); } +#if HALFWORD_HEAP + else { // SVERK: Heavy solution; make tmp copy + ErlOffHeap tmp_offheap; + Eterm* hp; + DbTerm* tmp = erts_alloc(ERTS_ALC_T_TMP, + sizeof(DbTerm) + obj->size*sizeof(Eterm)); + hp = tmp->tpl; + tmp_offheap.first = NULL; + copy_shallow_rel(obj->tpl, obj->size, &hp, &tmp_offheap, obj->tpl); + tmp->size = obj->size; + tmp->first_oh = tmp_offheap.first; + #ifdef DEBUG_CLONE + tmp->debug_clone = NULL; + #endif + obj = tmp; + } +#endif res = db_prog_match(c_p, bprog, make_tuple(obj->tpl), NULL, 0, &dummy); @@ -4762,6 +4923,9 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, if (tb->compress) { db_free_tmp_uncompressed(obj); } +#if HALFWORD_HEAP + else db_free_tmp_uncompressed(obj); // SVERK misleading name +#endif return res; } diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 58ad39d772..600110e745 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -86,6 +86,9 @@ typedef struct { Uint new_size; int mustResize; void* lck; +#if HALFWORD_HEAP + Eterm* new_tuple; +#endif } DbUpdateHandle; @@ -255,7 +258,14 @@ typedef struct db_table_common { #define NFIXED(T) (erts_refc_read(&(T)->common.ref,0)) #define IS_FIXED(T) (NFIXED(T) != 0) -Eterm erts_ets_copy_object(Eterm, Process*); +/* + * tplp is an untagged pointer to a tuple we know is large enough + * and dth is a pointer to a DbTableHash. + */ +#define GETKEY(dth, tplp) (*((tplp) + ((DbTableCommon*)(dth))->keypos)) + + +ERTS_GLB_INLINE Eterm db_copy_key(Process* p, DbTable* tb, DbTerm* obj); Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, ErlOffHeap* off_heap); int db_eq_comp(DbTableCommon* tb, Eterm a, DbTerm* b); @@ -264,9 +274,23 @@ DbTerm* db_alloc_tmp_uncompressed(DbTableCommon* tb, DbTerm* org); ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, ErlOffHeap* off_heap); ERTS_GLB_INLINE int db_eq(DbTableCommon* tb, Eterm a, DbTerm* b); -ERTS_GLB_INLINE Eterm db_do_read_element(DbUpdateHandle* handle, Sint position); +Wterm db_do_read_element(DbUpdateHandle* handle, Sint position); #if ERTS_GLB_INLINE_INCL_FUNC_DEF + +ERTS_GLB_INLINE Eterm db_copy_key(Process* p, DbTable* tb, DbTerm* obj) +{ + Eterm key = GETKEY(tb, obj->tpl); + if IS_CONST(key) return key; + else { + Uint size = size_object_rel(key, obj->tpl); + Eterm* hp = HAlloc(p, size); + Eterm res = copy_struct_rel(key, size, &hp, &MSO(p), obj->tpl, NULL); + ASSERT(eq_rel(res,key,obj->tpl)); + return res; + } +} + ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, ErlOffHeap* off_heap) { @@ -274,49 +298,27 @@ ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp, return db_copy_from_comp(tb, bp, hpp, off_heap); } else { - return copy_shallow(bp->tpl, bp->size, hpp, off_heap); + return copy_shallow_rel(bp->tpl, bp->size, hpp, off_heap, bp->tpl); } } ERTS_GLB_INLINE int db_eq(DbTableCommon* tb, Eterm a, DbTerm* b) { if (!tb->compress) { - return eq(a, make_tuple(b->tpl)); + return eq_rel(a, make_tuple_rel(b->tpl,b->tpl), b->tpl); } else { return db_eq_comp(tb, a, b); } } -/* Must be called to read elements after db_lookup_dbterm. -** Will decompress if needed. */ -ERTS_GLB_INLINE Eterm db_do_read_element(DbUpdateHandle* handle, Sint position) -{ - Eterm elem = handle->dbterm->tpl[position]; - if (!is_header(elem)) { - return elem; - } - ASSERT(((DbTableCommon*)handle->tb)->compress); - ASSERT(!handle->mustResize); - handle->dbterm = db_alloc_tmp_uncompressed((DbTableCommon*)handle->tb, handle->dbterm); - handle->mustResize = 1; - return handle->dbterm->tpl[position]; -} - #endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */ -/* optimised version of copy_object (normal case? atomic object) */ -#define COPY_OBJECT(obj, p, objp) \ - if (IS_CONST(obj)) { *(objp) = (obj); } \ - else { *objp = erts_ets_copy_object(obj, p); } #define DB_READ (DB_PROTECTED|DB_PUBLIC) #define DB_WRITE DB_PUBLIC #define DB_INFO (DB_PROTECTED|DB_PUBLIC|DB_PRIVATE) -/* tb is an DbTableCommon and obj is an Eterm (tagged) */ -#define TERM_GETKEY(tb, obj) db_getkey((tb)->common.keypos, (obj)) - #define ONLY_WRITER(P,T) (((T)->common.status & (DB_PRIVATE|DB_PROTECTED)) \ && (T)->common.owner == (P)->id) @@ -337,12 +339,11 @@ Eterm db_copy_element_from_ets(DbTableCommon* tb, Process* p, DbTerm* obj, Uint pos, Eterm** hpp, Uint extra); int db_has_variable(Eterm obj); int db_is_variable(Eterm obj); -Eterm db_do_read_element(DbUpdateHandle* handle, Sint position); void db_do_update_element(DbUpdateHandle* handle, Sint position, Eterm newval); void db_finalize_resize(DbUpdateHandle* handle, Uint offset); -Eterm db_add_counter(Eterm** hpp, Eterm counter, Eterm incr); +Eterm db_add_counter(Eterm** hpp, Wterm counter, Eterm incr); Eterm db_match_set_lint(Process *p, Eterm matchexpr, Uint flags); Binary *db_match_set_compile(Process *p, Eterm matchexpr, Uint flags); diff --git a/erts/emulator/beam/erl_monitors.c b/erts/emulator/beam/erl_monitors.c index d873c7a701..9dff157411 100644 --- a/erts/emulator/beam/erl_monitors.c +++ b/erts/emulator/beam/erl_monitors.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2004-2009. All Rights Reserved. + * Copyright Ericsson AB 2004-2010. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -85,7 +85,7 @@ static ERTS_INLINE int cmp_mon_ref(Eterm ref1, Eterm ref2) if (is_ref_thing_header(*b2)) { return 1; } - return cmp(ref1,ref2); + return CMP(ref1,ref2); } #define CP_LINK_VAL(To, Hp, From) \ @@ -380,7 +380,7 @@ int erts_add_link(ErtsLink **root, Uint type, Eterm pid) state = 1; *this = create_link(type,pid); break; - } else if ((c = cmp(pid,(*this)->pid)) < 0) { + } else if ((c = CMP(pid,(*this)->pid)) < 0) { /* go left */ dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; @@ -415,7 +415,7 @@ erts_add_or_lookup_suspend_monitor(ErtsSuspendMonitor **root, Eterm pid) state = 1; res = *this = create_suspend_monitor(pid); break; - } else if ((c = cmp(pid,(*this)->pid)) < 0) { + } else if ((c = CMP(pid,(*this)->pid)) < 0) { /* go left */ dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; @@ -453,7 +453,7 @@ ErtsLink *erts_add_or_lookup_link(ErtsLink **root, Uint type, Eterm pid) *this = create_link(type,pid); ret = *this; break; - } else if ((c = cmp(pid,(*this)->pid)) < 0) { + } else if ((c = CMP(pid,(*this)->pid)) < 0) { /* go left */ dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; @@ -663,7 +663,7 @@ ErtsLink *erts_remove_link(ErtsLink **root, Eterm pid) for (;;) { if (!*this) { /* Failure */ return NULL; - } else if ((c = cmp(pid,(*this)->pid)) < 0) { + } else if ((c = CMP(pid,(*this)->pid)) < 0) { dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; this = &((*this)->left); @@ -715,7 +715,7 @@ erts_delete_suspend_monitor(ErtsSuspendMonitor **root, Eterm pid) for (;;) { if (!*this) { /* Nothing found */ return; - } else if ((c = cmp(pid,(*this)->pid)) < 0) { + } else if ((c = CMP(pid,(*this)->pid)) < 0) { dstack[dpos++] = DIR_LEFT; tstack[tpos++] = this; this = &((*this)->left); @@ -771,7 +771,7 @@ ErtsLink *erts_lookup_link(ErtsLink *root, Eterm pid) Sint c; for (;;) { - if (root == NULL || (c = cmp(pid,root->pid)) == 0) { + if (root == NULL || (c = CMP(pid,root->pid)) == 0) { return root; } else if (c < 0) { root = root->left; @@ -787,7 +787,7 @@ erts_lookup_suspend_monitor(ErtsSuspendMonitor *root, Eterm pid) Sint c; for (;;) { - if (root == NULL || (c = cmp(pid,root->pid)) == 0) { + if (root == NULL || (c = CMP(pid,root->pid)) == 0) { return root; } else if (c < 0) { root = root->left; diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index a680097c2d..b3f0b17ce4 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -574,7 +574,7 @@ int enif_is_identical(Eterm lhs, Eterm rhs) int enif_compare(Eterm lhs, Eterm rhs) { - return cmp(lhs,rhs); + return CMP(lhs,rhs); } int enif_get_tuple(ErlNifEnv* env, Eterm tpl, int* arity, const Eterm** array) diff --git a/erts/emulator/beam/erl_node_container_utils.h b/erts/emulator/beam/erl_node_container_utils.h index ae1316eba2..e06a54477c 100644 --- a/erts/emulator/beam/erl_node_container_utils.h +++ b/erts/emulator/beam/erl_node_container_utils.h @@ -255,19 +255,32 @@ extern int erts_use_r9_pids_ports; #define internal_ref_no_of_numbers(x) \ (internal_ref_data((x))[0]) +#define internal_thing_ref_no_of_numbers(thing) \ + (internal_thing_ref_data(thing)[0]) #define internal_ref_numbers(x) \ (&internal_ref_data((x))[1]) +#define internal_thing_ref_numbers(thing) \ + (&internal_thing_ref_data(thing)[1]) #define external_ref_no_of_numbers(x) \ (external_ref_data((x))[0]) +#define external_thing_ref_no_of_numbers(thing) \ + (external_thing_ref_data(thing)[0]) #define external_ref_numbers(x) \ (&external_ref_data((x))[1]) +#define external_thing_ref_numbers(thing) \ + (&external_thing_ref_data(thing)[1]) + #else #define internal_ref_no_of_numbers(x) (internal_ref_data_words((x))) +#define internal_thing_ref_no_of_numbers(t) (internal_thing_ref_data_words(t)) #define internal_ref_numbers(x) (internal_ref_data((x))) +#define internal_thing_ref_numbers(t) (internal_thing_ref_data(t)) #define external_ref_no_of_numbers(x) (external_ref_data_words((x))) +#define external_thing_ref_no_of_numbers(t) (external_thing_ref_data_words((t))) #define external_ref_numbers(x) (external_ref_data((x))) +#define external_thing_ref_numbers(t) (external_thing_ref_data((t))) #endif @@ -311,6 +324,8 @@ extern int erts_use_r9_pids_ports; : external_ref_channel_no((x))) #define is_ref(x) (is_internal_ref((x)) \ || is_external_ref((x))) +#define is_ref_rel(x,Base) (is_internal_ref_rel((x),Base) \ + || is_external_ref_rel((x),Base)) #define is_not_ref(x) (!is_ref(x)) #endif diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c index c6458a0e45..e4ed685169 100644 --- a/erts/emulator/beam/erl_term.c +++ b/erts/emulator/beam/erl_term.c @@ -58,9 +58,9 @@ do { \ #endif #if ET_DEBUG -unsigned tag_val_def_debug(Eterm x, const char *file, unsigned line) +unsigned tag_val_def_debug(Wterm x, const char *file, unsigned line) #else -unsigned tag_val_def(Eterm x) +unsigned tag_val_def(Wterm x) #define file __FILE__ #define line __LINE__ #endif @@ -125,10 +125,10 @@ FUNTY checked_##FUN(ARGTY x, const char *file, unsigned line) \ ET_DEFINE_CHECKED(Eterm,make_boxed,Eterm*,_is_taggable_pointer); ET_DEFINE_CHECKED(int,is_boxed,Eterm,!is_header); -ET_DEFINE_CHECKED(Eterm*,boxed_val,Eterm,_boxed_precond); +ET_DEFINE_CHECKED(Eterm*,boxed_val,Wterm,_boxed_precond); ET_DEFINE_CHECKED(Eterm,make_list,Eterm*,_is_taggable_pointer); ET_DEFINE_CHECKED(int,is_not_list,Eterm,!is_header); -ET_DEFINE_CHECKED(Eterm*,list_val,Eterm,_list_precond); +ET_DEFINE_CHECKED(Eterm*,list_val,Wterm,_list_precond); ET_DEFINE_CHECKED(Uint,unsigned_val,Eterm,is_small); ET_DEFINE_CHECKED(Sint,signed_val,Eterm,is_small); ET_DEFINE_CHECKED(Uint,atom_val,Eterm,is_atom); @@ -136,34 +136,35 @@ ET_DEFINE_CHECKED(Uint,header_arity,Eterm,is_header); ET_DEFINE_CHECKED(Uint,arityval,Eterm,is_arity_value); ET_DEFINE_CHECKED(Uint,thing_arityval,Eterm,is_thing); ET_DEFINE_CHECKED(Uint,thing_subtag,Eterm,is_thing); -ET_DEFINE_CHECKED(Eterm*,binary_val,Eterm,is_binary); -ET_DEFINE_CHECKED(Eterm*,fun_val,Eterm,is_fun); +ET_DEFINE_CHECKED(Eterm*,binary_val,Wterm,is_binary); +ET_DEFINE_CHECKED(Eterm*,fun_val,Wterm,is_fun); ET_DEFINE_CHECKED(int,bignum_header_is_neg,Eterm,_is_bignum_header); ET_DEFINE_CHECKED(Eterm,bignum_header_neg,Eterm,_is_bignum_header); ET_DEFINE_CHECKED(Uint,bignum_header_arity,Eterm,_is_bignum_header); -ET_DEFINE_CHECKED(Eterm*,big_val,Eterm,is_big); -ET_DEFINE_CHECKED(Eterm*,float_val,Eterm,is_float); -ET_DEFINE_CHECKED(Eterm*,tuple_val,Eterm,is_tuple); +ET_DEFINE_CHECKED(Eterm*,big_val,Wterm,is_big); +ET_DEFINE_CHECKED(Eterm*,float_val,Wterm,is_float); +ET_DEFINE_CHECKED(Eterm*,tuple_val,Wterm,is_tuple); ET_DEFINE_CHECKED(Uint,internal_pid_data,Eterm,is_internal_pid); ET_DEFINE_CHECKED(struct erl_node_*,internal_pid_node,Eterm,is_internal_pid); ET_DEFINE_CHECKED(Uint,internal_port_data,Eterm,is_internal_port); ET_DEFINE_CHECKED(struct erl_node_*,internal_port_node,Eterm,is_internal_port); -ET_DEFINE_CHECKED(Eterm*,internal_ref_val,Eterm,is_internal_ref); -ET_DEFINE_CHECKED(Uint,internal_ref_data_words,Eterm,is_internal_ref); -ET_DEFINE_CHECKED(Uint32*,internal_ref_data,Eterm,is_internal_ref); +ET_DEFINE_CHECKED(Eterm*,internal_ref_val,Wterm,is_internal_ref); +ET_DEFINE_CHECKED(Uint,internal_ref_data_words,Wterm,is_internal_ref); +ET_DEFINE_CHECKED(Uint32*,internal_ref_data,Wterm,is_internal_ref); ET_DEFINE_CHECKED(struct erl_node_*,internal_ref_node,Eterm,is_internal_ref); -ET_DEFINE_CHECKED(Eterm*,external_val,Eterm,is_external); -ET_DEFINE_CHECKED(Uint,external_data_words,Eterm,is_external); -ET_DEFINE_CHECKED(Uint,external_pid_data_words,Eterm,is_external_pid); -ET_DEFINE_CHECKED(Uint,external_pid_data,Eterm,is_external_pid); -ET_DEFINE_CHECKED(struct erl_node_*,external_pid_node,Eterm,is_external_pid); -ET_DEFINE_CHECKED(Uint,external_port_data_words,Eterm,is_external_port); -ET_DEFINE_CHECKED(Uint,external_port_data,Eterm,is_external_port); -ET_DEFINE_CHECKED(struct erl_node_*,external_port_node,Eterm,is_external_port); -ET_DEFINE_CHECKED(Uint,external_ref_data_words,Eterm,is_external_ref); -ET_DEFINE_CHECKED(Uint32*,external_ref_data,Eterm,is_external_ref); +ET_DEFINE_CHECKED(Eterm*,external_val,Wterm,is_external); +ET_DEFINE_CHECKED(Uint,external_data_words,Wterm,is_external); +ET_DEFINE_CHECKED(Uint,external_pid_data_words,Wterm,is_external_pid); +ET_DEFINE_CHECKED(Uint,external_pid_data,Wterm,is_external_pid); +ET_DEFINE_CHECKED(struct erl_node_*,external_pid_node,Wterm,is_external_pid); +ET_DEFINE_CHECKED(Uint,external_port_data_words,Wterm,is_external_port); +ET_DEFINE_CHECKED(Uint,external_port_data,Wterm,is_external_port); +ET_DEFINE_CHECKED(struct erl_node_*,external_port_node,Wterm,is_external_port); +ET_DEFINE_CHECKED(Uint,external_ref_data_words,Wterm,is_external_ref); +ET_DEFINE_CHECKED(Uint32*,external_ref_data,Wterm,is_external_ref); ET_DEFINE_CHECKED(struct erl_node_*,external_ref_node,Eterm,is_external_ref); -ET_DEFINE_CHECKED(Eterm*,export_val,Eterm,is_export); +ET_DEFINE_CHECKED(Eterm*,export_val,Wterm,is_export); +ET_DEFINE_CHECKED(Uint,external_thing_data_words,ExternalThing*,is_thing_ptr); ET_DEFINE_CHECKED(Eterm,make_cp,UWord *,_is_taggable_pointer); ET_DEFINE_CHECKED(UWord *,cp_val,Eterm,is_CP); diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index 815cc1beae..1225b6a944 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -22,6 +22,8 @@ #include "sys.h" /* defines HALFWORD_HEAP */ +typedef UWord Wterm; /* Full word terms */ + #if HALFWORD_HEAP # define HEAP_ON_C_STACK 0 # if HALFWORD_ASSERT @@ -204,7 +206,7 @@ _ET_DECLARE_CHECKED(int,is_boxed,Eterm) #define is_boxed(x) (((x) & _TAG_PRIMARY_MASK) == TAG_PRIMARY_BOXED) #endif #define _unchecked_boxed_val(x) ((Eterm*) EXPAND_POINTER(((x) - TAG_PRIMARY_BOXED))) -_ET_DECLARE_CHECKED(Eterm*,boxed_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,boxed_val,Wterm) #define boxed_val(x) _ET_APPLY(boxed_val,(x)) /* cons cell ("list") access methods */ @@ -226,7 +228,7 @@ _ET_DECLARE_CHECKED(int,is_not_list,Eterm) #define _list_precond(x) (is_list(x)) #endif #define _unchecked_list_val(x) ((Eterm*) EXPAND_POINTER((x) - TAG_PRIMARY_LIST)) -_ET_DECLARE_CHECKED(Eterm*,list_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,list_val,Wterm) #define list_val(x) _ET_APPLY(list_val,(x)) #define CONS(hp, car, cdr) \ @@ -240,6 +242,8 @@ _ET_DECLARE_CHECKED(Eterm*,list_val,Eterm) #define ptr_val(x) _unchecked_ptr_val((x)) /*XXX*/ #define _unchecked_offset_ptr(x,offs) ((x)+((offs)*sizeof(Eterm))) #define offset_ptr(x,offs) _unchecked_offset_ptr(x,offs) /*XXX*/ +#define _unchecked_byte_offset_ptr(x,byte_offs) ((x)+(offs)) +#define byte_offset_ptr(x,offs) _unchecked_byte_offset_ptr(x,offs) /*XXX*/ /* fixnum ("small") access methods */ #if defined(ARCH_64) && !HALFWORD_HEAP @@ -305,6 +309,7 @@ _ET_DECLARE_CHECKED(Uint,arityval,Eterm) /* thing access methods */ #define is_thing(x) (is_header((x)) && header_is_thing((x))) +#define is_thing_ptr(t) (is_thing((t)->header)) #define _unchecked_thing_arityval(x) _unchecked_header_arity((x)) _ET_DECLARE_CHECKED(Uint,thing_arityval,Eterm) #define thing_arityval(x) _ET_APPLY(thing_arityval,(x)) @@ -339,7 +344,7 @@ _ET_DECLARE_CHECKED(Uint,thing_subtag,Eterm) #define is_binary(x) (is_boxed((x)) && is_binary_header(*boxed_val((x)))) #define is_not_binary(x) (!is_binary((x))) #define _unchecked_binary_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,binary_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,binary_val,Wterm) #define binary_val(x) _ET_APPLY(binary_val,(x)) /* process binaries stuff (special case of binaries) */ @@ -354,17 +359,19 @@ _ET_DECLARE_CHECKED(Eterm*,binary_val,Eterm) #define is_fun_header(x) ((x) == HEADER_FUN) #define make_fun(x) make_boxed((Eterm*)(x)) #define is_fun(x) (is_boxed((x)) && is_fun_header(*boxed_val((x)))) +#define is_fun_rel(x,Base) (is_boxed((x)) && is_fun_header(*boxed_val_rel((x),Base))) #define is_not_fun(x) (!is_fun((x))) #define _unchecked_fun_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,fun_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,fun_val,Wterm) #define fun_val(x) _ET_APPLY(fun_val,(x)) /* export access methods */ #define make_export(x) make_boxed((x)) #define is_export(x) (is_boxed((x)) && is_export_header(*boxed_val((x)))) +#define is_export_rel(x,Base) (is_boxed((x)) && is_export_header(*boxed_val_rel((x),Base))) #define is_not_export(x) (!is_export((x))) #define _unchecked_export_val(x) _unchecked_boxed_val(x) -_ET_DECLARE_CHECKED(Eterm*,export_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,export_val,Wterm) #define export_val(x) _ET_APPLY(export_val,(x)) #define is_export_header(x) ((x) == HEADER_EXPORT) #if HALFWORD_HEAP @@ -389,9 +396,10 @@ _ET_DECLARE_CHECKED(Uint,bignum_header_arity,Eterm) #define BIG_ARITY_MAX ((1 << 19)-1) #define make_big(x) make_boxed((x)) #define is_big(x) (is_boxed((x)) && _is_bignum_header(*boxed_val((x)))) +#define is_big_rel(x,Base) (is_boxed((x)) && _is_bignum_header(*boxed_val_rel((x),Base))) #define is_not_big(x) (!is_big((x))) #define _unchecked_big_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,big_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,big_val,Wterm) #define big_val(x) _ET_APPLY(big_val,(x)) /* flonum ("float") access methods */ @@ -402,9 +410,10 @@ _ET_DECLARE_CHECKED(Eterm*,big_val,Eterm) #endif #define make_float(x) make_boxed((x)) #define is_float(x) (is_boxed((x)) && *boxed_val((x)) == HEADER_FLONUM) +#define is_float_rel(x,Base) (is_boxed((x)) && *boxed_val_rel((x),Base) == HEADER_FLONUM) #define is_not_float(x) (!is_float(x)) #define _unchecked_float_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,float_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,float_val,Wterm) #define float_val(x) _ET_APPLY(float_val,(x)) /* Float definition for byte and word access */ @@ -422,15 +431,16 @@ typedef union float_def } FloatDef; #if defined(ARCH_64) && !HALFWORD_HEAP -#define GET_DOUBLE(x, f) (f).fdw = *(float_val(x)+1) + +#define FLOAT_VAL_GET_DOUBLE(fval, f) (f).fdw = *((fval)+1) #define PUT_DOUBLE(f, x) *(x) = HEADER_FLONUM, \ *((x)+1) = (f).fdw #define GET_DOUBLE_DATA(p, f) (f).fdw = *((Uint *) (p)) #define PUT_DOUBLE_DATA(f,p) *((Uint *) (p)) = (f).fdw #else -#define GET_DOUBLE(x, f) (f).fw[0] = *(float_val(x)+1), \ - (f).fw[1] = *(float_val(x)+2) +#define FLOAT_VAL_GET_DOUBLE(fval, f) (f).fw[0] = *((fval)+1), \ + (f).fw[1] = *((fval)+2) #define PUT_DOUBLE(f, x) *(x) = HEADER_FLONUM, \ *((x)+1) = (f).fw[0], \ @@ -440,18 +450,23 @@ typedef union float_def #define PUT_DOUBLE_DATA(f,p) *((Uint *) (p)) = (f).fw[0],\ *(((Uint *) (p))+1) = (f).fw[1] #endif + +#define GET_DOUBLE(x, f) FLOAT_VAL_GET_DOUBLE(float_val(x),f) +#define GET_DOUBLE_REL(x, f, Base) FLOAT_VAL_GET_DOUBLE(float_val_rel(x,Base),f) + #define DOUBLE_DATA_WORDS (sizeof(ieee754_8)/sizeof(Eterm)) #define FLOAT_SIZE_OBJECT (DOUBLE_DATA_WORDS+1) /* tuple access methods */ #define make_tuple(x) make_boxed((x)) #define is_tuple(x) (is_boxed((x)) && is_arity_value(*boxed_val((x)))) +#define is_tuple_rel(x,Base) (is_boxed((x)) && is_arity_value(*boxed_val_rel((x),Base))) #define is_not_tuple(x) (!is_tuple((x))) #define is_tuple_arity(x, a) \ (is_boxed((x)) && *boxed_val((x)) == make_arityval((a))) #define is_not_tuple_arity(x, a) (!is_tuple_arity((x),(a))) #define _unchecked_tuple_val(x) _unchecked_boxed_val(x) -_ET_DECLARE_CHECKED(Eterm*,tuple_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,tuple_val,Wterm) #define tuple_val(x) _ET_APPLY(tuple_val,(x)) #define TUPLE0(t) \ @@ -788,23 +803,30 @@ do { \ ((RefThing*) _unchecked_internal_ref_val(x)) #define ref_thing_ptr(x) \ ((RefThing*) internal_ref_val(x)) +#define ref_thing_ptr_rel(x,Base) \ + ((RefThing*) internal_ref_val_rel(x,Base)) + #define is_internal_ref(x) \ (_unchecked_is_boxed((x)) && is_ref_thing_header(*boxed_val((x)))) +#define is_internal_ref_rel(x,Base) \ + (_unchecked_is_boxed((x)) && is_ref_thing_header(*boxed_val_rel((x),Base))) #define is_not_internal_ref(x) \ (!is_internal_ref((x))) #define _unchecked_internal_ref_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,internal_ref_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,internal_ref_val,Wterm) #define internal_ref_val(x) _ET_APPLY(internal_ref_val,(x)) +#define internal_thing_ref_data_words(t) (thing_arityval(*(Eterm*)(t))) #define _unchecked_internal_ref_data_words(x) \ (_unchecked_thing_arityval(*_unchecked_internal_ref_val(x))) -_ET_DECLARE_CHECKED(Uint,internal_ref_data_words,Eterm) +_ET_DECLARE_CHECKED(Uint,internal_ref_data_words,Wterm) #define internal_ref_data_words(x) _ET_APPLY(internal_ref_data_words,(x)) -#define _unchecked_internal_ref_data(x) (_unchecked_ref_thing_ptr(x)->data.ui32) -_ET_DECLARE_CHECKED(Uint32*,internal_ref_data,Eterm) +#define internal_thing_ref_data(thing) ((thing)->data.ui32) +#define _unchecked_internal_ref_data(x) (internal_thing_ref_data(_unchecked_ref_thing_ptr(x))) +_ET_DECLARE_CHECKED(Uint32*,internal_ref_data,Wterm) #define internal_ref_data(x) _ET_APPLY(internal_ref_data,(x)) #define _unchecked_internal_ref_node(x) erts_this_node @@ -891,12 +913,18 @@ typedef struct external_thing_ { #define is_external(x) \ (is_boxed((x)) && is_external_header(*boxed_val((x)))) +#define is_external_rel(x,Base) \ + (is_boxed((x)) && is_external_header(*boxed_val_rel((x),Base))) #define is_external_pid(x) \ (is_boxed((x)) && is_external_pid_header(*boxed_val((x)))) #define is_external_port(x) \ (is_boxed((x)) && is_external_port_header(*boxed_val((x)))) +#define is_external_port_rel(x,Base) \ + (is_boxed((x)) && is_external_port_header(*boxed_val_rel((x),Base))) #define is_external_ref(x) \ (_unchecked_is_boxed((x)) && is_external_ref_header(*boxed_val((x)))) +#define is_external_ref_rel(x,Base) \ + (_unchecked_is_boxed((x)) && is_external_ref_header(*boxed_val_rel((x),Base))) #define _unchecked_is_external(x) \ (_unchecked_is_boxed((x)) && is_external_header(*_unchecked_boxed_val((x)))) @@ -914,36 +942,43 @@ typedef struct external_thing_ { #define make_external_ref make_external #define _unchecked_external_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,external_val,Eterm) +_ET_DECLARE_CHECKED(Eterm*,external_val,Wterm) #define external_val(x) _ET_APPLY(external_val,(x)) #define external_thing_ptr(x) ((ExternalThing *) external_val((x))) #define _unchecked_external_thing_ptr(x) \ ((ExternalThing *) _unchecked_external_val((x))) +#define _unchecked_external_thing_data_words(thing) \ + (_unchecked_thing_arityval((thing)->header) + (1 - EXTERNAL_THING_HEAD_SIZE)) +_ET_DECLARE_CHECKED(Uint,external_thing_data_words,ExternalThing*) +#define external_thing_data_words(thing) _ET_APPLY(external_thing_data_words,(thing)) + #define _unchecked_external_data_words(x) \ - (_unchecked_thing_arityval(_unchecked_external_thing_ptr((x))->header) \ - + (1 - EXTERNAL_THING_HEAD_SIZE)) -_ET_DECLARE_CHECKED(Uint,external_data_words,Eterm) + _unchecked_external_thing_data_words(_unchecked_external_thing_ptr((x))) +_ET_DECLARE_CHECKED(Uint,external_data_words,Wterm) #define external_data_words(x) _ET_APPLY(external_data_words,(x)) +#define external_data_words_rel(x,Base) \ + external_thing_data_words(external_thing_ptr_rel((x),Base)) #define _unchecked_external_data(x) (_unchecked_external_thing_ptr((x))->data.ui) #define _unchecked_external_node(x) (_unchecked_external_thing_ptr((x))->node) #define external_data(x) (external_thing_ptr((x))->data.ui) #define external_node(x) (external_thing_ptr((x))->node) +#define external_node_rel(x,Base) (external_thing_ptr_rel((x),Base)->node) #define _unchecked_external_pid_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_pid_data_words,Eterm) +_ET_DECLARE_CHECKED(Uint,external_pid_data_words,Wterm) #define external_pid_data_words(x) _ET_APPLY(external_pid_data_words,(x)) #define _unchecked_external_pid_data(x) _unchecked_external_data((x))[0] -_ET_DECLARE_CHECKED(Uint,external_pid_data,Eterm) +_ET_DECLARE_CHECKED(Uint,external_pid_data,Wterm) #define external_pid_data(x) _ET_APPLY(external_pid_data,(x)) #define _unchecked_external_pid_node(x) _unchecked_external_node((x)) -_ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Eterm) +_ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Wterm) #define external_pid_node(x) _ET_APPLY(external_pid_node,(x)) #define external_pid_number(x) _GET_PID_NUM(external_pid_data((x))) @@ -951,27 +986,29 @@ _ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Eterm) #define _unchecked_external_port_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_port_data_words,Eterm) +_ET_DECLARE_CHECKED(Uint,external_port_data_words,Wterm) #define external_port_data_words(x) _ET_APPLY(external_port_data_words,(x)) #define _unchecked_external_port_data(x) _unchecked_external_data((x))[0] -_ET_DECLARE_CHECKED(Uint,external_port_data,Eterm) +_ET_DECLARE_CHECKED(Uint,external_port_data,Wterm) #define external_port_data(x) _ET_APPLY(external_port_data,(x)) #define _unchecked_external_port_node(x) _unchecked_external_node((x)) -_ET_DECLARE_CHECKED(struct erl_node_*,external_port_node,Eterm) +_ET_DECLARE_CHECKED(struct erl_node_*,external_port_node,Wterm) #define external_port_node(x) _ET_APPLY(external_port_node,(x)) #define external_port_number(x) _GET_PORT_NUM(external_port_data((x))) #define _unchecked_external_ref_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_ref_data_words,Eterm) +_ET_DECLARE_CHECKED(Uint,external_ref_data_words,Wterm) #define external_ref_data_words(x) _ET_APPLY(external_ref_data_words,(x)) +#define external_thing_ref_data_words(thing) external_thing_data_words(thing) #define _unchecked_external_ref_data(x) (_unchecked_external_thing_ptr((x))->data.ui32) -_ET_DECLARE_CHECKED(Uint32*,external_ref_data,Eterm) +_ET_DECLARE_CHECKED(Uint32*,external_ref_data,Wterm) #define external_ref_data(x) _ET_APPLY(external_ref_data,(x)) +#define external_thing_ref_data(thing) ((thing)->data.ui32) #define _unchecked_external_ref_node(x) _unchecked_external_node((x)) _ET_DECLARE_CHECKED(struct erl_node_*,external_ref_node,Eterm) @@ -1083,10 +1120,10 @@ _ET_DECLARE_CHECKED(Uint,y_reg_index,Uint) #define SMALL_DEF 0xf #if ET_DEBUG -extern unsigned tag_val_def_debug(Eterm, const char*, unsigned); +extern unsigned tag_val_def_debug(Wterm, const char*, unsigned); #define tag_val_def(x) tag_val_def_debug((x),__FILE__,__LINE__) #else -extern unsigned tag_val_def(Eterm); +extern unsigned tag_val_def(Wterm); #endif #define not_eq_tags(X,Y) (tag_val_def((X)) ^ tag_val_def((Y))) @@ -1102,5 +1139,64 @@ extern unsigned tag_val_def(Eterm); #define FLOAT_BIG _NUMBER_CODE(FLOAT_DEF,BIG_DEF) #define FLOAT_FLOAT _NUMBER_CODE(FLOAT_DEF,FLOAT_DEF) +#if HALFWORD_HEAP +#define ptr2rel(PTR,BASE) ((Eterm*)((char*)(PTR) - (char*)(BASE))) +#define rel2ptr(REL,BASE) ((typeof(REL)) ((UWord)(REL) + (char*)(BASE))) +#define rterm2wterm(REL,BASE) ((Wterm)(REL) + (Wterm)(BASE)) + +#else /* HALFWORD_HEAP */ + +#define ptr2rel(PTR,BASE) (PTR) +#define rel2ptr(REL,BASE) (REL) +#define rterm2wterm(REL,BASE) (REL) + +#endif /* !HALFWORD_HEAP */ + +#define make_list_rel(PTR, BASE) make_list(ptr2rel(PTR,BASE)) +#define make_boxed_rel(PTR, BASE) make_boxed(ptr2rel(PTR,BASE)) +#define make_fun_rel make_boxed_rel +#define make_binary_rel make_boxed_rel +#define make_tuple_rel make_boxed_rel +#define make_external_rel make_boxed_rel + +#define binary_val_rel(RTERM, BASE) binary_val(rterm2wterm(RTERM, BASE)) +#define list_val_rel(RTERM, BASE) list_val(rterm2wterm(RTERM, BASE)) +#define boxed_val_rel(RTERM, BASE) boxed_val(rterm2wterm(RTERM, BASE)) +#define tuple_val_rel(RTERM, BASE) tuple_val(rterm2wterm(RTERM, BASE)) +#define export_val_rel(RTERM, BASE) export_val(rterm2wterm(RTERM, BASE)) +#define fun_val_rel(RTERM, BASE) fun_val(rterm2wterm(RTERM, BASE)) +#define big_val_rel(RTERM,BASE) big_val(rterm2wterm(RTERM,BASE)) +#define float_val_rel(RTERM,BASE) float_val(rterm2wterm(RTERM,BASE)) +#define internal_ref_val_rel(RTERM,BASE) internal_ref_val(rterm2wterm(RTERM,BASE)) + +#define external_thing_ptr_rel(RTERM, BASE) external_thing_ptr(rterm2wterm(RTERM, BASE)) +#define external_port_node_rel(RTERM,BASE) external_port_node(rterm2wterm(RTERM,BASE)) +#define external_port_data_rel(RTERM,BASE) external_port_data(rterm2wterm(RTERM,BASE)) + +#define is_external_pid_rel(RTERM,BASE) is_external_pid(rterm2wterm(RTERM,BASE)) +#define external_pid_node_rel(RTERM,BASE) external_pid_node(rterm2wterm(RTERM,BASE)) +#define external_pid_data_rel(RTERM,BASE) external_pid_data(rterm2wterm(RTERM,BASE)) + +#define is_binary_rel(RTERM,BASE) is_binary(rterm2wterm(RTERM,BASE)) + +#if HALFWORD_HEAP +ERTS_GLB_INLINE int is_same(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base); + +#if ERTS_GLB_INLINE_INCL_FUNC_DEF +ERTS_GLB_INLINE int is_same(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base) +{ + if (a_base == b_base) { + return a == b; + } + /* Assume a and b are on different "heaps", ie can only be same if immed */ + ASSERT(is_immed(a) || is_immed(b) || rterm2wterm(a,a_base) != rterm2wterm(b,b_base)); + return is_immed(a) && a == b; +} +#endif + +#else /* !HALFWORD_HEAP */ +#define is_same(A,A_BASE,B,B_BASE) ((A)==(B)) +#endif + #endif /* __ERL_TERM_H */ diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index e8a9d5f32f..1516d08299 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -890,9 +890,31 @@ void erl_error(char*, va_list); /* copy.c */ void init_copy(void); Eterm copy_object(Eterm, Process*); + +#if HALFWORD_HEAP +Uint size_object_rel(Eterm, Eterm*); +# define size_object(A) size_object_rel(A,NULL) + +Eterm copy_struct_rel(Eterm, Uint, Eterm**, ErlOffHeap*, Eterm* src_base, Eterm* dst_base); +# define copy_struct(OBJ,SZ,HPP,OH) copy_struct_rel(OBJ,SZ,HPP,OH, NULL,NULL) + +Eterm copy_shallow_rel(Eterm*, Uint, Eterm**, ErlOffHeap*, Eterm* src_base); +# define copy_shallow(A,B,C,D) copy_shallow_rel(A,B,C,D,NULL) + +#else /* HALFWORD_HEAP */ + Uint size_object(Eterm); +# define size_object_rel(A,B) size_object(A) + Eterm copy_struct(Eterm, Uint, Eterm**, ErlOffHeap*); +# define copy_struct_rel(OBJ,SZ,HPP,OH, SB,DB) copy_struct(OBJ,SZ,HPP,OH) + Eterm copy_shallow(Eterm*, Uint, Eterm**, ErlOffHeap*); +# define copy_shallow_rel(A,B,C,D, BASE) copy_shallow(A,B,C,D) + +#endif + + void move_multi_frags(Eterm** hpp, ErlOffHeap*, ErlHeapFragment* first, Eterm* refs, unsigned nrefs); @@ -1483,16 +1505,30 @@ void erts_init_utils_mem(void); erts_dsprintf_buf_t *erts_create_tmp_dsbuf(Uint); void erts_destroy_tmp_dsbuf(erts_dsprintf_buf_t *); +#if HALFWORD_HEAP +int eq_rel(Eterm a, Eterm b, Eterm* b_base); +# define eq(A,B) eq_rel(A,B,NULL) +#else int eq(Eterm, Eterm); +# define eq_rel(A,B,B_BASE) eq(A,B) +#endif + #define EQ(x,y) (((x) == (y)) || (is_not_both_immed((x),(y)) && eq((x),(y)))) +#if HALFWORD_HEAP +Sint cmp_rel(Eterm, Eterm*, Eterm, Eterm*); +#define CMP(A,B) cmp_rel(A,NULL,B,NULL) +#else Sint cmp(Eterm, Eterm); -#define cmp_lt(a,b) (cmp((a),(b)) < 0) -#define cmp_le(a,b) (cmp((a),(b)) <= 0) -#define cmp_eq(a,b) (cmp((a),(b)) == 0) -#define cmp_ne(a,b) (cmp((a),(b)) != 0) -#define cmp_ge(a,b) (cmp((a),(b)) >= 0) -#define cmp_gt(a,b) (cmp((a),(b)) > 0) +#define cmp_rel(A,A_BASE,B,B_BASE) cmp(A,B) +#define CMP(A,B) cmp(A,B) +#endif +#define cmp_lt(a,b) (CMP((a),(b)) < 0) +#define cmp_le(a,b) (CMP((a),(b)) <= 0) +#define cmp_eq(a,b) (CMP((a),(b)) == 0) +#define cmp_ne(a,b) (CMP((a),(b)) != 0) +#define cmp_ge(a,b) (CMP((a),(b)) >= 0) +#define cmp_gt(a,b) (CMP((a),(b)) > 0) #define CMP_LT(a,b) ((a) != (b) && cmp_lt((a),(b))) #define CMP_GE(a,b) ((a) == (b) || cmp_ge((a),(b))) diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 1d60b54d21..9cdd46f27a 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -1894,15 +1894,17 @@ erts_destroy_tmp_dsbuf(erts_dsprintf_buf_t *dsbufp) erts_free(ERTS_ALC_T_TMP_DSBUF, (void *) dsbufp); } - /* eq and cmp are written as separate functions a eq is a little faster */ /* * Test for equality of two terms. * Returns 0 if not equal, or a non-zero value otherwise. */ - +#if HALFWORD_HEAP +int eq_rel(Eterm a, Eterm b, Eterm* b_base) +#else int eq(Eterm a, Eterm b) +#endif { DECLARE_WSTACK(stack); Sint sz; @@ -1910,18 +1912,18 @@ int eq(Eterm a, Eterm b) Eterm* bb; tailrecur: - if (a == b) goto pop_next; + if (is_same(a,NULL, b,b_base)) goto pop_next; tailrecur_ne: switch (primary_tag(a)) { case TAG_PRIMARY_LIST: if (is_list(b)) { Eterm* aval = list_val(a); - Eterm* bval = list_val(b); + Eterm* bval = list_val_rel(b, b_base); while (1) { Eterm atmp = CAR(aval); Eterm btmp = CAR(bval); - if (atmp != btmp) { + if (!is_same(atmp,NULL,btmp,b_base)) { WSTACK_PUSH2(stack,(UWord) CDR(bval),(UWord) CDR(aval)); a = atmp; b = btmp; @@ -1929,7 +1931,7 @@ tailrecur_ne: } atmp = CDR(aval); btmp = CDR(bval); - if (atmp == btmp) { + if (is_same(atmp,NULL,btmp,b_base)) { goto pop_next; } if (is_not_list(atmp) || is_not_list(btmp)) { @@ -1938,7 +1940,7 @@ tailrecur_ne: goto tailrecur_ne; } aval = list_val(atmp); - bval = list_val(btmp); + bval = list_val_rel(btmp, b_base); } } break; /* not equal */ @@ -1950,9 +1952,9 @@ tailrecur_ne: case ARITYVAL_SUBTAG: { aa = tuple_val(a); - if (!is_boxed(b) || *boxed_val(b) != *aa) + if (!is_boxed(b) || *boxed_val_rel(b,b_base) != *aa) goto not_equal; - bb = tuple_val(b); + bb = tuple_val_rel(b,b_base); if ((sz = arityval(*aa)) == 0) goto pop_next; ++aa; ++bb; @@ -1971,16 +1973,16 @@ tailrecur_ne: Uint a_bitoffs; Uint b_bitoffs; - if (is_not_binary(b)) { + if (!is_binary_rel(b,b_base)) { goto not_equal; } a_size = binary_size(a); - b_size = binary_size(b); + b_size = binary_size_rel(b,b_base); if (a_size != b_size) { goto not_equal; } ERTS_GET_BINARY_BYTES(a, a_ptr, a_bitoffs, a_bitsize); - ERTS_GET_BINARY_BYTES(b, b_ptr, b_bitoffs, b_bitsize); + ERTS_GET_BINARY_BYTES_REL(b, b_ptr, b_bitoffs, b_bitsize, b_base); if ((a_bitsize | b_bitsize | a_bitoffs | b_bitoffs) == 0) { if (sys_memcmp(a_ptr, b_ptr, a_size) == 0) goto pop_next; } else if (a_bitsize == b_bitsize) { @@ -1991,9 +1993,9 @@ tailrecur_ne: } case EXPORT_SUBTAG: { - if (is_export(b)) { + if (is_export_rel(b,b_base)) { Export* a_exp = *((Export **) (export_val(a) + 1)); - Export* b_exp = *((Export **) (export_val(b) + 1)); + Export* b_exp = *((Export **) (export_val_rel(b,b_base) + 1)); if (a_exp == b_exp) goto pop_next; } break; /* not equal */ @@ -2003,10 +2005,10 @@ tailrecur_ne: ErlFunThing* f1; ErlFunThing* f2; - if (is_not_fun(b)) + if (!is_fun_rel(b,b_base)) goto not_equal; f1 = (ErlFunThing *) fun_val(a); - f2 = (ErlFunThing *) fun_val(b); + f2 = (ErlFunThing *) fun_val_rel(b,b_base); if (f1->fe->module != f2->fe->module || f1->fe->old_index != f2->fe->old_index || f1->fe->old_uniq != f2->fe->old_uniq || @@ -2024,15 +2026,15 @@ tailrecur_ne: ExternalThing *ap; ExternalThing *bp; - if(is_not_external(b)) + if(!is_external_rel(b,b_base)) goto not_equal; ap = external_thing_ptr(a); - bp = external_thing_ptr(b); + bp = external_thing_ptr_rel(b,b_base); if(ap->header == bp->header && ap->node == bp->node) { ASSERT(1 == external_data_words(a)); - ASSERT(1 == external_data_words(b)); + ASSERT(1 == external_data_words_rel(b,b_base)); if (ap->data.ui[0] == bp->data.ui[0]) goto pop_next; } @@ -2050,27 +2052,36 @@ tailrecur_ne: Uint alen; Uint blen; Uint i; + ExternalThing* athing; + ExternalThing* bthing; - if(is_not_external_ref(b)) + if(!is_external_ref_rel(b,b_base)) goto not_equal; - if(external_node(a) != external_node(b)) + athing = external_thing_ptr(a); + bthing = external_thing_ptr_rel(b,b_base); + + if(athing->node != bthing->node) goto not_equal; - anum = external_ref_numbers(a); - bnum = external_ref_numbers(b); - alen = external_ref_no_of_numbers(a); - blen = external_ref_no_of_numbers(b); + anum = external_thing_ref_numbers(athing); + bnum = external_thing_ref_numbers(bthing); + alen = external_thing_ref_no_of_numbers(athing); + blen = external_thing_ref_no_of_numbers(bthing); goto ref_common; case REF_SUBTAG: - - if (is_not_internal_ref(b)) + if (!is_internal_ref_rel(b,b_base)) goto not_equal; - alen = internal_ref_no_of_numbers(a); - blen = internal_ref_no_of_numbers(b); - anum = internal_ref_numbers(a); - bnum = internal_ref_numbers(b); + + { + RefThing* athing = ref_thing_ptr(a); + RefThing* bthing = ref_thing_ptr_rel(b,b_base); + alen = internal_thing_ref_no_of_numbers(athing); + blen = internal_thing_ref_no_of_numbers(bthing); + anum = internal_thing_ref_numbers(athing); + bnum = internal_thing_ref_numbers(bthing); + } ref_common: ASSERT(alen > 0 && blen > 0); @@ -2115,10 +2126,10 @@ tailrecur_ne: { int i; - if (is_not_big(b)) + if (!is_big_rel(b,b_base)) goto not_equal; aa = big_val(a); /* get pointer to thing */ - bb = big_val(b); + bb = big_val_rel(b,b_base); if (*aa != *bb) goto not_equal; i = BIG_ARITY(aa); @@ -2133,9 +2144,9 @@ tailrecur_ne: FloatDef af; FloatDef bf; - if (is_float(b)) { + if (is_float_rel(b,b_base)) { GET_DOUBLE(a, af); - GET_DOUBLE(b, bf); + GET_DOUBLE_REL(b, bf, b_base); if (af.fd == bf.fd) goto pop_next; } break; /* not equal */ @@ -2154,7 +2165,7 @@ term_array: /* arrays in 'aa' and 'bb', length in 'sz' */ Eterm* bp = bb; Sint i = sz; for (;;) { - if (*ap != *bp) break; + if (!is_same(*ap,NULL,*bp,b_base)) break; if (--i == 0) goto pop_next; ++ap; ++bp; @@ -2243,7 +2254,11 @@ static int cmp_atoms(Eterm a, Eterm b) bb->name+3, bb->len-3); } +#if HALFWORD_HEAP +Sint cmp_rel(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base) +#else Sint cmp(Eterm a, Eterm b) +#endif { DECLARE_WSTACK(stack); Eterm* aa; @@ -2277,7 +2292,7 @@ Sint cmp(Eterm a, Eterm b) tailrecur: - if (a == b) { /* Equal values or pointers. */ + if (is_same(a,a_base,b,b_base)) { /* Equal values or pointers. */ goto pop_next; } tailrecur_ne: @@ -2303,9 +2318,9 @@ tailrecur_ne: if (is_internal_port(b)) { bnode = erts_this_node; bdata = internal_port_data(b); - } else if (is_external_port(b)) { - bnode = external_port_node(b); - bdata = external_port_data(b); + } else if (is_external_port_rel(b,b_base)) { + bnode = external_port_node_rel(b,b_base); + bdata = external_port_data_rel(b,b_base); } else { a_tag = PORT_DEF; goto mixed_types; @@ -2321,9 +2336,9 @@ tailrecur_ne: if (is_internal_pid(b)) { bnode = erts_this_node; bdata = internal_pid_data(b); - } else if (is_external_pid(b)) { - bnode = external_pid_node(b); - bdata = external_pid_data(b); + } else if (is_external_pid_rel(b,b_base)) { + bnode = external_pid_node_rel(b,b_base); + bdata = external_pid_data_rel(b,b_base); } else { a_tag = PID_DEF; goto mixed_types; @@ -2356,12 +2371,12 @@ tailrecur_ne: a_tag = LIST_DEF; goto mixed_types; } - aa = list_val(a); - bb = list_val(b); + aa = list_val_rel(a,a_base); + bb = list_val_rel(b,b_base); while (1) { Eterm atmp = CAR(aa); Eterm btmp = CAR(bb); - if (atmp != btmp) { + if (!is_same(atmp,a_base,btmp,b_base)) { WSTACK_PUSH2(stack,(UWord) CDR(bb),(UWord) CDR(aa)); a = atmp; b = btmp; @@ -2369,7 +2384,7 @@ tailrecur_ne: } atmp = CDR(aa); btmp = CDR(bb); - if (atmp == btmp) { + if (is_same(atmp,a_base,btmp,b_base)) { goto pop_next; } if (is_not_list(atmp) || is_not_list(btmp)) { @@ -2377,20 +2392,20 @@ tailrecur_ne: b = btmp; goto tailrecur_ne; } - aa = list_val(atmp); - bb = list_val(btmp); + aa = list_val_rel(atmp,a_base); + bb = list_val_rel(btmp,b_base); } case TAG_PRIMARY_BOXED: { - Eterm ahdr = *boxed_val(a); + Eterm ahdr = *boxed_val_rel(a,a_base); switch ((ahdr & _TAG_HEADER_MASK) >> _TAG_PRIMARY_SIZE) { case (_TAG_HEADER_ARITYVAL >> _TAG_PRIMARY_SIZE): - if (is_not_tuple(b)) { + if (!is_tuple_rel(b,b_base)) { a_tag = TUPLE_DEF; goto mixed_types; } - aa = tuple_val(a); - bb = tuple_val(b); + aa = tuple_val_rel(a,a_base); + bb = tuple_val_rel(b,b_base); /* compare the arities */ i = arityval(ahdr); /* get the arity*/ if (i != arityval(*bb)) { @@ -2404,31 +2419,31 @@ tailrecur_ne: goto term_array; case (_TAG_HEADER_FLOAT >> _TAG_PRIMARY_SIZE): - if (is_not_float(b)) { + if (!is_float_rel(b,b_base)) { a_tag = FLOAT_DEF; goto mixed_types; } else { FloatDef af; FloatDef bf; - GET_DOUBLE(a, af); - GET_DOUBLE(b, bf); + GET_DOUBLE_REL(a, af, a_base); + GET_DOUBLE_REL(b, bf, b_base); ON_CMP_GOTO(float_comp(af.fd, bf.fd)); } case (_TAG_HEADER_POS_BIG >> _TAG_PRIMARY_SIZE): case (_TAG_HEADER_NEG_BIG >> _TAG_PRIMARY_SIZE): - if (is_not_big(b)) { + if (!is_big_rel(b,b_base)) { a_tag = BIG_DEF; goto mixed_types; } - ON_CMP_GOTO(big_comp(a, b)); + ON_CMP_GOTO(big_comp(rterm2wterm(a,a_base), rterm2wterm(b,b_base))); case (_TAG_HEADER_EXPORT >> _TAG_PRIMARY_SIZE): - if (is_not_export(b)) { + if (!is_export_rel(b,b_base)) { a_tag = EXPORT_DEF; goto mixed_types; } else { - Export* a_exp = *((Export **) (export_val(a) + 1)); - Export* b_exp = *((Export **) (export_val(b) + 1)); + Export* a_exp = *((Export **) (export_val_rel(a,a_base) + 1)); + Export* b_exp = *((Export **) (export_val_rel(b,b_base) + 1)); if ((j = cmp_atoms(a_exp->code[0], b_exp->code[0])) != 0) { RETURN_NEQ(j); @@ -2440,12 +2455,12 @@ tailrecur_ne: } break; case (_TAG_HEADER_FUN >> _TAG_PRIMARY_SIZE): - if (is_not_fun(b)) { + if (!is_fun_rel(b,b_base)) { a_tag = FUN_DEF; goto mixed_types; } else { - ErlFunThing* f1 = (ErlFunThing *) fun_val(a); - ErlFunThing* f2 = (ErlFunThing *) fun_val(b); + ErlFunThing* f1 = (ErlFunThing *) fun_val_rel(a,a_base); + ErlFunThing* f2 = (ErlFunThing *) fun_val_rel(b,b_base); Sint diff; diff = cmpbytes(atom_tab(atom_val(f1->fe->module))->name, @@ -2477,51 +2492,57 @@ tailrecur_ne: if (is_internal_pid(b)) { bnode = erts_this_node; bdata = internal_pid_data(b); - } else if (is_external_pid(b)) { - bnode = external_pid_node(b); - bdata = external_pid_data(b); + } else if (is_external_pid_rel(b,b_base)) { + bnode = external_pid_node_rel(b,b_base); + bdata = external_pid_data_rel(b,b_base); } else { a_tag = EXTERNAL_PID_DEF; goto mixed_types; } - anode = external_pid_node(a); - adata = external_pid_data(a); + anode = external_pid_node_rel(a,a_base); + adata = external_pid_data_rel(a,a_base); goto pid_common; case (_TAG_HEADER_EXTERNAL_PORT >> _TAG_PRIMARY_SIZE): if (is_internal_port(b)) { bnode = erts_this_node; bdata = internal_port_data(b); - } else if (is_external_port(b)) { - bnode = external_port_node(b); - bdata = external_port_data(b); + } else if (is_external_port_rel(b,b_base)) { + bnode = external_port_node_rel(b,b_base); + bdata = external_port_data_rel(b,b_base); } else { a_tag = EXTERNAL_PORT_DEF; goto mixed_types; } - anode = external_port_node(a); - adata = external_port_data(a); + anode = external_port_node_rel(a,a_base); + adata = external_port_data_rel(a,a_base); goto port_common; case (_TAG_HEADER_REF >> _TAG_PRIMARY_SIZE): /* * Note! When comparing refs we need to compare ref numbers * (32-bit words), *not* ref data words. */ + - if (is_internal_ref(b)) { + if (is_internal_ref_rel(b,b_base)) { + RefThing* bthing = ref_thing_ptr_rel(b,b_base); bnode = erts_this_node; - bnum = internal_ref_numbers(b); - blen = internal_ref_no_of_numbers(b); - } else if(is_external_ref(b)) { - bnode = external_ref_node(b); - bnum = external_ref_numbers(b); - blen = external_ref_no_of_numbers(b); + bnum = internal_thing_ref_numbers(bthing); + blen = internal_thing_ref_no_of_numbers(bthing); + } else if(is_external_ref_rel(b,b_base)) { + ExternalThing* bthing = external_thing_ptr_rel(b,b_base); + bnode = bthing->node; + bnum = external_thing_ref_numbers(bthing); + blen = external_thing_ref_no_of_numbers(bthing); } else { a_tag = REF_DEF; goto mixed_types; } - anode = erts_this_node; - anum = internal_ref_numbers(a); - alen = internal_ref_no_of_numbers(a); + { + RefThing* athing = ref_thing_ptr_rel(a,a_base); + anode = erts_this_node; + anum = internal_thing_ref_numbers(athing); + alen = internal_thing_ref_no_of_numbers(athing); + } ref_common: CMP_NODES(anode, bnode); @@ -2550,31 +2571,36 @@ tailrecur_ne: RETURN_NEQ((Sint32) (anum[i] - bnum[i])); goto pop_next; case (_TAG_HEADER_EXTERNAL_REF >> _TAG_PRIMARY_SIZE): - if (is_internal_ref(b)) { + if (is_internal_ref_rel(b,b_base)) { + RefThing* bthing = ref_thing_ptr_rel(b,b_base); bnode = erts_this_node; - bnum = internal_ref_numbers(b); - blen = internal_ref_no_of_numbers(b); - } else if (is_external_ref(b)) { - bnode = external_ref_node(b); - bnum = external_ref_numbers(b); - blen = external_ref_no_of_numbers(b); + bnum = internal_thing_ref_numbers(bthing); + blen = internal_thing_ref_no_of_numbers(bthing); + } else if (is_external_ref_rel(b,b_base)) { + ExternalThing* bthing = external_thing_ptr_rel(b,b_base); + bnode = bthing->node; + bnum = external_thing_ref_numbers(bthing); + blen = external_thing_ref_no_of_numbers(bthing); } else { a_tag = EXTERNAL_REF_DEF; goto mixed_types; } - anode = external_ref_node(a); - anum = external_ref_numbers(a); - alen = external_ref_no_of_numbers(a); + { + ExternalThing* athing = external_thing_ptr_rel(a,a_base); + anode = athing->node; + anum = external_thing_ref_numbers(athing); + alen = external_thing_ref_no_of_numbers(athing); + } goto ref_common; default: /* Must be a binary */ - ASSERT(is_binary(a)); - if (is_not_binary(b)) { + ASSERT(is_binary_rel(a,a_base)); + if (!is_binary_rel(b,b_base)) { a_tag = BINARY_DEF; goto mixed_types; } else { - Uint a_size = binary_size(a); - Uint b_size = binary_size(b); + Uint a_size = binary_size_rel(a,a_base); + Uint b_size = binary_size_rel(b,b_base); Uint a_bitsize; Uint b_bitsize; Uint a_bitoffs; @@ -2583,8 +2609,8 @@ tailrecur_ne: int cmp; byte* a_ptr; byte* b_ptr; - ERTS_GET_BINARY_BYTES(a, a_ptr, a_bitoffs, a_bitsize); - ERTS_GET_BINARY_BYTES(b, b_ptr, b_bitoffs, b_bitsize); + ERTS_GET_BINARY_BYTES_REL(a, a_ptr, a_bitoffs, a_bitsize, a_base); + ERTS_GET_BINARY_BYTES_REL(b, b_ptr, b_bitoffs, b_bitsize, b_base); if ((a_bitsize | b_bitsize | a_bitoffs | b_bitoffs) == 0) { min_size = (a_size < b_size) ? a_size : b_size; if ((cmp = sys_memcmp(a_ptr, b_ptr, min_size)) != 0) { @@ -2611,7 +2637,6 @@ tailrecur_ne: */ mixed_types: - b_tag = tag_val_def(b); { FloatDef f1, f2; @@ -2621,39 +2646,47 @@ tailrecur_ne: #else Eterm *big_buf = erts_get_scheduler_data()->cmp_tmp_heap; #endif +#if HALFWORD_HEAP + Wterm aw = is_immed(a) ? a : rterm2wterm(a,a_base); + Wterm bw = is_immed(b) ? b : rterm2wterm(b,b_base); +#else + Eterm aw = a; + Eterm bw = b; +#endif + b_tag = tag_val_def(bw); switch(_NUMBER_CODE(a_tag, b_tag)) { case SMALL_BIG: big = small_to_big(signed_val(a), big_buf); - j = big_comp(big, b); + j = big_comp(big, bw); break; case SMALL_FLOAT: f1.fd = signed_val(a); - GET_DOUBLE(b, f2); + GET_DOUBLE(bw, f2); j = float_comp(f1.fd, f2.fd); break; case BIG_SMALL: big = small_to_big(signed_val(b), big_buf); - j = big_comp(a, big); + j = big_comp(aw, big); break; case BIG_FLOAT: - if (big_to_double(a, &f1.fd) < 0) { + if (big_to_double(aw, &f1.fd) < 0) { j = big_sign(a) ? -1 : 1; } else { - GET_DOUBLE(b, f2); + GET_DOUBLE(bw, f2); j = float_comp(f1.fd, f2.fd); } break; case FLOAT_SMALL: - GET_DOUBLE(a, f1); + GET_DOUBLE(aw, f1); f2.fd = signed_val(b); j = float_comp(f1.fd, f2.fd); break; case FLOAT_BIG: - if (big_to_double(b, &f2.fd) < 0) { + if (big_to_double(bw, &f2.fd) < 0) { j = big_sign(b) ? 1 : -1; } else { - GET_DOUBLE(a, f1); + GET_DOUBLE(aw, f1); j = float_comp(f1.fd, f2.fd); } break; diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index 010d60eb63..bd931cc62b 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -448,6 +448,7 @@ link_cd(cache_desc_t *cd) cache_size++; } +#if CAN_PARTLY_DESTROY static ERTS_INLINE void end_link_cd(cache_desc_t *cd) { @@ -465,6 +466,7 @@ end_link_cd(cache_desc_t *cd) cache_size++; } +#endif static ERTS_INLINE void unlink_cd(cache_desc_t *cd) diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c index 6e9376b0f3..8abf698d4f 100644 --- a/erts/emulator/sys/unix/sys_float.c +++ b/erts/emulator/sys/unix/sys_float.c @@ -36,11 +36,6 @@ erts_sys_init_float(void) # endif } -static ERTS_INLINE void set_current_fp_exception(unsigned long pc) -{ - /* nothing to do */ -} - #else /* !NO_FPE_SIGNALS */ #ifdef ERTS_SMP diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 4e789790f6..a2c19fa10f 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -1391,8 +1391,7 @@ update_element_opts(Tuple,KeyPos,UpdPos,Opts) -> ok. update_element(T,Tuple,KeyPos,UpdPos) -> - KeyList = [Key || Key <- [17,"seventeen",<<"seventeen">>,{17},list_to_binary(lists:seq(1,100)), - make_ref(), self()]], + KeyList = [17,"seventeen",<<"seventeen">>,{17},list_to_binary(lists:seq(1,100)),make_ref(), self()], lists:foreach(fun(Key) -> TupleWithKey = setelement(KeyPos,Tuple,Key), update_element_do(T,TupleWithKey,Key,UpdPos) @@ -1406,6 +1405,8 @@ update_element_do(Tab,Tuple,Key,UpdPos) -> % This will try all combinations of {fromValue,toValue} % % IMPORTANT: size(Values) must be a prime number for this to work!!! + + %io:format("update_element_do for key=~p\n",[Key]), Big32 = 16#12345678, Big64 = 16#123456789abcdef0, Values = { 623, -27, 0, Big32, -Big32, Big64, -Big64, Big32*Big32, @@ -1426,7 +1427,7 @@ update_element_do(Tab,Tuple,Key,UpdPos) -> (ToIx, [], Pos, _Rand, _MeF) -> {Pos, element(ToIx+1,Values)} % single {pos,value} arg end, - + UpdateF = fun(ToIx,Rand) -> PosValArg = PosValArgF(ToIx,[],UpdPos,Rand,PosValArgF), %%io:format("update_element(~p)~n",[PosValArg]), @@ -1553,6 +1554,7 @@ update_counter_for(T) -> (Obj, Times, Arg3, Myself) -> ?line {NewObj, Ret} = uc_mimic(Obj,Arg3), ArgHash = erlang:phash2({T,a,Arg3}), + %%io:format("update_counter(~p, ~p, ~p) expecting ~p\n",[T,a,Arg3,Ret]), ?line Ret = ets:update_counter(T,a,Arg3), ?line ArgHash = erlang:phash2({T,a,Arg3}), %%io:format("NewObj=~p~n ",[NewObj]), @@ -3416,7 +3418,7 @@ firstnext_concurrent(Config) when is_list(Config) -> [dynamic_go() || _ <- lists:seq(1, 2)], receive after 5000 -> ok - end. + end. ets_init(Tab, N) -> ets_new(Tab, [named_table,public,ordered_set]), -- cgit v1.2.3 From 561f6fd2bc8367acd1bceea291303adb18ad0b93 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 10 Dec 2010 10:52:15 +0100 Subject: HALFWORD first stab at high mem alloc --- erts/emulator/beam/erl_alloc.types | 1 + erts/emulator/beam/erl_db.c | 6 +- erts/emulator/sys/common/erl_mseg.c | 475 +++++++++++++++++++++--------------- 3 files changed, 276 insertions(+), 206 deletions(-) diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types index b7b9c6a133..128adcaa8c 100644 --- a/erts/emulator/beam/erl_alloc.types +++ b/erts/emulator/beam/erl_alloc.types @@ -193,6 +193,7 @@ type DB_FIXATION SHORT_LIVED ETS db_fixation type DB_FIX_DEL SHORT_LIVED ETS fixed_del type DB_TABLES LONG_LIVED ETS db_tabs type DB_NTAB_ENT STANDARD ETS db_named_table_entry +type DB_HEIR_DATA STANDARD ETS db_heir_data type DB_TMP TEMPORARY ETS db_tmp type DB_MC_STK TEMPORARY ETS db_mc_stack type DB_MS_PSDO_PROC LONG_LIVED ETS db_match_pseudo_proc diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 3115e647af..f045690060 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -3501,8 +3501,8 @@ static void set_heir(Process* me, DbTable* tb, Eterm heir, UWord heir_data) /* Make a dummy 1-tuple around data to use DbTerm */ wrap_tpl = TUPLE1(tmp,heir_data); size = size_object(wrap_tpl); - // SVERK: Must be low memory - dbterm = erts_db_alloc(ERTS_ALC_T_DB_TERM, (DbTable *)tb, + /* SVERK: Must be low memory due to erts_send_message */ + dbterm = erts_db_alloc(ERTS_ALC_T_DB_HEIR_DATA, (DbTable *)tb, (sizeof(DbTerm) + sizeof(Eterm)*(size-1))); dbterm->size = size; top = dbterm->tpl; @@ -3521,7 +3521,7 @@ static void free_heir_data(DbTable* tb) if (tb->common.heir != am_none && !is_immed(tb->common.heir_data)) { DbTerm* p = (DbTerm*) tb->common.heir_data; db_cleanup_offheap_comp(p); - erts_db_free(ERTS_ALC_T_DB_TERM, tb, (void *)p, + erts_db_free(ERTS_ALC_T_DB_HEIR_DATA, tb, (void *)p, sizeof(DbTerm) + (p->size-1)*sizeof(Eterm)); } #ifdef DEBUG diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index bd931cc62b..00da31332a 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -77,8 +77,10 @@ static int atoms_initialized; static Uint cache_check_interval; +typedef struct mem_kind_t MemKind; + static void check_cache(void *unused); -static void mseg_clear_cache(void); +static void mseg_clear_cache(MemKind*); static int is_cache_check_scheduled; #ifdef ERTS_THREADS_NO_SMP static int is_cache_check_requested; @@ -160,15 +162,43 @@ static struct { CallCounter check_cache; } calls; -static cache_desc_t cache_descs[MAX_CACHE_SIZE]; -static cache_desc_t *free_cache_descs; -static cache_desc_t *cache; -static cache_desc_t *cache_end; -static Uint cache_hits; -static Uint cache_size; -static Uint min_cached_seg_size; -static Uint max_cached_seg_size; +struct mem_kind_t { + cache_desc_t cache_descs[MAX_CACHE_SIZE]; + cache_desc_t *free_cache_descs; + cache_desc_t *cache; + cache_desc_t *cache_end; + + Uint cache_size; + Uint min_cached_seg_size; + Uint max_cached_seg_size; + + struct { + struct { + Uint watermark; + Uint no; + Uint sz; + } current; + struct { + Uint no; + Uint sz; + } max; + struct { + Uint no; + Uint sz; + } max_ever; + } segments; + + MemKind* next; +};/*MemKind*/ + +#if HALFWORD_HEAP +static MemKind low_mem, hi_mem; +#else +static MemKind the_mem; +#endif +static MemKind* mk_list = NULL; +static Uint cache_hits; static Uint max_cache_size; static Uint abs_max_cache_bad_fit; static Uint rel_max_cache_bad_fit; @@ -177,47 +207,32 @@ static Uint rel_max_cache_bad_fit; static Uint min_seg_size; #endif -struct { - struct { - Uint watermark; - Uint no; - Uint sz; - } current; - struct { - Uint no; - Uint sz; - } max; - struct { - Uint no; - Uint sz; - } max_ever; -} segments; -#define ERTS_MSEG_ALLOC_STAT(SZ) \ +#define ERTS_MSEG_ALLOC_STAT(C,SZ) \ do { \ - segments.current.no++; \ - if (segments.max.no < segments.current.no) \ - segments.max.no = segments.current.no; \ - if (segments.current.watermark < segments.current.no) \ - segments.current.watermark = segments.current.no; \ - segments.current.sz += (SZ); \ - if (segments.max.sz < segments.current.sz) \ - segments.max.sz = segments.current.sz; \ + C->segments.current.no++; \ + if (C->segments.max.no < C->segments.current.no) \ + C->segments.max.no = C->segments.current.no; \ + if (C->segments.current.watermark < C->segments.current.no) \ + C->segments.current.watermark = C->segments.current.no; \ + C->segments.current.sz += (SZ); \ + if (C->segments.max.sz < C->segments.current.sz) \ + C->segments.max.sz = C->segments.current.sz; \ } while (0) -#define ERTS_MSEG_DEALLOC_STAT(SZ) \ +#define ERTS_MSEG_DEALLOC_STAT(C,SZ) \ do { \ - ASSERT(segments.current.no > 0); \ - segments.current.no--; \ - ASSERT(segments.current.sz >= (SZ)); \ - segments.current.sz -= (SZ); \ + ASSERT(C->segments.current.no > 0); \ + C->segments.current.no--; \ + ASSERT(C->segments.current.sz >= (SZ)); \ + C->segments.current.sz -= (SZ); \ } while (0) -#define ERTS_MSEG_REALLOC_STAT(OSZ, NSZ) \ +#define ERTS_MSEG_REALLOC_STAT(C,OSZ, NSZ) \ do { \ - ASSERT(segments.current.sz >= (OSZ)); \ - segments.current.sz -= (OSZ); \ - segments.current.sz += (NSZ); \ + ASSERT(C->segments.current.sz >= (OSZ)); \ + C->segments.current.sz -= (OSZ); \ + C->segments.current.sz += (NSZ); \ } while (0) #define ONE_GIGA (1000000000) @@ -303,13 +318,16 @@ check_schedule_cache_check(void) static void mseg_shutdown(void) { + MemKind* mk; erts_mtx_lock(&mseg_mutex); - mseg_clear_cache(); + for (mk=mk_list; mk; mk=mk->next) { + mseg_clear_cache(mk); + } erts_mtx_unlock(&mseg_mutex); } static ERTS_INLINE void * -mseg_create(Uint size) +mseg_create(MemKind* mk, Uint size) { void *seg; @@ -319,19 +337,21 @@ mseg_create(Uint size) seg = erts_sys_alloc(ERTS_ALC_N_INVALID, NULL, size); #elif HAVE_MMAP #if HALFWORD_HEAP - seg = pmmap(size); -#else - seg = (void *) mmap((void *) 0, (size_t) size, - MMAP_PROT, MMAP_FLAGS, MMAP_FD, 0); - if (seg == (void *) MAP_FAILED) - seg = NULL; -#endif -#if HALFWORD_HEAP - if ((unsigned long) seg & CHECK_POINTER_MASK) { - erts_fprintf(stderr,"Pointer mask failure (0x%08lx)\n",(unsigned long) seg); - return NULL; + if (mk == &low_mem) { + seg = pmmap(size); + if ((unsigned long) seg & CHECK_POINTER_MASK) { + erts_fprintf(stderr,"Pointer mask failure (0x%08lx)\n",(unsigned long) seg); + return NULL; + } } + else #endif + { + seg = (void *) mmap((void *) 0, (size_t) size, + MMAP_PROT, MMAP_FLAGS, MMAP_FD, 0); + if (seg == (void *) MAP_FAILED) + seg = NULL; + } #else #error "Missing mseg_create() implementation" #endif @@ -412,136 +432,142 @@ mseg_recreate(void *old_seg, Uint old_size, Uint new_size) static ERTS_INLINE cache_desc_t * -alloc_cd(void) +alloc_cd(MemKind* mk) { - cache_desc_t *cd = free_cache_descs; + cache_desc_t *cd = mk->free_cache_descs; ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); if (cd) - free_cache_descs = cd->next; + mk->free_cache_descs = cd->next; return cd; } static ERTS_INLINE void -free_cd(cache_desc_t *cd) +free_cd(MemKind* mk, cache_desc_t *cd) { ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); - cd->next = free_cache_descs; - free_cache_descs = cd; + cd->next = mk->free_cache_descs; + mk->free_cache_descs = cd; } static ERTS_INLINE void -link_cd(cache_desc_t *cd) +link_cd(MemKind* mk, cache_desc_t *cd) { ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); - if (cache) - cache->prev = cd; - cd->next = cache; + if (mk->cache) + mk->cache->prev = cd; + cd->next = mk->cache; cd->prev = NULL; - cache = cd; + mk->cache = cd; - if (!cache_end) { + if (!mk->cache_end) { ASSERT(!cd->next); - cache_end = cd; + mk->cache_end = cd; } - cache_size++; + mk->cache_size++; } #if CAN_PARTLY_DESTROY static ERTS_INLINE void -end_link_cd(cache_desc_t *cd) +end_link_cd(MemKind* mk, cache_desc_t *cd) { ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); - if (cache_end) - cache_end->next = cd; + if (mk->cache_end) + mk->cache_end->next = cd; cd->next = NULL; - cd->prev = cache_end; - cache_end = cd; + cd->prev = mk->cache_end; + mk->cache_end = cd; - if (!cache) { + if (!mk->cache) { ASSERT(!cd->prev); - cache = cd; + mk->cache = cd; } - cache_size++; + mk->cache_size++; } #endif static ERTS_INLINE void -unlink_cd(cache_desc_t *cd) +unlink_cd(MemKind* mk, cache_desc_t *cd) { ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); if (cd->next) cd->next->prev = cd->prev; else - cache_end = cd->prev; + mk->cache_end = cd->prev; if (cd->prev) cd->prev->next = cd->next; else - cache = cd->next; - ASSERT(cache_size > 0); - cache_size--; + mk->cache = cd->next; + ASSERT(mk->cache_size > 0); + mk->cache_size--; } static ERTS_INLINE void -check_cache_limits(void) +check_cache_limits(MemKind* mk) { cache_desc_t *cd; ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); - max_cached_seg_size = 0; - min_cached_seg_size = ~((Uint) 0); - for (cd = cache; cd; cd = cd->next) { - if (cd->size < min_cached_seg_size) - min_cached_seg_size = cd->size; - if (cd->size > max_cached_seg_size) - max_cached_seg_size = cd->size; + mk->max_cached_seg_size = 0; + mk->min_cached_seg_size = ~((Uint) 0); + for (cd = mk->cache; cd; cd = cd->next) { + if (cd->size < mk->min_cached_seg_size) + mk->min_cached_seg_size = cd->size; + if (cd->size > mk->max_cached_seg_size) + mk->max_cached_seg_size = cd->size; } - } static ERTS_INLINE void -adjust_cache_size(int force_check_limits) +adjust_cache_size(MemKind* mk, int force_check_limits) { cache_desc_t *cd; int check_limits = force_check_limits; - Sint max_cached = ((Sint) segments.current.watermark - - (Sint) segments.current.no); + Sint max_cached = ((Sint) mk->segments.current.watermark + - (Sint) mk->segments.current.no); ERTS_LC_ASSERT(erts_lc_mtx_is_locked(&mseg_mutex)); - while (((Sint) cache_size) > max_cached && ((Sint) cache_size) > 0) { - ASSERT(cache_end); - cd = cache_end; + while (((Sint) mk->cache_size) > max_cached && ((Sint) mk->cache_size) > 0) { + ASSERT(mk->cache_end); + cd = mk->cache_end; if (!check_limits && - !(min_cached_seg_size < cd->size - && cd->size < max_cached_seg_size)) { + !(mk->min_cached_seg_size < cd->size + && cd->size < mk->max_cached_seg_size)) { check_limits = 1; } if (erts_mtrace_enabled) erts_mtrace_crr_free(SEGTYPE, SEGTYPE, cd->seg); mseg_destroy(cd->seg, cd->size); - unlink_cd(cd); - free_cd(cd); + unlink_cd(mk,cd); + free_cd(mk,cd); } if (check_limits) - check_cache_limits(); - + check_cache_limits(mk); } static void -check_cache(void *unused) +check_one_cache(MemKind* mk) { + if (mk->segments.current.watermark > mk->segments.current.no) + mk->segments.current.watermark--; + adjust_cache_size(mk, 0); + + if (mk->cache_size) + schedule_cache_check(); +} + +static void check_cache(void* unused) +{ + MemKind* mk; erts_mtx_lock(&mseg_mutex); is_cache_check_scheduled = 0; - if (segments.current.watermark > segments.current.no) - segments.current.watermark--; - adjust_cache_size(0); - - if (cache_size) - schedule_cache_check(); + for (mk=mk_list; mk; mk=mk->next) { + check_one_cache(mk); + } INC_CC(check_cache); @@ -549,28 +575,37 @@ check_cache(void *unused) } static void -mseg_clear_cache(void) +mseg_clear_cache(MemKind* mk) { - segments.current.watermark = 0; + mk->segments.current.watermark = 0; - adjust_cache_size(1); + adjust_cache_size(mk, 1); - ASSERT(!cache); - ASSERT(!cache_end); - ASSERT(!cache_size); + ASSERT(!mk->cache); + ASSERT(!mk->cache_end); + ASSERT(!mk->cache_size); - segments.current.watermark = segments.current.no; + mk->segments.current.watermark = mk->segments.current.no; INC_CC(clear_cache); } +static ERTS_INLINE MemKind* type2mk(ErtsAlcType_t atype) +{ +#if HALFWORD_HEAP + return (atype == ERTS_ALC_A_ETS) ? &hi_mem : &low_mem; +#else + return &the_mem; +#endif +} + static void * mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) { - Uint max, min, diff_size, size; cache_desc_t *cd, *cand_cd; void *seg; + MemKind* mk = type2mk(atype); INC_CC(alloc); @@ -583,11 +618,11 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) if (!opt->cache) { create_seg: - adjust_cache_size(0); - seg = mseg_create(size); + adjust_cache_size(mk,0); + seg = mseg_create(mk, size); if (!seg) { - mseg_clear_cache(); - seg = mseg_create(size); + mseg_clear_cache(mk); + seg = mseg_create(mk, size); if (!seg) size = 0; } @@ -596,17 +631,17 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) if (seg) { if (erts_mtrace_enabled) erts_mtrace_crr_alloc(seg, atype, ERTS_MTRACE_SEGMENT_ID, size); - ERTS_MSEG_ALLOC_STAT(size); + ERTS_MSEG_ALLOC_STAT(mk,size); } return seg; } - if (size > max_cached_seg_size) + if (size > mk->max_cached_seg_size) goto create_seg; - if (size < min_cached_seg_size) { + if (size < mk->min_cached_seg_size) { - diff_size = min_cached_seg_size - size; + diff_size = mk->min_cached_seg_size - size; if (diff_size > abs_max_cache_bad_fit) goto create_seg; @@ -620,7 +655,7 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) min = ~((Uint) 0); cand_cd = NULL; - for (cd = cache; cd; cd = cd->next) { + for (cd = mk->cache; cd; cd = cd->next) { if (cd->size >= size) { if (!cand_cd) { cand_cd = cd; @@ -641,8 +676,8 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) min = cd->size; } - min_cached_seg_size = min; - max_cached_seg_size = max; + mk->min_cached_seg_size = min; + mk->max_cached_seg_size = max; if (!cand_cd) goto create_seg; @@ -651,10 +686,10 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) if (diff_size > abs_max_cache_bad_fit || 100*PAGES(diff_size) > rel_max_cache_bad_fit*PAGES(size)) { - if (max_cached_seg_size < cand_cd->size) - max_cached_seg_size = cand_cd->size; - if (min_cached_seg_size > cand_cd->size) - min_cached_seg_size = cand_cd->size; + if (mk->max_cached_seg_size < cand_cd->size) + mk->max_cached_seg_size = cand_cd->size; + if (mk->min_cached_seg_size > cand_cd->size) + mk->min_cached_seg_size = cand_cd->size; goto create_seg; } @@ -663,8 +698,8 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) size = cand_cd->size; seg = cand_cd->seg; - unlink_cd(cand_cd); - free_cd(cand_cd); + unlink_cd(mk,cand_cd); + free_cd(mk,cand_cd); *size_p = size; @@ -674,7 +709,7 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) } if (seg) - ERTS_MSEG_ALLOC_STAT(size); + ERTS_MSEG_ALLOC_STAT(mk,size); return seg; } @@ -683,9 +718,10 @@ static void mseg_dealloc(ErtsAlcType_t atype, void *seg, Uint size, const ErtsMsegOpt_t *opt) { + MemKind* mk = type2mk(atype); cache_desc_t *cd; - ERTS_MSEG_DEALLOC_STAT(size); + ERTS_MSEG_DEALLOC_STAT(mk,size); if (!opt->cache || max_cache_size == 0) { if (erts_mtrace_enabled) @@ -695,29 +731,29 @@ mseg_dealloc(ErtsAlcType_t atype, void *seg, Uint size, else { int check_limits = 0; - if (size < min_cached_seg_size) - min_cached_seg_size = size; - if (size > max_cached_seg_size) - max_cached_seg_size = size; - - if (!free_cache_descs) { - cd = cache_end; - if (!(min_cached_seg_size < cd->size - && cd->size < max_cached_seg_size)) { + if (size < mk->min_cached_seg_size) + mk->min_cached_seg_size = size; + if (size > mk->max_cached_seg_size) + mk->max_cached_seg_size = size; + + if (!mk->free_cache_descs) { + cd = mk->cache_end; + if (!(mk->min_cached_seg_size < cd->size + && cd->size < mk->max_cached_seg_size)) { check_limits = 1; } if (erts_mtrace_enabled) erts_mtrace_crr_free(SEGTYPE, SEGTYPE, cd->seg); mseg_destroy(cd->seg, cd->size); - unlink_cd(cd); - free_cd(cd); + unlink_cd(mk,cd); + free_cd(mk,cd); } - cd = alloc_cd(); + cd = alloc_cd(mk); ASSERT(cd); cd->seg = seg; cd->size = size; - link_cd(cd); + link_cd(mk,cd); if (erts_mtrace_enabled) { erts_mtrace_crr_free(atype, SEGTYPE, seg); @@ -727,7 +763,7 @@ mseg_dealloc(ErtsAlcType_t atype, void *seg, Uint size, /* ASSERT(segments.current.watermark >= segments.current.no + cache_size); */ if (check_limits) - check_cache_limits(); + check_cache_limits(mk); schedule_cache_check(); @@ -740,6 +776,7 @@ static void * mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, Uint *new_size_p, const ErtsMsegOpt_t *opt) { + MemKind* mk = type2mk(atype); void *new_seg; Uint new_size; @@ -777,15 +814,15 @@ mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, Uint *new_size_p, #if CAN_PARTLY_DESTROY if (shrink_sz > min_seg_size - && free_cache_descs + && mk->free_cache_descs && opt->cache) { cache_desc_t *cd; - cd = alloc_cd(); + cd = alloc_cd(mk); ASSERT(cd); cd->seg = ((char *) seg) + new_size; cd->size = shrink_sz; - end_link_cd(cd); + end_link_cd(mk,cd); if (erts_mtrace_enabled) { erts_mtrace_crr_realloc(new_seg, @@ -861,7 +898,7 @@ mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, Uint *new_size_p, *new_size_p = new_size; - ERTS_MSEG_REALLOC_STAT(old_size, new_size); + ERTS_MSEG_REALLOC_STAT(mk, old_size, new_size); return new_seg; } @@ -1143,53 +1180,54 @@ info_status(int *print_to_p, Uint *szp) { Eterm res = THE_NON_VALUE; + MemKind* mk = type2mk(0); // SVERK cheat - if (segments.max_ever.no < segments.max.no) - segments.max_ever.no = segments.max.no; - if (segments.max_ever.sz < segments.max.sz) - segments.max_ever.sz = segments.max.sz; + if (mk->segments.max_ever.no < mk->segments.max.no) + mk->segments.max_ever.no = mk->segments.max.no; + if (mk->segments.max_ever.sz < mk->segments.max.sz) + mk->segments.max_ever.sz = mk->segments.max.sz; if (print_to_p) { int to = *print_to_p; void *arg = print_to_arg; - erts_print(to, arg, "cached_segments: %bpu\n", cache_size); + erts_print(to, arg, "cached_segments: %bpu\n", mk->cache_size); erts_print(to, arg, "cache_hits: %bpu\n", cache_hits); erts_print(to, arg, "segments: %bpu %bpu %bpu\n", - segments.current.no, segments.max.no, segments.max_ever.no); + mk->segments.current.no, mk->segments.max.no, mk->segments.max_ever.no); erts_print(to, arg, "segments_size: %bpu %bpu %bpu\n", - segments.current.sz, segments.max.sz, segments.max_ever.sz); + mk->segments.current.sz, mk->segments.max.sz, mk->segments.max_ever.sz); erts_print(to, arg, "segments_watermark: %bpu\n", - segments.current.watermark); + mk->segments.current.watermark); } if (hpp || szp) { res = NIL; add_2tup(hpp, szp, &res, am.segments_watermark, - bld_unstable_uint(hpp, szp, segments.current.watermark)); + bld_unstable_uint(hpp, szp, mk->segments.current.watermark)); add_4tup(hpp, szp, &res, am.segments_size, - bld_unstable_uint(hpp, szp, segments.current.sz), - bld_unstable_uint(hpp, szp, segments.max.sz), - bld_unstable_uint(hpp, szp, segments.max_ever.sz)); + bld_unstable_uint(hpp, szp, mk->segments.current.sz), + bld_unstable_uint(hpp, szp, mk->segments.max.sz), + bld_unstable_uint(hpp, szp, mk->segments.max_ever.sz)); add_4tup(hpp, szp, &res, am.segments, - bld_unstable_uint(hpp, szp, segments.current.no), - bld_unstable_uint(hpp, szp, segments.max.no), - bld_unstable_uint(hpp, szp, segments.max_ever.no)); + bld_unstable_uint(hpp, szp, mk->segments.current.no), + bld_unstable_uint(hpp, szp, mk->segments.max.no), + bld_unstable_uint(hpp, szp, mk->segments.max_ever.no)); add_2tup(hpp, szp, &res, am.cache_hits, bld_unstable_uint(hpp, szp, cache_hits)); add_2tup(hpp, szp, &res, am.cached_segments, - bld_unstable_uint(hpp, szp, cache_size)); + bld_unstable_uint(hpp, szp, mk->cache_size)); } if (begin_new_max_period) { - segments.max.no = segments.current.no; - segments.max.sz = segments.current.sz; + mk->segments.max.no = mk->segments.current.no; + mk->segments.max.sz = mk->segments.current.sz; } return res; @@ -1320,17 +1358,23 @@ erts_mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, void erts_mseg_clear_cache(void) { + MemKind* mk; erts_mtx_lock(&mseg_mutex); - mseg_clear_cache(); + for (mk=mk_list; mk; mk=mk->next) { + mseg_clear_cache(mk); + } erts_mtx_unlock(&mseg_mutex); } Uint erts_mseg_no(void) { - Uint n; + MemKind* mk; + Uint n = 0; erts_mtx_lock(&mseg_mutex); - n = segments.current.no; + for (mk=mk_list; mk; mk=mk->next) { + n += mk->segments.current.no; + } erts_mtx_unlock(&mseg_mutex); return n; } @@ -1341,11 +1385,41 @@ erts_mseg_unit_size(void) return page_size; } -void -erts_mseg_init(ErtsMsegInit_t *init) +static void mem_kind_init(MemKind* mk) { unsigned i; + mk->cache = NULL; + mk->cache_end = NULL; + mk->max_cached_seg_size = 0; + mk->min_cached_seg_size = ~((Uint) 0); + mk->cache_size = 0; + + if (max_cache_size > 0) { + for (i = 0; i < max_cache_size - 1; i++) + mk->cache_descs[i].next = &mk->cache_descs[i + 1]; + mk->cache_descs[max_cache_size - 1].next = NULL; + mk->free_cache_descs = &mk->cache_descs[0]; + } + else + mk->free_cache_descs = NULL; + + mk->segments.current.watermark = 0; + mk->segments.current.no = 0; + mk->segments.current.sz = 0; + mk->segments.max.no = 0; + mk->segments.max.sz = 0; + mk->segments.max_ever.no = 0; + mk->segments.max_ever.sz = 0; + + mk->next = mk_list; + mk_list = mk; +} + + +void +erts_mseg_init(ErtsMsegInit_t *init) +{ atoms_initialized = 0; is_init_done = 0; @@ -1388,40 +1462,35 @@ erts_mseg_init(ErtsMsegInit_t *init) min_seg_size = ~((Uint) 0); #endif - cache = NULL; - cache_end = NULL; + if (max_cache_size > MAX_CACHE_SIZE) + max_cache_size = MAX_CACHE_SIZE; + cache_hits = 0; - max_cached_seg_size = 0; - min_cached_seg_size = ~((Uint) 0); - cache_size = 0; + +#if HALFWORD_HEAP + mem_kind_init(&low_mem); + mem_kind_init(&hi_mem); +#else + mem_kind_init(&the_mem); +#endif is_cache_check_scheduled = 0; #ifdef ERTS_THREADS_NO_SMP is_cache_check_requested = 0; #endif +} - if (max_cache_size > MAX_CACHE_SIZE) - max_cache_size = MAX_CACHE_SIZE; - if (max_cache_size > 0) { - for (i = 0; i < max_cache_size - 1; i++) - cache_descs[i].next = &cache_descs[i + 1]; - cache_descs[max_cache_size - 1].next = NULL; - free_cache_descs = &cache_descs[0]; +static ERTS_INLINE Uint tot_cache_size(void) +{ + MemKind* mk; + Uint sz = 0; + for (mk=mk_list; mk; mk=mk->next) { + sz += mk->cache_size; } - else - free_cache_descs = NULL; - - segments.current.watermark = 0; - segments.current.no = 0; - segments.current.sz = 0; - segments.max.no = 0; - segments.max.sz = 0; - segments.max_ever.no = 0; - segments.max_ever.sz = 0; + return sz; } - /* * erts_mseg_late_init() have to be called after all allocators, * threads and timers have been initialized. @@ -1439,7 +1508,7 @@ erts_mseg_late_init(void) #ifdef ERTS_THREADS_NO_SMP async_handle = handle; #endif - if (cache_size) + if (tot_cache_size()) schedule_cache_check(); erts_mtx_unlock(&mseg_mutex); } @@ -1480,7 +1549,7 @@ erts_mseg_test(unsigned long op, case 0x406: { unsigned long res; erts_mtx_lock(&mseg_mutex); - res = (unsigned long) cache_size; + res = (unsigned long) tot_cache_size(); erts_mtx_unlock(&mseg_mutex); return res; } -- cgit v1.2.3 From 651c99b7aac8ac7ca7f84efa0d3bd3b541d6f3a4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 15 Dec 2010 17:20:46 +0100 Subject: HALFWORD ETS Real matching on relative terms --- erts/emulator/beam/erl_db.c | 2 +- erts/emulator/beam/erl_db_hash.c | 2 +- erts/emulator/beam/erl_db_util.c | 81 +++++++++++++++++++++++----------------- erts/emulator/beam/erl_db_util.h | 7 ++-- erts/emulator/beam/global.h | 8 ++-- erts/emulator/beam/sys.h | 2 + erts/emulator/beam/utils.c | 40 ++++++++++---------- 7 files changed, 78 insertions(+), 64 deletions(-) diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index f045690060..914eedce0c 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -2738,7 +2738,7 @@ BIF_RETTYPE ets_match_spec_run_r_3(BIF_ALIST_3) BIF_TRAP3(bif_export[BIF_ets_match_spec_run_r_3], BIF_P,lst,BIF_ARG_2,ret); } - res = db_prog_match(BIF_P, mp, CAR(list_val(lst)), NULL, 0, &dummy); + res = db_prog_match(BIF_P, mp, CAR(list_val(lst)), NULL, NULL, 0, &dummy); if (is_value(res)) { sz = size_object(res); hp = HAlloc(BIF_P, sz + 2); diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c index ced6629c43..e43e734b27 100644 --- a/erts/emulator/beam/erl_db_hash.c +++ b/erts/emulator/beam/erl_db_hash.c @@ -429,7 +429,7 @@ static ERTS_INLINE void try_shrink(DbTableHash* tb) } #define EQ_REL(x,y,y_base) \ - (is_same(x,NULL,y,y_base) || (is_not_both_immed((x),(y)) && eq_rel((x),(y),y_base))) + (is_same(x,NULL,y,y_base) || (is_not_both_immed((x),(y)) && eq_rel((x),NULL,(y),y_base))) /* Is this a live object (not pseodo-deleted) with the specified key? */ diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index cff208ffa7..be8e10e8f2 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1169,7 +1169,7 @@ Eterm erts_match_set_run(Process *p, Binary *mpsp, Eterm ret; ret = db_prog_match(p, mpsp, - NIL, args, + NIL, NULL, args, num_args, return_flags); #if defined(HARDDEBUG) if (is_non_value(ret)) { @@ -1194,9 +1194,7 @@ static Eterm erts_match_set_run_ets(Process *p, Binary *mpsp, { Eterm ret; - ret = db_prog_match(p, mpsp, - args, NULL, - num_args, return_flags); + ret = db_prog_match(p, mpsp, args, NULL, NULL, num_args, return_flags); #if defined(HARDDEBUG) if (is_non_value(ret)) { erts_fprintf(stderr, "Failed\n"); @@ -1596,7 +1594,8 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) ** the parameter 'arity' is only used if 'term' is actually an array, ** i.e. 'DCOMP_TRACE' was specified */ -Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, +Eterm db_prog_match(Process *c_p, Binary *bprog, + Eterm term, Eterm* base, Eterm *termp, int arity, Uint32 *return_flags) @@ -1623,7 +1622,9 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, Eterm (*bif)(Process*, ...); int fail_label; int atomic_trace; - Eterm* base = is_immed(term) ? NULL : termp; +#if HALFWORD_HEAP + int is_abs_variables = (base == NULL); +#endif #ifdef DMC_DEBUG Uint *heap_fence; Uint *eheap_fence; @@ -1631,8 +1632,6 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, Uint save_op; #endif /* DMC_DEBUG */ - ASSERT(base==NULL); // SVERK: base not used for now, maybe remove - mpsp = get_match_pseudo_process(c_p, prog->heap_size); psp = &mpsp->process; @@ -1693,6 +1692,12 @@ restart: do_catch = 0; fail_label = -1; +#if HALFWORD_HEAP /* clear all variables for matchPushV */ + for (i=prog->eheap_offset-(1+FENCE_PATTERN_SIZE); i>=0; i--) { + hp[i] = NIL; + } +#endif + for (;;) { #ifdef DMC_DEBUG if (*heap_fence != FENCE_PATTERN) { @@ -1761,18 +1766,20 @@ restart: ep = *(--sp); break; case matchBind: + ASSERT_HALFWORD(is_abs_variables == !base); n = *pc++; hp[n] = *ep++; break; case matchCmp: + ASSERT_HALFWORD(is_abs_variables == !base); n = *pc++; - if (!eq_rel(hp[n],*ep,base)) + if (!eq_rel(hp[n],base,*ep,base)) FAIL(); ++ep; break; case matchEqBin: t = (Eterm) *pc++; - if (!eq_rel(t,*ep,base)) + if (!eq_rel(t,NULL,*ep,base)) FAIL(); ++ep; break; @@ -1787,7 +1794,7 @@ restart: case matchEqRef: if (!is_ref_rel(*ep,base)) FAIL(); - if (!eq_rel(make_internal_ref((Uint *) pc), *ep, base)) + if (!eq_rel(make_internal_ref((Uint *) pc), NULL, *ep, base)) FAIL(); i = thing_arityval(*((Uint *) pc)); pc += TermWords(i+1); @@ -1894,11 +1901,31 @@ restart: esp[-1] = t; break; case matchPushV: - *esp++ = hp[*pc++]; + n = *pc++; + #if HALFWORD_HEAP + if (!is_abs_variables && !is_immed(hp[n])) { + for (i=prog->eheap_offset-1; i>=0; i--) if (!is_immed(hp[i])) { + Uint sz = size_object_rel(hp[i], base); + Eterm* top = HAlloc(psp, sz); + hp[i] = copy_struct_rel(hp[i], sz, &top, &MSO(psp), base, NULL); + } + is_abs_variables = 1; + } + #endif + *esp++ = hp[n]; break; case matchPushExpr: ASSERT(is_tuple_rel(term,base)); - *esp++ = make_tuple(tuple_val_rel(term,base)); + #if HALFWORD_HEAP + if (base) { + Uint sz = size_object_rel(term, base); + Eterm* top = HAlloc(psp, sz); + *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, + &top, &MSO(psp), base); + break; + } + #endif + *esp++ = term; break; case matchPushArrayAsList: n = arity; /* Only happens when 'term' is an array */ @@ -4883,35 +4910,22 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, int all, DbTerm* obj, Eterm** hpp, Uint extra) { Uint32 dummy; + Eterm* base; Eterm res; if (tb->compress) { obj = db_alloc_tmp_uncompressed(tb, obj); + base = NULL; } -#if HALFWORD_HEAP - else { // SVERK: Heavy solution; make tmp copy - ErlOffHeap tmp_offheap; - Eterm* hp; - DbTerm* tmp = erts_alloc(ERTS_ALC_T_TMP, - sizeof(DbTerm) + obj->size*sizeof(Eterm)); - hp = tmp->tpl; - tmp_offheap.first = NULL; - copy_shallow_rel(obj->tpl, obj->size, &hp, &tmp_offheap, obj->tpl); - tmp->size = obj->size; - tmp->first_oh = tmp_offheap.first; - #ifdef DEBUG_CLONE - tmp->debug_clone = NULL; - #endif - obj = tmp; - } -#endif + else base = obj->tpl; - res = db_prog_match(c_p, bprog, make_tuple(obj->tpl), NULL, 0, &dummy); + res = db_prog_match(c_p, bprog, make_tuple_rel(obj->tpl,base), base, + NULL, 0, &dummy); if (is_value(res) && hpp!=NULL) { if (all) { *hpp = HAlloc(c_p, obj->size + extra); - res = copy_shallow(obj->tpl, obj->size, hpp, &MSO(c_p)); + res = copy_shallow_rel(obj->tpl, obj->size, hpp, &MSO(c_p), base); } else { Uint sz = size_object(res); @@ -4923,9 +4937,6 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, if (tb->compress) { db_free_tmp_uncompressed(obj); } -#if HALFWORD_HEAP - else db_free_tmp_uncompressed(obj); // SVERK misleading name -#endif return res; } diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 600110e745..30b3eb731d 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -286,7 +286,7 @@ ERTS_GLB_INLINE Eterm db_copy_key(Process* p, DbTable* tb, DbTerm* obj) Uint size = size_object_rel(key, obj->tpl); Eterm* hp = HAlloc(p, size); Eterm res = copy_struct_rel(key, size, &hp, &MSO(p), obj->tpl, NULL); - ASSERT(eq_rel(res,key,obj->tpl)); + ASSERT(eq_rel(res,NULL,key,obj->tpl)); return res; } } @@ -305,7 +305,7 @@ ERTS_GLB_INLINE Eterm db_copy_object_from_ets(DbTableCommon* tb, DbTerm* bp, ERTS_GLB_INLINE int db_eq(DbTableCommon* tb, Eterm a, DbTerm* b) { if (!tb->compress) { - return eq_rel(a, make_tuple_rel(b->tpl,b->tpl), b->tpl); + return eq_rel(a, NULL, make_tuple_rel(b->tpl,b->tpl), b->tpl); } else { return db_eq_comp(tb, a, b); @@ -427,7 +427,8 @@ Binary *db_match_compile(Eterm *matchexpr, Eterm *guards, Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, int all, DbTerm* obj, Eterm** hpp, Uint extra); /* Returns newly allocated MatchProg binary with refc == 0*/ -Eterm db_prog_match(Process *p, Binary *prog, Eterm term, Eterm *termp, int arity, +Eterm db_prog_match(Process *p, Binary *prog, Eterm term, Eterm* base, + Eterm *termp, int arity, Uint32 *return_flags /* Zeroed on enter */); /* returns DB_ERROR_NONE if matches, 1 if not matches and some db error on error. */ diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index 1516d08299..b59f26b2bf 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -901,7 +901,7 @@ Eterm copy_struct_rel(Eterm, Uint, Eterm**, ErlOffHeap*, Eterm* src_base, Eterm* Eterm copy_shallow_rel(Eterm*, Uint, Eterm**, ErlOffHeap*, Eterm* src_base); # define copy_shallow(A,B,C,D) copy_shallow_rel(A,B,C,D,NULL) -#else /* HALFWORD_HEAP */ +#else /* !HALFWORD_HEAP */ Uint size_object(Eterm); # define size_object_rel(A,B) size_object(A) @@ -1506,11 +1506,11 @@ erts_dsprintf_buf_t *erts_create_tmp_dsbuf(Uint); void erts_destroy_tmp_dsbuf(erts_dsprintf_buf_t *); #if HALFWORD_HEAP -int eq_rel(Eterm a, Eterm b, Eterm* b_base); -# define eq(A,B) eq_rel(A,B,NULL) +int eq_rel(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base); +# define eq(A,B) eq_rel(A,NULL,B,NULL) #else int eq(Eterm, Eterm); -# define eq_rel(A,B,B_BASE) eq(A,B) +# define eq_rel(A,A_BASE,B,B_BASE) eq(A,B) #endif #define EQ(x,y) (((x) == (y)) || (is_not_both_immed((x),(y)) && eq((x),(y)))) diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index dff2dc37a2..e36f7cf8cf 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -229,9 +229,11 @@ int real_printf(const char *fmt, ...); # ifdef HALFWORD_HEAP_EMULATOR # define HALFWORD_HEAP 1 # define HALFWORD_ASSERT 0 +# define ASSERT_HALFWORD(COND) ASSERT(COND) # else # define HALFWORD_HEAP 0 # define HALFWORD_ASSERT 0 +# define ASSERT_HALFWORD(COND) # endif #endif diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 9cdd46f27a..2d0155bdf5 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -1901,7 +1901,7 @@ erts_destroy_tmp_dsbuf(erts_dsprintf_buf_t *dsbufp) * Returns 0 if not equal, or a non-zero value otherwise. */ #if HALFWORD_HEAP -int eq_rel(Eterm a, Eterm b, Eterm* b_base) +int eq_rel(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base) #else int eq(Eterm a, Eterm b) #endif @@ -1909,21 +1909,21 @@ int eq(Eterm a, Eterm b) DECLARE_WSTACK(stack); Sint sz; Eterm* aa; - Eterm* bb; + Eterm* bb; tailrecur: - if (is_same(a,NULL, b,b_base)) goto pop_next; + if (is_same(a, a_base, b, b_base)) goto pop_next; tailrecur_ne: switch (primary_tag(a)) { case TAG_PRIMARY_LIST: if (is_list(b)) { - Eterm* aval = list_val(a); + Eterm* aval = list_val_rel(a, a_base); Eterm* bval = list_val_rel(b, b_base); while (1) { Eterm atmp = CAR(aval); Eterm btmp = CAR(bval); - if (!is_same(atmp,NULL,btmp,b_base)) { + if (!is_same(atmp,a_base,btmp,b_base)) { WSTACK_PUSH2(stack,(UWord) CDR(bval),(UWord) CDR(aval)); a = atmp; b = btmp; @@ -1931,7 +1931,7 @@ tailrecur_ne: } atmp = CDR(aval); btmp = CDR(bval); - if (is_same(atmp,NULL,btmp,b_base)) { + if (is_same(atmp,a_base,btmp,b_base)) { goto pop_next; } if (is_not_list(atmp) || is_not_list(btmp)) { @@ -1939,7 +1939,7 @@ tailrecur_ne: b = btmp; goto tailrecur_ne; } - aval = list_val(atmp); + aval = list_val_rel(atmp, a_base); bval = list_val_rel(btmp, b_base); } } @@ -1947,11 +1947,11 @@ tailrecur_ne: case TAG_PRIMARY_BOXED: { - Eterm hdr = *boxed_val(a); + Eterm hdr = *boxed_val_rel(a,a_base); switch (hdr & _TAG_HEADER_MASK) { case ARITYVAL_SUBTAG: { - aa = tuple_val(a); + aa = tuple_val_rel(a, a_base); if (!is_boxed(b) || *boxed_val_rel(b,b_base) != *aa) goto not_equal; bb = tuple_val_rel(b,b_base); @@ -1976,12 +1976,12 @@ tailrecur_ne: if (!is_binary_rel(b,b_base)) { goto not_equal; } - a_size = binary_size(a); + a_size = binary_size_rel(a,a_base); b_size = binary_size_rel(b,b_base); if (a_size != b_size) { goto not_equal; } - ERTS_GET_BINARY_BYTES(a, a_ptr, a_bitoffs, a_bitsize); + ERTS_GET_BINARY_BYTES_REL(a, a_ptr, a_bitoffs, a_bitsize, a_base); ERTS_GET_BINARY_BYTES_REL(b, b_ptr, b_bitoffs, b_bitsize, b_base); if ((a_bitsize | b_bitsize | a_bitoffs | b_bitoffs) == 0) { if (sys_memcmp(a_ptr, b_ptr, a_size) == 0) goto pop_next; @@ -1994,7 +1994,7 @@ tailrecur_ne: case EXPORT_SUBTAG: { if (is_export_rel(b,b_base)) { - Export* a_exp = *((Export **) (export_val(a) + 1)); + Export* a_exp = *((Export **) (export_val_rel(a,a_base) + 1)); Export* b_exp = *((Export **) (export_val_rel(b,b_base) + 1)); if (a_exp == b_exp) goto pop_next; } @@ -2007,7 +2007,7 @@ tailrecur_ne: if (!is_fun_rel(b,b_base)) goto not_equal; - f1 = (ErlFunThing *) fun_val(a); + f1 = (ErlFunThing *) fun_val_rel(a,a_base); f2 = (ErlFunThing *) fun_val_rel(b,b_base); if (f1->fe->module != f2->fe->module || f1->fe->old_index != f2->fe->old_index || @@ -2029,11 +2029,11 @@ tailrecur_ne: if(!is_external_rel(b,b_base)) goto not_equal; - ap = external_thing_ptr(a); + ap = external_thing_ptr_rel(a,a_base); bp = external_thing_ptr_rel(b,b_base); if(ap->header == bp->header && ap->node == bp->node) { - ASSERT(1 == external_data_words(a)); + ASSERT(1 == external_data_words_rel(a,a_base)); ASSERT(1 == external_data_words_rel(b,b_base)); if (ap->data.ui[0] == bp->data.ui[0]) goto pop_next; @@ -2058,7 +2058,7 @@ tailrecur_ne: if(!is_external_ref_rel(b,b_base)) goto not_equal; - athing = external_thing_ptr(a); + athing = external_thing_ptr_rel(a,a_base); bthing = external_thing_ptr_rel(b,b_base); if(athing->node != bthing->node) @@ -2075,7 +2075,7 @@ tailrecur_ne: goto not_equal; { - RefThing* athing = ref_thing_ptr(a); + RefThing* athing = ref_thing_ptr_rel(a,a_base); RefThing* bthing = ref_thing_ptr_rel(b,b_base); alen = internal_thing_ref_no_of_numbers(athing); blen = internal_thing_ref_no_of_numbers(bthing); @@ -2128,7 +2128,7 @@ tailrecur_ne: if (!is_big_rel(b,b_base)) goto not_equal; - aa = big_val(a); /* get pointer to thing */ + aa = big_val_rel(a,a_base); bb = big_val_rel(b,b_base); if (*aa != *bb) goto not_equal; @@ -2145,7 +2145,7 @@ tailrecur_ne: FloatDef bf; if (is_float_rel(b,b_base)) { - GET_DOUBLE(a, af); + GET_DOUBLE_REL(a, af, a_base); GET_DOUBLE_REL(b, bf, b_base); if (af.fd == bf.fd) goto pop_next; } @@ -2165,7 +2165,7 @@ term_array: /* arrays in 'aa' and 'bb', length in 'sz' */ Eterm* bp = bb; Sint i = sz; for (;;) { - if (!is_same(*ap,NULL,*bp,b_base)) break; + if (!is_same(*ap,a_base,*bp,b_base)) break; if (--i == 0) goto pop_next; ++ap; ++bp; -- cgit v1.2.3 From 359517b5177756d871b91757160e6840e0fbfe4a Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 16 Dec 2010 12:14:33 +0100 Subject: HALFWORD ETS nicer update_element --- erts/emulator/beam/erl_db_hash.c | 6 +- erts/emulator/beam/erl_db_tree.c | 6 +- erts/emulator/beam/erl_db_util.c | 265 ++++++++++++++------------------------- erts/emulator/beam/erl_db_util.h | 2 +- 4 files changed, 104 insertions(+), 175 deletions(-) diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c index e43e734b27..035aefed0c 100644 --- a/erts/emulator/beam/erl_db_hash.c +++ b/erts/emulator/beam/erl_db_hash.c @@ -2690,9 +2690,9 @@ static int db_lookup_dbterm_hash(DbTable *tbl, Eterm key, DbUpdateHandle* handle handle->dbterm = &b->dbterm; handle->mustResize = 0; handle->new_size = b->dbterm.size; - #if HALFWORD_HEAP - handle->new_tuple = handle->dbterm->tpl; - #endif + #if HALFWORD_HEAP + handle->abs_vec = NULL; + #endif handle->lck = lck; /* KEEP hval WLOCKED, db_finalize_dbterm_hash will WUNLOCK */ return 1; diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index c74ccdc119..d9330a3bbf 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -2548,9 +2548,9 @@ static int db_lookup_dbterm_tree(DbTable *tbl, Eterm key, DbUpdateHandle* handle handle->mustResize = 0; handle->bp = (void**) pp; handle->new_size = (*pp)->dbterm.size; - #if HALFWORD_HEAP - handle->new_tuple = handle->dbterm->tpl; - #endif +#if HALFWORD_HEAP + handle->abs_vec = NULL; +#endif return 1; } diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index be8e10e8f2..3883ff69fa 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -2392,39 +2392,29 @@ Eterm db_add_counter(Eterm** hpp, Wterm counter, Eterm incr) /* Must be called to read elements after db_lookup_dbterm. ** Will decompress if needed. -** HEALFWORD_HEAP: Will convert from relative to Wterm format if needed. +** HEALFWORD_HEAP: +** Will convert from relative to Wterm format if needed. +** (but only on top level, tuples and lists will still contain rterms) */ Wterm db_do_read_element(DbUpdateHandle* handle, Sint position) { -#if HALFWORD_HEAP - Eterm elem = handle->new_tuple[position]; - Eterm* base = handle->dbterm->tpl; - - if (elem == THE_NON_VALUE) { - elem = handle->dbterm->tpl[position]; - ASSERT(is_value(elem)); - } - else if (handle->new_tuple != handle->dbterm->tpl - || handle->tb->common.compress) { - base = NULL; - } - if (!is_header(elem)) { - return is_immed(elem) ? elem : rterm2wterm(elem, base); - } -#else Eterm elem = handle->dbterm->tpl[position]; if (!is_header(elem)) { +#if HALFWORD_HEAP + if (!is_immed(elem) + && !handle->tb->common.compress + && !(handle->abs_vec && handle->abs_vec[position])) { + return rterm2wterm(elem, handle->dbterm->tpl); + } +#endif return elem; } -#endif ASSERT(((DbTableCommon*)handle->tb)->compress); ASSERT(!handle->mustResize); - handle->dbterm = db_alloc_tmp_uncompressed((DbTableCommon*)handle->tb, handle->dbterm); + handle->dbterm = db_alloc_tmp_uncompressed(&handle->tb->common, + handle->dbterm); handle->mustResize = 1; -#if HALFWORD_HEAP - handle->new_tuple = handle->dbterm->tpl; -#endif return handle->dbterm->tpl[position]; } @@ -2439,74 +2429,22 @@ void db_do_update_element(DbUpdateHandle* handle, Sint position, Eterm newval) { -#if HALFWORD_HEAP - Eterm oldval = handle->new_tuple[position]; - Eterm* old_base; - Uint newval_sz; - Uint oldval_sz; - - if (is_both_immed(newval,oldval)) { - handle->new_tuple[position] = newval; -#ifdef DEBUG_CLONE - if (handle->dbterm->debug_clone) { - handle->dbterm->debug_clone[position] = newval; - } -#endif - return; - } - - if (handle->tb->common.compress) { - if (!handle->mustResize) { - handle->dbterm = db_alloc_tmp_uncompressed(&handle->tb->common, - handle->dbterm); - handle->mustResize = 1; - handle->new_tuple = handle->dbterm->tpl; - oldval = handle->dbterm->tpl[position]; - } - old_base = NULL; - } - else { - if (handle->new_tuple == handle->dbterm->tpl) { - int i = header_arity(handle->new_tuple[0]); - handle->new_tuple = erts_alloc(ERTS_ALC_T_TMP, (i+1)*sizeof(Eterm)); - handle->new_tuple[0] = handle->dbterm->tpl[0]; - for ( ; i ; i--) { - handle->new_tuple[i] = THE_NON_VALUE; - } - } - if (handle->new_tuple[position] == THE_NON_VALUE) { - oldval = handle->dbterm->tpl[position]; - old_base = handle->dbterm->tpl; - } - else { - old_base = NULL; - } - } - oldval_sz = is_immed(oldval) ? 0 : size_object_rel(oldval,old_base); - newval_sz = is_immed(newval) ? 0 : size_object(newval); - - handle->new_size = handle->new_size - oldval_sz + newval_sz; - - /* write new value in old dbterm, finalize will make a flat copy */ - handle->new_tuple[position] = newval; - handle->mustResize = 1; - - -#else /****** !HALFWORD_HEAP ******/ - Eterm oldval = handle->dbterm->tpl[position]; Eterm* newp; Eterm* oldp; Uint newval_sz; Uint oldval_sz; +#if HALFWORD_HEAP + Eterm* old_base; +#endif if (is_both_immed(newval,oldval)) { handle->dbterm->tpl[position] = newval; -#ifdef DEBUG_CLONE + #ifdef DEBUG_CLONE if (handle->dbterm->debug_clone) { handle->dbterm->debug_clone[position] = newval; } -#endif + #endif return; } if (!handle->mustResize) { @@ -2515,50 +2453,78 @@ void db_do_update_element(DbUpdateHandle* handle, handle->dbterm); handle->mustResize = 1; oldval = handle->dbterm->tpl[position]; + #if HALFWORD_HEAP + old_base = NULL; + #endif } - else if (is_boxed(newval)) { - newp = boxed_val(newval); - switch (*newp & _TAG_HEADER_MASK) { - case _TAG_HEADER_POS_BIG: - case _TAG_HEADER_NEG_BIG: - case _TAG_HEADER_FLOAT: - case _TAG_HEADER_HEAP_BIN: - newval_sz = header_arity(*newp) + 1; - if (is_boxed(oldval)) { - oldp = boxed_val(oldval); - switch (*oldp & _TAG_HEADER_MASK) { - case _TAG_HEADER_POS_BIG: - case _TAG_HEADER_NEG_BIG: - case _TAG_HEADER_FLOAT: - case _TAG_HEADER_HEAP_BIN: - oldval_sz = header_arity(*oldp) + 1; - if (oldval_sz == newval_sz) { - /* "self contained" terms of same size, do memcpy */ - sys_memcpy(oldp, newp, newval_sz*sizeof(Eterm)); - return; + else { + #if HALFWORD_HEAP + ASSERT(!handle->abs_vec); + old_base = handle->dbterm->tpl; + #endif + if (is_boxed(newval)) { + newp = boxed_val(newval); + switch (*newp & _TAG_HEADER_MASK) { + case _TAG_HEADER_POS_BIG: + case _TAG_HEADER_NEG_BIG: + case _TAG_HEADER_FLOAT: + case _TAG_HEADER_HEAP_BIN: + newval_sz = header_arity(*newp) + 1; + if (is_boxed(oldval)) { + oldp = boxed_val_rel(oldval,old_base); + switch (*oldp & _TAG_HEADER_MASK) { + case _TAG_HEADER_POS_BIG: + case _TAG_HEADER_NEG_BIG: + case _TAG_HEADER_FLOAT: + case _TAG_HEADER_HEAP_BIN: + oldval_sz = header_arity(*oldp) + 1; + if (oldval_sz == newval_sz) { + /* "self contained" terms of same size, do memcpy */ + sys_memcpy(oldp, newp, newval_sz*sizeof(Eterm)); + return; + } + goto both_size_set; } - goto both_size_set; } + goto new_size_set; } - goto new_size_set; } } } +#if HALFWORD_HEAP + else { + old_base = (handle->tb->common.compress + || (handle->abs_vec && handle->abs_vec[position])) ? + NULL : handle->dbterm->tpl; + } +#endif /* Not possible for simple memcpy or dbterm is already non-contiguous, */ /* need to realloc... */ newval_sz = is_immed(newval) ? 0 : size_object(newval); new_size_set: - oldval_sz = is_immed(oldval) ? 0 : size_object(oldval); + oldval_sz = is_immed(oldval) ? 0 : size_object_rel(oldval,old_base); both_size_set: handle->new_size = handle->new_size - oldval_sz + newval_sz; - /* write new value in old dbterm, finalize will make a flat copy */ + /* write new value in old dbterm, finalize will make a flat copy */ handle->dbterm->tpl[position] = newval; handle->mustResize = 1; -#endif /* !HALFWORD_HEAP */ + +#if HALFWORD_HEAP + if (old_base && newval_sz > 0) { + ASSERT(!handle->tb->common.compress); + if (!handle->abs_vec) { + int i = header_arity(handle->dbterm->tpl[0]); + handle->abs_vec = erts_alloc(ERTS_ALC_T_TMP, (i+1)*sizeof(char)); + sys_memset(handle->abs_vec, 0, i+1); + /* abs_vec[0] not used */ + } + handle->abs_vec[position] = 1; + } +#endif } static ERTS_INLINE byte* db_realloc_term(DbTableCommon* tb, void* old, @@ -2770,7 +2736,6 @@ void* db_store_term_comp(DbTableCommon *tb, DbTerm* old, Uint offset, Eterm obj) void db_finalize_resize(DbUpdateHandle* handle, Uint offset) { -#if HALFWORD_HEAP DbTable* tbl = handle->tb; DbTerm* newDbTerm; Uint alloc_sz = offset + @@ -2784,6 +2749,9 @@ void db_finalize_resize(DbUpdateHandle* handle, Uint offset) *(handle->bp) = newp; newDbTerm = (DbTerm*) (newp + offset); newDbTerm->size = handle->new_size; +#ifdef DEBUG_CLONE + newDbTerm->debug_clone = NULL; +#endif /* make a flat copy */ @@ -2794,77 +2762,38 @@ void db_finalize_resize(DbUpdateHandle* handle, Uint offset) } else { ErlOffHeap tmp_offheap; - int i, arity = header_arity(handle->dbterm->tpl[0]); - Eterm* top = newDbTerm->tpl + arity + 1; + Eterm* tpl = handle->dbterm->tpl; + Eterm* top = newDbTerm->tpl; - ASSERT(handle->new_tuple != handle->dbterm->tpl); tmp_offheap.first = NULL; - newDbTerm->tpl[0] = handle->dbterm->tpl[0]; - for (i=1; i<=arity; i++) { - Eterm* tpl; - Eterm* src_base; + #if HALFWORD_HEAP + if (handle->abs_vec) { + int i, arity = header_arity(handle->dbterm->tpl[0]); + top[0] = tpl[0]; + top += arity + 1; + for (i=1; i<=arity; i++) { + Eterm* src_base = handle->abs_vec[i] ? NULL : tpl; - if (handle->new_tuple[i] == THE_NON_VALUE) { - tpl = handle->dbterm->tpl; - src_base = tpl; - } - else { - tpl = handle->new_tuple; - src_base = NULL; + newDbTerm->tpl[i] = copy_struct_rel(tpl[i], + size_object_rel(tpl[i],src_base), + &top, &tmp_offheap, src_base, + newDbTerm->tpl); } - newDbTerm->tpl[i] = copy_struct_rel(tpl[i], - size_object_rel(tpl[i],src_base), - &top, &tmp_offheap, src_base, - newDbTerm->tpl); + newDbTerm->first_oh = tmp_offheap.first; + ASSERT((byte*)top <= (newp + alloc_sz)); + erts_free(ERTS_ALC_T_TMP, handle->abs_vec); + } + else + #endif /* HALFWORD_HEAP */ + { + copy_struct_rel(make_tuple_rel(tpl,tpl), handle->new_size, &top, + &tmp_offheap, tpl, top); + newDbTerm->first_oh = tmp_offheap.first; + ASSERT((byte*)top == (newp + alloc_sz)); } - - newDbTerm->first_oh = tmp_offheap.first; -#ifdef DEBUG_CLONE - newDbTerm->debug_clone = NULL; -#endif - ASSERT((byte*)top <= (newp + alloc_sz)); - ASSERT(handle->new_tuple != handle->dbterm->tpl); - erts_free(ERTS_ALC_T_TMP, handle->new_tuple); - } - -#else /***** !HALFWORD_HEAP *****/ - DbTable* tbl = handle->tb; - DbTerm* newDbTerm; - Uint alloc_sz = offset + - (tbl->common.compress ? - db_size_dbterm_comp(&tbl->common, make_tuple(handle->dbterm->tpl)) : - sizeof(DbTerm)+sizeof(Eterm)*(handle->new_size-1)); - byte* newp = erts_db_alloc(ERTS_ALC_T_DB_TERM, tbl, alloc_sz); - byte* oldp = *(handle->bp); - - sys_memcpy(newp, oldp, offset); /* copy only hash/tree header */ - *(handle->bp) = newp; - newDbTerm = (DbTerm*) (newp + offset); - newDbTerm->size = handle->new_size; - - /* make a flat copy */ - - if (tbl->common.compress) { - copy_to_comp(&tbl->common, make_tuple(handle->dbterm->tpl), - newDbTerm, alloc_sz); - db_free_tmp_uncompressed(handle->dbterm); - } - else { - Eterm* top; - ErlOffHeap tmp_offheap; - tmp_offheap.first = NULL; - top = newDbTerm->tpl; - copy_struct(make_tuple(handle->dbterm->tpl), handle->new_size, - &top, &tmp_offheap); - newDbTerm->first_oh = tmp_offheap.first; -#ifdef DEBUG_CLONE - newDbTerm->debug_clone = NULL; -#endif - ASSERT((byte*)top <= (newp + alloc_sz)); } -#endif } Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp, diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 30b3eb731d..bbf1e29f72 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -87,7 +87,7 @@ typedef struct { int mustResize; void* lck; #if HALFWORD_HEAP - Eterm* new_tuple; + unsigned char* abs_vec; /* [i] true if dbterm->tpl[i] is absolute Eterm */ #endif } DbUpdateHandle; -- cgit v1.2.3 From 0b09ffabadd38bd2d0fa9cfa735542defc380efc Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 22 Dec 2010 15:14:39 +0100 Subject: HALFWORD ETS 32-bit arch fixes and other cleanups --- erts/emulator/beam/erl_db.c | 3 +- erts/emulator/beam/erl_db_tree.c | 4 +- erts/emulator/beam/erl_db_util.c | 10 +++-- erts/emulator/beam/erl_lock_check.c | 2 +- erts/emulator/beam/erl_term.h | 69 +++++++++++++++---------------- erts/emulator/beam/sys.h | 6 +-- erts/emulator/sys/common/erl_mseg.c | 81 ++++++++++++++++++++++--------------- lib/stdlib/test/ets_SUITE.erl | 4 +- 8 files changed, 95 insertions(+), 84 deletions(-) diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 914eedce0c..02f16899ae 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -3501,7 +3501,6 @@ static void set_heir(Process* me, DbTable* tb, Eterm heir, UWord heir_data) /* Make a dummy 1-tuple around data to use DbTerm */ wrap_tpl = TUPLE1(tmp,heir_data); size = size_object(wrap_tpl); - /* SVERK: Must be low memory due to erts_send_message */ dbterm = erts_db_alloc(ERTS_ALC_T_DB_HEIR_DATA, (DbTable *)tb, (sizeof(DbTerm) + sizeof(Eterm)*(size-1))); dbterm->size = size; diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index d9330a3bbf..d4f02f9117 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -2753,7 +2753,7 @@ static Sint cmp_partly_bound(Eterm partly_bound_key, Eterm bound_key, Eterm* bk_ erts_fprintf(stderr," > "); else erts_fprintf(stderr," == "); - erts_fprintf(stderr,"%T\n",bound_key); // SVERK: printing rterm + erts_fprintf(stderr,"%T\n",bound_key); // HALFWORD BUG: printing rterm #endif return ret; } diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 3883ff69fa..7a6a811a60 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1915,11 +1915,13 @@ restart: *esp++ = hp[n]; break; case matchPushExpr: - ASSERT(is_tuple_rel(term,base)); #if HALFWORD_HEAP if (base) { - Uint sz = size_object_rel(term, base); - Eterm* top = HAlloc(psp, sz); + Uint sz; + Eterm* top; + ASSERT(is_tuple_rel(term,base)); /* assume ETS */ + sz = size_object_rel(term, base); + top = HAlloc(psp, sz); *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, &top, &MSO(psp), base); break; diff --git a/erts/emulator/beam/erl_lock_check.c b/erts/emulator/beam/erl_lock_check.c index 0185baee6b..7cd379d2c8 100644 --- a/erts/emulator/beam/erl_lock_check.c +++ b/erts/emulator/beam/erl_lock_check.c @@ -155,7 +155,7 @@ static erts_lc_lock_order_t erts_lock_order[] = { { "alcu_allocator", "index" }, { "alcu_delayed_free", "index" }, { "mseg", NULL }, -#ifdef HALFWORD_HEAP +#if HALFWORD_HEAP { "pmmap", NULL }, #endif #ifdef ERTS_SMP diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index 1225b6a944..161093434f 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * Copyright Ericsson AB 2000-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -359,7 +359,6 @@ _ET_DECLARE_CHECKED(Eterm*,binary_val,Wterm) #define is_fun_header(x) ((x) == HEADER_FUN) #define make_fun(x) make_boxed((Eterm*)(x)) #define is_fun(x) (is_boxed((x)) && is_fun_header(*boxed_val((x)))) -#define is_fun_rel(x,Base) (is_boxed((x)) && is_fun_header(*boxed_val_rel((x),Base))) #define is_not_fun(x) (!is_fun((x))) #define _unchecked_fun_val(x) _unchecked_boxed_val((x)) _ET_DECLARE_CHECKED(Eterm*,fun_val,Wterm) @@ -368,7 +367,6 @@ _ET_DECLARE_CHECKED(Eterm*,fun_val,Wterm) /* export access methods */ #define make_export(x) make_boxed((x)) #define is_export(x) (is_boxed((x)) && is_export_header(*boxed_val((x)))) -#define is_export_rel(x,Base) (is_boxed((x)) && is_export_header(*boxed_val_rel((x),Base))) #define is_not_export(x) (!is_export((x))) #define _unchecked_export_val(x) _unchecked_boxed_val(x) _ET_DECLARE_CHECKED(Eterm*,export_val,Wterm) @@ -396,7 +394,6 @@ _ET_DECLARE_CHECKED(Uint,bignum_header_arity,Eterm) #define BIG_ARITY_MAX ((1 << 19)-1) #define make_big(x) make_boxed((x)) #define is_big(x) (is_boxed((x)) && _is_bignum_header(*boxed_val((x)))) -#define is_big_rel(x,Base) (is_boxed((x)) && _is_bignum_header(*boxed_val_rel((x),Base))) #define is_not_big(x) (!is_big((x))) #define _unchecked_big_val(x) _unchecked_boxed_val((x)) _ET_DECLARE_CHECKED(Eterm*,big_val,Wterm) @@ -410,7 +407,6 @@ _ET_DECLARE_CHECKED(Eterm*,big_val,Wterm) #endif #define make_float(x) make_boxed((x)) #define is_float(x) (is_boxed((x)) && *boxed_val((x)) == HEADER_FLONUM) -#define is_float_rel(x,Base) (is_boxed((x)) && *boxed_val_rel((x),Base) == HEADER_FLONUM) #define is_not_float(x) (!is_float(x)) #define _unchecked_float_val(x) _unchecked_boxed_val((x)) _ET_DECLARE_CHECKED(Eterm*,float_val,Wterm) @@ -451,8 +447,7 @@ typedef union float_def *(((Uint *) (p))+1) = (f).fw[1] #endif -#define GET_DOUBLE(x, f) FLOAT_VAL_GET_DOUBLE(float_val(x),f) -#define GET_DOUBLE_REL(x, f, Base) FLOAT_VAL_GET_DOUBLE(float_val_rel(x,Base),f) +#define GET_DOUBLE(x, f) FLOAT_VAL_GET_DOUBLE(float_val(x), f) #define DOUBLE_DATA_WORDS (sizeof(ieee754_8)/sizeof(Eterm)) #define FLOAT_SIZE_OBJECT (DOUBLE_DATA_WORDS+1) @@ -460,7 +455,6 @@ typedef union float_def /* tuple access methods */ #define make_tuple(x) make_boxed((x)) #define is_tuple(x) (is_boxed((x)) && is_arity_value(*boxed_val((x)))) -#define is_tuple_rel(x,Base) (is_boxed((x)) && is_arity_value(*boxed_val_rel((x),Base))) #define is_not_tuple(x) (!is_tuple((x))) #define is_tuple_arity(x, a) \ (is_boxed((x)) && *boxed_val((x)) == make_arityval((a))) @@ -803,14 +797,10 @@ do { \ ((RefThing*) _unchecked_internal_ref_val(x)) #define ref_thing_ptr(x) \ ((RefThing*) internal_ref_val(x)) -#define ref_thing_ptr_rel(x,Base) \ - ((RefThing*) internal_ref_val_rel(x,Base)) - #define is_internal_ref(x) \ - (_unchecked_is_boxed((x)) && is_ref_thing_header(*boxed_val((x)))) -#define is_internal_ref_rel(x,Base) \ - (_unchecked_is_boxed((x)) && is_ref_thing_header(*boxed_val_rel((x),Base))) + (_unchecked_is_boxed((x)) && is_ref_thing_header(*boxed_val((x)))) + #define is_not_internal_ref(x) \ (!is_internal_ref((x))) @@ -911,20 +901,14 @@ typedef struct external_thing_ { #define is_external_header(x) \ (((x) & (_TAG_HEADER_MASK-_BINARY_XXX_MASK)) == _TAG_HEADER_EXTERNAL_PID) -#define is_external(x) \ - (is_boxed((x)) && is_external_header(*boxed_val((x)))) -#define is_external_rel(x,Base) \ - (is_boxed((x)) && is_external_header(*boxed_val_rel((x),Base))) +#define is_external(x) (is_boxed((x)) && is_external_header(*boxed_val((x)))) + #define is_external_pid(x) \ (is_boxed((x)) && is_external_pid_header(*boxed_val((x)))) #define is_external_port(x) \ - (is_boxed((x)) && is_external_port_header(*boxed_val((x)))) -#define is_external_port_rel(x,Base) \ - (is_boxed((x)) && is_external_port_header(*boxed_val_rel((x),Base))) -#define is_external_ref(x) \ - (_unchecked_is_boxed((x)) && is_external_ref_header(*boxed_val((x)))) -#define is_external_ref_rel(x,Base) \ - (_unchecked_is_boxed((x)) && is_external_ref_header(*boxed_val_rel((x),Base))) + (is_boxed((x)) && is_external_port_header(*boxed_val((x)))) + +#define is_external_ref(x) (_unchecked_is_boxed((x)) && is_external_ref_header(*boxed_val((x)))) #define _unchecked_is_external(x) \ (_unchecked_is_boxed((x)) && is_external_header(*_unchecked_boxed_val((x)))) @@ -958,15 +942,12 @@ _ET_DECLARE_CHECKED(Uint,external_thing_data_words,ExternalThing*) _unchecked_external_thing_data_words(_unchecked_external_thing_ptr((x))) _ET_DECLARE_CHECKED(Uint,external_data_words,Wterm) #define external_data_words(x) _ET_APPLY(external_data_words,(x)) -#define external_data_words_rel(x,Base) \ - external_thing_data_words(external_thing_ptr_rel((x),Base)) #define _unchecked_external_data(x) (_unchecked_external_thing_ptr((x))->data.ui) #define _unchecked_external_node(x) (_unchecked_external_thing_ptr((x))->node) #define external_data(x) (external_thing_ptr((x))->data.ui) #define external_node(x) (external_thing_ptr((x))->node) -#define external_node_rel(x,Base) (external_thing_ptr_rel((x),Base)->node) #define _unchecked_external_pid_data_words(x) \ _unchecked_external_data_words((x)) @@ -1141,13 +1122,11 @@ extern unsigned tag_val_def(Wterm); #if HALFWORD_HEAP #define ptr2rel(PTR,BASE) ((Eterm*)((char*)(PTR) - (char*)(BASE))) -#define rel2ptr(REL,BASE) ((typeof(REL)) ((UWord)(REL) + (char*)(BASE))) #define rterm2wterm(REL,BASE) ((Wterm)(REL) + (Wterm)(BASE)) #else /* HALFWORD_HEAP */ #define ptr2rel(PTR,BASE) (PTR) -#define rel2ptr(REL,BASE) (REL) #define rterm2wterm(REL,BASE) (REL) #endif /* !HALFWORD_HEAP */ @@ -1170,6 +1149,8 @@ extern unsigned tag_val_def(Wterm); #define internal_ref_val_rel(RTERM,BASE) internal_ref_val(rterm2wterm(RTERM,BASE)) #define external_thing_ptr_rel(RTERM, BASE) external_thing_ptr(rterm2wterm(RTERM, BASE)) +#define external_data_words_rel(RTERM,BASE) external_data_words(rterm2wterm(RTERM,BASE)) + #define external_port_node_rel(RTERM,BASE) external_port_node(rterm2wterm(RTERM,BASE)) #define external_port_data_rel(RTERM,BASE) external_port_data(rterm2wterm(RTERM,BASE)) @@ -1178,6 +1159,22 @@ extern unsigned tag_val_def(Wterm); #define external_pid_data_rel(RTERM,BASE) external_pid_data(rterm2wterm(RTERM,BASE)) #define is_binary_rel(RTERM,BASE) is_binary(rterm2wterm(RTERM,BASE)) +#define is_float_rel(RTERM,BASE) is_float(rterm2wterm(RTERM,BASE)) +#define is_fun_rel(RTERM,BASE) is_fun(rterm2wterm(RTERM,BASE)) +#define is_big_rel(RTERM,BASE) is_big(rterm2wterm(RTERM,BASE)) +#define is_export_rel(RTERM,BASE) is_export(rterm2wterm(RTERM,BASE)) +#define is_tuple_rel(RTERM,BASE) is_tuple(rterm2wterm(RTERM,BASE)) + +#define GET_DOUBLE_REL(RTERM, f, BASE) GET_DOUBLE(rterm2wterm(RTERM,BASE), f) + +#define ref_thing_ptr_rel(RTERM,BASE) ref_thing_ptr(rterm2wterm(RTERM,BASE)) +#define is_internal_ref_rel(RTERM,BASE) is_internal_ref(rterm2wterm(RTERM,BASE)) +#define is_external_rel(RTERM,BASE) is_external(rterm2wterm(RTERM,BASE)) +#define is_external_port_rel(RTERM,BASE) is_external_port(rterm2wterm(RTERM,BASE)) +#define is_external_ref_rel(RTERM,BASE) is_external_ref(rterm2wterm(RTERM,BASE)) + +#define external_node_rel(RTERM,BASE) external_node(rterm2wterm(RTERM,BASE)) + #if HALFWORD_HEAP ERTS_GLB_INLINE int is_same(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base); @@ -1185,12 +1182,12 @@ ERTS_GLB_INLINE int is_same(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base); #if ERTS_GLB_INLINE_INCL_FUNC_DEF ERTS_GLB_INLINE int is_same(Eterm a, Eterm* a_base, Eterm b, Eterm* b_base) { - if (a_base == b_base) { - return a == b; - } - /* Assume a and b are on different "heaps", ie can only be same if immed */ - ASSERT(is_immed(a) || is_immed(b) || rterm2wterm(a,a_base) != rterm2wterm(b,b_base)); - return is_immed(a) && a == b; + /* If bases differ, assume a and b are on different "heaps", + ie can only be same if immed */ + ASSERT(a_base == b_base || is_immed(a) || is_immed(b) + || rterm2wterm(a,a_base) != rterm2wterm(b,b_base)); + + return a == b && (a_base == b_base || is_immed(a)); } #endif diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index e36f7cf8cf..d480229999 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -225,16 +225,14 @@ int real_printf(const char *fmt, ...); #else #error Neither 32 nor 64 bit architecture #endif -#ifdef ARCH_64 -# ifdef HALFWORD_HEAP_EMULATOR +#if defined(ARCH_64) && defined(HALFWORD_HEAP_EMULATOR) # define HALFWORD_HEAP 1 # define HALFWORD_ASSERT 0 # define ASSERT_HALFWORD(COND) ASSERT(COND) -# else +#else # define HALFWORD_HEAP 0 # define HALFWORD_ASSERT 0 # define ASSERT_HALFWORD(COND) -# endif #endif #if SIZEOF_VOID_P != SIZEOF_SIZE_T diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index 00da31332a..68c62ca8e1 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -362,20 +362,23 @@ mseg_create(MemKind* mk, Uint size) } static ERTS_INLINE void -mseg_destroy(void *seg, Uint size) +mseg_destroy(MemKind* mk, void *seg, Uint size) { #if defined(ERTS_MSEG_FAKE_SEGMENTS) erts_sys_free(ERTS_ALC_N_INVALID, NULL, seg); #elif HAVE_MMAP + int res; -#ifdef DEBUG - int res = -#endif #if HALFWORD_HEAP - pmunmap((void *) seg, size); -#else - munmap((void *) seg, size); + if (mk == &low_mem) { + res = pmunmap((void *) seg, size); + } + else #endif + { + res = munmap((void *) seg, size); + } + ASSERT(size % page_size == 0); ASSERT(res == 0); #else @@ -389,7 +392,7 @@ mseg_destroy(void *seg, Uint size) #if HAVE_MSEG_RECREATE static ERTS_INLINE void * -mseg_recreate(void *old_seg, Uint old_size, Uint new_size) +mseg_recreate(MemKind* mk, void *old_seg, Uint old_size, Uint new_size) { void *new_seg; @@ -400,25 +403,29 @@ mseg_recreate(void *old_seg, Uint old_size, Uint new_size) new_seg = erts_sys_realloc(ERTS_ALC_N_INVALID, NULL, old_seg, new_size); #elif HAVE_MREMAP #if HALFWORD_HEAP - new_seg = (void *) pmremap((void *) old_seg, - (size_t) old_size, - (size_t) new_size); -#elif defined(__NetBSD__) - new_seg = (void *) mremap((void *) old_seg, - (size_t) old_size, - NULL, - (size_t) new_size, - 0); - if (new_seg == (void *) MAP_FAILED) - new_seg = NULL; -#else - new_seg = (void *) mremap((void *) old_seg, - (size_t) old_size, - (size_t) new_size, - MREMAP_MAYMOVE); - if (new_seg == (void *) MAP_FAILED) - new_seg = NULL; + if (mk == &low_mem) { + new_seg = (void *) pmremap((void *) old_seg, + (size_t) old_size, + (size_t) new_size); + } + else #endif + { + #if defined(__NetBSD__) + new_seg = (void *) mremap((void *) old_seg, + (size_t) old_size, + NULL, + (size_t) new_size, + 0); + #else + new_seg = (void *) mremap((void *) old_seg, + (size_t) old_size, + (size_t) new_size, + MREMAP_MAYMOVE); + #endif + if (new_seg == (void *) MAP_FAILED) + new_seg = NULL; + } #else #error "Missing mseg_recreate() implementation" #endif @@ -538,7 +545,7 @@ adjust_cache_size(MemKind* mk, int force_check_limits) } if (erts_mtrace_enabled) erts_mtrace_crr_free(SEGTYPE, SEGTYPE, cd->seg); - mseg_destroy(cd->seg, cd->size); + mseg_destroy(mk, cd->seg, cd->size); unlink_cd(mk,cd); free_cd(mk,cd); } @@ -593,7 +600,14 @@ mseg_clear_cache(MemKind* mk) static ERTS_INLINE MemKind* type2mk(ErtsAlcType_t atype) { #if HALFWORD_HEAP - return (atype == ERTS_ALC_A_ETS) ? &hi_mem : &low_mem; + switch (atype) { + case ERTS_ALC_A_ETS: + //case ERTS_ALC_A_BINARY: + //case ERTS_ALC_A_FIXED_SIZE: + return &hi_mem; + default: + return &low_mem; + } #else return &the_mem; #endif @@ -726,7 +740,7 @@ mseg_dealloc(ErtsAlcType_t atype, void *seg, Uint size, if (!opt->cache || max_cache_size == 0) { if (erts_mtrace_enabled) erts_mtrace_crr_free(atype, SEGTYPE, seg); - mseg_destroy(seg, size); + mseg_destroy(mk, seg, size); } else { int check_limits = 0; @@ -744,7 +758,7 @@ mseg_dealloc(ErtsAlcType_t atype, void *seg, Uint size, } if (erts_mtrace_enabled) erts_mtrace_crr_free(SEGTYPE, SEGTYPE, cd->seg); - mseg_destroy(cd->seg, cd->size); + mseg_destroy(mk, cd->seg, cd->size); unlink_cd(mk,cd); free_cd(mk,cd); } @@ -841,7 +855,7 @@ mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, Uint *new_size_p, SEGTYPE, seg, new_size); - mseg_destroy(((char *) seg) + new_size, shrink_sz); + mseg_destroy(mk, ((char *) seg) + new_size, shrink_sz); } #elif HAVE_MSEG_RECREATE @@ -875,7 +889,7 @@ mseg_realloc(ErtsAlcType_t atype, void *seg, Uint old_size, Uint *new_size_p, #if !CAN_PARTLY_DESTROY do_recreate: #endif - new_seg = mseg_recreate((void *) seg, old_size, new_size); + new_seg = mseg_recreate(mk, (void *) seg, old_size, new_size); if (erts_mtrace_enabled) erts_mtrace_crr_realloc(new_seg, atype, SEGTYPE, seg, new_size); if (!new_seg) @@ -1828,6 +1842,7 @@ static int pmunmap(void *p, size_t size) FreeBlock *last; FreeBlock *nb = (FreeBlock *) p; + ASSERT(((unsigned long)p & CHECK_POINTER_MASK)==0); if (real_size > pagsz) { if (do_unmap(((char *) p) + pagsz,real_size - pagsz)) { return 1; diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index a2c19fa10f..691b1189be 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -4056,7 +4056,7 @@ do_lookup_element(Tab, N, M) -> end. -heavy_concurrent(_Config) -> +heavy_concurrent(Config) when is_list(Config) -> repeat_for_opts(do_heavy_concurrent). do_heavy_concurrent(Opts) -> -- cgit v1.2.3 From 9153527f9808b4b6fcd2080f2cb8558015dfaeed Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 11 Jan 2011 11:49:06 +0100 Subject: HALFWORD Make more allocators use high mem (binary, fixed and driver) --- erts/emulator/beam/erl_db_util.c | 47 +++++++++++++++++++++---------------- erts/emulator/beam/erl_nif.c | 35 +++++++++++++++------------ erts/emulator/beam/erl_term.h | 1 + erts/emulator/sys/common/erl_mseg.c | 5 ++-- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 7a6a811a60..3405ec87d2 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1791,15 +1791,18 @@ restart: pc += TermWords(2); ++ep; break; - case matchEqRef: + case matchEqRef: { + Eterm* epc = (Eterm*)pc; if (!is_ref_rel(*ep,base)) FAIL(); - if (!eq_rel(make_internal_ref((Uint *) pc), NULL, *ep, base)) + if (!eq_rel(make_internal_ref_rel(epc, epc), epc, *ep, base)) { FAIL(); - i = thing_arityval(*((Uint *) pc)); + } + i = thing_arityval(*epc); pc += TermWords(i+1); ++ep; break; + } case matchEqBig: if (!is_big_rel(*ep,base)) FAIL(); @@ -3143,6 +3146,8 @@ static DMCRet dmc_one_term(DMCContext *context, DMC_PUSH(*stack, c); break; case (_TAG_HEADER_REF >> _TAG_PRIMARY_SIZE): + { + Eterm* ref_val = internal_ref_val(c); DMC_PUSH(*text, matchEqRef); #if HALFWORD_HEAP { @@ -3150,25 +3155,27 @@ static DMCRet dmc_one_term(DMCContext *context, UWord u; Uint t[2]; } fiddle; - ASSERT(thing_arityval(*internal_ref_val(c)) == 3); - fiddle.t[0] = *internal_ref_val(c); - fiddle.t[1] = (Uint) internal_ref_val(c)[1]; + ASSERT(thing_arityval(ref_val[0]) == 3); + fiddle.t[0] = ref_val[0]; + fiddle.t[1] = ref_val[1]; DMC_PUSH(*text, fiddle.u); - fiddle.t[0] = (Uint) internal_ref_val(c)[2]; - fiddle.t[1] = (Uint) internal_ref_val(c)[3]; + fiddle.t[0] = ref_val[2]; + fiddle.t[1] = ref_val[3]; DMC_PUSH(*text, fiddle.u); } #else - n = thing_arityval(*internal_ref_val(c)); - DMC_PUSH(*text, *internal_ref_val(c)); - for (i = 1; i <= n; ++i) { - DMC_PUSH(*text, (Uint) internal_ref_val(c)[i]); + n = thing_arityval(ref_val[0]); + for (i = 0; i <= n; ++i) { + DMC_PUSH(*text, ref_val[i]); } #endif break; + } case (_TAG_HEADER_POS_BIG >> _TAG_PRIMARY_SIZE): case (_TAG_HEADER_NEG_BIG >> _TAG_PRIMARY_SIZE): - n = thing_arityval(*big_val(c)); + { + Eterm* bval = big_val(c); + n = thing_arityval(bval[0]); DMC_PUSH(*text, matchEqBig); #if HALFWORD_HEAP { @@ -3177,13 +3184,13 @@ static DMCRet dmc_one_term(DMCContext *context, Uint t[2]; } fiddle; ASSERT(n >= 1); - fiddle.t[0] = *big_val(c); - fiddle.t[1] = big_val(c)[1]; + fiddle.t[0] = bval[0]; + fiddle.t[1] = bval[1]; DMC_PUSH(*text, fiddle.u); for (i = 2; i <= n; ++i) { - fiddle.t[0] = big_val(c)[i]; + fiddle.t[0] = bval[i]; if (++i <= n) { - fiddle.t[1] = big_val(c)[i]; + fiddle.t[1] = bval[i]; } else { fiddle.t[1] = (Uint) 0; } @@ -3191,12 +3198,12 @@ static DMCRet dmc_one_term(DMCContext *context, } } #else - DMC_PUSH(*text, *big_val(c)); - for (i = 1; i <= n; ++i) { - DMC_PUSH(*text, (Uint) big_val(c)[i]); + for (i = 0; i <= n; ++i) { + DMC_PUSH(*text, (Uint) bval[i]); } #endif break; + } case (_TAG_HEADER_FLOAT >> _TAG_PRIMARY_SIZE): DMC_PUSH(*text,matchEqFloat); #if HALFWORD_HEAP diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index b3f0b17ce4..529b602575 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2009-2010. All Rights Reserved. + * Copyright Ericsson AB 2009-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -939,21 +939,26 @@ ERL_NIF_TERM enif_make_list_cell(ErlNifEnv* env, Eterm car, Eterm cdr) ERL_NIF_TERM enif_make_list(ErlNifEnv* env, unsigned cnt, ...) { - Eterm* hp = alloc_heap(env,cnt*2); - Eterm ret = make_list(hp); - Eterm* last = &ret; - va_list ap; - - va_start(ap,cnt); - while (cnt--) { - *last = make_list(hp); - *hp = va_arg(ap,Eterm); - last = ++hp; - ++hp; + if (cnt == 0) { + return NIL; + } + else { + Eterm* hp = alloc_heap(env,cnt*2); + Eterm ret = make_list(hp); + Eterm* last = &ret; + va_list ap; + + va_start(ap,cnt); + while (cnt--) { + *last = make_list(hp); + *hp = va_arg(ap,Eterm); + last = ++hp; + ++hp; + } + va_end(ap); + *last = NIL; + return ret; } - va_end(ap); - *last = NIL; - return ret; } ERL_NIF_TERM enif_make_list_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index 161093434f..1d75fa313c 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -1137,6 +1137,7 @@ extern unsigned tag_val_def(Wterm); #define make_binary_rel make_boxed_rel #define make_tuple_rel make_boxed_rel #define make_external_rel make_boxed_rel +#define make_internal_ref_rel make_boxed_rel #define binary_val_rel(RTERM, BASE) binary_val(rterm2wterm(RTERM, BASE)) #define list_val_rel(RTERM, BASE) list_val(rterm2wterm(RTERM, BASE)) diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index 68c62ca8e1..b46c6263a0 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -602,8 +602,9 @@ static ERTS_INLINE MemKind* type2mk(ErtsAlcType_t atype) #if HALFWORD_HEAP switch (atype) { case ERTS_ALC_A_ETS: - //case ERTS_ALC_A_BINARY: - //case ERTS_ALC_A_FIXED_SIZE: + case ERTS_ALC_A_BINARY: + case ERTS_ALC_A_FIXED_SIZE: + case ERTS_ALC_A_DRIVER: return &hi_mem; default: return &low_mem; -- cgit v1.2.3 From 82e07561d4feae3393f30b7a9197e78b49da116b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 11 Jan 2011 18:48:37 +0100 Subject: HALFWORD Fix segv caused by erlang:halt Faulty use of term on C-stack in heap_dump() --- erts/emulator/beam/erl_process_dump.c | 240 +++++++++++++++++----------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/erts/emulator/beam/erl_process_dump.c b/erts/emulator/beam/erl_process_dump.c index 7a7042abe4..68fda01597 100644 --- a/erts/emulator/beam/erl_process_dump.c +++ b/erts/emulator/beam/erl_process_dump.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2003-2010. All Rights Reserved. + * Copyright Ericsson AB 2003-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -261,139 +261,139 @@ print_function_from_pc(int to, void *to_arg, BeamInstr* x) static void heap_dump(int to, void *to_arg, Eterm x) { + DeclareTmpHeapNoproc(last,1); + Eterm* next = last; Eterm* ptr; - Eterm last = OUR_NIL; - Eterm* next = &last; if (is_immed(x) || is_CP(x)) { return; } - - again: - if (x == OUR_NIL) { /* We are done. */ - return; - } if (is_CP(x)) { - next = (Eterm *) EXPAND_POINTER(x); - } else if (is_list(x)) { - ptr = list_val(x); - if (ptr[0] != OUR_NIL) { - erts_print(to, to_arg, ADDR_FMT ":l", ptr); - dump_element(to, to_arg, ptr[0]); - erts_putc(to, to_arg, '|'); - dump_element(to, to_arg, ptr[1]); - erts_putc(to, to_arg, '\n'); - if (is_immed(ptr[1])) { - ptr[1] = make_small(0); - } - x = ptr[0]; - ptr[0] = (Eterm) COMPRESS_POINTER(next); - next = ptr + 1; - goto again; - } - } else if (is_boxed(x)) { - Eterm hdr; - - ptr = boxed_val(x); - hdr = *ptr; - if (hdr != OUR_NIL) { /* If not visited */ - erts_print(to, to_arg, ADDR_FMT ":", ptr); - if (is_arity_value(hdr)) { - Uint i; - Uint arity = arityval(hdr); - - erts_print(to, to_arg, "t" WORD_FMT ":", arity); - for (i = 1; i <= arity; i++) { - dump_element(to, to_arg, ptr[i]); - if (is_immed(ptr[i])) { - ptr[i] = make_small(0); - } - if (i < arity) { - erts_putc(to, to_arg, ','); - } - } + UseTmpHeapNoproc(1); + *last = OUR_NIL; + + while (x != OUR_NIL) { + if (is_CP(x)) { + next = (Eterm *) EXPAND_POINTER(x); + } else if (is_list(x)) { + ptr = list_val(x); + if (ptr[0] != OUR_NIL) { + erts_print(to, to_arg, ADDR_FMT ":l", ptr); + dump_element(to, to_arg, ptr[0]); + erts_putc(to, to_arg, '|'); + dump_element(to, to_arg, ptr[1]); erts_putc(to, to_arg, '\n'); - if (arity == 0) { - ptr[0] = OUR_NIL; - } else { - x = ptr[arity]; - ptr[0] = (Eterm) COMPRESS_POINTER(next); - next = ptr + arity - 1; - goto again; + if (is_immed(ptr[1])) { + ptr[1] = make_small(0); } - } else if (hdr == HEADER_FLONUM) { - FloatDef f; - char sbuf[31]; - int i; - - GET_DOUBLE_DATA((ptr+1), f); - i = sys_double_to_chars(f.fd, (char*) sbuf); - sys_memset(sbuf+i, 0, 31-i); - erts_print(to, to_arg, "F%X:%s\n", i, sbuf); - *ptr = OUR_NIL; - } else if (_is_bignum_header(hdr)) { - erts_print(to, to_arg, "B%T\n", x); - *ptr = OUR_NIL; - } else if (is_binary_header(hdr)) { - Uint tag = thing_subtag(hdr); - Uint size = binary_size(x); - Uint i; - - if (tag == HEAP_BINARY_SUBTAG) { - byte* p; - - erts_print(to, to_arg, "Yh%X:", size); - p = binary_bytes(x); - for (i = 0; i < size; i++) { - erts_print(to, to_arg, "%02X", p[i]); + x = ptr[0]; + ptr[0] = (Eterm) COMPRESS_POINTER(next); + next = ptr + 1; + continue; + } + } else if (is_boxed(x)) { + Eterm hdr; + + ptr = boxed_val(x); + hdr = *ptr; + if (hdr != OUR_NIL) { /* If not visited */ + erts_print(to, to_arg, ADDR_FMT ":", ptr); + if (is_arity_value(hdr)) { + Uint i; + Uint arity = arityval(hdr); + + erts_print(to, to_arg, "t" WORD_FMT ":", arity); + for (i = 1; i <= arity; i++) { + dump_element(to, to_arg, ptr[i]); + if (is_immed(ptr[i])) { + ptr[i] = make_small(0); + } + if (i < arity) { + erts_putc(to, to_arg, ','); + } } - } else if (tag == REFC_BINARY_SUBTAG) { - ProcBin* pb = (ProcBin *) binary_val(x); - Binary* val = pb->val; - - if (erts_smp_atomic_xchg(&val->refc, 0) != 0) { - val->flags = (UWord) all_binaries; - all_binaries = val; + erts_putc(to, to_arg, '\n'); + if (arity == 0) { + ptr[0] = OUR_NIL; + } else { + x = ptr[arity]; + ptr[0] = (Eterm) COMPRESS_POINTER(next); + next = ptr + arity - 1; + continue; } - erts_print(to, to_arg, "Yc%X:%X:%X", val, - pb->bytes - (byte *)val->orig_bytes, - size); - } else if (tag == SUB_BINARY_SUBTAG) { - ErlSubBin* Sb = (ErlSubBin *) binary_val(x); - Eterm* real_bin = binary_val(Sb->orig); - void* val; - - if (thing_subtag(*real_bin) == REFC_BINARY_SUBTAG) { - ProcBin* pb = (ProcBin *) real_bin; - val = pb->val; - } else { /* Heap binary */ - val = real_bin; + } else if (hdr == HEADER_FLONUM) { + FloatDef f; + char sbuf[31]; + int i; + + GET_DOUBLE_DATA((ptr+1), f); + i = sys_double_to_chars(f.fd, (char*) sbuf); + sys_memset(sbuf+i, 0, 31-i); + erts_print(to, to_arg, "F%X:%s\n", i, sbuf); + *ptr = OUR_NIL; + } else if (_is_bignum_header(hdr)) { + erts_print(to, to_arg, "B%T\n", x); + *ptr = OUR_NIL; + } else if (is_binary_header(hdr)) { + Uint tag = thing_subtag(hdr); + Uint size = binary_size(x); + Uint i; + + if (tag == HEAP_BINARY_SUBTAG) { + byte* p; + + erts_print(to, to_arg, "Yh%X:", size); + p = binary_bytes(x); + for (i = 0; i < size; i++) { + erts_print(to, to_arg, "%02X", p[i]); + } + } else if (tag == REFC_BINARY_SUBTAG) { + ProcBin* pb = (ProcBin *) binary_val(x); + Binary* val = pb->val; + + if (erts_smp_atomic_xchg(&val->refc, 0) != 0) { + val->flags = (UWord) all_binaries; + all_binaries = val; + } + erts_print(to, to_arg, "Yc%X:%X:%X", val, + pb->bytes - (byte *)val->orig_bytes, + size); + } else if (tag == SUB_BINARY_SUBTAG) { + ErlSubBin* Sb = (ErlSubBin *) binary_val(x); + Eterm* real_bin = binary_val(Sb->orig); + void* val; + + if (thing_subtag(*real_bin) == REFC_BINARY_SUBTAG) { + ProcBin* pb = (ProcBin *) real_bin; + val = pb->val; + } else { /* Heap binary */ + val = real_bin; + } + erts_print(to, to_arg, "Ys%X:%X:%X", val, Sb->offs, size); } - erts_print(to, to_arg, "Ys%X:%X:%X", val, Sb->offs, size); + erts_putc(to, to_arg, '\n'); + *ptr = OUR_NIL; + } else if (is_external_pid_header(hdr)) { + erts_print(to, to_arg, "P%T\n", x); + *ptr = OUR_NIL; + } else if (is_external_port_header(hdr)) { + erts_print(to, to_arg, "p<%bpu.%bpu>\n", + port_channel_no(x), port_number(x)); + *ptr = OUR_NIL; + } else { + /* + * All other we dump in the external term format. + */ + dump_externally(to, to_arg, x); + erts_putc(to, to_arg, '\n'); + *ptr = OUR_NIL; } - erts_putc(to, to_arg, '\n'); - *ptr = OUR_NIL; - } else if (is_external_pid_header(hdr)) { - erts_print(to, to_arg, "P%T\n", x); - *ptr = OUR_NIL; - } else if (is_external_port_header(hdr)) { - erts_print(to, to_arg, "p<%bpu.%bpu>\n", - port_channel_no(x), port_number(x)); - *ptr = OUR_NIL; - } else { - /* - * All other we dump in the external term format. - */ - dump_externally(to, to_arg, x); - erts_putc(to, to_arg, '\n'); - *ptr = OUR_NIL; } } + x = *next; + *next = OUR_NIL; + next--; } - - x = *next; - *next = OUR_NIL; - next--; - goto again; + UnUseTmpHeapNoproc(1); } static void -- cgit v1.2.3 From 104042e73a5f8fbeaf3350fa4f9605d0a8f5cd53 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 12 Jan 2011 17:19:08 +0100 Subject: HALFWORD Make system_info mseg_alloc report both low/high mem --- erts/emulator/sys/common/erl_mseg.c | 80 +++++++++++++++++++++++++------------ erts/emulator/test/driver_SUITE.erl | 24 +++++++++-- 2 files changed, 75 insertions(+), 29 deletions(-) diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index b46c6263a0..8421eb415c 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -171,6 +171,7 @@ struct mem_kind_t { Uint cache_size; Uint min_cached_seg_size; Uint max_cached_seg_size; + Uint cache_hits; struct { struct { @@ -188,6 +189,7 @@ struct mem_kind_t { } max_ever; } segments; + const char* name; MemKind* next; };/*MemKind*/ @@ -198,7 +200,6 @@ static MemKind the_mem; #endif static MemKind* mk_list = NULL; -static Uint cache_hits; static Uint max_cache_size; static Uint abs_max_cache_bad_fit; static Uint rel_max_cache_bad_fit; @@ -708,7 +709,7 @@ mseg_alloc(ErtsAlcType_t atype, Uint *size_p, const ErtsMsegOpt_t *opt) goto create_seg; } - cache_hits++; + mk->cache_hits++; size = cand_cd->size; seg = cand_cd->seg; @@ -929,6 +930,8 @@ static struct { Eterm mcs; Eterm cci; + Eterm memkind; + Eterm name; Eterm status; Eterm cached_segments; Eterm cache_hits; @@ -978,6 +981,8 @@ init_atoms(void) #endif AM_INIT(version); + AM_INIT(memkind); + AM_INIT(name); AM_INIT(options); AM_INIT(amcbf); @@ -1188,14 +1193,10 @@ info_calls(int *print_to_p, void *print_to_arg, Uint **hpp, Uint *szp) } static Eterm -info_status(int *print_to_p, - void *print_to_arg, - int begin_new_max_period, - Uint **hpp, - Uint *szp) +info_status(MemKind* mk, int *print_to_p, void *print_to_arg, + int begin_new_max_period, Uint **hpp, Uint *szp) { Eterm res = THE_NON_VALUE; - MemKind* mk = type2mk(0); // SVERK cheat if (mk->segments.max_ever.no < mk->segments.max.no) mk->segments.max_ever.no = mk->segments.max.no; @@ -1207,7 +1208,7 @@ info_status(int *print_to_p, void *arg = print_to_arg; erts_print(to, arg, "cached_segments: %bpu\n", mk->cache_size); - erts_print(to, arg, "cache_hits: %bpu\n", cache_hits); + erts_print(to, arg, "cache_hits: %bpu\n", mk->cache_hits); erts_print(to, arg, "segments: %bpu %bpu %bpu\n", mk->segments.current.no, mk->segments.max.no, mk->segments.max_ever.no); erts_print(to, arg, "segments_size: %bpu %bpu %bpu\n", @@ -1233,7 +1234,7 @@ info_status(int *print_to_p, bld_unstable_uint(hpp, szp, mk->segments.max_ever.no)); add_2tup(hpp, szp, &res, am.cache_hits, - bld_unstable_uint(hpp, szp, cache_hits)); + bld_unstable_uint(hpp, szp, mk->cache_hits)); add_2tup(hpp, szp, &res, am.cached_segments, bld_unstable_uint(hpp, szp, mk->cache_size)); @@ -1248,6 +1249,32 @@ info_status(int *print_to_p, return res; } +static Eterm info_memkind(MemKind* mk, int *print_to_p, void *print_to_arg, + int begin_max_per, Uint **hpp, Uint *szp) +{ + Eterm res = THE_NON_VALUE; + Eterm atoms[3]; + Eterm values[3]; + + if (print_to_p) { + erts_print(*print_to_p, print_to_arg, "memory kind: %s\n", mk->name); + } + if (hpp || szp) { + atoms[0] = am.name; + atoms[1] = am.status; + atoms[2] = am.calls; + values[0] = erts_bld_string(hpp, szp, mk->name); + } + values[1] = info_status(mk, print_to_p, print_to_arg, begin_max_per, hpp, szp); + values[2] = info_calls(print_to_p, print_to_arg, hpp, szp); + + if (hpp || szp) + res = bld_2tup_list(hpp, szp, 3, atoms, values); + + return res; +} + + static Eterm info_version(int *print_to_p, void *print_to_arg, Uint **hpp, Uint *szp) { @@ -1294,6 +1321,7 @@ erts_mseg_info(int *print_to_p, Eterm res = THE_NON_VALUE; Eterm atoms[4]; Eterm values[4]; + Uint n = 0; erts_mtx_lock(&mseg_mutex); @@ -1304,17 +1332,19 @@ erts_mseg_info(int *print_to_p, atoms[0] = am.version; atoms[1] = am.options; - atoms[2] = am.status; - atoms[3] = am.calls; + atoms[2] = am.memkind; + atoms[3] = am.memkind; } - - values[0] = info_version(print_to_p, print_to_arg, hpp, szp); - values[1] = info_options("option ", print_to_p, print_to_arg, hpp, szp); - values[2] = info_status(print_to_p, print_to_arg, begin_max_per, hpp, szp); - values[3] = info_calls(print_to_p, print_to_arg, hpp, szp); - + values[n++] = info_version(print_to_p, print_to_arg, hpp, szp); + values[n++] = info_options("option ", print_to_p, print_to_arg, hpp, szp); +#if HALFWORD_HEAP + values[n++] = info_memkind(&low_mem, print_to_p, print_to_arg, begin_max_per, hpp, szp); + values[n++] = info_memkind(&hi_mem, print_to_p, print_to_arg, begin_max_per, hpp, szp); +#else + values[n++] = info_memkind(&the_mem, print_to_p, print_to_arg, begin_max_per, hpp, szp); +#endif if (hpp || szp) - res = bld_2tup_list(hpp, szp, 4, atoms, values); + res = bld_2tup_list(hpp, szp, n, atoms, values); erts_mtx_unlock(&mseg_mutex); @@ -1400,7 +1430,7 @@ erts_mseg_unit_size(void) return page_size; } -static void mem_kind_init(MemKind* mk) +static void mem_kind_init(MemKind* mk, const char* name) { unsigned i; @@ -1409,6 +1439,7 @@ static void mem_kind_init(MemKind* mk) mk->max_cached_seg_size = 0; mk->min_cached_seg_size = ~((Uint) 0); mk->cache_size = 0; + mk->cache_hits = 0; if (max_cache_size > 0) { for (i = 0; i < max_cache_size - 1; i++) @@ -1427,6 +1458,7 @@ static void mem_kind_init(MemKind* mk) mk->segments.max_ever.no = 0; mk->segments.max_ever.sz = 0; + mk->name = name; mk->next = mk_list; mk_list = mk; } @@ -1480,13 +1512,11 @@ erts_mseg_init(ErtsMsegInit_t *init) if (max_cache_size > MAX_CACHE_SIZE) max_cache_size = MAX_CACHE_SIZE; - cache_hits = 0; - #if HALFWORD_HEAP - mem_kind_init(&low_mem); - mem_kind_init(&hi_mem); + mem_kind_init(&low_mem, "low memory"); + mem_kind_init(&hi_mem, "high memory"); #else - mem_kind_init(&the_mem); + mem_kind_init(&the_mem, "all memory"); #endif is_cache_check_scheduled = 0; diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 39b2ed395f..f3c7bc954e 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1790,8 +1790,8 @@ mseg_alloc_ccc() -> mseg_alloc_ccc(erlang:system_info({allocator,mseg_alloc})). mseg_alloc_ccc(MsegAllocInfo) -> - ?line {value,{calls, CL}} - = lists:keysearch(calls, 1, MsegAllocInfo), + ?line {value,{memkind, MKL}} = lists:keysearch(memkind,1,MsegAllocInfo), + ?line {value,{calls, CL}} = lists:keysearch(calls, 1, MKL), ?line {value,{mseg_check_cache, GigaCCC, CCC}} = lists:keysearch(mseg_check_cache, 1, CL), ?line GigaCCC*1000000000 + CCC. @@ -1800,12 +1800,28 @@ mseg_alloc_cached_segments() -> mseg_alloc_cached_segments(erlang:system_info({allocator,mseg_alloc})). mseg_alloc_cached_segments(MsegAllocInfo) -> + MemName = case is_halfword_vm() of + true -> "high memory"; + false -> "all memory" + end, + ?line [{memkind,DrvMem}] + = lists:filter(fun(E) -> case E of + {memkind, [{name, MemName} | _]} -> true; + _ -> false + end end, MsegAllocInfo), ?line {value,{status, SL}} - = lists:keysearch(status, 1, MsegAllocInfo), + = lists:keysearch(status, 1, DrvMem), ?line {value,{cached_segments, CS}} = lists:keysearch(cached_segments, 1, SL), ?line CS. +is_halfword_vm() -> + case {erlang:system_info({wordsize, internal}), + erlang:system_info({wordsize, external})} of + {4, 8} -> true; + {WS, WS} -> false + end. + driver_alloc_sbct() -> {_, _, _, As} = erlang:system_info(allocator), case lists:keysearch(driver_alloc, 1, As) of -- cgit v1.2.3 From aa861b4e7ac73d9a6b2813aa2aa20864eaa9d37a Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 13 Jan 2011 17:46:52 +0100 Subject: HALFWORD ETS Fix segv for match spec with several function and guards Did not properly take care of case when TryMeElse restarted with next match clause. --- erts/emulator/beam/erl_db_util.c | 19 ++-- lib/stdlib/test/ets_SUITE.erl | 183 +++++++++++++++++++++++++++++++-------- 2 files changed, 156 insertions(+), 46 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 3405ec87d2..4620114db1 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -853,7 +853,7 @@ static DMCRet dmc_one_term(DMCContext *context, #ifdef DMC_DEBUG static int test_disassemble_next = 0; -static void db_match_dis(Binary *prog); +void db_match_dis(Binary *prog); #define TRACE erts_fprintf(stderr,"Trace: %s:%d\n",__FILE__,__LINE__) #define FENCE_PATTERN_SIZE 1 #define FENCE_PATTERN 0xDEADBEEFUL @@ -1588,6 +1588,7 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) return ret; } + /* ** Execution of the match program, this is Pam. ** May return THE_NON_VALUE, which is a bailout. @@ -1623,7 +1624,7 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, int fail_label; int atomic_trace; #if HALFWORD_HEAP - int is_abs_variables = (base == NULL); + Eterm* variable_base; /* base for $n-variables (hp[n]) */ #endif #ifdef DMC_DEBUG Uint *heap_fence; @@ -1696,6 +1697,7 @@ restart: for (i=prog->eheap_offset-(1+FENCE_PATTERN_SIZE); i>=0; i--) { hp[i] = NIL; } + variable_base = base; #endif for (;;) { @@ -1718,6 +1720,7 @@ restart: #endif switch (*pc++) { case matchTryMeElse: + ASSERT(fail_label == -1); fail_label = *pc++; break; case matchArray: /* only when DCOMP_TRACE, is always first @@ -1766,14 +1769,13 @@ restart: ep = *(--sp); break; case matchBind: - ASSERT_HALFWORD(is_abs_variables == !base); + ASSERT_HALFWORD(variable_base == base); n = *pc++; hp[n] = *ep++; break; case matchCmp: - ASSERT_HALFWORD(is_abs_variables == !base); n = *pc++; - if (!eq_rel(hp[n],base,*ep,base)) + if (!eq_rel(hp[n], variable_base, *ep, base)) FAIL(); ++ep; break; @@ -1906,13 +1908,13 @@ restart: case matchPushV: n = *pc++; #if HALFWORD_HEAP - if (!is_abs_variables && !is_immed(hp[n])) { + if (variable_base!=NULL && !is_immed(hp[n])) { for (i=prog->eheap_offset-1; i>=0; i--) if (!is_immed(hp[i])) { Uint sz = size_object_rel(hp[i], base); Eterm* top = HAlloc(psp, sz); hp[i] = copy_struct_rel(hp[i], sz, &top, &MSO(psp), base, NULL); } - is_abs_variables = 1; + variable_base = NULL; } #endif *esp++ = hp[n]; @@ -4880,10 +4882,11 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, #ifdef DMC_DEBUG + /* ** Disassemble match program */ -static void db_match_dis(Binary *bp) +void db_match_dis(Binary *bp) { MatchProg *prog = Binary2MatchProg(bp); UWord *t = prog->text; diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 691b1189be..1661aa0217 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -99,6 +99,8 @@ -include("test_server.hrl"). +-define(m(A,B), ?line assert_eq(A,B)). + init_per_testcase(Case, Config) -> Seed = {S1,S2,S3} = random:seed0(), %now(), random:seed(S1,S2,S3), @@ -176,29 +178,114 @@ t_match_spec_run(suite) -> t_match_spec_run(doc) -> ["Check ets:match_spec_run/2."]; t_match_spec_run(Config) when is_list(Config) -> + init_externals(), ?line EtsMem = etsmem(), - ?line [2,3] = ets:match_spec_run([{1},{2},{3}], - ets:match_spec_compile( - [{{'$1'},[{'>','$1',1}],['$1']}])), + + t_match_spec_run_test([{1},{2},{3}], + [{{'$1'},[{'>','$1',1}],['$1']}], + [2,3]), + ?line Huge = [{X} || X <- lists:seq(1,2500)], ?line L = lists:seq(2476,2500), - ?line L = ets:match_spec_run(Huge, - ets:match_spec_compile( - [{{'$1'},[{'>','$1',2475}],['$1']}])), + t_match_spec_run_test(Huge, [{{'$1'},[{'>','$1',2475}],['$1']}], L), + ?line L2 = [{X*16#FFFFFFF} || X <- L], - ?line L2 = ets:match_spec_run(Huge, - ets:match_spec_compile( - [{{'$1'}, - [{'>','$1',2475}], - [{{{'*','$1',16#FFFFFFF}}}]}])), - ?line [500,1000,1500,2000,2500] = - ets:match_spec_run(Huge, - ets:match_spec_compile( - [{{'$1'}, - [{'=:=',{'rem','$1',500},0}], - ['$1']}])), + t_match_spec_run_test(Huge, + [{{'$1'}, [{'>','$1',2475}], [{{{'*','$1',16#FFFFFFF}}}]}], + L2), + + t_match_spec_run_test(Huge, [{{'$1'}, [{'=:=',{'rem','$1',500},0}], ['$1']}], + [500,1000,1500,2000,2500]), + + %% More matching fun with several match clauses and guards, + %% applied to a variety of terms. + Fun = fun(Term) -> + CTerm = {const, Term}, + + N_List = [{Term, "0", "v-element"}, + {"=hidden_node", "0", Term}, + {"0", Term, Term}, + {"something", Term, "something else"}, + {"guard and res", Term, 872346}, + {Term, {'and',Term,'again'}, 3.14}, + {Term, {'and',Term,'again'}, "m&g"}, + {Term, {'and',Term,'again'}, "m&g&r"}, + {[{second,Term}, 'and', "tail"], Term, ['and',"tail"]}], + + N_MS = [{{'$1','$2','$3'}, + [{'=:=','$1',CTerm}, {'=:=','$2',{const,"0"}}], + [{{"Guard only for $1",'$3'}}]}, + + {{'$3','$1','$4'}, + [{'=:=','$3',"=hidden_node"}, {'=:=','$1',{const,"0"}}], + [{{"Result only for $4",'$4'}}]}, + + {{'$2','$1','$1'}, + [{'=:=','$2',{const,"0"}}], + [{{"Match only for $1",'$2'}}]}, + + {{'$2',Term,['$3'|'_']}, + [{is_list,'$2'},{'=:=','$3',$s}], + [{{"Matching term",'$2'}}]}, + + {{'$1','$2',872346}, + [{'=:=','$2',CTerm}, {is_list,'$1'}], + [{{"Guard and result",'$2'}}]}, + + {{'$1', {'and','$1','again'}, '$2'}, + [{is_float,'$2'}], + [{{"Match and result",'$1'}}]}, + + {{'$1', {'and','$1','again'}, '$2'}, + [{'=:=','$1',CTerm}, {'=:=', '$2', "m&g"}], + [{{"Match and guard",'$2'}}]}, + + {{'$1', {'and','$1','again'}, "m&g&r"}, + [{'=:=','$1',CTerm}], + [{{"Match, guard and result",'$1'}}]}, + + {{'$1', '$2', '$3'}, + [{'=:=','$1',[{{second,'$2'}} | '$3']}], + [{{"Building guard"}}]} + ], + + N_Result = [{"Guard only for $1", "v-element"}, + {"Result only for $4", Term}, + {"Match only for $1", "0"}, + {"Matching term","something"}, + {"Guard and result",Term}, + {"Match and result",Term}, + {"Match and guard","m&g"}, + {"Match, guard and result",Term}, + {"Building guard"}], + + F = fun(N_MS_Perm) -> + t_match_spec_run_test(N_List, N_MS_Perm, N_Result) + end, + repeat_for_permutations(F, N_MS) + end, + + test_terms(Fun), + ?line verify_etsmem(EtsMem). +t_match_spec_run_test(List, MS, Result) -> + + %%io:format("ms = ~p\n",[MS]), + + ?m(Result, ets:match_spec_run(List, ets:match_spec_compile(MS))), + + %% Check that ets:select agree + Tab = ets:new(xxx, [bag]), + ets:insert(Tab, List), + SRes = lists:sort(Result), + ?m(SRes, lists:sort(ets:select(Tab, MS))), + ets:delete(Tab). + +assert_eq(A,A) -> ok; +assert_eq(A,B) -> + io:format("FAILED MATCH:\n~p\n =/=\n~p\n",[A,B]), + ?t:fail("assert_eq failed"). t_repair_continuation(suite) -> @@ -5496,6 +5583,20 @@ repeat_while(Fun, Arg0) -> {false,Ret} -> Ret end. +%% Some (but not all) permutations of List +repeat_for_permutations(Fun, List) -> + repeat_for_permutations(Fun, List, length(List)-1). +repeat_for_permutations(Fun, List, 0) -> + Fun(List); +repeat_for_permutations(Fun, List, N) -> + {A,B} = lists:split(N, List), + L1 = B++A, + L2 = lists:reverse(L1), + L3 = B++lists:reverse(A), + L4 = lists:reverse(B)++A, + Fun(L1), Fun(L2), Fun(L3), Fun(L4), + repeat_for_permutations(Fun, List, N-1). + receive_any() -> receive M -> io:format("Process ~p got msg ~p\n", [self(),M]), @@ -5677,6 +5778,7 @@ test_terms(Test_Func) -> ?line Pib0 = process_info(self(),binary), ok. + id(I) -> I. very_big_num() -> @@ -5708,27 +5810,32 @@ make_ext_ref() -> Ref. init_externals() -> - SysDistSz = ets:info(sys_dist,size), - ?line Pa = filename:dirname(code:which(?MODULE)), - ?line {ok, Node} = test_server:start_node(plopp, slave, [{args, " -pa " ++ Pa}]), - ?line Res = case rpc:call(Node, ?MODULE, rpc_externals, []) of - {badrpc, {'EXIT', E}} -> - test_server:fail({rpcresult, E}); - R -> R - end, - ?line test_server:stop_node(Node), - - %% Wait for table 'sys_dist' to stabilize - repeat_while(fun() -> - case ets:info(sys_dist,size) of - SysDistSz -> false; - Sz -> - io:format("Waiting for sys_dist to revert size from ~p to size ~p\n", - [Sz, SysDistSz]), - receive after 1000 -> true end - end - end), - put(externals, Res). + case get(externals) of + undefined -> + SysDistSz = ets:info(sys_dist,size), + ?line Pa = filename:dirname(code:which(?MODULE)), + ?line {ok, Node} = test_server:start_node(plopp, slave, [{args, " -pa " ++ Pa}]), + ?line Res = case rpc:call(Node, ?MODULE, rpc_externals, []) of + {badrpc, {'EXIT', E}} -> + test_server:fail({rpcresult, E}); + R -> R + end, + ?line test_server:stop_node(Node), + + %% Wait for table 'sys_dist' to stabilize + repeat_while(fun() -> + case ets:info(sys_dist,size) of + SysDistSz -> false; + Sz -> + io:format("Waiting for sys_dist to revert size from ~p to size ~p\n", + [Sz, SysDistSz]), + receive after 1000 -> true end + end + end), + put(externals, Res); + + {_,_,_} -> ok + end. rpc_externals() -> {self(), make_port(), make_ref()}. -- cgit v1.2.3 From b066f2f18ba3192c2fae4e8dde570501ad5961bd Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 3 Feb 2011 19:13:41 +0100 Subject: HALFWORD ETS db_prog_match optimization --- erts/emulator/beam/erl_db_util.c | 208 +++++++++++++++++++++++++++------------ 1 file changed, 147 insertions(+), 61 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 4620114db1..49d3f9ffd1 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1588,6 +1588,58 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) return ret; } +void heap_consistency_check(Process*); // SVERK + +/************************ +struct heap_checkpoint_t +{ + Process *p; + Eterm* htop; + ErlHeapFragment* mbuf; + unsigned used_size; + ErlOffHeap off_heap; +}; + +static void heap_checkpoint_init(Process* p, struct heap_checkpoint_t* hcp) +{ + hcp->p = p; + hcp->htop = HEAP_TOP(p); + hcp->mbuf = MBUF(p); + hcp->used_size = hcp->mbuf ? hcp->mbuf->used_size : 0; + hcp->off_heap = MSO(p); +} + +static void heap_checkpoint_revert(struct heap_checkpoint_t* hcp) +{ + struct erl_off_heap_header* oh = MSO(hcp->p).first; + + if (oh != hcp->off_heap.first) { + ASSERT(oh != NULL); + if (hcp->off_heap.first) { + while (oh->next != hcp->off_heap.first) { + oh = oh->next; + } + oh->next = NULL; + } + erts_cleanup_offheap(&MSO(hcp->p)); + MSO(hcp->p) = hcp->off_heap; + } + if (MBUF(hcp->p) != hcp->mbuf) { + ErlHeapFragment* hf = MBUF(hcp->p); + ASSERT(hf != NULL); + while (hf->next != hcp->mbuf) { + hf = hf->next; + } + hf->next = NULL; + free_message_buffer(MBUF(hcp->p)); + MBUF(hcp->p) = hcp->mbuf; + } + if (hcp->mbuf != NULL && hcp->mbuf->used_size != hcp->used_size) { + abort(); + } + HEAP_TOP(hcp->p) = hcp->htop; +} +*******************/ /* ** Execution of the match program, this is Pam. @@ -1617,15 +1669,18 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, unsigned do_catch; ErtsMatchPseudoProcess *mpsp; Process *psp; + Process* build_proc; + Process* variable_proc; +#if HALFWORD_HEAP + Eterm* variable_base; /* base for $n-variables (hp[n]) */ +#endif Process *tmpp; Process *current_scheduled; ErtsSchedulerData *esdp; Eterm (*bif)(Process*, ...); int fail_label; int atomic_trace; -#if HALFWORD_HEAP - Eterm* variable_base; /* base for $n-variables (hp[n]) */ -#endif + int is_ets = 0; // SVERK ToDo!!! #ifdef DMC_DEBUG Uint *heap_fence; Uint *eheap_fence; @@ -1683,25 +1738,35 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, *return_flags = 0U; + //heap_checkpoint_init(c_p, &heap_checkpoint); + + hp = mpsp->heap; + restart: ep = &term; esp = mpsp->heap + prog->stack_offset; sp = (Eterm **) esp; - hp = mpsp->heap; - ehp = mpsp->heap + prog->eheap_offset; + ASSERT(hp == mpsp->heap); // SVERK + //ehp = mpsp->heap + prog->eheap_offset; ret = am_true; do_catch = 0; fail_label = -1; + build_proc = psp; -#if HALFWORD_HEAP /* clear all variables for matchPushV */ + /* Clear all variables for matchPushV */ for (i=prog->eheap_offset-(1+FENCE_PATTERN_SIZE); i>=0; i--) { hp[i] = NIL; } +#if HALFWORD_HEAP variable_base = base; + variable_proc = NULL; +#else + variable_proc = build_proc; #endif for (;;) { -#ifdef DMC_DEBUG + + #ifdef DMC_DEBUG if (*heap_fence != FENCE_PATTERN) { erl_exit(1, "Heap fence overwritten in db_prog_match after op " "0x%08x, overwritten with 0x%08x.", save_op, *heap_fence); @@ -1717,7 +1782,7 @@ restart: *stack_fence); } save_op = *pc; -#endif + #endif switch (*pc++) { case matchTryMeElse: ASSERT(fail_label == -1); @@ -1731,6 +1796,8 @@ restart: ep = termp; break; case matchArrayBind: /* When the array size is unknown. */ + ASSERT_HALFWORD(variable_base == NULL); + ASSERT(build_proc == NULL); n = *pc++; hp[n] = dpm_array_to_list(psp, termp, arity); break; @@ -1836,22 +1903,30 @@ restart: * Here comes guard instructions */ case matchPushC: /* Push constant */ - *esp++ = *pc++; + if (do_catch && !is_immed(*pc)) { + *esp++ = copy_object(*pc++, build_proc); + } + else { + *esp++ = *pc++; + } break; case matchConsA: - ehp[1] = *--esp; - ehp[0] = esp[-1]; + ehp = HAlloc(build_proc, 2); + CDR(ehp) = *--esp; + CAR(ehp) = esp[-1]; esp[-1] = make_list(ehp); - ehp += 2; + //ehp += 2; break; case matchConsB: - ehp[0] = *--esp; - ehp[1] = esp[-1]; + ehp = HAlloc(build_proc, 2); + CAR(ehp) = *--esp; + CDR(ehp) = esp[-1]; esp[-1] = make_list(ehp); - ehp += 2; + //ehp += 2; break; case matchMkTuple: n = *pc++; + ehp = HAlloc(build_proc, n+1); t = make_tuple(ehp); *ehp++ = make_arityval(n); while (n--) { @@ -1861,7 +1936,7 @@ restart: break; case matchCall0: bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(psp); + t = (*bif)(build_proc); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -1872,7 +1947,7 @@ restart: break; case matchCall1: bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(psp, esp[-1]); + t = (*bif)(build_proc, esp[-1]); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -1883,7 +1958,7 @@ restart: break; case matchCall2: bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(psp, esp[-1], esp[-2]); + t = (*bif)(build_proc, esp[-1], esp[-2]); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -1895,7 +1970,7 @@ restart: break; case matchCall3: bif = (Eterm (*)(Process*, ...)) *pc++; - t = (*bif)(psp, esp[-1], esp[-2], esp[-3]); + t = (*bif)(build_proc, esp[-1], esp[-2], esp[-3]); if (is_non_value(t)) { if (do_catch) t = FAIL_TERM; @@ -1907,36 +1982,42 @@ restart: break; case matchPushV: n = *pc++; - #if HALFWORD_HEAP - if (variable_base!=NULL && !is_immed(hp[n])) { + if (variable_proc != build_proc && !is_immed(hp[n])) { + ASSERT(build_proc); for (i=prog->eheap_offset-1; i>=0; i--) if (!is_immed(hp[i])) { - Uint sz = size_object_rel(hp[i], base); - Eterm* top = HAlloc(psp, sz); - hp[i] = copy_struct_rel(hp[i], sz, &top, &MSO(psp), base, NULL); + Uint sz = size_object_rel(hp[i], variable_base); + Eterm* top = HAlloc(build_proc, sz); + hp[i] = copy_struct_rel(hp[i], sz, &top, &MSO(build_proc), + variable_base, NULL); } + #if HALFWORD_HEAP variable_base = NULL; + #endif + variable_proc = build_proc; } - #endif *esp++ = hp[n]; break; - case matchPushExpr: - #if HALFWORD_HEAP - if (base) { - Uint sz; - Eterm* top; - ASSERT(is_tuple_rel(term,base)); /* assume ETS */ - sz = size_object_rel(term, base); - top = HAlloc(psp, sz); + case matchPushExpr: { + Uint sz; + Eterm* top; + sz = size_object_rel(term, base); + top = HAlloc(build_proc, sz); + if (is_ets) { + ASSERT(is_tuple_rel(term,base)); *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, - &top, &MSO(psp), base); - break; + &top, &MSO(build_proc), base); + } + else { + *esp++ = copy_struct_rel(term, sz, &top, &MSO(build_proc), + base, NULL); } - #endif - *esp++ = term; break; + } case matchPushArrayAsList: + ASSERT_HALFWORD(base == NULL); n = arity; /* Only happens when 'term' is an array */ tp = termp; + ehp = HAlloc(build_proc, n*2); *esp++ = make_list(ehp); while (n--) { *ehp++ = *tp++; @@ -1949,7 +2030,8 @@ restart: break; case matchPushArrayAsListU: /* This instruction is NOT efficient. */ - *esp++ = dpm_array_to_list(psp, termp, arity); + ASSERT_HALFWORD(base == NULL); + *esp++ = dpm_array_to_list(build_proc, termp, arity); break; case matchTrue: if (*--esp != am_true) @@ -2035,7 +2117,7 @@ restart: case matchProcessDump: { erts_dsprintf_buf_t *dsbufp = erts_create_tmp_dsbuf(0); print_process_info(ERTS_PRINT_DSBUF, (void *) dsbufp, c_p); - *esp++ = new_binary(psp, (byte *)dsbufp->str, (int)dsbufp->str_len); + *esp++ = new_binary(build_proc, (byte *)dsbufp->str, (int)dsbufp->str_len); erts_destroy_tmp_dsbuf(dsbufp); break; } @@ -2079,29 +2161,23 @@ restart: if (SEQ_TRACE_TOKEN(c_p) == NIL) *esp++ = NIL; else { + Eterm sender = SEQ_TRACE_TOKEN_SENDER(c_p); + Uint sender_sz = is_immed(sender) ? 0 : size_object(sender); + ehp = HAlloc(build_proc, 6 + sender_sz); *esp++ = make_tuple(ehp); ehp[0] = make_arityval(5); ehp[1] = SEQ_TRACE_TOKEN_FLAGS(c_p); ehp[2] = SEQ_TRACE_TOKEN_LABEL(c_p); ehp[3] = SEQ_TRACE_TOKEN_SERIAL(c_p); - ehp[4] = SEQ_TRACE_TOKEN_SENDER(c_p); ehp[5] = SEQ_TRACE_TOKEN_LASTCNT(c_p); ASSERT(SEQ_TRACE_TOKEN_ARITY(c_p) == 5); ASSERT(is_immed(ehp[1])); ASSERT(is_immed(ehp[2])); ASSERT(is_immed(ehp[3])); ASSERT(is_immed(ehp[5])); - if(!is_immed(ehp[4])) { - Eterm *sender = &ehp[4]; - ehp += 6; - *sender = copy_struct(*sender, - size_object(*sender), - &ehp, - &MSO(psp)); - } - else - ehp += 6; - + ehp += 6; + ehp[4] = (sender_sz==0) ? sender + : copy_struct(sender, sender_sz, &ehp, &MSO(build_proc)); } break; case matchEnableTrace: @@ -2150,12 +2226,13 @@ restart: if (!(c_p->cp) || !(cp = find_function_from_pc(c_p->cp))) { *esp++ = am_undefined; } else { + ehp = HAlloc(build_proc, 4); *esp++ = make_tuple(ehp); ehp[0] = make_arityval(3); ehp[1] = cp[0]; ehp[2] = cp[1]; ehp[3] = make_small((Uint) cp[2]); - ehp += 4; + //ehp += 4; } break; case matchSilent: @@ -2233,7 +2310,10 @@ restart: } break; case matchCatch: + //heap_checkpoint_revert(&heap_checkpoint); do_catch = 1; + build_proc = c_p; + esdp->current_process = build_proc; break; case matchHalt: goto success; @@ -2242,6 +2322,7 @@ restart: } } fail: + //heap_checkpoint_revert(&heap_checkpoint); *return_flags = 0U; if (fail_label >= 0) { /* We failed during a "TryMeElse", lets restart, with the next match @@ -2273,6 +2354,10 @@ success: esdp->current_process = current_scheduled; END_ATOMIC_TRACE(c_p); + + #ifdef DEBUG + //heap_consistency_check(c_p); // SVERK + #endif return ret; #undef FAIL #undef FAIL_TERM @@ -4863,15 +4948,16 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, NULL, 0, &dummy); if (is_value(res) && hpp!=NULL) { - if (all) { - *hpp = HAlloc(c_p, obj->size + extra); - res = copy_shallow_rel(obj->tpl, obj->size, hpp, &MSO(c_p), base); - } - else { - Uint sz = size_object(res); - *hpp = HAlloc(c_p, sz + extra); - res = copy_struct(res, sz, hpp, &MSO(c_p)); - } + *hpp = HAlloc(c_p, extra); +// if (all) { +// *hpp = HAlloc(c_p, obj->size + extra); +// res = copy_shallow_rel(obj->tpl, obj->size, hpp, &MSO(c_p), base); +// } +// else { +// Uint sz = size_object(res); +// *hpp = HAlloc(c_p, sz + extra); +// res = copy_struct(res, sz, hpp, &MSO(c_p)); +// } } if (tb->compress) { -- cgit v1.2.3 From 9fa33de8e1654484851555cd54b0b5118eb32069 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 24 Jan 2011 14:46:06 +0100 Subject: HALFWORD ETS Further match spec optimization to minimize copying and garbage --- erts/emulator/beam/erl_db.c | 8 +- erts/emulator/beam/erl_db_hash.c | 28 +-- erts/emulator/beam/erl_db_tree.c | 16 +- erts/emulator/beam/erl_db_util.c | 391 +++++++++++++++++++++++++-------------- erts/emulator/beam/erl_db_util.h | 10 +- erts/emulator/beam/erl_trace.c | 6 +- erts/emulator/beam/global.h | 9 +- 7 files changed, 296 insertions(+), 172 deletions(-) diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index 02f16899ae..5b74240cc3 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -2713,7 +2713,6 @@ BIF_RETTYPE ets_match_spec_run_r_3(BIF_ALIST_3) Binary *mp; Eterm res; Uint32 dummy; - Uint sz; if (!(is_list(BIF_ARG_1) || BIF_ARG_1 == NIL) || !is_binary(BIF_ARG_2)) { error: @@ -2738,11 +2737,10 @@ BIF_RETTYPE ets_match_spec_run_r_3(BIF_ALIST_3) BIF_TRAP3(bif_export[BIF_ets_match_spec_run_r_3], BIF_P,lst,BIF_ARG_2,ret); } - res = db_prog_match(BIF_P, mp, CAR(list_val(lst)), NULL, NULL, 0, &dummy); + res = db_prog_match(BIF_P, mp, CAR(list_val(lst)), NULL, NULL, 0, + ERTS_PAM_COPY_RESULT, &dummy); if (is_value(res)) { - sz = size_object(res); - hp = HAlloc(BIF_P, sz + 2); - res = copy_struct(res, sz, &hp, &MSO(BIF_P)); + hp = HAlloc(BIF_P, 2); ret = CONS(hp,res,ret); /*hp += 2;*/ } diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c index 035aefed0c..9ef990cc4f 100644 --- a/erts/emulator/beam/erl_db_hash.c +++ b/erts/emulator/beam/erl_db_hash.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1303,8 +1303,8 @@ static int db_select_continue_hash(Process *p, } for(;;) { if (current->hvalue != INVALID_HASH && - (match_res = db_prog_match_and_copy(&tb->common, p, mp, all_objects, - ¤t->dbterm, &hp, 2), + (match_res = db_match_dbterm(&tb->common, p, mp, all_objects, + ¤t->dbterm, &hp, 2), is_value(match_res))) { match_list = CONS(hp, match_res, match_list); @@ -1468,8 +1468,8 @@ static int db_select_chunk_hash(Process *p, DbTable *tbl, for(;;) { if (current != NULL) { if (current->hvalue != INVALID_HASH) { - match_res = db_prog_match_and_copy(&tb->common, p, mpi.mp, 0, - ¤t->dbterm, &hp, 2); + match_res = db_match_dbterm(&tb->common, p, mpi.mp, 0, + ¤t->dbterm, &hp, 2); if (is_value(match_res)) { match_list = CONS(hp, match_res, match_list); ++got; @@ -1634,8 +1634,8 @@ static int db_select_count_hash(Process *p, for(;;) { if (current != NULL) { if (current->hvalue != INVALID_HASH) { - if (db_prog_match_and_copy(&tb->common, p, mpi.mp, 0, - ¤t->dbterm, NULL,0) == am_true) { + if (db_match_dbterm(&tb->common, p, mpi.mp, 0, + ¤t->dbterm, NULL,0) == am_true) { ++got; } --num_left; @@ -1783,8 +1783,8 @@ static int db_select_delete_hash(Process *p, } else { int did_erase = 0; - if (db_prog_match_and_copy(&tb->common, p, mpi.mp, 0, - &(*current)->dbterm, NULL, 0) == am_true) { + if (db_match_dbterm(&tb->common, p, mpi.mp, 0, + &(*current)->dbterm, NULL, 0) == am_true) { if (NFIXED(tb) > fixated_by_me) { /* fixated by others? */ if (slot_ix != last_pseudo_delete) { add_fixed_deletion(tb, slot_ix); @@ -1894,8 +1894,8 @@ static int db_select_delete_continue_hash(Process *p, } else { int did_erase = 0; - if (db_prog_match_and_copy(&tb->common, p, mp, 0, - &(*current)->dbterm, NULL, 0) == am_true) { + if (db_match_dbterm(&tb->common, p, mp, 0, + &(*current)->dbterm, NULL, 0) == am_true) { if (NFIXED(tb) > fixated_by_me) { /* fixated by others? */ if (slot_ix != last_pseudo_delete) { add_fixed_deletion(tb, slot_ix); @@ -1994,8 +1994,8 @@ static int db_select_count_continue_hash(Process *p, current = current->next; continue; } - if (db_prog_match_and_copy(&tb->common, p, mp, 0, ¤t->dbterm, - NULL, 0) == am_true) { + if (db_match_dbterm(&tb->common, p, mp, 0, ¤t->dbterm, + NULL, 0) == am_true) { ++got; } --num_left; @@ -2174,7 +2174,7 @@ static int analyze_pattern(DbTableHash *tb, Eterm pattern, HashValue hval = NIL; int num_heads = 0; int i; - + mpi->lists = mpi->dlists; mpi->num_lists = 0; mpi->key_given = 1; diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index d4f02f9117..484a096249 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -2978,8 +2978,8 @@ static int doit_select(DbTableTree *tb, TreeDbTerm *this, void *ptr, this->dbterm.tpl) > 0))) { return 0; } - ret = db_prog_match_and_copy(&tb->common,sc->p,sc->mp,sc->all_objects, - &this->dbterm, &hp, 2); + ret = db_match_dbterm(&tb->common,sc->p,sc->mp,sc->all_objects, + &this->dbterm, &hp, 2); if (is_value(ret)) { sc->accum = CONS(hp, ret, sc->accum); } @@ -3011,8 +3011,8 @@ static int doit_select_count(DbTableTree *tb, TreeDbTerm *this, void *ptr, this->dbterm.tpl) > 0)) { return 0; } - ret = db_prog_match_and_copy(&tb->common, sc->p, sc->mp, 0, - &this->dbterm, NULL, 0); + ret = db_match_dbterm(&tb->common, sc->p, sc->mp, 0, + &this->dbterm, NULL, 0); if (ret == am_true) { ++(sc->got); } @@ -3043,8 +3043,8 @@ static int doit_select_chunk(DbTableTree *tb, TreeDbTerm *this, void *ptr, return 0; } - ret = db_prog_match_and_copy(&tb->common, sc->p, sc->mp, sc->all_objects, - &this->dbterm, &hp, 2); + ret = db_match_dbterm(&tb->common, sc->p, sc->mp, sc->all_objects, + &this->dbterm, &hp, 2); if (is_value(ret)) { ++(sc->got); sc->accum = CONS(hp, ret, sc->accum); @@ -3080,8 +3080,8 @@ static int doit_select_delete(DbTableTree *tb, TreeDbTerm *this, void *ptr, GETKEY_WITH_POS(sc->keypos, this->dbterm.tpl), this->dbterm.tpl) > 0) return 0; - ret = db_prog_match_and_copy(&tb->common, sc->p, sc->mp, 0, - &this->dbterm, NULL, 0); + ret = db_match_dbterm(&tb->common, sc->p, sc->mp, 0, + &this->dbterm, NULL, 0); if (ret == am_true) { key = GETKEY(sc->tb, this->dbterm.tpl); linkout_tree(sc->tb, key, this->dbterm.tpl); diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 49d3f9ffd1..2b7e0bcac3 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -229,6 +229,11 @@ typedef enum { matchCall2, matchCall3, matchPushV, +#if HALFWORD_HEAP + matchPushVGuard, /* First guard-only variable reference */ +#endif + matchPushVResult, /* First variable reference in result, or (if HALFWORD) + in guard if also referenced in result */ matchPushExpr, /* Push the whole expression we're matching ('$_') */ matchPushArrayAsList, /* Only when parameter is an Array and not an erlang term (DCOMP_TRACE) */ @@ -292,11 +297,19 @@ DMC_DECLARE_STACK_TYPE(unsigned); ** Data about the heap during compilation */ +typedef struct DMCVariable { + int is_bound; + int is_in_body; +#if HALFWORD_HEAP + int first_guard_label; /* to maybe change from PushVGuard to PushVResult */ +#endif +} DMCVariable; + typedef struct DMCHeap { int size; - unsigned def[DMC_DEFAULT_SIZE]; - unsigned *data; - int used; + DMCVariable vars_def[DMC_DEFAULT_SIZE]; + DMCVariable* vars; + int vars_used; } DMCHeap; /* @@ -346,9 +359,22 @@ typedef struct dmc_context { #define ERTS_DEFAULT_MS_HEAP_SIZE 128 +/* Runtime info about a $-variable +*/ +typedef struct MatchVariable { + Eterm term; +#ifdef DEBUG + Process* proc; + Eterm* base; +#endif +} MatchVariable; + typedef struct { Process process; - Eterm *heap; + union { + Eterm* heap; + MatchVariable* variables; /* first on "heap" */ + }u; Eterm default_heap[ERTS_DEFAULT_MS_HEAP_SIZE]; } ErtsMatchPseudoProcess; @@ -371,10 +397,10 @@ cleanup_match_pseudo_process(ErtsMatchPseudoProcess *mpsp, int keep_heap) } #endif if (!keep_heap) { - if (mpsp->heap != &mpsp->default_heap[0]) { + if (mpsp->u.heap != mpsp->default_heap) { /* Have to be done *after* call to erts_cleanup_empty_process() */ - erts_free(ERTS_ALC_T_DB_MS_RUN_HEAP, (void *) mpsp->heap); - mpsp->heap = &mpsp->default_heap[0]; + erts_free(ERTS_ALC_T_DB_MS_RUN_HEAP, (void *) mpsp->u.heap); + mpsp->u.heap = mpsp->default_heap; } #ifdef DEBUG else { @@ -398,7 +424,7 @@ create_match_pseudo_process(void) mpsp = (ErtsMatchPseudoProcess *)erts_alloc(ERTS_ALC_T_DB_MS_PSDO_PROC, sizeof(ErtsMatchPseudoProcess)); erts_init_empty_process(&mpsp->process); - mpsp->heap = &mpsp->default_heap[0]; + mpsp->u.heap = mpsp->default_heap; return mpsp; } @@ -422,12 +448,11 @@ get_match_pseudo_process(Process *c_p, Uint heap_size) mpsp = match_pseudo_process; cleanup_match_pseudo_process(mpsp, 0); #endif - if (heap_size > ERTS_DEFAULT_MS_HEAP_SIZE) { - mpsp->heap = (Eterm *) erts_alloc(ERTS_ALC_T_DB_MS_RUN_HEAP, - heap_size*sizeof(Uint)); + if (heap_size > ERTS_DEFAULT_MS_HEAP_SIZE*sizeof(Eterm)) { + mpsp->u.heap = (Eterm*) erts_alloc(ERTS_ALC_T_DB_MS_RUN_HEAP, heap_size); } else { - ASSERT(mpsp->heap == &mpsp->default_heap[0]); + ASSERT(mpsp->u.heap == mpsp->default_heap); } return mpsp; } @@ -855,7 +880,7 @@ static DMCRet dmc_one_term(DMCContext *context, static int test_disassemble_next = 0; void db_match_dis(Binary *prog); #define TRACE erts_fprintf(stderr,"Trace: %s:%d\n",__FILE__,__LINE__) -#define FENCE_PATTERN_SIZE 1 +#define FENCE_PATTERN_SIZE (1*sizeof(Uint)) #define FENCE_PATTERN 0xDEADBEEFUL #else #define TRACE /* Nothing */ @@ -1163,14 +1188,14 @@ done: } Eterm erts_match_set_run(Process *p, Binary *mpsp, - Eterm *args, int num_args, + Eterm *args, int num_args, + enum erts_pam_run_flags in_flags, Uint32 *return_flags) { Eterm ret; - ret = db_prog_match(p, mpsp, - NIL, NULL, args, - num_args, return_flags); + ret = db_prog_match(p, mpsp, NIL, NULL, args, num_args, + in_flags, return_flags); #if defined(HARDDEBUG) if (is_non_value(ret)) { erts_fprintf(stderr, "Failed\n"); @@ -1194,7 +1219,9 @@ static Eterm erts_match_set_run_ets(Process *p, Binary *mpsp, { Eterm ret; - ret = db_prog_match(p, mpsp, args, NULL, NULL, num_args, return_flags); + ret = db_prog_match(p, mpsp, args, NULL, NULL, num_args, + ERTS_PAM_CONTIGUOUS_TUPLE | ERTS_PAM_COPY_RESULT, + return_flags); #if defined(HARDDEBUG) if (is_non_value(ret)) { erts_fprintf(stderr, "Failed\n"); @@ -1280,19 +1307,19 @@ Binary *db_match_compile(Eterm *matchexpr, context.cflags = flags; heap.size = DMC_DEFAULT_SIZE; - heap.data = heap.def; + heap.vars = heap.vars_def; /* ** Compile the match expression */ restart: - heap.used = 0; + heap.vars_used = 0; max_eheap_need = 0; for (context.current_match = 0; context.current_match < num_progs; ++context.current_match) { /* This loop is long, too long */ - memset(heap.data, 0, heap.size * sizeof(*heap.data)); + memset(heap.vars, 0, heap.size * sizeof(*heap.vars)); t = context.matchexpr[context.current_match]; context.stack_used = 0; context.eheap_need = 0; @@ -1506,16 +1533,14 @@ restart: ret->saved_program_buf = NULL; ret->saved_program = NIL; ret->term_save = context.save; - ret->num_bindings = heap.used; + ret->num_bindings = heap.vars_used; ret->single_variable = context.special; sys_memcpy(ret->text, DMC_STACK_DATA(text), DMC_STACK_NUM(text) * sizeof(UWord)); - ret->heap_size = ((heap.used * sizeof(Eterm)) + - (max_eheap_need * sizeof(Eterm)) + - (context.stack_need * sizeof(Eterm *)) + - (3 * (FENCE_PATTERN_SIZE * sizeof(Eterm *)))); - ret->eheap_offset = heap.used + FENCE_PATTERN_SIZE; - ret->stack_offset = ret->eheap_offset + max_eheap_need + FENCE_PATTERN_SIZE; + ret->eheap_offset = heap.vars_used*sizeof(MatchVariable) + FENCE_PATTERN_SIZE; + ret->stack_offset = ret->eheap_offset + max_eheap_need*sizeof(Eterm) + FENCE_PATTERN_SIZE; + ret->heap_size = ret->stack_offset + context.stack_need * sizeof(Eterm*) + FENCE_PATTERN_SIZE; + #ifdef DMC_DEBUG ret->prog_end = ret->text + DMC_STACK_NUM(text); #endif @@ -1533,8 +1558,8 @@ error: /* Here is were we land when compilation failed. */ DMC_FREE(text); if (context.copy != NULL) free_message_buffer(context.copy); - if (heap.data != heap.def) - erts_free(ERTS_ALC_T_DB_MS_CMPL_HEAP, (void *) heap.data); + if (heap.vars != heap.vars_def) + erts_free(ERTS_ALC_T_DB_MS_CMPL_HEAP, (void *) heap.vars); return bp; } @@ -1588,9 +1613,9 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) return ret; } -void heap_consistency_check(Process*); // SVERK +//void heap_consistency_check(Process*); // SVERK -/************************ +#if HALFWORD_HEAP struct heap_checkpoint_t { Process *p; @@ -1627,19 +1652,32 @@ static void heap_checkpoint_revert(struct heap_checkpoint_t* hcp) if (MBUF(hcp->p) != hcp->mbuf) { ErlHeapFragment* hf = MBUF(hcp->p); ASSERT(hf != NULL); - while (hf->next != hcp->mbuf) { - hf = hf->next; + if (hcp->mbuf) { + while (hf->next != hcp->mbuf) { + hf = hf->next; + } + hf->next = NULL; } - hf->next = NULL; free_message_buffer(MBUF(hcp->p)); MBUF(hcp->p) = hcp->mbuf; } if (hcp->mbuf != NULL && hcp->mbuf->used_size != hcp->used_size) { - abort(); + hcp->mbuf->used_size = hcp->used_size; } HEAP_TOP(hcp->p) = hcp->htop; } -*******************/ +#endif /* HALFWORD_HEAP */ + +static ERTS_INLINE Eterm copy_object_rel(Process* p, Eterm term, Eterm* base) +{ + if (!is_immed(term)) { + Uint sz = size_object_rel(term, base); + Eterm* top = HAlloc(p, sz); + return copy_struct_rel(term, sz, &top, &MSO(p), base, NULL); + } + return term; +} + /* ** Execution of the match program, this is Pam. @@ -1651,6 +1689,7 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm term, Eterm* base, Eterm *termp, int arity, + enum erts_pam_run_flags in_flags, Uint32 *return_flags) { MatchProg *prog = Binary2MatchProg(bprog); @@ -1659,7 +1698,7 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Eterm t; Eterm **sp; Eterm *esp; - Eterm *hp; + MatchVariable* variables; BeamInstr *cp; UWord *pc = prog->text; Eterm *ehp; @@ -1670,17 +1709,15 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, ErtsMatchPseudoProcess *mpsp; Process *psp; Process* build_proc; - Process* variable_proc; -#if HALFWORD_HEAP - Eterm* variable_base; /* base for $n-variables (hp[n]) */ -#endif Process *tmpp; Process *current_scheduled; ErtsSchedulerData *esdp; Eterm (*bif)(Process*, ...); int fail_label; int atomic_trace; - int is_ets = 0; // SVERK ToDo!!! +#if HALFWORD_HEAP + struct heap_checkpoint_t c_p_checkpoint = {}; +#endif #ifdef DMC_DEBUG Uint *heap_fence; Uint *eheap_fence; @@ -1688,6 +1725,13 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, Uint save_op; #endif /* DMC_DEBUG */ +// if (base == NULL) { +// erts_fprintf(stderr, "SVERK prog_match = %T\r\n", term); +// } else { +// erts_fprintf(stderr, "SVERK prog_match = REL-TERM\r\n"); +// } + ASSERT(base==NULL || HALFWORD_HEAP); + mpsp = get_match_pseudo_process(c_p, prog->heap_size); psp = &mpsp->process; @@ -1697,7 +1741,6 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, esdp = ERTS_GET_SCHEDULER_DATA_FROM_PROC(c_p); ASSERT(esdp != NULL); current_scheduled = esdp->current_process; - esdp->current_process = psp; /* SMP: psp->scheduler_data is set by get_match_pseudo_process */ atomic_trace = 0; @@ -1720,9 +1763,9 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, #ifdef DMC_DEBUG save_op = 0; - heap_fence = (Uint *) mpsp->heap + prog->eheap_offset - 1; - eheap_fence = (Uint *) mpsp->heap + prog->stack_offset - 1; - stack_fence = (Uint *) mpsp->heap + prog->heap_size - 1; + heap_fence = (Eterm*)((char*) mpsp->u.heap + prog->eheap_offset) - 1; + eheap_fence = (Eterm*)((char*) mpsp->u.heap + prog->stack_offset) - 1; + stack_fence = (Eterm*)((char*) mpsp->u.heap + prog->heap_size) - 1; *heap_fence = FENCE_PATTERN; *eheap_fence = FENCE_PATTERN; *stack_fence = FENCE_PATTERN; @@ -1738,30 +1781,30 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, *return_flags = 0U; - //heap_checkpoint_init(c_p, &heap_checkpoint); - - hp = mpsp->heap; + variables = mpsp->u.variables; +#if HALFWORD_HEAP + c_p_checkpoint.p = NULL; +#endif restart: ep = &term; - esp = mpsp->heap + prog->stack_offset; + esp = (Eterm*)((char*)mpsp->u.heap + prog->stack_offset); sp = (Eterm **) esp; - ASSERT(hp == mpsp->heap); // SVERK - //ehp = mpsp->heap + prog->eheap_offset; + //ehp = (char*)mpsp->u.heap + prog->eheap_offset; ret = am_true; do_catch = 0; fail_label = -1; build_proc = psp; + esdp->current_process = psp; + ASSERT_HALFWORD(!c_p_checkpoint.p); - /* Clear all variables for matchPushV */ - for (i=prog->eheap_offset-(1+FENCE_PATTERN_SIZE); i>=0; i--) { - hp[i] = NIL; +#ifdef DEBUG + ASSERT(variables == mpsp->u.variables); + for (i=0; inum_bindings; i++) { + variables[i].term = THE_NON_VALUE; + variables[i].proc = NULL; + variables[i].base = base; } -#if HALFWORD_HEAP - variable_base = base; - variable_proc = NULL; -#else - variable_proc = build_proc; #endif for (;;) { @@ -1796,10 +1839,9 @@ restart: ep = termp; break; case matchArrayBind: /* When the array size is unknown. */ - ASSERT_HALFWORD(variable_base == NULL); - ASSERT(build_proc == NULL); + ASSERT(termp); n = *pc++; - hp[n] = dpm_array_to_list(psp, termp, arity); + variables[n].term = dpm_array_to_list(psp, termp, arity); break; case matchTuple: /* *ep is a tuple of arity n */ if (!is_tuple_rel(*ep,base)) @@ -1836,13 +1878,12 @@ restart: ep = *(--sp); break; case matchBind: - ASSERT_HALFWORD(variable_base == base); n = *pc++; - hp[n] = *ep++; + variables[n].term = *ep++; break; case matchCmp: n = *pc++; - if (!eq_rel(hp[n], variable_base, *ep, base)) + if (!eq_rel(variables[n].term, base, *ep, base)) FAIL(); ++ep; break; @@ -1900,11 +1941,12 @@ restart: ++ep; break; /* - * Here comes guard instructions + * Here comes guard & body instructions */ case matchPushC: /* Push constant */ - if (do_catch && !is_immed(*pc)) { - *esp++ = copy_object(*pc++, build_proc); + if ((in_flags & ERTS_PAM_COPY_RESULT) + && do_catch && !is_immed(*pc)) { + *esp++ = copy_object(*pc++, c_p); } else { *esp++ = *pc++; @@ -1980,39 +2022,68 @@ restart: esp -= 2; esp[-1] = t; break; - case matchPushV: + + #if HALFWORD_HEAP + case matchPushVGuard: + if (!base) goto case_matchPushV; + /* Build NULL-based copy on pseudo heap for easy disposal */ n = *pc++; - if (variable_proc != build_proc && !is_immed(hp[n])) { - ASSERT(build_proc); - for (i=prog->eheap_offset-1; i>=0; i--) if (!is_immed(hp[i])) { - Uint sz = size_object_rel(hp[i], variable_base); - Eterm* top = HAlloc(build_proc, sz); - hp[i] = copy_struct_rel(hp[i], sz, &top, &MSO(build_proc), - variable_base, NULL); - } - #if HALFWORD_HEAP - variable_base = NULL; + ASSERT(is_value(variables[n].term)); + ASSERT(!variables[n].proc); + variables[n].term = copy_object_rel(psp, variables[n].term, base); + *esp++ = variables[n].term; + #ifdef DEBUG + variables[n].proc = psp; + variables[n].base = NULL; #endif - variable_proc = build_proc; + break; + #endif + case matchPushVResult: + if (!(in_flags & ERTS_PAM_COPY_RESULT)) goto case_matchPushV; + + /* Build (NULL-based) copy on callers heap */ + #if HALFWORD_HEAP + if (!do_catch && !c_p_checkpoint.p) { + heap_checkpoint_init(c_p, &c_p_checkpoint); } - *esp++ = hp[n]; + #endif + n = *pc++; + ASSERT(is_value(variables[n].term)); + ASSERT(!variables[n].proc); + variables[n].term = copy_object_rel(c_p, variables[n].term, base); + *esp++ = variables[n].term; + #ifdef DEBUG + variables[n].proc = c_p; + variables[n].base = NULL; + #endif + break; + case matchPushV: + case_matchPushV: + n = *pc++; + ASSERT(is_value(variables[n].term)); + ASSERT(!variables[n].base); + *esp++ = variables[n].term; break; - case matchPushExpr: { - Uint sz; - Eterm* top; - sz = size_object_rel(term, base); - top = HAlloc(build_proc, sz); - if (is_ets) { - ASSERT(is_tuple_rel(term,base)); - *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, - &top, &MSO(build_proc), base); + case matchPushExpr: + if (in_flags & ERTS_PAM_COPY_RESULT) { + Uint sz; + Eterm* top; + sz = size_object_rel(term, base); + top = HAlloc(build_proc, sz); + if (in_flags & ERTS_PAM_CONTIGUOUS_TUPLE) { + ASSERT(is_tuple_rel(term,base)); + *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, + &top, &MSO(build_proc), base); + } + else { + *esp++ = copy_struct_rel(term, sz, &top, &MSO(build_proc), + base, NULL); + } } else { - *esp++ = copy_struct_rel(term, sz, &top, &MSO(build_proc), - base, NULL); + *esp = term; } break; - } case matchPushArrayAsList: ASSERT_HALFWORD(base == NULL); n = arity; /* Only happens when 'term' is an array */ @@ -2309,11 +2380,12 @@ restart: } } break; - case matchCatch: - //heap_checkpoint_revert(&heap_checkpoint); + case matchCatch: /* Match success, now build result */ do_catch = 1; - build_proc = c_p; - esdp->current_process = build_proc; + if (in_flags & ERTS_PAM_COPY_RESULT) { + build_proc = c_p; + esdp->current_process = c_p; + } break; case matchHalt: goto success; @@ -2322,10 +2394,16 @@ restart: } } fail: - //heap_checkpoint_revert(&heap_checkpoint); +#if HALFWORD_HEAP + if (c_p_checkpoint.p) { + /* Dispose garbage built by guards on caller heap */ + heap_checkpoint_revert(&c_p_checkpoint); + c_p_checkpoint.p = NULL; + } +#endif *return_flags = 0U; - if (fail_label >= 0) { /* We failed during a "TryMeElse", - lets restart, with the next match + if (fail_label >= 0) { /* We failed during a "TryMeElse", + lets restart, with the next match program */ pc = (prog->text) + fail_label; cleanup_match_pseudo_process(mpsp, 1); @@ -2369,7 +2447,8 @@ success: /* * Convert a match program to a "magic" binary to return up to erlang */ -Eterm db_make_mp_binary(Process *p, Binary *mp, Eterm **hpp) { +Eterm db_make_mp_binary(Process *p, Binary *mp, Eterm **hpp) +{ return erts_mk_magic_binary_term(hpp, &MSO(p), mp); } @@ -3153,7 +3232,7 @@ static DMCRet dmc_one_term(DMCContext *context, ** Ouch, big integer in match variable. */ Eterm *save_hp; - ASSERT(heap->data == heap->def); + ASSERT(heap->vars == heap->vars_def); sz = sz2 = sz3 = 0; for (j = 0; j < context->num_match; ++j) { sz += size_object(context->matchexpr[j]); @@ -3191,24 +3270,23 @@ static DMCRet dmc_one_term(DMCContext *context, may be atoms that changed */ context->matchexpr[j] = context->copy->mem[j]; } - heap->data = erts_alloc(ERTS_ALC_T_DB_MS_CMPL_HEAP, - heap->size*sizeof(unsigned)); - sys_memset(heap->data, 0, - heap->size * sizeof(unsigned)); + heap->vars = erts_alloc(ERTS_ALC_T_DB_MS_CMPL_HEAP, + heap->size*sizeof(DMCVariable)); + sys_memset(heap->vars, 0, heap->size * sizeof(DMCVariable)); DMC_CLEAR(*stack); /*DMC_PUSH(*stack,NIL);*/ DMC_CLEAR(*text); return retRestart; } - if (heap->data[n]) { /* already bound ? */ + if (heap->vars[n].is_bound) { DMC_PUSH(*text,matchCmp); DMC_PUSH(*text,n); } else { /* Not bound, bind! */ - if (n >= heap->used) - heap->used = n + 1; + if (n >= heap->vars_used) + heap->vars_used = n + 1; DMC_PUSH(*text,matchBind); DMC_PUSH(*text,n); - heap->data[n] = 1; + heap->vars[n].is_bound = 1; } } else if (c == am_Underscore) { DMC_PUSH(*text, matchSkip); @@ -3515,6 +3593,41 @@ static DMCRet dmc_whole_expression(DMCContext *context, return retOk; } +/* Figure out which PushV instruction to use. +*/ +static void dmc_add_pushv_variant(DMCContext *context, DMCHeap *heap, + DMC_STACK_TYPE(UWord) *text, Uint n) +{ + DMCVariable* v = &heap->vars[n]; + MatchOps instr = matchPushV; + + ASSERT(n < heap->vars_used && v->is_bound); + if (context->is_guard) { + #if HALFWORD_HEAP + if (!v->first_guard_label) { + v->first_guard_label = DMC_STACK_NUM(*text); + ASSERT(v->first_guard_label); + instr = matchPushVGuard; /* may be changed to PushVResult below */ + } + #endif + } + else { /* body */ + #if HALFWORD_HEAP + if (v->first_guard_label) { + /* Avoid double-copy, copy to result heap at first encounter in guard */ + DMC_POKE(*text, v->first_guard_label, matchPushVResult); + v->is_in_body = 1; + } + #endif + if (!v->is_in_body) { + instr = matchPushVResult; + v->is_in_body = 1; + } + } + DMC_PUSH(*text, instr); + DMC_PUSH(*text, n); +} + static DMCRet dmc_variable(DMCContext *context, DMCHeap *heap, DMC_STACK_TYPE(UWord) *text, @@ -3522,13 +3635,13 @@ static DMCRet dmc_variable(DMCContext *context, int *constant) { Uint n = db_is_variable(t); - ASSERT(n >= 0); - if (n >= heap->used) - RETURN_VAR_ERROR("Variable $%d is unbound.", n, context, *constant); - if (heap->data[n] == 0U) + + if (n >= heap->vars_used || !heap->vars[n].is_bound) { RETURN_VAR_ERROR("Variable $%d is unbound.", n, context, *constant); - DMC_PUSH(*text, matchPushV); - DMC_PUSH(*text, n); + } + + dmc_add_pushv_variant(context, heap, text, n); + ++context->stack_used; if (context->stack_used > context->stack_need) context->stack_need = context->stack_used; @@ -3547,10 +3660,9 @@ static DMCRet dmc_all_bindings(DMCContext *context, DMC_PUSH(*text, matchPushC); DMC_PUSH(*text, NIL); - for (i = heap->used - 1; i >= 0; --i) { - if (heap->data[i]) { - DMC_PUSH(*text, matchPushV); - DMC_PUSH(*text, i); + for (i = heap->vars_used - 1; i >= 0; --i) { + if (heap->vars[i].is_bound) { + dmc_add_pushv_variant(context, heap, text, i); DMC_PUSH(*text, matchConsB); heap_used += 2; } @@ -4859,7 +4971,8 @@ static Eterm match_spec_test(Process *p, Eterm against, Eterm spec, int trace) } save_cp = p->cp; p->cp = NULL; - res = erts_match_set_run(p, mps, arr, n, &ret_flags); + res = erts_match_set_run(p, mps, arr, n, + ERTS_PAM_COPY_RESULT, &ret_flags); p->cp = save_cp; } else { n = 0; @@ -4872,11 +4985,10 @@ static Eterm match_spec_test(Process *p, Eterm against, Eterm spec, int trace) if (is_non_value(res)) { res = am_false; } - sz = size_object(res); + sz = 0; if (ret_flags & MATCH_SET_EXCEPTION_TRACE) sz += 2; if (ret_flags & MATCH_SET_RETURN_TRACE) sz += 2; hp = HAlloc(p, 5 + sz); - res = copy_struct(res, sz, &hp, &MSO(p)); flg = NIL; if (ret_flags & MATCH_SET_EXCEPTION_TRACE) { flg = CONS(hp, am_exception_trace, flg); @@ -4931,7 +5043,7 @@ void db_free_tmp_uncompressed(DbTerm* obj) erts_free(ERTS_ALC_T_TMP, obj); } -Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, +Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog, int all, DbTerm* obj, Eterm** hpp, Uint extra) { Uint32 dummy; @@ -4942,22 +5054,13 @@ Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, obj = db_alloc_tmp_uncompressed(tb, obj); base = NULL; } - else base = obj->tpl; + else base = HALFWORD_HEAP ? obj->tpl : NULL; - res = db_prog_match(c_p, bprog, make_tuple_rel(obj->tpl,base), base, - NULL, 0, &dummy); + res = db_prog_match(c_p, bprog, make_tuple_rel(obj->tpl,base), base, NULL, 0, + ERTS_PAM_COPY_RESULT|ERTS_PAM_CONTIGUOUS_TUPLE, &dummy); if (is_value(res) && hpp!=NULL) { *hpp = HAlloc(c_p, extra); -// if (all) { -// *hpp = HAlloc(c_p, obj->size + extra); -// res = copy_shallow_rel(obj->tpl, obj->size, hpp, &MSO(c_p), base); -// } -// else { -// Uint sz = size_object(res); -// *hpp = HAlloc(c_p, sz + extra); -// res = copy_struct(res, sz, hpp, &MSO(c_p)); -// } } if (tb->compress) { @@ -5187,6 +5290,18 @@ void db_match_dis(Binary *bp) ++t; erts_printf("PushV\t%bpu\n", n); break; + #if HALFWORD_HEAP + case matchPushVGuard: + n = (Uint) *++t; + ++t; + erts_printf("PushVGuard\t%bpu\n", n); + break; + #endif + case matchPushVResult: + n = (Uint) *++t; + ++t; + erts_printf("PushVResult\t%bpu\n", n); + break; case matchTrue: ++t; erts_printf("True\n"); diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index bbf1e29f72..4cb5a457ef 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -424,12 +424,16 @@ Binary *db_match_compile(Eterm *matchexpr, Eterm *guards, Eterm *body, int num_matches, Uint flags, DMCErrInfo *err_info); -Eterm db_prog_match_and_copy(DbTableCommon* tb, Process* c_p, Binary* bprog, - int all, DbTerm* obj, Eterm** hpp, Uint extra); /* Returns newly allocated MatchProg binary with refc == 0*/ + +Eterm db_match_dbterm(DbTableCommon* tb, Process* c_p, Binary* bprog, + int all, DbTerm* obj, Eterm** hpp, Uint extra); + Eterm db_prog_match(Process *p, Binary *prog, Eterm term, Eterm* base, Eterm *termp, int arity, + enum erts_pam_run_flags in_flags, Uint32 *return_flags /* Zeroed on enter */); + /* returns DB_ERROR_NONE if matches, 1 if not matches and some db error on error. */ DMCErrInfo *db_new_dmc_err_info(void); diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c index 3043bb1e8c..c0397ca6c3 100644 --- a/erts/emulator/beam/erl_trace.c +++ b/erts/emulator/beam/erl_trace.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2010. All Rights Reserved. + * Copyright Ericsson AB 1999-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1668,7 +1668,7 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec, return_flags = 0; if (match_spec) { pam_result = erts_match_set_run(p, match_spec, args, arity, - &return_flags); + ERTS_PAM_TMP_RESULT, &return_flags); if (is_non_value(pam_result)) { erts_match_set_release_result(p); #if !HEAP_ON_C_STACK @@ -1815,7 +1815,7 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec, return_flags = 0; if (match_spec) { pam_result = erts_match_set_run(p, match_spec, args, arity, - &return_flags); + ERTS_PAM_TMP_RESULT, &return_flags); if (is_non_value(pam_result)) { erts_match_set_release_result(p); UnUseTmpHeap(ERL_SUB_BIN_SIZE,p); diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index b59f26b2bf..bd540eaaa6 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1757,8 +1757,15 @@ do { \ extern Binary *erts_match_set_compile(Process *p, Eterm matchexpr); Eterm erts_match_set_lint(Process *p, Eterm matchexpr); extern void erts_match_set_release_result(Process* p); + +enum erts_pam_run_flags { + ERTS_PAM_TMP_RESULT=0, + ERTS_PAM_COPY_RESULT=1, + ERTS_PAM_CONTIGUOUS_TUPLE=2 +}; extern Eterm erts_match_set_run(Process *p, Binary *mpsp, Eterm *args, int num_args, + enum erts_pam_run_flags in_flags, Uint32 *return_flags); extern Eterm erts_match_set_get_source(Binary *mpsp); extern void erts_match_prog_foreach_offheap(Binary *b, -- cgit v1.2.3 From 677d59fc6d76360dc5ad996bdf91a4c05293b52d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 1 Feb 2011 17:53:15 +0100 Subject: HALFWORD ETS removed eheap and improved test case t_match_spec_run --- erts/emulator/beam/erl_db_util.c | 52 +----------------------- erts/emulator/beam/erl_db_util.h | 1 - lib/stdlib/test/ets_SUITE.erl | 87 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 82 insertions(+), 58 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 2b7e0bcac3..7f17d1212f 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -336,7 +336,6 @@ typedef struct dmc_context { Eterm *bodyexpr; int num_match; int current_match; - int eheap_need; Uint cflags; int is_guard; /* 1 if in guard, 0 if in body */ int special; /* 1 if the head in the match was a single expression */ @@ -1289,7 +1288,6 @@ Binary *db_match_compile(Eterm *matchexpr, int structure_checked; DMCRet res; int current_try_label; - Uint max_eheap_need; Binary *bp = NULL; unsigned clause_start; @@ -1302,7 +1300,6 @@ Binary *db_match_compile(Eterm *matchexpr, context.matchexpr = matchexpr; context.guardexpr = guards; context.bodyexpr = body; - context.eheap_need = 0; context.err_info = err_info; context.cflags = flags; @@ -1314,7 +1311,6 @@ Binary *db_match_compile(Eterm *matchexpr, */ restart: heap.vars_used = 0; - max_eheap_need = 0; for (context.current_match = 0; context.current_match < num_progs; ++context.current_match) { /* This loop is long, @@ -1322,7 +1318,6 @@ restart: memset(heap.vars, 0, heap.size * sizeof(*heap.vars)); t = context.matchexpr[context.current_match]; context.stack_used = 0; - context.eheap_need = 0; structure_checked = 0; if (context.current_match < num_progs - 1) { DMC_PUSH(text,matchTryMeElse); @@ -1494,10 +1489,6 @@ restart: if (current_try_label >= 0) { DMC_POKE(text, current_try_label, DMC_STACK_NUM(text)); } - /* So, how much eheap did this part of the match program need? */ - if (context.eheap_need > max_eheap_need) { - max_eheap_need = context.eheap_need; - } } /* for (context.current_match = 0 ...) */ @@ -1537,8 +1528,7 @@ restart: ret->single_variable = context.special; sys_memcpy(ret->text, DMC_STACK_DATA(text), DMC_STACK_NUM(text) * sizeof(UWord)); - ret->eheap_offset = heap.vars_used*sizeof(MatchVariable) + FENCE_PATTERN_SIZE; - ret->stack_offset = ret->eheap_offset + max_eheap_need*sizeof(Eterm) + FENCE_PATTERN_SIZE; + ret->stack_offset = heap.vars_used*sizeof(MatchVariable) + FENCE_PATTERN_SIZE; ret->heap_size = ret->stack_offset + context.stack_need * sizeof(Eterm*) + FENCE_PATTERN_SIZE; #ifdef DMC_DEBUG @@ -1613,7 +1603,6 @@ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) return ret; } -//void heap_consistency_check(Process*); // SVERK #if HALFWORD_HEAP struct heap_checkpoint_t @@ -1720,16 +1709,10 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, #endif #ifdef DMC_DEBUG Uint *heap_fence; - Uint *eheap_fence; Uint *stack_fence; Uint save_op; #endif /* DMC_DEBUG */ -// if (base == NULL) { -// erts_fprintf(stderr, "SVERK prog_match = %T\r\n", term); -// } else { -// erts_fprintf(stderr, "SVERK prog_match = REL-TERM\r\n"); -// } ASSERT(base==NULL || HALFWORD_HEAP); mpsp = get_match_pseudo_process(c_p, prog->heap_size); @@ -1763,11 +1746,9 @@ Eterm db_prog_match(Process *c_p, Binary *bprog, #ifdef DMC_DEBUG save_op = 0; - heap_fence = (Eterm*)((char*) mpsp->u.heap + prog->eheap_offset) - 1; - eheap_fence = (Eterm*)((char*) mpsp->u.heap + prog->stack_offset) - 1; + heap_fence = (Eterm*)((char*) mpsp->u.heap + prog->stack_offset) - 1; stack_fence = (Eterm*)((char*) mpsp->u.heap + prog->heap_size) - 1; *heap_fence = FENCE_PATTERN; - *eheap_fence = FENCE_PATTERN; *stack_fence = FENCE_PATTERN; #endif /* DMC_DEBUG */ @@ -1790,7 +1771,6 @@ restart: ep = &term; esp = (Eterm*)((char*)mpsp->u.heap + prog->stack_offset); sp = (Eterm **) esp; - //ehp = (char*)mpsp->u.heap + prog->eheap_offset; ret = am_true; do_catch = 0; fail_label = -1; @@ -1814,11 +1794,6 @@ restart: erl_exit(1, "Heap fence overwritten in db_prog_match after op " "0x%08x, overwritten with 0x%08x.", save_op, *heap_fence); } - if (*eheap_fence != FENCE_PATTERN) { - erl_exit(1, "Eheap fence overwritten in db_prog_match after op " - "0x%08x, overwritten with 0x%08x.", save_op, - *eheap_fence); - } if (*stack_fence != FENCE_PATTERN) { erl_exit(1, "Stack fence overwritten in db_prog_match after op " "0x%08x, overwritten with 0x%08x.", save_op, @@ -1957,14 +1932,12 @@ restart: CDR(ehp) = *--esp; CAR(ehp) = esp[-1]; esp[-1] = make_list(ehp); - //ehp += 2; break; case matchConsB: ehp = HAlloc(build_proc, 2); CAR(ehp) = *--esp; CDR(ehp) = esp[-1]; esp[-1] = make_list(ehp); - //ehp += 2; break; case matchMkTuple: n = *pc++; @@ -2303,7 +2276,6 @@ restart: ehp[1] = cp[0]; ehp[2] = cp[1]; ehp[3] = make_small((Uint) cp[2]); - //ehp += 4; } break; case matchSilent: @@ -2417,11 +2389,6 @@ success: erl_exit(1, "Heap fence overwritten in db_prog_match after op " "0x%08x, overwritten with 0x%08x.", save_op, *heap_fence); } - if (*eheap_fence != FENCE_PATTERN) { - erl_exit(1, "Eheap fence overwritten in db_prog_match after op " - "0x%08x, overwritten with 0x%08x.", save_op, - *eheap_fence); - } if (*stack_fence != FENCE_PATTERN) { erl_exit(1, "Stack fence overwritten in db_prog_match after op " "0x%08x, overwritten with 0x%08x.", save_op, @@ -2433,9 +2400,6 @@ success: END_ATOMIC_TRACE(c_p); - #ifdef DEBUG - //heap_consistency_check(c_p); // SVERK - #endif return ret; #undef FAIL #undef FAIL_TERM @@ -3501,7 +3465,6 @@ static DMCRet dmc_list(DMCContext *context, DMC_PUSH(*text, matchConsB); } --context->stack_used; /* Two objects on stack becomes one */ - context->eheap_need += 2; return retOk; } @@ -3560,7 +3523,6 @@ static DMCRet dmc_tuple(DMCContext *context, DMC_PUSH(*text, matchMkTuple); DMC_PUSH(*text, nelems); context->stack_used -= (nelems - 1); - context->eheap_need += (nelems + 1); *constant = 0; return retOk; } @@ -3578,9 +3540,6 @@ static DMCRet dmc_whole_expression(DMCContext *context, } else { ASSERT(is_tuple(context->matchexpr [context->current_match])); - context->eheap_need += - arityval(*(tuple_val(context->matchexpr - [context->current_match]))) * 2; DMC_PUSH(*text, matchPushArrayAsList); } } else { @@ -3670,7 +3629,6 @@ static DMCRet dmc_all_bindings(DMCContext *context, ++context->stack_used; if ((context->stack_used + 1) > context->stack_need) context->stack_need = (context->stack_used + 1); - context->eheap_need += heap_used; *constant = 0; return retOk; } @@ -4073,10 +4031,6 @@ static DMCRet dmc_get_seq_token(DMCContext *context, *constant = 0; DMC_PUSH(*text, matchGetSeqToken); - context->eheap_need += (6 /* A 5-tuple is built */ - + EXTERNAL_THING_HEAD_SIZE + 2 /* Sender can - be an external - pid */); if (++context->stack_used > context->stack_need) context->stack_need = context->stack_used; return retOk; @@ -4373,7 +4327,6 @@ static DMCRet dmc_caller(DMCContext *context, } *constant = 0; DMC_PUSH(*text, matchCaller); /* Creates binary */ - context->eheap_need += 4; /* A 3-tuple is built */ if (++context->stack_used > context->stack_need) context->stack_need = context->stack_used; return retOk; @@ -5412,7 +5365,6 @@ void db_match_dis(Binary *bp) erts_printf("}\n"); erts_printf("num_bindings: %d\n", prog->num_bindings); erts_printf("heap_size: %bpu\n", prog->heap_size); - erts_printf("eheap_offset: %bpu\n", prog->eheap_offset); erts_printf("stack_offset: %bpu\n", prog->stack_offset); erts_printf("text: 0x%08x\n", (unsigned long) prog->text); erts_printf("stack_size: %d (words)\n", prog->heap_size-prog->stack_offset); diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 4cb5a457ef..bb1751d309 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -360,7 +360,6 @@ typedef struct match_prog { struct erl_heap_fragment *saved_program_buf; Eterm saved_program; Uint heap_size; /* size of: heap + eheap + stack */ - Uint eheap_offset; Uint stack_offset; #ifdef DMC_DEBUG UWord* prog_end; /* End of program */ diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 1661aa0217..5eed767dfe 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -92,7 +92,8 @@ misc1_do/1, safe_fixtable_do/1, info_do/1, dups_do/1, heavy_lookup_do/1, heavy_lookup_element_do/1, member_do/1, otp_5340_do/1, otp_7665_do/1, meta_wb_do/1, do_heavy_concurrent/1, tab2file2_do/2, exit_large_table_owner_do/2, - types_do/1, sleeper/0, rpc_externals/0, memory_do/1 + types_do/1, sleeper/0, rpc_externals/0, memory_do/1, + ms_tracee_dummy/1, ms_tracee_dummy/2, ms_tracee_dummy/3, ms_tracee_dummy/4 ]). -export([t_select_reverse/1]). @@ -265,7 +266,7 @@ t_match_spec_run(Config) when is_list(Config) -> repeat_for_permutations(F, N_MS) end, - test_terms(Fun), + test_terms(Fun, skip_refc_check), ?line verify_etsmem(EtsMem). @@ -280,7 +281,73 @@ t_match_spec_run_test(List, MS, Result) -> ets:insert(Tab, List), SRes = lists:sort(Result), ?m(SRes, lists:sort(ets:select(Tab, MS))), - ets:delete(Tab). + ets:delete(Tab), + + %% Check that tracing agree + Self = self(), + {Tracee, MonRef} = spawn_monitor(fun() -> ms_tracee(Self, List) end), + receive {Tracee, ready} -> ok end, + + MST = lists:map(fun(Clause) -> ms_clause_ets_to_trace(Clause) end, MS), + + %%io:format("MS = ~p\nMST= ~p\n",[MS,MST]), + + erlang:trace_pattern({?MODULE,ms_tracee_dummy,'_'}, MST , [local]), + erlang:trace(Tracee, true, [call]), + Tracee ! start, + TRes = ms_tracer_collect(Tracee, MonRef, []), + %erlang:trace(Tracee, false, [call]), + %Tracee ! stop, + case TRes of + SRes -> ok; + _ -> + io:format("TRACE MATCH FAILED\n"), + io:format("Input = ~p\nMST = ~p\nExpected = ~p\nGot = ~p\n", [List, MST, SRes, TRes]), + ?t:fail("TRACE MATCH FAILED") + end, + ok. + + + +ms_tracer_collect(Tracee, Ref, Acc) -> + receive + {trace, Tracee, call, Args, [Msg]} -> + %io:format("trace Args=~p Msg=~p\n", [Args, Msg]), + ms_tracer_collect(Tracee, Ref, [Msg | Acc]); + + {'DOWN', Ref, process, Tracee, _} -> + %io:format("monitor DOWN for ~p\n", [Tracee]), + TDRef = erlang:trace_delivered(Tracee), + ms_tracer_collect(Tracee, TDRef, Acc); + + {trace_delivered, Tracee, Ref} -> + %%io:format("trace delivered for ~p\n", [Tracee]), + lists:sort(Acc); + + Other -> + io:format("Unexpected message = ~p\n", [Other]), + ?t:fail("Unexpected tracer msg") + end. + + +ms_tracee(Parent, CallArgList) -> + %io:format("ms_tracee ~p started with ArgList = ~p\n", [self(), CallArgList]), + Parent ! {self(), ready}, + receive start -> ok end, + lists:foreach(fun(Args) -> + erlang:apply(?MODULE, ms_tracee_dummy, tuple_to_list(Args)) + end, CallArgList). + %%receive stop -> ok end. + + + +ms_tracee_dummy(_) -> ok. +ms_tracee_dummy(_,_) -> ok. +ms_tracee_dummy(_,_,_) -> ok. +ms_tracee_dummy(_,_,_,_) -> ok. + +ms_clause_ets_to_trace({Head, Guard, Body}) -> + {tuple_to_list(Head), Guard, [{message, Body}]}. assert_eq(A,A) -> ok; assert_eq(A,B) -> @@ -5339,7 +5406,7 @@ types_do(Opts) -> ets:delete_all_objects(T), ?line 0 = ets:info(T,size) end, - test_terms(Fun), + test_terms(Fun, strict), ets:delete(T), ?line verify_etsmem(EtsMem). @@ -5654,7 +5721,7 @@ only_if_smp(Schedulers, Func) -> %% Copy-paste from emulator/test/binary_SUITE.erl -define(heap_binary_size, 64). -test_terms(Test_Func) -> +test_terms(Test_Func, Mode) -> garbage_collect(), ?line Pib0 = process_info(self(),binary), @@ -5731,7 +5798,10 @@ test_terms(Test_Func) -> Pib = process_info(self(),binary), ?line Test_Func(Bin3), garbage_collect(), - ?line Pib = process_info(self(),binary), + case Mode of + strict -> ?line Pib = process_info(self(),binary); + skip_refc_check -> ok + end, ?line Test_Func(make_unaligned_sub_binary(Bin0)), ?line Test_Func(make_unaligned_sub_binary(Bin1)), @@ -5775,7 +5845,10 @@ test_terms(Test_Func) -> ?line Test_Func(lists:duplicate(32, FF)), garbage_collect(), - ?line Pib0 = process_info(self(),binary), + case Mode of + strict -> ?line Pib0 = process_info(self(),binary); + skip_refc_check -> ok + end, ok. -- cgit v1.2.3 From 2e0181837dbe96a4ce738a339a9a02a6e26746f8 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 1 Feb 2011 20:01:52 +0100 Subject: HALFWORD ETS match spec heap fragment optimization Introduce HAllocX to allocate heap fragments with a larger capacity than requested and by that reduce the number of fragments allocated. --- erts/emulator/beam/erl_db_util.c | 19 ++++++++++--------- erts/emulator/beam/erl_nif.c | 9 ++++----- erts/emulator/beam/erl_process.h | 4 ++-- erts/emulator/beam/erl_vm.h | 7 ++++--- erts/emulator/beam/utils.c | 8 ++++---- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 7f17d1212f..69b6261549 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -57,6 +57,7 @@ DBIF_TABLE_GUARD | DBIF_TABLE_BODY | DBIF_TRACE_GUARD | DBIF_TRACE_BODY +#define HEAP_XTRA 100 /* ** Some convenience macros for stacks (DMC == db_match_compile) @@ -1594,7 +1595,7 @@ erts_match_prog_foreach_offheap(Binary *bprog, */ static Eterm dpm_array_to_list(Process *psp, Eterm *arr, int arity) { - Eterm *hp = HAlloc(psp, arity * 2); + Eterm *hp = HAllocX(psp, arity * 2, HEAP_XTRA); Eterm ret = NIL; while (--arity >= 0) { ret = CONS(hp, arr[arity], ret); @@ -1661,7 +1662,7 @@ static ERTS_INLINE Eterm copy_object_rel(Process* p, Eterm term, Eterm* base) { if (!is_immed(term)) { Uint sz = size_object_rel(term, base); - Eterm* top = HAlloc(p, sz); + Eterm* top = HAllocX(p, sz, HEAP_XTRA); return copy_struct_rel(term, sz, &top, &MSO(p), base, NULL); } return term; @@ -1928,20 +1929,20 @@ restart: } break; case matchConsA: - ehp = HAlloc(build_proc, 2); + ehp = HAllocX(build_proc, 2, HEAP_XTRA); CDR(ehp) = *--esp; CAR(ehp) = esp[-1]; esp[-1] = make_list(ehp); break; case matchConsB: - ehp = HAlloc(build_proc, 2); + ehp = HAllocX(build_proc, 2, HEAP_XTRA); CAR(ehp) = *--esp; CDR(ehp) = esp[-1]; esp[-1] = make_list(ehp); break; case matchMkTuple: n = *pc++; - ehp = HAlloc(build_proc, n+1); + ehp = HAllocX(build_proc, n+1, HEAP_XTRA); t = make_tuple(ehp); *ehp++ = make_arityval(n); while (n--) { @@ -2042,7 +2043,7 @@ restart: Uint sz; Eterm* top; sz = size_object_rel(term, base); - top = HAlloc(build_proc, sz); + top = HAllocX(build_proc, sz, HEAP_XTRA); if (in_flags & ERTS_PAM_CONTIGUOUS_TUPLE) { ASSERT(is_tuple_rel(term,base)); *esp++ = copy_shallow_rel(tuple_val_rel(term,base), sz, @@ -2061,7 +2062,7 @@ restart: ASSERT_HALFWORD(base == NULL); n = arity; /* Only happens when 'term' is an array */ tp = termp; - ehp = HAlloc(build_proc, n*2); + ehp = HAllocX(build_proc, n*2, HEAP_XTRA); *esp++ = make_list(ehp); while (n--) { *ehp++ = *tp++; @@ -2207,7 +2208,7 @@ restart: else { Eterm sender = SEQ_TRACE_TOKEN_SENDER(c_p); Uint sender_sz = is_immed(sender) ? 0 : size_object(sender); - ehp = HAlloc(build_proc, 6 + sender_sz); + ehp = HAllocX(build_proc, 6 + sender_sz, HEAP_XTRA); *esp++ = make_tuple(ehp); ehp[0] = make_arityval(5); ehp[1] = SEQ_TRACE_TOKEN_FLAGS(c_p); @@ -2270,7 +2271,7 @@ restart: if (!(c_p->cp) || !(cp = find_function_from_pc(c_p->cp))) { *esp++ = am_undefined; } else { - ehp = HAlloc(build_proc, 4); + ehp = HAllocX(build_proc, 4, HEAP_XTRA); *esp++ = make_tuple(ehp); ehp[0] = make_arityval(3); ehp[1] = cp[0]; diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index 529b602575..2f9295e624 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -81,7 +81,6 @@ static ERTS_INLINE Eterm* alloc_heap(ErlNifEnv* env, unsigned need) static Eterm* alloc_heap_heavy(ErlNifEnv* env, unsigned need, Eterm* hp) { - unsigned frag_sz; env->hp = hp; if (env->heap_frag == NULL) { ASSERT(HEAP_LIMIT(env->proc) == env->hp_end); @@ -91,11 +90,11 @@ static Eterm* alloc_heap_heavy(ErlNifEnv* env, unsigned need, Eterm* hp) env->heap_frag->used_size = hp - env->heap_frag->mem; ASSERT(env->heap_frag->used_size <= env->heap_frag->alloc_size); } - frag_sz = need + MIN_HEAP_FRAG_SZ; - hp = erts_heap_alloc(env->proc, frag_sz); - env->hp = hp + need; - env->hp_end = hp + frag_sz; + hp = erts_heap_alloc(env->proc, need, MIN_HEAP_FRAG_SZ); env->heap_frag = MBUF(env->proc); + env->hp = hp + need; + env->hp_end = env->heap_frag->mem + env->heap_frag->alloc_size; + return hp; } diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index d927415f37..8479e56710 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -824,7 +824,7 @@ ERTS_GLB_INLINE void erts_heap_frag_shrink(Process* p, Eterm* hp) } #endif /* inline */ -Eterm* erts_heap_alloc(Process* p, Uint need); +Eterm* erts_heap_alloc(Process* p, Uint need, Uint xtra); #ifdef CHECK_FOR_HOLES Eterm* erts_set_hole_marker(Eterm* ptr, Uint sz); #endif diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h index 48fa99934e..d6daf0cc4b 100644 --- a/erts/emulator/beam/erl_vm.h +++ b/erts/emulator/beam/erl_vm.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -120,14 +120,15 @@ * Allocate heap memory, first on the ordinary heap; * failing that, in a heap fragment. */ -#define HAlloc(p, sz) \ +#define HAllocX(p, sz, xtra) \ (ASSERT_EXPR((sz) >= 0), \ ErtsHAllocLockCheck(p), \ (IS_FORCE_HEAP_FRAGS || (((HEAP_LIMIT(p) - HEAP_TOP(p)) < (sz))) \ - ? erts_heap_alloc((p),(sz)) \ + ? erts_heap_alloc((p),(sz),(xtra)) \ : (INIT_HEAP_MEM(p,sz), \ HEAP_TOP(p) = HEAP_TOP(p) + (sz), HEAP_TOP(p) - (sz)))) +#define HAlloc(P, SZ) HAllocX(P,SZ,0) #define HRelease(p, endp, ptr) \ if ((ptr) == (endp)) { \ diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 2d0155bdf5..f531d1430b 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -91,7 +91,7 @@ dispatch_profile_msg_q(profile_sched_msg_q *psmq) Eterm* -erts_heap_alloc(Process* p, Uint need) +erts_heap_alloc(Process* p, Uint need, Uint xtra) { ErlHeapFragment* bp; Eterm* htop; @@ -117,7 +117,7 @@ erts_heap_alloc(Process* p, Uint need) p->space_verified_from = NULL; #endif /* FORCE_HEAP_FRAGS */ - n = need; + n = need + xtra; bp = MBUF(p); if (bp != NULL && need <= (bp->alloc_size - bp->used_size)) { Eterm* ret = bp->mem + bp->used_size; @@ -153,7 +153,7 @@ erts_heap_alloc(Process* p, Uint need) bp->next = MBUF(p); MBUF(p) = bp; bp->alloc_size = n; - bp->used_size = n; + bp->used_size = need; MBUF_SIZE(p) += n; bp->off_heap.first = NULL; bp->off_heap.overhead = 0; -- cgit v1.2.3 From 68aed1c7441ceb2e8dd87f5fa9ac8fefe98e3b47 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 26 Dec 2010 17:56:42 +0100 Subject: Fix a couple typos in driver_entry(3) --- erts/doc/src/driver_entry.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index dd949d4048..aa890e1ecd 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -36,7 +36,7 @@

As of erts version 5.5.3 the driver interface has been extended (see extended marker). - The extended interface introduce + The extended interface introduces version management, the possibility to pass capability flags (see driver flags) @@ -45,21 +45,21 @@

Old drivers (compiled with an erl_driver.h from an earlier erts version than 5.5.3) have to be recompiled - (but does not have to use the extended interface).

+ (but do not have to use the extended interface).

The driver_entry structure is a C struct that all erlang - drivers defines. It contains entry points for the erlang driver + drivers define. It contains entry points for the erlang driver that are called by the erlang emulator when erlang code accesses the driver.

The erl_driver driver - API functions needs a port handle + API functions need a port handle that identifies the driver instance (and the port in the emulator). This is only passed to the start function, but not to the other functions. The start function returns a driver-defined handle that is passed to the other functions. A - common practice is to have the start function allocating + common practice is to have the start function allocate some application-defined structure and stash the port handle in it, to use it later with the driver API functions.

The driver call-back functions are called synchronously from the @@ -235,7 +235,7 @@ typedef struct erl_drv_entry { void *handle -

This field is reserved for the emulators internal use. The +

This field is reserved for the emulator's internal use. The emulator will modify this field; therefore, it is important that the driver_entry isn't declared const.

@@ -399,7 +399,7 @@ typedef struct erl_drv_entry { void *handle2

- This field is reserved for the emulators internal use. The + This field is reserved for the emulator's internal use. The emulator will modify this field; therefore, it is important that the driver_entry isn't declared const.

-- cgit v1.2.3 From e3d12b73ffcbc85d276414128482d7946bd0b861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 7 Feb 2011 08:34:39 +0100 Subject: v3_codegen: Use the latest instance of St By accident a previous instance of St is used, which is harmless in this case, but leads to worse quality of the generated code. --- lib/compiler/src/v3_codegen.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl index 77da6c8d00..f24a46c5a9 100644 --- a/lib/compiler/src/v3_codegen.erl +++ b/lib/compiler/src/v3_codegen.erl @@ -235,7 +235,7 @@ match_cg(M, Rs, Le, Vdb, Bef, St0) -> I = Le#l.i, {Sis,Int0} = adjust_stack(Bef, I, I+1, Vdb), {B,St1} = new_label(St0), - {Mis,Int1,St2} = match_cg(M, St0#cg.ultimate_failure, + {Mis,Int1,St2} = match_cg(M, St1#cg.ultimate_failure, Int0, St1#cg{break=B}), %% Put return values in registers. Reg = load_vars(Rs, Int1#sr.reg), -- cgit v1.2.3 From 40bb2bed83e00ac6378a8ffa6a234dd81a58247d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 9 Feb 2011 13:47:08 +0100 Subject: Fix win32 file drivers atime/mtime When setting file_info it will now correctly set access and modified time. Previously these entities were swapped. --- erts/emulator/drivers/win32/win_efile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c index 4ec9579529..101853736a 100755 --- a/erts/emulator/drivers/win32/win_efile.c +++ b/erts/emulator/drivers/win32/win_efile.c @@ -1016,8 +1016,8 @@ efile_write_info(Efile_error* errInfo, } \ } - MKTIME(ModifyFileTime, pInfo->accessTime, mtime); - MKTIME(AccessFileTime, pInfo->modifyTime, atime); + MKTIME(ModifyFileTime, pInfo->modifyTime, mtime); + MKTIME(AccessFileTime, pInfo->accessTime, atime); MKTIME(CreationFileTime, pInfo->cTime, ctime); #undef MKTIME -- cgit v1.2.3 From ae7e427471b4798a94bf030b3261a46a7df898df Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 19:05:29 +0100 Subject: Rename Suite Callback to Common Test Hook --- lib/common_test/doc/src/ct_junit_report.xml | 109 ---------- lib/test_server/src/Makefile | 2 +- lib/test_server/src/ts_install_cth.erl | 293 ++++++++++++++++++++++++++ lib/test_server/src/ts_install_scb.erl | 316 ---------------------------- 4 files changed, 294 insertions(+), 426 deletions(-) delete mode 100644 lib/common_test/doc/src/ct_junit_report.xml create mode 100644 lib/test_server/src/ts_install_cth.erl delete mode 100644 lib/test_server/src/ts_install_scb.erl diff --git a/lib/common_test/doc/src/ct_junit_report.xml b/lib/common_test/doc/src/ct_junit_report.xml deleted file mode 100644 index 49a40cc1de..0000000000 --- a/lib/common_test/doc/src/ct_junit_report.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - -
-ct_junit_report - - -1 - - - -A -ct_junit_report.xml
-ct_junit_report -Common Test Framework functions handling test specifications. - -

Common Test Framework functions handling test specifications.

- -

This module creates a junit report of the test run if plugged in - as a suite_callback.

- - -init(Opts) -> term() - - - - - - -post_end_group(Group, Config, State) -> term() - - - - - - -post_end_suite(Suite, Config, State) -> term() - - - - - - -post_end_tc(TC, Config, State) -> term() - - - - - - -post_init_group(Group, Config, State) -> term() - - - - - - -post_init_suite(Suite, Config, State) -> term() - - - - - - -pre_end_group(Group, Config, State) -> term() - - - - - - -pre_end_suite(Suite, Config, State) -> term() - - - - - - -pre_init_group(Group, Config, State) -> term() - - - - - - -pre_init_suite(Suite, Config, State) -> term() - - - - - - -pre_init_tc(TC, Config, State) -> term() - - - - - - -terminate(Config, State) -> term() - - - - - - - - -
\ No newline at end of file diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile index 6f1c6fd167..ba264a5748 100644 --- a/lib/test_server/src/Makefile +++ b/lib/test_server/src/Makefile @@ -58,7 +58,7 @@ TS_MODULES= \ ts_autoconf_win32 \ ts_autoconf_vxworks \ ts_install \ - ts_install_scb + ts_install_cth TARGET_MODULES= $(MODULES:%=$(EBIN)/%) TS_TARGET_MODULES= $(TS_MODULES:%=$(EBIN)/%) diff --git a/lib/test_server/src/ts_install_cth.erl b/lib/test_server/src/ts_install_cth.erl new file mode 100644 index 0000000000..3e28ebd529 --- /dev/null +++ b/lib/test_server/src/ts_install_cth.erl @@ -0,0 +1,293 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc TS Installed SCB +%%% +%%% This module does what the make parts of the ts:run/x command did, +%%% but not the Makefile.first parts! So they have to be done by ts or +%%% manually!! + +-module(ts_install_cth). + +%% Suite Callbacks +-export([id/1]). +-export([init/2]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/4]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/4]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/4]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/4]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/4]). + +-export([on_tc_fail/3]). +-export([on_tc_skip/3]). + +-export([terminate/1]). + +-include_lib("kernel/include/file.hrl"). + +-type proplist() :: list({atom(),term()}). +-type config() :: proplist(). +-type reason() :: term(). +-type skip_or_fail() :: {skip, reason()} | + {auto_skip, reason()} | + {fail, reason()}. + +-record(state, { ts_conf_dir, target_system, install_opts, nodenames, nodes }). + +%% @doc The id of this SCB +-spec id(Opts :: term()) -> + Id :: term(). +id(_Opts) -> + ?MODULE. + +%% @doc Always called before any other callback function. +-spec init(Id :: term(), Opts :: proplist()) -> + State :: #state{}. +init(_Id, Opts) -> +% ct:log("CurrWD: ~p",[file:get_cwd()]), + Nodenames = proplists:get_value(nodenames, Opts, 0), + Nodes = proplists:get_value(nodes, Opts, 0), + TSConfDir = proplists:get_value(ts_conf_dir, Opts), + TargetSystem = proplists:get_value(target_system, Opts, install_local), + InstallOpts = proplists:get_value(install_opts, Opts, []), + #state{ nodenames = Nodenames, + nodes = Nodes, + ts_conf_dir = TSConfDir, + target_system = TargetSystem, + install_opts = InstallOpts }. + +%% @doc Called before init_per_suite is called. +-spec pre_init_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_suite(Suite,Config,#state{ ts_conf_dir = undefined} = State) -> + DataDir = proplists:get_value(data_dir, Config), + ParentDir = filename:join( + lists:reverse( + tl(lists:reverse(filename:split(DataDir))))), + TSConfDir = filename:join([ParentDir, "..","test_server"]), + pre_init_per_suite(Suite, Config, State#state{ ts_conf_dir = TSConfDir }); +pre_init_per_suite(_Suite,Config,State) -> +% ct:log("pre_init_per_suite(~p,~p,~p)",[_Suite,Config,State]), + DataDir = proplists:get_value(data_dir, Config), + try +% install(State#state.ts_conf_dir, +% State#state.target_system, +% State#state.install_opts), + + {ok,Variables} = + file:consult(filename:join(State#state.ts_conf_dir,"variables")), + + %% Make the stuff in all_SUITE_data if it exists + AllDir = filename:join(DataDir,"../all_SUITE_data"), + case filelib:is_dir(AllDir) of + true -> + make_non_erlang(AllDir,Variables); + false -> + ok + end, + + make_non_erlang(DataDir, Variables), + + {add_node_name(Config, State), State} + catch Error:Reason -> + Stack = erlang:get_stacktrace(), + ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), + {fail,{?MODULE,{Error,Reason, Stack}}} + end. + +%% @doc Called after init_per_suite. +-spec post_init_per_suite(Suite :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_suite(_Suite,_Config,Return,State) -> + test_server_ctrl:kill_slavenodes(), + {Return, State}. + +%% @doc Called before end_per_suite. +-spec pre_end_per_suite(Suite :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_suite(_Suite,Config,State) -> + {Config, State}. + +%% @doc Called after end_per_suite. +-spec post_end_per_suite(Suite :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_suite(_Suite,_Config,Return,State) -> + {Return, State}. + +%% @doc Called before each init_per_group. +-spec pre_init_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_group(_Group,Config,State) -> + {add_node_name(Config, State), State}. + +%% @doc Called after each init_per_group. +-spec post_init_per_group(Group :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_group(_Group,_Config,Return,State) -> + {Return, State}. + +%% @doc Called after each end_per_group. +-spec pre_end_per_group(Group :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_group(_Group,Config,State) -> + {Config, State}. + +%% @doc Called after each end_per_group. +-spec post_end_per_group(Group :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_group(_Group,_Config,Return,State) -> + {Return, State}. + +%% @doc Called before each test case. +-spec pre_init_per_testcase(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_testcase(_TC,Config,State) -> + {add_node_name(Config, State), State}. + +%% @doc Called after each test case. +-spec post_end_per_testcase(TC :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_testcase(_TC,_Config,Return,State) -> + {Return, State}. + +%% @doc Called after a test case failed. +-spec on_tc_fail(TC :: init_per_suite | end_per_suite | + init_per_group | end_per_group | atom(), + Reason :: term(), State :: #state{}) -> + NewState :: #state{}. +on_tc_fail(_TC, _Reason, State) -> + State. + +%% @doc Called when a test case is skipped. +-spec on_tc_skip(TC :: end_per_suite | init_per_group | end_per_group | atom(), + {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), + Reason :: term()}}} | + {tc_user_skip, {skipped, Reason :: term()}}, + State :: #state{}) -> + NewState :: #state{}. +on_tc_skip(_TC, _Reason, State) -> + State. + +%% @doc Called when the scope of the SCB is done. +-spec terminate(State :: #state{}) -> + term(). +terminate(_State) -> +% ct:log("Terminate called"), + ok. + +%%% ============================================================================ +%%% Local functions +%%% ============================================================================ +%% Configure and run all the Makefiles in the data dirs of the suite +%% in question +make_non_erlang(DataDir, Variables) -> + {ok,CurrWD} = file:get_cwd(), + try + file:set_cwd(DataDir), + MakeCommand = proplists:get_value(make_command,Variables), + + FirstMakefile = filename:join(DataDir,"Makefile.first"), + case filelib:is_regular(FirstMakefile) of + true -> + ct:log("Making ~p",[FirstMakefile]), + ok = ts_make:make( + MakeCommand, DataDir, filename:basename(FirstMakefile)); + false -> + ok + end, + + MakefileSrc = filename:join(DataDir,"Makefile.src"), + MakefileDest = filename:join(DataDir,"Makefile"), + case filelib:is_regular(MakefileSrc) of + true -> + ok = ts_lib:subst_file(MakefileSrc,MakefileDest,Variables), + ct:log("Making ~p",[MakefileDest]), + ok = ts_make:make([{makefile,"Makefile"},{data_dir,DataDir} + | Variables]); + false -> + ok + end + after + file:set_cwd(CurrWD), + timer:sleep(100) + end. + +%% Add a nodename to config if it does not exist +add_node_name(Config, State) -> + case proplists:get_value(nodenames, Config) of + undefined -> + lists:keystore( + nodenames, 1, Config, + {nodenames,generate_nodenames(State#state.nodenames)}); + _Else -> + Config + end. + + +%% Copied from test_server_ctrl.erl +generate_nodenames(Num) -> + {ok,Name} = inet:gethostname(), + generate_nodenames2(Num, [Name], []). + +generate_nodenames2(0, _Hosts, Acc) -> + Acc; +generate_nodenames2(N, Hosts, Acc) -> + Host=lists:nth((N rem (length(Hosts)))+1, Hosts), + Name=list_to_atom(temp_nodename("nod", []) ++ "@" ++ Host), + generate_nodenames2(N-1, Hosts, [Name|Acc]). + +temp_nodename([], Acc) -> + lists:flatten(Acc); +temp_nodename([Chr|Base], Acc) -> + {A,B,C} = erlang:now(), + New = [Chr | integer_to_list(Chr bxor A bxor B+A bxor C+B)], + temp_nodename(Base, [New|Acc]). diff --git a/lib/test_server/src/ts_install_scb.erl b/lib/test_server/src/ts_install_scb.erl deleted file mode 100644 index 3ba8795764..0000000000 --- a/lib/test_server/src/ts_install_scb.erl +++ /dev/null @@ -1,316 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%% @doc TS Installed SCB -%%% -%%% This module does what the make parts of the ts:run/x command did, -%%% but not the Makefile.first parts! So they have to be done by ts or -%%% manually!! - --module(ts_install_scb). - -%% Suite Callbacks --export([init/1]). - --export([pre_init_per_suite/3]). --export([post_init_per_suite/4]). --export([pre_end_per_suite/3]). --export([post_end_per_suite/4]). - --export([pre_init_per_group/3]). --export([post_init_per_group/4]). --export([pre_end_per_group/3]). --export([post_end_per_group/4]). - --export([pre_init_per_testcase/3]). --export([post_end_per_testcase/4]). - --export([on_tc_fail/3]). --export([on_tc_skip/3]). - --export([terminate/1]). - --include_lib("kernel/include/file.hrl"). - --type proplist() :: list({atom(),term()}). --type config() :: proplist(). --type reason() :: term(). --type skip_or_fail() :: {skip, reason()} | - {auto_skip, reason()} | - {fail, reason()}. - --record(state, { ts_conf_dir, target_system, install_opts, nodenames, nodes }). - -%% @doc Always called before any other callback function. --spec init(Opts :: proplist()) -> - {Id :: term(), State :: #state{}}. -init(Opts) -> -% ct:log("CurrWD: ~p",[file:get_cwd()]), - Nodenames = proplists:get_value(nodenames, Opts, 0), - Nodes = proplists:get_value(nodes, Opts, 0), - TSConfDir = proplists:get_value(ts_conf_dir, Opts), - TargetSystem = proplists:get_value(target_system, Opts, install_local), - InstallOpts = proplists:get_value(install_opts, Opts, []), - {?MODULE, #state{ nodenames = Nodenames, - nodes = Nodes, - ts_conf_dir = TSConfDir, - target_system = TargetSystem, - install_opts = InstallOpts }}. - -%% @doc Called before init_per_suite is called. --spec pre_init_per_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_suite(Suite,Config,#state{ ts_conf_dir = undefined} = State) -> - DataDir = proplists:get_value(data_dir, Config), - ParentDir = filename:join( - lists:reverse( - tl(lists:reverse(filename:split(DataDir))))), - TSConfDir = filename:join([ParentDir, "..","test_server"]), - pre_init_per_suite(Suite, Config, State#state{ ts_conf_dir = TSConfDir }); -pre_init_per_suite(_Suite,Config,State) -> -% ct:log("pre_init_per_suite(~p,~p,~p)",[_Suite,Config,State]), - DataDir = proplists:get_value(data_dir, Config), - try -% install(State#state.ts_conf_dir, -% State#state.target_system, -% State#state.install_opts), - - {ok,Variables} = - file:consult(filename:join(State#state.ts_conf_dir,"variables")), - - %% Make the stuff in all_SUITE_data if it exists - AllDir = filename:join(DataDir,"../all_SUITE_data"), - case filelib:is_dir(AllDir) of - true -> - make_non_erlang(AllDir,Variables); - false -> - ok - end, - - make_non_erlang(DataDir, Variables), - - {add_node_name(Config, State), State} - catch Error:Reason -> - Stack = erlang:get_stacktrace(), - ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), - {fail,{?MODULE,{Error,Reason, Stack}}} - end. - -%% @doc Called after init_per_suite. --spec post_init_per_suite(Suite :: atom(), - Config :: config(), - Return :: config() | skip_or_fail(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_suite(_Suite,_Config,Return,State) -> - test_server_ctrl:kill_slavenodes(), - {Return, State}. - -%% @doc Called before end_per_suite. --spec pre_end_per_suite(Suite :: atom(), - Config :: config() | skip_or_fail(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_per_suite(_Suite,Config,State) -> - {Config, State}. - -%% @doc Called after end_per_suite. --spec post_end_per_suite(Suite :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_suite(_Suite,_Config,Return,State) -> - {Return, State}. - -%% @doc Called before each init_per_group. --spec pre_init_per_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_group(_Group,Config,State) -> - {add_node_name(Config, State), State}. - -%% @doc Called after each init_per_group. --spec post_init_per_group(Group :: atom(), - Config :: config(), - Return :: config() | skip_or_fail(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_group(_Group,_Config,Return,State) -> - {Return, State}. - -%% @doc Called after each end_per_group. --spec pre_end_per_group(Group :: atom(), - Config :: config() | skip_or_fail(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_per_group(_Group,Config,State) -> - {Config, State}. - -%% @doc Called after each end_per_group. --spec post_end_per_group(Group :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_group(_Group,_Config,Return,State) -> - {Return, State}. - -%% @doc Called before each test case. --spec pre_init_per_testcase(TC :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_testcase(_TC,Config,State) -> - {add_node_name(Config, State), State}. - -%% @doc Called after each test case. --spec post_end_per_testcase(TC :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_testcase(_TC,_Config,Return,State) -> - {Return, State}. - -%% @doc Called after a test case failed. --spec on_tc_fail(TC :: init_per_suite | end_per_suite | - init_per_group | end_per_group | atom(), - Reason :: term(), State :: #state{}) -> - NewState :: #state{}. -on_tc_fail(_TC, _Reason, State) -> - State. - -%% @doc Called when a test case is skipped. --spec on_tc_skip(TC :: end_per_suite | init_per_group | end_per_group | atom(), - {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), - Reason :: term()}}} | - {tc_user_skip, {skipped, Reason :: term()}}, - State :: #state{}) -> - NewState :: #state{}. -on_tc_skip(_TC, _Reason, State) -> - State. - -%% @doc Called when the scope of the SCB is done. --spec terminate(State :: #state{}) -> - term(). -terminate(_State) -> -% ct:log("Terminate called"), - ok. - -%%% ============================================================================ -%%% Local functions -%%% ============================================================================ -%% Install the test environment -install(ConfDir, TargetSystem, InstallOpts) -> - {ok,CurrWD} = file:get_cwd(), - try - ConfVars = filename:join(ConfDir, "variables"), - ConfVarsIn = filename:join(ConfDir, "conf_vars.in"), - Configure = filename:join(ConfDir, "configure"), - case has_changed([ConfVars],[ConfVarsIn, Configure]) of - true -> - file:set_cwd(ConfDir), - ts_install:install(TargetSystem, InstallOpts); - false -> - ct:log("Already installed!",[]) - end - after - file:set_cwd(CurrWD) - end. - -%% Configure and run all the Makefiles in the data dirs of the suite -%% in question -make_non_erlang(DataDir, Variables) -> - {ok,CurrWD} = file:get_cwd(), - try - file:set_cwd(DataDir), - MakeCommand = proplists:get_value(make_command,Variables), - - FirstMakefile = filename:join(DataDir,"Makefile.first"), - case filelib:is_regular(FirstMakefile) of - true -> - ct:log("Making ~p",[FirstMakefile]), - ok = ts_make:make( - MakeCommand, DataDir, filename:basename(FirstMakefile)); - false -> - ok - end, - - MakefileSrc = filename:join(DataDir,"Makefile.src"), - MakefileDest = filename:join(DataDir,"Makefile"), - case filelib:is_regular(MakefileSrc) of - true -> - ok = ts_lib:subst_file(MakefileSrc,MakefileDest,Variables), - ct:log("Making ~p",[MakefileDest]), - ok = ts_make:make([{makefile,"Makefile"},{data_dir,DataDir} - | Variables]); - false -> - ok - end - after - file:set_cwd(CurrWD), - timer:sleep(100) - end. - -%% Check if the source files have been changed after the dest files -has_changed(Dest, Source) -> - [] == [D || D <- Dest, S <- Source, get_mtime(D) > get_mtime(S)]. - -get_mtime(File) -> - case file:read_file_info(File) of - {ok,#file_info{ mtime = MTime }} -> - MTime; - _Else -> - {{0,0,0},{0,0,0}} - end. - -%% Add a nodename to config if it does not exist -add_node_name(Config, State) -> - case proplists:get_value(nodenames, Config) of - undefined -> - lists:keystore( - nodenames, 1, Config, - {nodenames,generate_nodenames(State#state.nodenames)}); - _Else -> - Config - end. - - -%% Copied from test_server_ctrl.erl -generate_nodenames(Num) -> - {ok,Name} = inet:gethostname(), - generate_nodenames2(Num, [Name], []). - -generate_nodenames2(0, _Hosts, Acc) -> - Acc; -generate_nodenames2(N, Hosts, Acc) -> - Host=lists:nth((N rem (length(Hosts)))+1, Hosts), - Name=list_to_atom(temp_nodename("nod", []) ++ "@" ++ Host), - generate_nodenames2(N-1, Hosts, [Name|Acc]). - -temp_nodename([], Acc) -> - lists:flatten(Acc); -temp_nodename([Chr|Base], Acc) -> - {A,B,C} = erlang:now(), - New = [Chr | integer_to_list(Chr bxor A bxor B+A bxor C+B)], - temp_nodename(Base, [New|Acc]). -- cgit v1.2.3 From 6f260c38ce2a75d86dbd4348e973ffca629d331b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 10 Feb 2011 14:23:20 +0100 Subject: Fix exception generation in the io module Some functions did not generate correct badarg exception on a badarg exception. Affected functions: - io:put_chars/1,2 - io:nl/1 - io:write/1,2 - io:format/1,2,3 - io:fwrite/1,2,3 --- lib/stdlib/src/io.erl | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/stdlib/src/io.erl b/lib/stdlib/src/io.erl index 78412ab2bc..3efa68ca09 100644 --- a/lib/stdlib/src/io.erl +++ b/lib/stdlib/src/io.erl @@ -55,26 +55,12 @@ to_tuple(T) when is_tuple(T) -> T; to_tuple(T) -> {T}. -%% Problem: the variables Other, Name and Args may collide with surrounding -%% ones. -%% Give extra args to macro, being the variables to use. --define(O_REQUEST(Io, Request), - case request(Io, Request) of - {error, Reason} -> - [Name | Args] = tuple_to_list(to_tuple(Request)), - erlang:error(conv_reason(Name, Reason), [Name, Io | Args]); - Other -> - Other - end). - o_request(Io, Request, Func) -> case request(Io, Request) of {error, Reason} -> [_Name | Args] = tuple_to_list(to_tuple(Request)), - {'EXIT',{undef,[_Current|Mfas]}} = (catch erlang:error(undef)), - MFA = {io, Func, [Io | Args]}, - exit({conv_reason(Func, Reason),[MFA|Mfas]}); -% erlang:error(conv_reason(Name, Reason), [Name, Io | Args]); + {'EXIT',{get_stacktrace,[_Current|Mfas]}} = (catch erlang:error(get_stacktrace)), + erlang:raise(error, conv_reason(Func, Reason), [{io, Func, [Io | Args]}|Mfas]); Other -> Other end. -- cgit v1.2.3 From 96effb9c1115f7a168d4db625726c738240d4c9b Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 14 Jan 2011 12:04:54 +0100 Subject: Verify that temp allocated memory is released --- erts/emulator/beam/beam_emu.c | 31 +++++++++++++++++++++++++++++++ erts/emulator/beam/erl_alloc.c | 27 +++++++++++++++++++++++++++ erts/emulator/beam/erl_alloc.h | 5 +++++ erts/emulator/beam/erl_alloc_util.c | 32 ++++++++++++++++++++++++++++++++ erts/emulator/beam/erl_alloc_util.h | 3 +++ erts/emulator/beam/erl_process.c | 16 ++++++++++++++++ erts/emulator/beam/erl_process.h | 25 +++++++++++++++++++++++++ 7 files changed, 139 insertions(+) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 16741aa2d7..51086aabce 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -321,6 +321,7 @@ extern int count_instructions; # define POST_BIF_GC_SWAPIN_0(_p, _res) \ ERTS_SMP_REQ_PROC_MAIN_LOCK((_p)); \ PROCESS_MAIN_CHK_LOCKS((_p)); \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC((_p)); \ if (((_p)->mbuf) || (MSO(_p).overhead >= BIN_VHEAP_SZ(_p)) ) { \ _res = erts_gc_after_bif_call((_p), (_res), NULL, 0); \ E = (_p)->stop; \ @@ -328,6 +329,7 @@ extern int count_instructions; HTOP = HEAP_TOP((_p)) # define POST_BIF_GC_SWAPIN(_p, _res, _regs, _arity) \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC((_p)); \ ERTS_SMP_REQ_PROC_MAIN_LOCK((_p)); \ PROCESS_MAIN_CHK_LOCKS((_p)); \ if (((_p)->mbuf) || (MSO(_p).overhead >= BIN_VHEAP_SZ(_p)) ) { \ @@ -367,6 +369,7 @@ extern int count_instructions; reg[0] = r(0); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ FCALLS -= erts_garbage_collect(c_p, needed + (HeapNeed), reg, (M)); \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ r(0) = reg[0]; \ SWAPIN; \ @@ -420,6 +423,7 @@ extern int count_instructions; reg[0] = r(0); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ FCALLS -= erts_garbage_collect(c_p, need, reg, (Live)); \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ r(0) = reg[0]; \ SWAPIN; \ @@ -442,6 +446,7 @@ extern int count_instructions; reg[0] = r(0); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ FCALLS -= erts_garbage_collect(c_p, need, reg, (Live)); \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ r(0) = reg[0]; \ SWAPIN; \ @@ -464,6 +469,7 @@ extern int count_instructions; reg[Live] = Extra; \ PROCESS_MAIN_CHK_LOCKS(c_p); \ FCALLS -= erts_garbage_collect(c_p, need, reg, (Live)+1); \ + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); \ PROCESS_MAIN_CHK_LOCKS(c_p); \ if (Live > 0) { \ r(0) = reg[0]; \ @@ -1214,7 +1220,9 @@ void process_main(void) do_schedule1: PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); c_p = schedule(c_p, reds_used); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); #ifdef DEBUG pid = c_p->id; #endif @@ -1664,6 +1672,7 @@ void process_main(void) SWAPOUT; PROCESS_MAIN_CHK_LOCKS(c_p); FCALLS -= erts_garbage_collect(c_p, 3, reg+2, 1); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); SWAPIN; } @@ -1782,6 +1791,7 @@ void process_main(void) PROCESS_MAIN_CHK_LOCKS(c_p); }, { + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); r(0) = reg[0]; SWAPIN; @@ -1840,6 +1850,7 @@ void process_main(void) CANCEL_TIMER(c_p); free_message(msgp); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); NextPF(0, next); @@ -2230,6 +2241,7 @@ void process_main(void) ASSERT(!ERTS_PROC_IS_EXITING(c_p)); result = (*bf)(c_p, arg); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_HOLE_CHECK(c_p); FCALLS = c_p->fcalls; @@ -2258,6 +2270,7 @@ void process_main(void) ASSERT(!ERTS_PROC_IS_EXITING(c_p)); result = (*bf)(c_p, arg); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_HOLE_CHECK(c_p); FCALLS = c_p->fcalls; @@ -2287,6 +2300,7 @@ void process_main(void) PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); result = (*bf)(c_p, reg, live); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); SWAPIN; @@ -2322,6 +2336,7 @@ void process_main(void) PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); result = (*bf)(c_p, reg, live); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); SWAPIN; @@ -2360,6 +2375,7 @@ void process_main(void) PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); result = (*bf)(c_p, reg, live); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); SWAPIN; @@ -2394,6 +2410,7 @@ void process_main(void) ASSERT(!ERTS_PROC_IS_EXITING(c_p)); result = (*bf)(c_p, tmp_arg1, tmp_arg2); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_HOLE_CHECK(c_p); FCALLS = c_p->fcalls; @@ -2417,6 +2434,7 @@ void process_main(void) ASSERT(!ERTS_PROC_IS_EXITING(c_p)); result = (*bf)(c_p, tmp_arg1, tmp_arg2); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); ERTS_HOLE_CHECK(c_p); if (is_value(result)) { @@ -3287,6 +3305,7 @@ void process_main(void) PROCESS_MAIN_CHK_LOCKS(c_p); bif_nif_arity = I[-1]; ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); ASSERT(!ERTS_PROC_IS_EXITING(c_p)); { @@ -3300,6 +3319,7 @@ void process_main(void) } ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); PROCESS_MAIN_CHK_LOCKS(c_p); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); goto apply_bif_or_nif_epilogue; OpCase(apply_bif): @@ -3326,6 +3346,7 @@ void process_main(void) bif_nif_arity = I[-1]; ASSERT(bif_nif_arity <= 3); ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); switch (bif_nif_arity) { case 3: { @@ -3334,6 +3355,7 @@ void process_main(void) nif_bif_result = (*bf)(c_p, r(0), x(1), x(2), I); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); } break; @@ -3344,6 +3366,7 @@ void process_main(void) nif_bif_result = (*bf)(c_p, r(0), x(1), I); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); } break; @@ -3354,6 +3377,7 @@ void process_main(void) nif_bif_result = (*bf)(c_p, r(0), I); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); } break; @@ -3364,6 +3388,7 @@ void process_main(void) nif_bif_result = (*bf)(c_p, I); ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result)); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); break; } @@ -4591,6 +4616,7 @@ void process_main(void) ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p); flags = erts_call_trace(c_p, ep->code, ep->match_prog_set, reg, 0, &c_p->tracer_proc); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); ASSERT(!ERTS_PROC_IS_EXITING(c_p)); @@ -4602,6 +4628,7 @@ void process_main(void) /* SWAPOUT, SWAPIN was done and r(0) was saved above */ PROCESS_MAIN_CHK_LOCKS(c_p); FCALLS -= erts_garbage_collect(c_p, 3, reg, ep->code[2]); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); r(0) = reg[0]; SWAPIN; @@ -4691,6 +4718,7 @@ void process_main(void) reg[0] = r(0); PROCESS_MAIN_CHK_LOCKS(c_p); FCALLS -= erts_garbage_collect(c_p, 2, reg, I[-1]); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); r(0) = reg[0]; } @@ -4794,6 +4822,7 @@ void process_main(void) /* SWAPOUT was done and r(0) was saved above */ PROCESS_MAIN_CHK_LOCKS(c_p); FCALLS -= erts_garbage_collect(c_p, need, reg, I[-1]); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); r(0) = reg[0]; SWAPIN; @@ -6250,6 +6279,7 @@ hibernate(Process* c_p, Eterm module, Eterm function, Eterm args, Eterm* reg) c_p->fvalue = NIL; PROCESS_MAIN_CHK_LOCKS(c_p); erts_garbage_collect_hibernate(c_p); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p); PROCESS_MAIN_CHK_LOCKS(c_p); erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS); ASSERT(!ERTS_PROC_IS_EXITING(c_p)); @@ -6495,6 +6525,7 @@ new_fun(Process* p, Eterm* reg, ErlFunEntry* fe, int num_free) if (HEAP_LIMIT(p) - HEAP_TOP(p) <= needed) { PROCESS_MAIN_CHK_LOCKS(p); erts_garbage_collect(p, needed, reg, num_free); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(p); PROCESS_MAIN_CHK_LOCKS(p); } hp = p->htop; diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index e85e2d7e3f..323c422c6d 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1411,6 +1411,33 @@ void erts_alloc_reg_scheduler_id(Uint id) erts_tsd_set(thr_ix_key, (void *)(long) ix); } +static void +no_verify(Allctr_t *allctr) +{ + +} + +erts_alloc_verify_func_t +erts_alloc_get_verify_unused_temp_alloc(Allctr_t **allctr) +{ + if (erts_allctrs_info[ERTS_ALC_A_TEMPORARY].alloc_util + && erts_allctrs_info[ERTS_ALC_A_TEMPORARY].thr_spec) { + ErtsAllocatorThrSpec_t *tspec; + tspec = &erts_allctr_thr_spec[ERTS_ALC_A_TEMPORARY]; + if (!tspec->all_thr_safe) { + int ix = erts_alc_get_thr_ix(); + + if (ix < tspec->size) { + *allctr = tspec->allctr[ix]; + return erts_alcu_verify_unused; + } + } + } + + *allctr = NULL; + return no_verify; +} + __decl_noreturn void erts_alc_fatal_error(int error, int func, ErtsAlcType_t n, ...) { diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h index 3e96c76dbf..dd4cc22171 100644 --- a/erts/emulator/beam/erl_alloc.h +++ b/erts/emulator/beam/erl_alloc.h @@ -236,6 +236,11 @@ void *erts_realloc_fnf(ErtsAlcType_t type, void *ptr, Uint size) #endif /* #if ERTS_ALC_DO_INLINE || defined(ERTS_ALC_INTERNAL__) */ +typedef void (*erts_alloc_verify_func_t)(Allctr_t *); + +erts_alloc_verify_func_t +erts_alloc_get_verify_unused_temp_alloc(Allctr_t **allctr); + #ifndef ERTS_CACHE_LINE_SIZE /* Assume a cache line size of 64 bytes */ # define ERTS_CACHE_LINE_SIZE ((UWord) 64) diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index 8b184899c9..c09f0bbd77 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -3368,6 +3368,38 @@ erts_alcu_test(unsigned long op, unsigned long a1, unsigned long a2) * Debug functions * \* */ +void +erts_alcu_verify_unused(Allctr_t *allctr) +{ + UWord no; + + no = allctr->sbcs.curr_mseg.no; + no += allctr->sbcs.curr_sys_alloc.no; + no += allctr->mbcs.blocks.curr.no; + + if (no) { + UWord sz = allctr->sbcs.blocks.curr.size; + sz += allctr->mbcs.blocks.curr.size; + erl_exit(ERTS_ABORT_EXIT, + "%salloc() used when expected to be unused!\n" + "Total amount of blocks allocated: %bpu\n" + "Total amount of bytes allocated: %bpu\n", + allctr->name_prefix, no, sz); + } +} + +void +erts_alcu_verify_unused_ts(Allctr_t *allctr) +{ +#ifdef USE_THREADS + erts_mtx_lock(&allctr->mutex); +#endif + erts_alcu_verify_unused(allctr); +#ifdef USE_THREADS + erts_mtx_unlock(&allctr->mutex); +#endif +} + #ifdef ERTS_ALLOC_UTIL_HARD_DEBUG static void diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h index f2b951bca6..5a8db5e29e 100644 --- a/erts/emulator/beam/erl_alloc_util.h +++ b/erts/emulator/beam/erl_alloc_util.h @@ -333,6 +333,9 @@ struct Allctr_t_ { int erts_alcu_start(Allctr_t *, AllctrInit_t *); void erts_alcu_stop(Allctr_t *); +void erts_alcu_verify_unused(Allctr_t *); +void erts_alcu_verify_unused_ts(Allctr_t *allctr); + unsigned long erts_alcu_test(unsigned long, unsigned long, unsigned long); diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index ddfc27a93f..e4a871fd7e 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -2752,6 +2752,15 @@ erts_init_scheduling(int mrq, int no_schedulers, int no_schedulers_online) /* init port tasks */ erts_port_task_init(); + +#ifndef ERTS_SMP +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC + erts_scheduler_data->verify_unused_temp_alloc + = erts_alloc_get_verify_unused_temp_alloc( + &erts_scheduler_data->verify_unused_temp_alloc_data); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(NULL); +#endif +#endif } ErtsRunQueue * @@ -3711,6 +3720,13 @@ sched_thread_func(void *vesdp) } erts_smp_mtx_unlock(&schdlr_sspnd.mtx); +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC + ((ErtsSchedulerData *) vesdp)->verify_unused_temp_alloc + = erts_alloc_get_verify_unused_temp_alloc( + &((ErtsSchedulerData *) vesdp)->verify_unused_temp_alloc_data); + ERTS_VERIFY_UNUSED_TEMP_ALLOC(NULL); +#endif + process_main(); /* No schedulers should *ever* terminate */ erl_exit(ERTS_ABORT_EXIT, "Scheduler thread number %bpu terminated\n", diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index d927415f37..3ba9e947c9 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -28,6 +28,12 @@ #define ERTS_INCLUDE_SCHEDULER_INTERNALS #endif +/* #define ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC */ + +#if !defined(ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC) && defined(DEBUG) +# define ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC +#endif + typedef struct process Process; #include "sys.h" @@ -421,6 +427,11 @@ struct ErtsSchedulerData_ { /* NOTE: These fields are modified under held mutexes by other threads */ erts_smp_atomic32_t chk_cpu_bind; /* Only used when common run queue */ #endif + +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC + erts_alloc_verify_func_t verify_unused_temp_alloc; + Allctr_t *verify_unused_temp_alloc_data; +#endif }; typedef union { @@ -1145,6 +1156,20 @@ Uint erts_debug_nbalance(void); # define ERTS_PROC_GET_SCHDATA(PROC) (erts_scheduler_data) #endif +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC +# define ERTS_VERIFY_UNUSED_TEMP_ALLOC(P) \ +do { \ + ErtsSchedulerData *esdp__ = ((P) \ + ? ERTS_PROC_GET_SCHDATA((Process *) (P)) \ + : erts_get_scheduler_data()); \ + if (esdp__) \ + esdp__->verify_unused_temp_alloc( \ + esdp__->verify_unused_temp_alloc_data); \ +} while (0) +#else +# define ERTS_VERIFY_UNUSED_TEMP_ALLOC(ESDP) +#endif + #if defined(ERTS_SMP) || defined(USE_THREADS) ErtsSchedulerData *erts_get_scheduler_data(void); #else -- cgit v1.2.3 From 59bb06a90248defb4c0be98f10afae88c2251fe7 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 10 Feb 2011 16:18:50 +0100 Subject: Eliminated Dialyzer warnings when using exit or throw. --- lib/cosEvent/doc/src/notes.xml | 36 +++++++++++++++++----- lib/cosEvent/src/cosEventApp.erl | 4 ++- lib/cosEvent/vsn.mk | 13 +------- lib/cosEventDomain/doc/src/notes.xml | 34 +++++++++++++++++++- .../src/CosEventDomainAdmin_EventDomain_impl.erl | 6 +++- lib/cosEventDomain/src/cosEventDomainApp.erl | 4 ++- lib/cosEventDomain/vsn.mk | 13 +------- lib/cosNotification/doc/src/notes.xml | 16 +++++++++- lib/cosNotification/src/CosNotification_Common.erl | 8 +++-- lib/cosNotification/vsn.mk | 16 +--------- lib/cosProperty/doc/src/notes.xml | 30 +++++++++++++++++- ...sPropertyService_PropertySetDefFactory_impl.erl | 5 ++- .../CosPropertyService_PropertySetFactory_impl.erl | 7 +++-- lib/cosProperty/vsn.mk | 12 +------- lib/cosTime/doc/src/notes.xml | 34 +++++++++++++++++++- lib/cosTime/src/cosTime.erl | 4 ++- lib/cosTime/vsn.mk | 12 +------- lib/orber/doc/src/notes.xml | 18 ++++++++++- lib/orber/include/ifr_types.hrl | 4 +-- lib/orber/src/orber.app.src | 2 +- lib/orber/src/orber.erl | 4 ++- lib/orber/vsn.mk | 2 +- 22 files changed, 197 insertions(+), 87 deletions(-) diff --git a/lib/cosEvent/doc/src/notes.xml b/lib/cosEvent/doc/src/notes.xml index 78299a38dc..1a5c8afa17 100644 --- a/lib/cosEvent/doc/src/notes.xml +++ b/lib/cosEvent/doc/src/notes.xml @@ -4,7 +4,7 @@
- 19992010 + 19992011 Ericsson AB. All Rights Reserved. @@ -33,26 +33,48 @@
- cosEvent 2.1.8 + cosEvent 2.1.10
Improvements and New Features

- Removed the usage of the codeinclude tag in the documentation.

+ Eliminated Dialyzer warnings when using exit or throw.

- Own Id: OTP-8409 Aux Id:

+ Own Id: OTP-9050 Aux Id:

+
+ +
+ cosEvent 2.1.9
- Fixed Bugs and Malfunctions + Improvements and New Features + + +

+ Test suites published.

+

+ Own Id: OTP-8543 Aux Id:

+
+
+
+
+ +
+ cosEvent 2.1.8 + +
+ Improvements and New Features -

The documentation EIX file was not generated.

-

Own id: OTP-8355 Aux Id:

+

+ Removed the usage of the codeinclude tag in the documentation.

+

+ Own Id: OTP-8409 Aux Id:

diff --git a/lib/cosEvent/src/cosEventApp.erl b/lib/cosEvent/src/cosEventApp.erl index 084490f845..373e2d170b 100644 --- a/lib/cosEvent/src/cosEventApp.erl +++ b/lib/cosEvent/src/cosEventApp.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -98,6 +98,8 @@ Trying to unregister ~p~n", [H,Accum]), uninstall() -> uninstall_loop(lists:reverse(?IDL_MODULES), ok). +%% To avoid dialyzer warnings due to the use of exit(..). +-spec(uninstall_loop/2 :: (_, _) -> no_return()). uninstall_loop([],ok) -> ok; uninstall_loop([],{exit, register}) -> diff --git a/lib/cosEvent/vsn.mk b/lib/cosEvent/vsn.mk index 8915903bbe..f0b4b0588c 100644 --- a/lib/cosEvent/vsn.mk +++ b/lib/cosEvent/vsn.mk @@ -1,13 +1,2 @@ -COSEVENT_VSN = 2.1.8 - -TICKETS = OTP-8355 \ - OTP-8409 - -TICKETS_2.1.7 = OTP-8201 - -TICKETS_2.1.6 = OTP-7987 - -TICKETS_2.1.5 = OTP-7837 - -TICKETS_2.1.4 = OTP-7595 +COSEVENT_VSN = 2.1.10 diff --git a/lib/cosEventDomain/doc/src/notes.xml b/lib/cosEventDomain/doc/src/notes.xml index 0ad42948af..a6b4471831 100644 --- a/lib/cosEventDomain/doc/src/notes.xml +++ b/lib/cosEventDomain/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20012009 + 20012011 Ericsson AB. All Rights Reserved. @@ -31,6 +31,38 @@ notes.xml
+
+ cosEventDomain 1.1.10 + +
+ Improvements and New Features + + +

+ Eliminated Dialyzer warnings when using exit or throw.

+

+ Own Id: OTP-9050 Aux Id:

+
+
+
+
+ +
+ cosEventDomain 1.1.9 + +
+ Improvements and New Features + + +

+ Test suites published.

+

+ Own Id: OTP-8543 Aux Id:

+
+
+
+
+
cosEventDomain 1.1.8 diff --git a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl index 0b73100540..ddff0f8632 100644 --- a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl +++ b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -780,6 +780,8 @@ set_qos(_OE_This, State, NewQoS) -> QoS = cosEventDomainApp:get_qos(NewQoS), set_qos_helper(QoS, State, []). +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(set_qos_helper/3 :: (_, _, _) -> no_return()). set_qos_helper([], State, []) -> {reply, ok, State}; set_qos_helper([], _, Errors) -> @@ -830,6 +832,8 @@ validate_qos(_OE_This, State, WantedQoS) -> QoS = cosEventDomainApp:get_qos(WantedQoS), {reply, {ok, validate_qos_helper(QoS, State, [], [])}, State}. +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(validate_qos_helper/4 :: (_, _, _, _) -> no_return()). validate_qos_helper([], _, Properties, []) -> Properties; validate_qos_helper([], _, _, Errors) -> diff --git a/lib/cosEventDomain/src/cosEventDomainApp.erl b/lib/cosEventDomain/src/cosEventDomainApp.erl index d57f51443c..3cb4055fba 100644 --- a/lib/cosEventDomain/src/cosEventDomainApp.erl +++ b/lib/cosEventDomain/src/cosEventDomainApp.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -272,6 +272,8 @@ get_qos([]) -> get_qos(Properties) -> get_qos(Properties, [], []). +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(get_qos/3 :: (_, _, _) -> no_return()). get_qos([], Supported, []) -> Supported; get_qos([], _, Unsupported) -> diff --git a/lib/cosEventDomain/vsn.mk b/lib/cosEventDomain/vsn.mk index 483b130819..f6d1c7a332 100644 --- a/lib/cosEventDomain/vsn.mk +++ b/lib/cosEventDomain/vsn.mk @@ -1,13 +1,2 @@ -COSEVENTDOMAIN_VSN = 1.1.8 - -TICKETS = OTP-8353 \ - OTP-8355 - -TICKETS_1.1.7 = OTP-8201 - -TICKETS_1.1.6 = OTP-7987 - -TICKETS_1.1.5 = OTP-7837 - -TICKETS_1.1.4 = OTP-7595 +COSEVENTDOMAIN_VSN = 1.1.10 diff --git a/lib/cosNotification/doc/src/notes.xml b/lib/cosNotification/doc/src/notes.xml index dfbabadfa2..a92aa4d11b 100644 --- a/lib/cosNotification/doc/src/notes.xml +++ b/lib/cosNotification/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20002010 + 20002011 Ericsson AB. All Rights Reserved. @@ -31,6 +31,20 @@ notes.xml
+
cosNotification 1.1.16 + +
Improvements and New Features + + +

+ Eliminated Dialyzer warnings when using exit or throw.

+

+ Own Id: OTP-9050

+
+
+
+
+
cosNotification 1.1.15
Improvements and New Features diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 0e0f1da0d5..73a5550911 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -28,7 +28,6 @@ %%--------------- INCLUDES ----------------------------------- -include_lib("orber/include/corba.hrl"). --include_lib("orber/include/ifr_types.hrl"). %% Application files -include("CosNotification.hrl"). -include("CosNotifyChannelAdmin.hrl"). @@ -947,6 +946,9 @@ check_limits(LQS, NPR) -> validate_event_qos(Wanted, Curr) -> v_e_q_helper(Wanted, Curr, []), []. + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1071,6 +1073,8 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> diff --git a/lib/cosNotification/vsn.mk b/lib/cosNotification/vsn.mk index be7aa56e15..6cea4b35b9 100644 --- a/lib/cosNotification/vsn.mk +++ b/lib/cosNotification/vsn.mk @@ -1,15 +1 @@ -COSNOTIFICATION_VSN = 1.1.15 - -TICKETS = OTP-8353 \ - OTP-8354 \ - OTP-8355 - -TICKETS_1.1.12 = OTP-8201 - -TICKETS_1.1.11 = OTP-7987 - -TICKETS_1.1.10 = OTP-7837 - -TICKETS_1.1.9 = OTP-7595 - -TICKETS_1.1.8 = OTP-7553 +COSNOTIFICATION_VSN = 1.1.16 diff --git a/lib/cosProperty/doc/src/notes.xml b/lib/cosProperty/doc/src/notes.xml index e80c90849f..770d50f777 100644 --- a/lib/cosProperty/doc/src/notes.xml +++ b/lib/cosProperty/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20002009 + 20002011 Ericsson AB. All Rights Reserved. @@ -31,6 +31,34 @@ notes.xml
+
+ cosProperty 1.1.11 + +
+ Fixed Bugs and Malfunctions + + +

Eliminated Dialyzer warnings when using exit or throw.

+

Own id: OTP-9050 Aux Id:

+
+
+
+
+ +
+ cosProperty 1.1.12 + +
+ Fixed Bugs and Malfunctions + + +

Test suites published.

+

Own id: OTP-8543 Aux Id:

+
+
+
+
+
cosProperty 1.1.11 diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl index b099026b88..45fd097bff 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -153,6 +153,9 @@ create_initial_propertysetdef(_OE_This, State, PropDefs) -> %%====================================================================== evaluate_propertysetdef(SetDefs) -> evaluate_propertysetdef(SetDefs, [], []). + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(evaluate_propertysetdef/3 :: (_, _, _) -> no_return()). evaluate_propertysetdef([], NewProperties, []) -> %% No exceptions found. NewProperties; diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl index ad3cdb62d4..c251421205 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl @@ -2,10 +2,10 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in +%% Version 1.1, (the "License"); yu may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. @@ -154,6 +154,9 @@ create_initial_propertyset(_OE_This, State, Properties) -> %%====================================================================== evaluate_propertyset(Sets) -> evaluate_propertyset(Sets, [], []). + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(evaluate_propertyset/3 :: (_, _, _) -> no_return()). evaluate_propertyset([], NewProperties, []) -> %% No exceptions found. NewProperties; diff --git a/lib/cosProperty/vsn.mk b/lib/cosProperty/vsn.mk index c221e6fa4a..6d770a7d69 100644 --- a/lib/cosProperty/vsn.mk +++ b/lib/cosProperty/vsn.mk @@ -1,11 +1 @@ -COSPROPERTY_VSN = 1.1.11 - -TICKETS = OTP-8355 - -TICKETS_1.1.10 = OTP-8201 - -TICKETS_1.1.9 = OTP-7987 - -TICKETS_1.1.8 = OTP-7837 - -TICKETS_1.1.7 = OTP-7595 +COSPROPERTY_VSN = 1.1.13 diff --git a/lib/cosTime/doc/src/notes.xml b/lib/cosTime/doc/src/notes.xml index 9f23a8633c..6a5bc7be00 100644 --- a/lib/cosTime/doc/src/notes.xml +++ b/lib/cosTime/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20002009 + 20002011 Ericsson AB. All Rights Reserved. @@ -32,6 +32,38 @@ notes.xml
+
+ cosTime 1.1.10 + +
+ Improvements and New Features + + +

+ Eliminated Dialyzer warnings when using exit or throw.

+

+ Own Id: OTP-9050 Aux Id:

+
+
+
+
+ +
+ cosTime 1.1.9 + +
+ Improvements and New Features + + +

+ Test suites published.

+

+ Own Id: OTP-8543 Aux Id:

+
+
+
+
+
cosTime 1.1.8 diff --git a/lib/cosTime/src/cosTime.erl b/lib/cosTime/src/cosTime.erl index f4e67570ad..3f6050444a 100644 --- a/lib/cosTime/src/cosTime.erl +++ b/lib/cosTime/src/cosTime.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -110,6 +110,8 @@ uninstall_time() -> uninstall_timerevent() -> uninstall_loop(lists:reverse(?IDL_TIMEREVENT_MODULES),ok). +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(uninstall_loop/2 :: (_, _) -> no_return()). uninstall_loop([],ok) -> ok; uninstall_loop([],{exit, register}) -> diff --git a/lib/cosTime/vsn.mk b/lib/cosTime/vsn.mk index db51bf39b9..e93a4907ce 100644 --- a/lib/cosTime/vsn.mk +++ b/lib/cosTime/vsn.mk @@ -1,11 +1 @@ -COSTIME_VSN = 1.1.8 - -TICKETS = OTP-8355 - -TICKETS_1.1.7 = OTP-8201 - -TICKETS_1.1.6 = OTP-7987 - -TICKETS_1.1.5 = OTP-7837 - -TICKETS_1.1.4 = OTP-7595 +COSTIME_VSN = 1.1.10 diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml index ba16682f0b..589123ef73 100644 --- a/lib/orber/doc/src/notes.xml +++ b/lib/orber/doc/src/notes.xml @@ -4,7 +4,7 @@
- 19972010 + 19972011 Ericsson AB. All Rights Reserved. @@ -32,6 +32,22 @@ notes.xml
+
+ Orber 3.6.20 + +
+ Improvements and New Features + + +

+ Eliminated Dialyzer warnings when using exit or throw.

+

+ Own Id: OTP-9050 Aux Id:

+
+
+
+
+
Orber 3.6.19 diff --git a/lib/orber/include/ifr_types.hrl b/lib/orber/include/ifr_types.hrl index d982850e98..f4a1c533e1 100644 --- a/lib/orber/include/ifr_types.hrl +++ b/lib/orber/include/ifr_types.hrl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -54,7 +54,7 @@ id = Obj#Object_type.id, defined_in = Obj#Object_type.defined_in, version = Obj#Object_type.version, - type = Obj#Object_type.type}. + type = Obj#Object_type.type}). -record(exceptiondescription, {name, id, defined_in, version, type}). diff --git a/lib/orber/src/orber.app.src b/lib/orber/src/orber.app.src index fe911d65a4..88df4162b6 100644 --- a/lib/orber/src/orber.app.src +++ b/lib/orber/src/orber.app.src @@ -101,7 +101,7 @@ orber_iiop_insup, orber_init, orber_reqno, orber_objkeyserver, orber_iiop_socketsup, orber_iiop_pm, orber_env]}, - {applications, [stdlib, kernel]}, + {applications, [stdlib, kernel, mnesia]}, {env, []}, {mod, {orber, []}} ]}. diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index c3d37ad1fb..9902306161 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1029,6 +1029,8 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> remove_tables(Tables, Node, []). +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(remove_tables/3 :: (_, _, _) -> no_return()). remove_tables([], _, []) -> ok; remove_tables([], Node, Failed) -> ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk index c265db188f..5f17cda229 100644 --- a/lib/orber/vsn.mk +++ b/lib/orber/vsn.mk @@ -1,3 +1,3 @@ -ORBER_VSN = 3.6.19 +ORBER_VSN = 3.6.20 -- cgit v1.2.3 From d45434a0b0388e4598186e60fa3d94db5678de4f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 2 Feb 2011 15:42:07 +0100 Subject: Update internal pmap to have a process limit Add write concurrancy to cover masters ?COVER_TABLE --- lib/tools/src/cover.erl | 53 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl index cc4f75f2e8..ada2db45be 100644 --- a/lib/tools/src/cover.erl +++ b/lib/tools/src/cover.erl @@ -407,14 +407,14 @@ analyze_to_file(Module, OutFile, Options) -> analyse_to_file(Module, OutFile, Options). async_analyse_to_file(Module) -> - do_spawn(?MODULE,analyse_to_file, [Module]). + do_spawn(?MODULE, analyse_to_file, [Module]). async_analyse_to_file(Module, OutFileOrOpts) -> do_spawn(?MODULE, analyse_to_file, [Module, OutFileOrOpts]). async_analyse_to_file(Module, OutFile, Options) -> do_spawn(?MODULE, analyse_to_file, [Module, OutFile, Options]). do_spawn(M,F,A) -> - spawn(fun() -> + spawn_link(fun() -> case apply(M,F,A) of {ok, _} -> ok; @@ -559,7 +559,11 @@ remote_reply(MainNode,Reply) -> init_main(Starter) -> register(?SERVER,self()), - ets:new(?COVER_TABLE, [set, public, named_table]), + %% Having write concurrancy here gives a 40% performance boost + %% when collect/1 is called. + ets:new(?COVER_TABLE, [set, public, named_table + ,{write_concurrency, true} + ]), ets:new(?COVER_CLAUSE_TABLE, [set, public, named_table]), ets:new(?BINARY_TABLE, [set, named_table]), ets:new(?COLLECTION_TABLE, [set, public, named_table]), @@ -801,7 +805,10 @@ main_process_loop(State) -> init_remote(Starter,MainNode) -> register(?SERVER,self()), - ets:new(?COVER_TABLE, [set, public, named_table]), + ets:new(?COVER_TABLE, [set, public, named_table + %% write_concurrency here makes otp_8270 break :( + %,{write_concurrency, true} + ]), ets:new(?COVER_CLAUSE_TABLE, [set, public, named_table]), Starter ! {self(),started}, remote_process_loop(#remote_state{main_node=MainNode}). @@ -2284,17 +2291,29 @@ escape_lt_and_gt1([],Acc) -> escape_lt_and_gt1([H|T],Acc) -> escape_lt_and_gt1(T,[H|Acc]). -pmap(Fun,List) -> +pmap(Fun, List) -> + pmap(Fun, List, 20). +pmap(Fun, List, Limit) -> + pmap(Fun, List, [], Limit, 0, []). +pmap(Fun, [E | Rest], Pids, Limit, Cnt, Acc) when Cnt < Limit -> Collector = self(), - Pids = lists:map(fun(E) -> - spawn_link(fun() -> - ?SPAWN_DBG(pmap,E), - Collector ! {res,self(),Fun(E)} - end) - end, List), - lists:map(fun(Pid) -> - receive - {res,Pid,Res} -> - Res - end - end, Pids). + Pid = spawn_link(fun() -> + ?SPAWN_DBG(pmap,E), + Collector ! {res,self(),Fun(E)} + end), + erlang:monitor(process, Pid), + pmap(Fun, Rest, Pids ++ [Pid], Limit, Cnt + 1, Acc); +pmap(Fun, List, [Pid | Pids], Limit, Cnt, Acc) -> + receive + {'DOWN', _Ref, process, _, _} -> + pmap(Fun, List, [Pid | Pids], Limit, Cnt - 1, Acc); + {res, Pid, Res} -> + pmap(Fun, List, Pids, Limit, Cnt, [Res | Acc]) + end; +pmap(_Fun, [], [], _Limit, 0, Acc) -> + lists:reverse(Acc); +pmap(Fun, [], [], Limit, Cnt, Acc) -> + receive + {'DOWN', _Ref, process, _, _} -> + pmap(Fun, [], [], Limit, Cnt - 1, Acc) + end. -- cgit v1.2.3 From 55203980361ea0e39ac40569583c598c147ad9b2 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 11 Feb 2011 12:06:49 +0100 Subject: Added missing return value in dialyzer specs (ssl.erl) Suppressed dialyzer warnings with spec if possible to minimize clutter from this file belonging to old ssl. --- lib/ssl/src/inet_ssl_dist.erl | 6 ++++++ lib/ssl/src/ssl.erl | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/ssl/src/inet_ssl_dist.erl b/lib/ssl/src/inet_ssl_dist.erl index f62aefd35a..b10aa76246 100644 --- a/lib/ssl/src/inet_ssl_dist.erl +++ b/lib/ssl/src/inet_ssl_dist.erl @@ -135,6 +135,9 @@ accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) -> [self(), AcceptPid, Socket, MyNode, Allowed, SetupTime]). +%% Suppress dialyzer warning, we do not really care about old ssl code +%% as we intend to remove it. +-spec(do_accept/6 :: (_,_,_,_,_,_) -> no_return()). do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) -> process_flag(priority, max), receive @@ -204,6 +207,9 @@ setup(Node, Type, MyNode, LongOrShortNames,SetupTime) -> LongOrShortNames, SetupTime]). +%% Suppress dialyzer warning, we do not really care about old ssl code +%% as we intend to remove it. +-spec(do_setup/6 :: (_,_,_,_,_,_) -> no_return()). do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> process_flag(priority, max), ?trace("~p~n",[{inet_ssl_dist,self(),setup,Node}]), diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 0e108c430f..65b081937f 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -98,9 +98,12 @@ stop() -> application:stop(ssl). %%-------------------------------------------------------------------- --spec connect(host() | port(), [option()]) -> {ok, #sslsocket{}}. --spec connect(host() | port(), [option()] | port_num(), timeout() | list()) -> {ok, #sslsocket{}}. --spec connect(host() | port(), port_num(), list(), timeout()) -> {ok, #sslsocket{}}. +-spec connect(host() | port(), [option()]) -> {ok, #sslsocket{}} | + {error, reason()}. +-spec connect(host() | port(), [option()] | port_num(), timeout() | list()) -> + {ok, #sslsocket{}} | {error, reason()}. +-spec connect(host() | port(), port_num(), list(), timeout()) -> + {ok, #sslsocket{}} | {error, reason()}. %% %% Description: Connect to a ssl server. @@ -171,8 +174,10 @@ listen(Port, Options0) -> end. %%-------------------------------------------------------------------- --spec transport_accept(#sslsocket{}) -> {ok, #sslsocket{}}. --spec transport_accept(#sslsocket{}, timeout()) -> {ok, #sslsocket{}}. +-spec transport_accept(#sslsocket{}) -> {ok, #sslsocket{}} | + {error, reason()}. +-spec transport_accept(#sslsocket{}, timeout()) -> {ok, #sslsocket{}} | + {error, reason()}. %% %% Description: Performs transport accept on a ssl listen socket %%-------------------------------------------------------------------- -- cgit v1.2.3 From 27d6af0ed32a25d7ea1dcd83a4163f8e6ec67844 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 10:31:00 +0100 Subject: Corrected spec usage. --- lib/cosNotification/src/CosNotification_Common.erl | 4 ++-- ...sPropertyService_PropertySetDefFactory_impl.erl | 2 -- .../CosPropertyService_PropertySetFactory_impl.erl | 4 +--- lib/cosTime/src/cosTime.erl | 24 +++++++++++++--------- lib/orber/src/corba.erl | 6 +++++- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 73a5550911..1e2d9640aa 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -948,7 +948,7 @@ validate_event_qos(Wanted, Curr) -> []. %% To avoid dialyzer warnings due to the use of exit/throw. --spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). +%%-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1074,7 +1074,7 @@ v_e_q_helper(What, _, _) -> %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ %% To avoid dialyzer warnings due to the use of exit/throw. --spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). +%%-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl index 45fd097bff..82bc00aa7f 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl @@ -154,8 +154,6 @@ create_initial_propertysetdef(_OE_This, State, PropDefs) -> evaluate_propertysetdef(SetDefs) -> evaluate_propertysetdef(SetDefs, [], []). -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(evaluate_propertysetdef/3 :: (_, _, _) -> no_return()). evaluate_propertysetdef([], NewProperties, []) -> %% No exceptions found. NewProperties; diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl index c251421205..1a8f83617a 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl @@ -5,7 +5,7 @@ %% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); yu may not use this file except in +%% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. @@ -155,8 +155,6 @@ create_initial_propertyset(_OE_This, State, Properties) -> evaluate_propertyset(Sets) -> evaluate_propertyset(Sets, [], []). -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(evaluate_propertyset/3 :: (_, _, _) -> no_return()). evaluate_propertyset([], NewProperties, []) -> %% No exceptions found. NewProperties; diff --git a/lib/cosTime/src/cosTime.erl b/lib/cosTime/src/cosTime.erl index 3f6050444a..b02cb72509 100644 --- a/lib/cosTime/src/cosTime.erl +++ b/lib/cosTime/src/cosTime.erl @@ -110,30 +110,34 @@ uninstall_time() -> uninstall_timerevent() -> uninstall_loop(lists:reverse(?IDL_TIMEREVENT_MODULES),ok). -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(uninstall_loop/2 :: (_, _) -> no_return()). uninstall_loop([],ok) -> ok; uninstall_loop([],{exit, register}) -> - exit({?MODULE, "oe_register failed"}); + do_exit({?MODULE, "oe_register failed"}); uninstall_loop([],{exit, unregister}) -> - exit({?MODULE, "oe_unregister failed"}); + do_exit({?MODULE, "oe_unregister failed"}); uninstall_loop([],{exit, both}) -> - exit({?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}); + do_exit({?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}); uninstall_loop([H|T], Status) -> case catch H:'oe_unregister'() of ok -> uninstall_loop(T, Status); _ when Status == ok -> - ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered. -You are adviced to confirm this.~n",[H]), + ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered.\n" + "You are adviced to confirm this.~n",[H]), uninstall_loop(T, {exit, unregister}); _ -> - ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered. -You are adviced to confirm this.~n",[H]), + ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered.\n" + "You are adviced to confirm this.~n",[H]), uninstall_loop(T, {exit, both}) end. - + + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(do_exit/1 :: (_) -> no_return()). +do_exit(Reason) -> + exit(Reason). + %%------------------------------------------------------------ %% function : start/stop %% Arguments: diff --git a/lib/orber/src/corba.erl b/lib/orber/src/corba.erl index ea1363742c..f4a17c10e9 100644 --- a/lib/orber/src/corba.erl +++ b/lib/orber/src/corba.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -620,6 +620,8 @@ get_pid(Objkey) -> %% Returns : Throws the exception. %% Description: %%---------------------------------------------------------------------- +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(raise/1 :: (_) -> no_return()). raise(E) -> throw({'EXCEPTION', E}). @@ -629,6 +631,8 @@ raise(E) -> %% Returns : Throws the exception. %% Description: %%---------------------------------------------------------------------- +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(raise_with_state/2 :: (_, _) -> no_return()). raise_with_state(E, State) -> throw({reply, {'EXCEPTION', E}, State}). -- cgit v1.2.3 From 3ed562f77418ea1d25c007a9d0d744f7d33f63f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 11 Feb 2011 16:41:22 +0100 Subject: compile: Refactor handling of source options (e.g. 'from_core') The options for compiling from Core Erlang, BEAM assembler files, and BEAM files are handled in several places, making it difficult to change or add more similar options. Refactor the option handling so that each option only need to be handled in one place. --- lib/compiler/src/compile.erl | 105 +++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 54 deletions(-) diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 26da3ecad2..5618bec293 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -112,9 +112,10 @@ noenv_forms(Forms, Opt) when is_atom(Opt) -> -spec noenv_output_generated([option()]) -> boolean(). noenv_output_generated(Opts) -> + {_,Passes} = passes(file, expand_opts(Opts)), any(fun ({save_binary,_F}) -> true; (_Other) -> false - end, passes(file, expand_opts(Opts))). + end, Passes). %% %% Local functions @@ -240,26 +241,12 @@ internal(Master, Input, Opts) -> end}. internal({forms,Forms}, Opts) -> - Ps = passes(forms, Opts), + {_,Ps} = passes(forms, Opts), internal_comp(Ps, "", "", #compile{code=Forms,options=Opts}); internal({file,File}, Opts) -> - Ps = passes(file, Opts), + {Ext,Ps} = passes(file, Opts), Compile = #compile{options=Opts}, - case member(from_core, Opts) of - true -> internal_comp(Ps, File, ".core", Compile); - false -> - case member(from_beam, Opts) of - true -> - internal_comp(Ps, File, ".beam", Compile); - false -> - case member(from_asm, Opts) orelse member(asm, Opts) of - true -> - internal_comp(Ps, File, ".S", Compile); - false -> - internal_comp(Ps, File, ".erl", Compile) - end - end - end. + internal_comp(Ps, File, Ext, Compile). internal_comp(Passes, File, Suffix, St0) -> Dir = filename:dirname(File), @@ -367,42 +354,52 @@ mpf(Ms) -> [{File,[M || {F,M} <- Ms, F =:= File]} || File <- lists:usort([F || {F,_} <- Ms])]. -%% passes(forms|file, [Option]) -> [{Name,PassFun}] -%% Figure out which passes that need to be run. - -passes(forms, Opts) -> - case member(from_core, Opts) of - true -> - select_passes(core_passes(), Opts); - false -> - select_passes(standard_passes(), Opts) +%% passes(forms|file, [Option]) -> {Extension,[{Name,PassFun}]} +%% Figure out the extension of the input file and which passes +%% that need to be run. + +passes(Type, Opts) -> + {Ext,Passes0} = passes_1(Opts), + Passes1 = case Type of + file -> Passes0; + forms -> tl(Passes0) + end, + Passes = select_passes(Passes1, Opts), + + %% If the last pass saves the resulting binary to a file, + %% insert a first pass to remove the file (unless the + %% source file is a BEAM file). + {Ext,case last(Passes) of + {save_binary,_Fun} -> + case Passes of + [{read_beam_file,_}|_] -> + %% The BEAM is both input and output. + %% Don't remove it. + Passes; + _ -> + [?pass(remove_file)|Passes] + end; + _ -> + Passes + end}. + +passes_1([Opt|Opts]) -> + case pass(Opt) of + {_,_}=Res -> Res; + none -> passes_1(Opts) end; -passes(file, Opts) -> - case member(from_beam, Opts) of - true -> - Ps = [?pass(read_beam_file)|binary_passes()], - select_passes(Ps, Opts); - false -> - Ps = case member(from_asm, Opts) orelse member(asm, Opts) of - true -> - [?pass(beam_consult_asm)|asm_passes()]; - false -> - case member(from_core, Opts) of - true -> - [?pass(parse_core)|core_passes()]; - false -> - [?pass(parse_module)|standard_passes()] - end - end, - Fs = select_passes(Ps, Opts), - - %% If the last pass saves the resulting binary to a file, - %% insert a first pass to remove the file. - case last(Fs) of - {save_binary,_Fun} -> [?pass(remove_file)|Fs]; - _Other -> Fs - end - end. +passes_1([]) -> + {".erl",[?pass(parse_module)|standard_passes()]}. + +pass(from_core) -> + {".core",[?pass(parse_core)|core_passes()]}; +pass(from_asm) -> + {".S",[?pass(beam_consult_asm)|asm_passes()]}; +pass(asm) -> + pass(from_asm); +pass(from_beam) -> + {".beam",[?pass(read_beam_file)|binary_passes()]}; +pass(_) -> none. %% select_passes([Command], Opts) -> [{Name,Function}] %% Interpret the lists of commands to return a pure list of passes. -- cgit v1.2.3 From eb6d08af973484e37e3efb0f159cf732cc618e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Feb 2011 11:09:50 +0100 Subject: Never allow os:find_executable/1 to return the path of directories --- lib/kernel/src/os.erl | 7 ++++--- lib/kernel/test/os_SUITE.erl | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl index 75a11a8afd..ce8c581e08 100644 --- a/lib/kernel/src/os.erl +++ b/lib/kernel/src/os.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -82,8 +82,9 @@ verify_executable(Name0, [Ext|Rest], OrigExtensions) -> end; _ -> case file:read_file_info(Name1) of - {ok, #file_info{mode=Mode}} when Mode band 8#111 =/= 0 -> - %% XXX This test for execution permission is not full-proof + {ok, #file_info{type=regular,mode=Mode}} + when Mode band 8#111 =/= 0 -> + %% XXX This test for execution permission is not fool-proof %% on Unix, since we test if any execution bit is set. {ok, Name1}; _ -> diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index eacf3c7584..3f6a7f4392 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -156,6 +156,21 @@ find_executable(Config) when is_list(Config) -> ?line find_exe(Current, "my_batch", ".bat", Path), ok; {unix, _} -> + DataDir = ?config(data_dir, Config), + + %% Smoke test. + case lib:progname() of + erl -> + ?line ErlPath = os:find_executable("erl"), + ?line true = is_list(ErlPath), + ?line true = filelib:is_regular(ErlPath); + _ -> + %% Don't bother -- the progname could include options. + ok + end, + + %% Never return a directory name. + ?line false = os:find_executable("unix", [DataDir]), ok; vxworks -> ok -- cgit v1.2.3 From 2edf8022d4269b403405f594bfc58bfec35dbee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 14 Jan 2011 14:33:14 +0100 Subject: Test more error cases for code:make_stub/1 --- erts/emulator/test/code_SUITE.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 33351a3cc9..5707de30d3 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -320,6 +320,9 @@ make_stub(Config) when is_list(Config) -> (catch code:make_stub_module(my_code_test, bit_sized_binary(Code), {[],[]})), + ?line {'EXIT',{badarg,_}} = + (catch code:make_stub_module(my_code_test_with_wrong_name, + Code, {[],[]})), ok. make_stub_many_funs(Config) when is_list(Config) -> -- cgit v1.2.3 From 4174e678388d4a829fef7a2102fc5b19e5df888f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 14 Jan 2011 14:34:03 +0100 Subject: Eliminate memory leak in code:make_stub/1 --- erts/emulator/beam/beam_load.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index e6448931eb..4e0d19dafa 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -5476,6 +5476,9 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info) if (state.lambdas != state.def_lambdas) { erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.lambdas); } + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.labels); + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.atom); + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.export); if (bin != NULL) { driver_free_binary(bin); } @@ -5487,9 +5490,18 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info) if (code != NULL) { erts_free(ERTS_ALC_T_CODE, code); } + if (state.labels != NULL) { + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.labels); + } if (state.lambdas != state.def_lambdas) { erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.lambdas); } + if (state.atom != NULL) { + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.atom); + } + if (state.export != NULL) { + erts_free(ERTS_ALC_T_LOADER_TMP, (void *) state.export); + } if (bin != NULL) { driver_free_binary(bin); } -- cgit v1.2.3 From d26eac5356b674ee7c26567952a659b72654d40a Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Mon, 14 Feb 2011 11:54:22 +0000 Subject: Fix -spec for file:write_file/3 Change type for second parameter from binary() to iodata(), since the function explicitly takes steps to accept lists as well as binaries. --- lib/kernel/src/file.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index bc95359986..3aca9b4b0d 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -240,7 +240,7 @@ write_file(Name, Bin) -> %% when it is time to change file server protocol again. %% Meanwhile, it is implemented here, slightly less efficient. --spec write_file(Name :: name(), Bin :: binary(), Modes :: [mode()]) -> +-spec write_file(Name :: name(), Bin :: iodata(), Modes :: [mode()]) -> 'ok' | {'error', posix()}. write_file(Name, Bin, ModeList) when is_list(ModeList) -> -- cgit v1.2.3 From d2bb03ce3a6a99f3e3f0abe1f74a355879437c4f Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Mon, 14 Feb 2011 14:34:00 +0100 Subject: Updsated macro EFORMAT exit handling. --- lib/cosNotification/src/CosNotification_Common.erl | 4 ---- lib/orber/src/orber.erl | 10 +++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index 1e2d9640aa..bcd241f3a8 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -947,8 +947,6 @@ validate_event_qos(Wanted, Curr) -> v_e_q_helper(Wanted, Curr, []), []. -%% To avoid dialyzer warnings due to the use of exit/throw. -%%-spec(v_e_q_helper/3 :: (_, _, _) -> no_return()). v_e_q_helper([], _Curr, []) -> %% Parsed all and foynd no conflicts. ok; @@ -1073,8 +1071,6 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ -%% To avoid dialyzer warnings due to the use of exit/throw. -%%-spec(set_properties/9 :: (_, _, _, _, _, _, _, _, _) -> no_return()). set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index 9902306161..f0820811f5 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -95,7 +95,13 @@ -define(DEBUG_LEVEL, 5). -define(FORMAT(_F, _A), lists:flatten(io_lib:format(_F, _A))). --define(EFORMAT(_F, _A), exit(lists:flatten(io_lib:format(_F, _A)))). +-define(EFORMAT(_F, _A), do_exit(lists:flatten(io_lib:format(_F, _A)))). + + +%% To avoid dialyzer warnings due to the use of exit/throw. +-spec(do_exit/1 :: (_) -> no_return()). +do_exit(Reason) -> + exit(Reason). %%----------------------------------------------------------------- @@ -1029,8 +1035,6 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> remove_tables(Tables, Node, []). -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(remove_tables/3 :: (_, _, _) -> no_return()). remove_tables([], _, []) -> ok; remove_tables([], Node, Failed) -> ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", -- cgit v1.2.3 From a5c92f814fd5c59ec219b83f9af8826f5f046962 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 14 Feb 2011 16:07:05 +0100 Subject: Fix bug with subgroups after introduction of remote groups --- lib/common_test/src/ct_framework.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index 3050aec0c5..0d82a106d5 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -756,8 +756,9 @@ find(Mod, Name, TCs, [{Name,Props,Tests} | _Gs], Known, Defs, false) find(Mod, Name, TCs, [{Name1,Props,Tests} | Gs], Known, Defs, false) when is_atom(Name1), is_list(Props), is_list(Tests) -> cyclic_test(Mod, Name1, Known), - find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false) ++ - find(Mod, Name, TCs, Gs, [], Defs, false); + [make_conf(Mod,Name1,Props, + find(Mod, Name, TCs, Tests, [Name1 | Known], Defs, false)) | + find(Mod, Name, TCs, Gs, [], Defs, false)]; find(Mod, Name, _TCs, [{Name,_Props,_Tests} | _Gs], _Known, _Defs, true) when is_atom(Name) -> -- cgit v1.2.3 From b397a5b6d3dce5ad0be19a7bac262d6f636a666d Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 2 Feb 2011 12:27:44 +0200 Subject: Various cleanups and cosmetic changes --- lib/hipe/icode/hipe_icode_range.erl | 212 ++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl index c7e6a451af..91f6fb47f3 100644 --- a/lib/hipe/icode/hipe_icode_range.erl +++ b/lib/hipe/icode/hipe_icode_range.erl @@ -1,20 +1,20 @@ %% -*- erlang-indent-level: 2 -*- %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %%%------------------------------------------------------------------- @@ -108,8 +108,8 @@ cfg(Cfg, MFA, Options, Servers) -> -spec concurrent_cfg(cfg(), mfa(), pid()) -> cfg(). concurrent_cfg(Cfg, MFA, CompServer) -> - CompServer ! {ready, {MFA,self()}}, - {ArgsFun,CallFun,FinalFun} = do_analysis(Cfg, MFA), + CompServer ! {ready, {MFA, self()}}, + {ArgsFun, CallFun, FinalFun} = do_analysis(Cfg, MFA), Ans = do_rewrite(Cfg, MFA, ArgsFun, CallFun, FinalFun), CompServer ! {done_rewrite, MFA}, Ans. @@ -266,7 +266,7 @@ handle_args(I, Info, WidenFun) -> %% io:format("Uses: ~p~nRanges: ~p~n", [Uses, PresentRanges]), JoinFun = fun(Var, Range) -> update_info(Var, Range, WidenFun) end, NewUses = lists:zipwith(JoinFun, Uses, PresentRanges), - hipe_icode:subst_uses(lists:zip(Uses, NewUses),I). + hipe_icode:subst_uses(lists:zip(Uses, NewUses), I). -spec join_info(#ann{}, #range{}, three_range_fun()) -> #ann{}. @@ -317,7 +317,7 @@ update_ann(Ann = #ann{range = R1, type = Type, count = C}, R2, _Fun) -> -spec type_to_ann(erl_types:erl_type()) -> #ann{}. type_to_ann(Type) -> - #ann{range = range_from_simple_type(Type), type = t_limit(Type,1), count=1}. + #ann{range = range_from_simple_type(Type), type = t_limit(Type,1), count = 1}. -spec make_range_anno(#ann{}) -> range_anno(). @@ -333,52 +333,52 @@ update_three(_R1, R2, R3) -> safe_widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> ResRange = - case {Old,New,Wide} of - {{Min,Max1},{Min,Max2},{_,Max}} -> - case inf_geq(OMax = next_up_limit(inf_max([Max1,Max2])),Max) of + case {Old, New, Wide} of + {{Min,Max1}, {Min,Max2}, {_,Max}} -> + case inf_geq(OMax = next_up_limit(inf_max([Max1, Max2])), Max) of true -> {Min,Max}; false -> {Min,OMax} end; - {{Min1,Max},{Min2,Max},{Min,_}} -> - case inf_geq(Min, OMin = next_down_limit(inf_min([Min1,Min2]))) of + {{Min1,Max}, {Min2,Max}, {Min,_}} -> + case inf_geq(Min, OMin = next_down_limit(inf_min([Min1, Min2]))) of true -> {Min,Max}; false -> {OMin,Max} end; - {{Min1,Max1},{Min2,Max2},{Min,Max}} -> + {{Min1,Max1}, {Min2,Max2}, {Min,Max}} -> RealMax = - case inf_geq(OMax = next_up_limit(inf_max([Max1,Max2])),Max) of + case inf_geq(OMax = next_up_limit(inf_max([Max1, Max2])), Max) of true -> Max; false -> OMax end, RealMin = - case inf_geq(Min, OMin = next_down_limit(inf_min([Min1,Min2]))) of + case inf_geq(Min, OMin = next_down_limit(inf_min([Min1, Min2]))) of true -> Min; false -> OMin end, - {RealMin,RealMax}; + {RealMin, RealMax}; _ -> Wide end, - T#range{range=ResRange}. + T#range{range = ResRange}. -spec widen(#range{}, #range{}, #range{}) -> #range{}. widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> ResRange = - case {Old,New,Wide} of - {{Min,_},{Min,Max2},{_,Max}} -> - case inf_geq(OMax = next_up_limit(Max2),Max) of + case {Old, New, Wide} of + {{Min,_}, {Min,Max2}, {_,Max}} -> + case inf_geq(OMax = next_up_limit(Max2), Max) of true -> {Min,Max}; false -> {Min,OMax} end; - {{_,Max},{Min2,Max},{Min,_}} -> + {{_,Max}, {Min2,Max}, {Min,_}} -> case inf_geq(Min, OMin = next_down_limit(Min2)) of true -> {Min,Max}; false -> {OMin,Max} end; - {_,{Min2,Max2},{Min,Max}} -> + {_, {Min2,Max2}, {Min,Max}} -> RealMax = - case inf_geq(OMax = next_up_limit(Max2),Max) of + case inf_geq(OMax = next_up_limit(Max2), Max) of true -> Max; false -> OMax end, @@ -387,11 +387,11 @@ widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> true -> Min; false -> OMin end, - {RealMin,RealMax}; + {RealMin, RealMax}; _ -> Wide end, - T#range{range=ResRange}. + T#range{range = ResRange}. -spec analyse_call(#icode_call{}, call_fun()) -> #icode_call{}. @@ -421,7 +421,7 @@ analyse_move(Move) -> analyse_begin_handler(Handler) -> SubstList = - [{Dst,update_info(Dst,any_type())} || + [{Dst, update_info(Dst, any_type())} || Dst <- hipe_icode:begin_handler_dstlist(Handler)], hipe_icode:subst_defines(SubstList, Handler). @@ -497,7 +497,7 @@ analyse_switch_val(Switch, Info, Rewrite) -> -spec update_infos(argument(), info(), [{#range{},label()}]) -> [{label(),info()}]. update_infos(Arg, Info, [{Range, Label}|Rest]) -> - [{Label,enter_define({Arg,Range},Info)} | update_infos(Arg,Info,Rest)]; + [{Label,enter_define({Arg,Range},Info)} | update_infos(Arg, Info, Rest)]; update_infos(_, _, []) -> []. -spec get_range_label_list([{argument(),label()}], #range{}, [{#range{},label()}]) -> @@ -524,7 +524,7 @@ update_switch(Switch, LabelRangeList, KeepFail) -> case label_range_list_to_cases(LabelRangeList, []) of no_update -> Switch; - Cases -> + Cases -> hipe_icode:switch_val_cases_update(Switch, Cases) end, if KeepFail -> S2; @@ -586,9 +586,9 @@ analyse_last_call(Call, Info, LookupFun) -> NewInfo = enter_vals(NewI, Info), case hipe_icode:call_fail_label(Call) of [] -> - {NewI, [{Continuation,NewInfo}]}; + {NewI, [{Continuation, NewInfo}]}; Fail -> - {NewI, [{Continuation,NewInfo}, {Fail,Info}]} + {NewI, [{Continuation, NewInfo}, {Fail, Info}]} end. -spec analyse_if(#icode_if{}, info(), boolean()) -> @@ -596,12 +596,12 @@ analyse_last_call(Call, Info, LookupFun) -> analyse_if(If, Info, Rewrite) -> case hipe_icode:if_args(If) of - Args = [_,_] -> + [_, _] = Args -> analyse_sane_if(If, Info, Args, get_range_from_args(Args), Rewrite); _ -> TrueLabel = hipe_icode:if_true_label(If), FalseLabel = hipe_icode:if_false_label(If), - {If, [{TrueLabel,Info},{FalseLabel,Info}]} + {If, [{TrueLabel, Info}, {FalseLabel, Info}]} end. -spec analyse_sane_if(#icode_if{}, info(), [argument(),...], @@ -613,59 +613,61 @@ analyse_sane_if(If, Info, [Arg1, Arg2], [Range1, Range2], Rewrite) -> '>' -> {TrueRange2, TrueRange1, FalseRange2, FalseRange1} = range_inequality_propagation(Range2, Range1); - '==' -> - {TempTrueRange1, TempTrueRange2, FalseRange1, FalseRange2}= - range_equality_propagation(Range1, Range2), - TrueRange1 = set_other(TempTrueRange1,other(Range1)), - TrueRange2 = set_other(TempTrueRange2,other(Range2)); '<' -> - {TrueRange1, TrueRange2, FalseRange1, FalseRange2} = + {TrueRange1, TrueRange2, FalseRange1, FalseRange2} = range_inequality_propagation(Range1, Range2); '>=' -> {FalseRange1, FalseRange2, TrueRange1, TrueRange2} = range_inequality_propagation(Range1, Range2); '=<' -> - {FalseRange2, FalseRange1, TrueRange2, TrueRange1} = + {FalseRange2, FalseRange1, TrueRange2, TrueRange1} = range_inequality_propagation(Range2, Range1); '=:=' -> - {TrueRange1, TrueRange2, FalseRange1, FalseRange2}= + {TrueRange1, TrueRange2, FalseRange1, FalseRange2} = range_equality_propagation(Range1, Range2); '=/=' -> {FalseRange1, FalseRange2, TrueRange1, TrueRange2} = range_equality_propagation(Range1, Range2); + '==' -> + {TempTrueRange1, TempTrueRange2, FalseRange1, FalseRange2} = + range_equality_propagation(Range1, Range2), + TrueRange1 = set_other(TempTrueRange1, other(Range1)), + TrueRange2 = set_other(TempTrueRange2, other(Range2)); '/=' -> - {TempFalseRange1, TempFalseRange2, TrueRange1, TrueRange2}= + {TempFalseRange1, TempFalseRange2, TrueRange1, TrueRange2} = range_equality_propagation(Range1, Range2), - FalseRange1 = set_other(TempFalseRange1,other(Range1)), - FalseRange2 = set_other(TempFalseRange2,other(Range2)) + FalseRange1 = set_other(TempFalseRange1, other(Range1)), + FalseRange2 = set_other(TempFalseRange2, other(Range2)) end, - TrueLabel = hipe_icode:if_true_label(If), - FalseLabel = hipe_icode:if_false_label(If), - TrueInfo = - enter_defines([{Arg1,TrueRange1}, {Arg2,TrueRange2}],Info), - FalseInfo = - enter_defines([{Arg1,FalseRange1}, {Arg2,FalseRange2}],Info), - True = - case lists:any(fun range__is_none/1,[TrueRange1,TrueRange2]) of + %% io:format("TR1 = ~w\nTR2 = ~w\n", [TrueRange1, TrueRange2]), + True = + case lists:any(fun range__is_none/1, [TrueRange1, TrueRange2]) of true -> []; - false -> [{TrueLabel,TrueInfo}] + false -> + TrueLabel = hipe_icode:if_true_label(If), + TrueArgRanges = [{Arg1, TrueRange1}, {Arg2, TrueRange2}], + TrueInfo = enter_defines(TrueArgRanges, Info), + [{TrueLabel, TrueInfo}] end, - False = - case lists:any(fun range__is_none/1, [FalseRange1,FalseRange2]) of + %% io:format("FR1 = ~w\nFR2 = ~w\n", [FalseRange1, FalseRange2]), + False = + case lists:any(fun range__is_none/1, [FalseRange1, FalseRange2]) of true -> []; - false -> [{FalseLabel,FalseInfo}] + false -> + FalseLabel = hipe_icode:if_false_label(If), + FalseArgRanges = [{Arg1, FalseRange1}, {Arg2, FalseRange2}], + FalseInfo = enter_defines(FalseArgRanges, Info), + [{FalseLabel, FalseInfo}] end, - UpdateInfo = True++False, + UpdateInfo = True ++ False, NewIF = if Rewrite -> - %%io:format("~w~n~w~n", [{Arg1,FalseRange1},{Arg2,FalseRange2}]), - %%io:format("Any none: ~w~n", [lists:any(fun range__is_none/1,[FalseRange1,FalseRange2])]), case UpdateInfo of - [] -> %%This is weird + [] -> %% This is weird If; - [{Label,_Info}] -> + [{Label, _Info}] -> hipe_icode:mk_goto(Label); - [_,_] -> + [_, _] -> If end; true -> @@ -692,7 +694,7 @@ normalize_name(Name) -> range_equality_propagation(Range_1, Range_2) -> True_range = inf(Range_1, Range_2), case {range(Range_1), range(Range_2)} of - {{N,N},{ N,N}} -> + {{N,N}, {N,N}} -> False_range_1 = none_range(), False_range_2 = none_range(); {{N1,N1}, {N2,N2}} -> @@ -781,26 +783,24 @@ analyse_type(Type, Info, Rewrite) -> TrueRange = inf(any_range(), OldVarRange), FalseRange = inf(none_range(), OldVarRange); _ -> - TrueRange = inf(none_range(),OldVarRange), + TrueRange = inf(none_range(), OldVarRange), FalseRange = OldVarRange end, TrueLabel = hipe_icode:type_true_label(Type), FalseLabel = hipe_icode:type_false_label(Type), - TrueInfo = - enter_define({Arg,TrueRange},Info), - FalseInfo = - enter_define({Arg,FalseRange},Info), - True = + TrueInfo = enter_define({Arg, TrueRange}, Info), + FalseInfo = enter_define({Arg, FalseRange}, Info), + True = case range__is_none(TrueRange) of true -> []; - false -> [{TrueLabel,TrueInfo}] + false -> [{TrueLabel, TrueInfo}] end, - False = + False = case range__is_none(FalseRange) of true -> []; - false -> [{FalseLabel,FalseInfo}] + false -> [{FalseLabel, FalseInfo}] end, - UpdateInfo = True++False, + UpdateInfo = True ++ False, NewType = if Rewrite -> case UpdateInfo of @@ -808,13 +808,13 @@ analyse_type(Type, Info, Rewrite) -> Type; [{Label,_Info}] -> hipe_icode:mk_goto(Label); - [_,_] -> + [_, _] -> Type end; true -> Type end, - {NewType,True ++ False}. + {NewType, True ++ False}. -spec compare_with_integer(integer(), #range{}) -> {#range{}, #range{}}. @@ -845,11 +845,11 @@ compare_with_integer(N, OldVarRange) -> -spec pp_ann(#ann{} | erl_types:erl_type()) -> string(). -pp_ann(#ann{range=#range{range=R, other=false}}) -> +pp_ann(#ann{range = #range{range = R, other = false}}) -> pp_range(R); -pp_ann(#ann{range=#range{range=empty, other=true}, type=Type}) -> +pp_ann(#ann{range = #range{range = empty, other = true}, type = Type}) -> t_to_string(Type); -pp_ann(#ann{range=#range{range=R, other=true}, type=Type}) -> +pp_ann(#ann{range = #range{range = R, other = true}, type = Type}) -> pp_range(R) ++ " | " ++ t_to_string(Type); pp_ann(Type) -> t_to_string(Type). @@ -913,23 +913,23 @@ set_other(R, O) -> R#range{other = O}. -spec range__min(#range{}) -> 'empty' | 'neg_inf' | integer(). -range__min(#range{range=empty}) -> empty; -range__min(#range{range={Min,_}}) -> Min. +range__min(#range{range = empty}) -> empty; +range__min(#range{range = {Min,_}}) -> Min. -spec range__max(#range{}) -> 'empty' | 'pos_inf' | integer(). -range__max(#range{range=empty}) -> empty; -range__max(#range{range={_,Max}}) -> Max. +range__max(#range{range = empty}) -> empty; +range__max(#range{range = {_,Max}}) -> Max. -spec range__is_none(#range{}) -> boolean(). -range__is_none(#range{range=empty, other=false}) -> true; +range__is_none(#range{range = empty, other = false}) -> true; range__is_none(#range{}) -> false. -spec range__is_empty(#range{}) -> boolean(). -range__is_empty(#range{range=empty}) -> true; -range__is_empty(#range{range={_,_}}) -> false. +range__is_empty(#range{range = empty}) -> true; +range__is_empty(#range{range = {_,_}}) -> false. -spec remove_point_types(#range{}, [#range{}]) -> #range{}. @@ -941,31 +941,31 @@ remove_point_types(Range, Ranges) -> -spec range__remove_constant(#range{}, #range{}) -> #range{}. -range__remove_constant(R = #range{range={C,C}}, #range{range={C,C}}) -> - R#range{range=empty}; -range__remove_constant(R = #range{range={C,H}}, #range{range={C,C}}) -> - R#range{range={C+1,H}}; -range__remove_constant(R = #range{range={L,C}}, #range{range={C,C}}) -> - R#range{range={L,C-1}}; -range__remove_constant(R = #range{}, #range{range={C,C}}) -> +range__remove_constant(#range{range = {C, C}} = R, #range{range = {C, C}}) -> + R#range{range = empty}; +range__remove_constant(#range{range = {C, H}} = R, #range{range = {C, C}}) -> + R#range{range = {C+1, H}}; +range__remove_constant(#range{range = {L, C}} = R, #range{range = {C, C}}) -> + R#range{range = {L, C-1}}; +range__remove_constant(#range{} = R, #range{range = {C,C}}) -> R; -range__remove_constant(R = #range{}, _) -> +range__remove_constant(#range{} = R, _) -> R. -spec any_type() -> #range{}. any_type() -> - #range{range=any_r(), other=true}. + #range{range = any_r(), other = true}. -spec any_range() -> #range{}. any_range() -> - #range{range=any_r(), other=false}. + #range{range = any_r(), other = false}. -spec none_range() -> #range{}. none_range() -> - #range{range=empty, other=true}. + #range{range = empty, other = true}. -spec none_type() -> #range{}. @@ -989,15 +989,15 @@ get_range_from_arg(Arg) -> Value = hipe_icode:const_value(Arg), case is_integer(Value) of true -> - #range{range={Value,Value}, other=false}; + #range{range = {Value, Value}, other = false}; false -> - #range{range=empty, other=true} + #range{range = empty, other = true} end; false -> case hipe_icode:is_annotated_variable(Arg) of true -> case hipe_icode:variable_annotation(Arg) of - {range_anno, #ann{range=Range}, _} -> + {range_anno, #ann{range = Range}, _} -> Range; {type_anno, Type, _} -> range_from_simple_type(Type) @@ -1022,8 +1022,8 @@ inf(#range{range=R1, other=O1}, #range{range=R2, other=O2}) -> range_inf(empty, _) -> empty; range_inf(_, empty) -> empty; range_inf({Min1,Max1}, {Min2,Max2}) -> - NewMin = inf_max([Min1,Min2]), - NewMax = inf_min([Max1,Max2]), + NewMin = inf_max([Min1, Min2]), + NewMax = inf_min([Max1, Max2]), case inf_geq(NewMax, NewMin) of true -> {NewMin, NewMax}; @@ -1105,7 +1105,7 @@ analyse_call_or_enter_fun(Fun, Args, CallType, LookupFun) -> [any_type()]; {hipe_bs_primop, {bs_get_integer, Size, Flags}} -> {Min, Max} = analyse_bs_get_integer(Size, Flags, length(Args) =:= 1), - [#range{range={Min, Max}, other=false}, any_type()]; + [#range{range = {Min, Max}, other = false}, any_type()]; {hipe_bs_primop, _} = Primop -> Type = hipe_icode_primops:type(Primop), range_from_type(Type) @@ -1115,9 +1115,9 @@ analyse_call_or_enter_fun(Fun, Args, CallType, LookupFun) -> -type unary_operation() :: fun((#range{}) -> #range{}). -spec basic_type(fun_name()) -> 'not_int' | 'not_analysed' - | {bin, bin_operation()} - | {unary, unary_operation()} - | {fcall, mfa()} | {hipe_bs_primop, _}. + | {'bin', bin_operation()} + | {'unary', unary_operation()} + | {'fcall', mfa()} | {'hipe_bs_primop', _}. %% Arithmetic operations basic_type('+') -> {bin, fun(R1, R2) -> range_add(R1, R2) end}; -- cgit v1.2.3 From 6c9a53e0e155dae4325fb104a4108cd6446940f3 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 2 Feb 2011 12:29:59 +0200 Subject: Fix bug in the simplification of inexact comparisons On 31/1/2011 Paul Guyot reported a bug in the native code compilation of inexact equality/inequality tests between floats and integers. The relevant test was: f(X) -> Y = X / 2, Y == 0. and hipe erroneously evaluated the calls f(0) and f(0.0) to 'false'. The culprit was in the simplification code of the Icode range analysis which used an erroneous test (lists:any/1 instead of lists:all/1). --- lib/hipe/icode/hipe_icode_range.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl index 91f6fb47f3..cdd5f7ace5 100644 --- a/lib/hipe/icode/hipe_icode_range.erl +++ b/lib/hipe/icode/hipe_icode_range.erl @@ -641,7 +641,7 @@ analyse_sane_if(If, Info, [Arg1, Arg2], [Range1, Range2], Rewrite) -> end, %% io:format("TR1 = ~w\nTR2 = ~w\n", [TrueRange1, TrueRange2]), True = - case lists:any(fun range__is_none/1, [TrueRange1, TrueRange2]) of + case lists:all(fun range__is_none/1, [TrueRange1, TrueRange2]) of true -> []; false -> TrueLabel = hipe_icode:if_true_label(If), @@ -651,7 +651,7 @@ analyse_sane_if(If, Info, [Arg1, Arg2], [Range1, Range2], Rewrite) -> end, %% io:format("FR1 = ~w\nFR2 = ~w\n", [FalseRange1, FalseRange2]), False = - case lists:any(fun range__is_none/1, [FalseRange1, FalseRange2]) of + case lists:all(fun range__is_none/1, [FalseRange1, FalseRange2]) of true -> []; false -> FalseLabel = hipe_icode:if_false_label(If), -- cgit v1.2.3 From cc526d2b1f22d67ddd5f6fb49fee0d5cd94761cd Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 2 Feb 2011 16:48:44 +0200 Subject: Cleanup specs --- lib/hipe/icode/hipe_icode_range.erl | 152 ++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 75 deletions(-) diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl index cdd5f7ace5..c222e8a5d5 100644 --- a/lib/hipe/icode/hipe_icode_range.erl +++ b/lib/hipe/icode/hipe_icode_range.erl @@ -59,15 +59,17 @@ -record(range, {range :: range_rep(), other :: boolean()}). +-type range() :: #range{}. --record(ann, {range :: #range{}, +-record(ann, {range :: range(), type :: erl_types:erl_type(), count :: integer()}). +-type ann() :: #ann{}. --type range_anno() :: {range_anno, #ann{}, fun((#ann{}) -> string())}. --type args_fun() :: fun((mfa(),cfg()) -> [#range{}]). --type call_fun() :: fun((mfa(),[#range{}]) -> #range{}). --type final_fun() :: fun((mfa(),[#range{}]) -> ok). +-type range_anno() :: {'range_anno', ann(), fun((ann()) -> string())}. +-type args_fun() :: fun((mfa(), cfg()) -> [range()]). +-type call_fun() :: fun((mfa(), [range()]) -> range()). +-type final_fun() :: fun((mfa(), [range()]) -> 'ok'). -type data() :: {mfa(), args_fun(), call_fun(), final_fun()}. -type label() :: non_neg_integer(). -type info() :: gb_tree(). @@ -75,15 +77,15 @@ -type variable() :: #icode_variable{}. -type annotated_variable() :: #icode_variable{}. -type argument() :: #icode_const{} | variable(). --type three_range_fun() :: fun((#range{},#range{},#range{}) -> #range{}). +-type three_range_fun() :: fun((range(),range(),range()) -> range()). -type instr_split_info() :: {icode_instr(), [{label(),info()}]}. --type last_instr_return() :: {instr_split_info(), #range{}}. +-type last_instr_return() :: {instr_split_info(), range()}. -record(state, {info_map = gb_trees:empty() :: info(), counter = dict:new() :: dict(), cfg :: cfg(), liveness = gb_trees:empty() :: gb_tree(), - ret_type :: #range{}, + ret_type :: range(), lookup_fun :: call_fun(), result_action :: final_fun()}). @@ -227,7 +229,7 @@ analyse_block(Label, Info, State, Rewrite) -> state__update_info(State2, InfoList, Rewrite). -spec analyse_BB([icode_instr()], info(), [icode_instr()], boolean(), call_fun()) -> - {[icode_instr()], [{label(),info()}], #range{}}. + {[icode_instr()], [{label(),info()}], range()}. analyse_BB([Last], Info, Code, Rewrite, LookupFun) -> {{NewI, LabelInfoList}, RetType} = @@ -268,7 +270,7 @@ handle_args(I, Info, WidenFun) -> NewUses = lists:zipwith(JoinFun, Uses, PresentRanges), hipe_icode:subst_uses(lists:zip(Uses, NewUses), I). --spec join_info(#ann{}, #range{}, three_range_fun()) -> #ann{}. +-spec join_info(ann(), range(), three_range_fun()) -> ann(). join_info(Ann = #ann{range = R1, type = Type, count = ?WIDEN}, R2, Fun) -> Ann#ann{range = Fun(R1, R2, range_from_simple_type(Type))}; @@ -278,17 +280,17 @@ join_info(Ann = #ann{range = R1, type = Type, count = C}, R2, _Fun) when C < ?WI NewR -> Ann#ann{range = NewR, count = C+1} end. --spec join_three(#range{}, #range{}, #range{}) -> #range{}. +-spec join_three(range(), range(), range()) -> range(). join_three(R1, R2, R3) -> inf(sup(R1, R2), R3). --spec update_info(variable(), #range{}) -> annotated_variable(). +-spec update_info(variable(), range()) -> annotated_variable(). update_info(Var, Range) -> update_info(Var, Range, fun update_three/3). --spec update_info(variable(), #range{}, three_range_fun()) -> annotated_variable(). +-spec update_info(variable(), range(), three_range_fun()) -> annotated_variable(). update_info(Arg, R, Fun) -> case hipe_icode:is_annotated_variable(Arg) of @@ -299,7 +301,7 @@ update_info(Arg, R, Fun) -> Arg end. --spec update_info1(any(), #range{}, three_range_fun()) -> range_anno(). +-spec update_info1(any(), range(), three_range_fun()) -> range_anno(). update_info1({range_anno, Ann, _}, R2, Fun) -> make_range_anno(update_ann(Ann,R2,Fun)); @@ -314,22 +316,22 @@ update_ann(Ann = #ann{range = R1, type = Type, count = C}, R2, _Fun) -> NewR -> Ann#ann{range = NewR, count = C+1} end. --spec type_to_ann(erl_types:erl_type()) -> #ann{}. +-spec type_to_ann(erl_types:erl_type()) -> ann(). type_to_ann(Type) -> #ann{range = range_from_simple_type(Type), type = t_limit(Type,1), count = 1}. --spec make_range_anno(#ann{}) -> range_anno(). +-spec make_range_anno(ann()) -> range_anno(). make_range_anno(Ann) -> {range_anno, Ann, fun pp_ann/1}. --spec update_three(#range{}, #range{}, #range{}) -> #range{}. +-spec update_three(range(), range(), range()) -> range(). update_three(_R1, R2, R3) -> inf(R2, R3). --spec safe_widen(#range{}, #range{}, #range{}) -> #range{}. +-spec safe_widen(range(), range(), range()) -> range(). safe_widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> ResRange = @@ -361,7 +363,7 @@ safe_widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> end, T#range{range = ResRange}. --spec widen(#range{}, #range{}, #range{}) -> #range{}. +-spec widen(range(), range(), range()) -> range(). widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) -> ResRange = @@ -494,14 +496,14 @@ analyse_switch_val(Switch, Info, Rewrite) -> end end. --spec update_infos(argument(), info(), [{#range{},label()}]) -> [{label(),info()}]. +-spec update_infos(argument(), info(), [{range(),label()}]) -> [{label(),info()}]. update_infos(Arg, Info, [{Range, Label}|Rest]) -> [{Label,enter_define({Arg,Range},Info)} | update_infos(Arg, Info, Rest)]; update_infos(_, _, []) -> []. --spec get_range_label_list([{argument(),label()}], #range{}, [{#range{},label()}]) -> - {#range{},[{#range{},label()}]}. +-spec get_range_label_list([{argument(),label()}], range(), [{range(),label()}]) -> + {range(),[{range(),label()}]}. get_range_label_list([{Val,Label}|Cases], SRange, Acc) -> VRange = get_range_from_arg(Val), @@ -516,7 +518,7 @@ get_range_label_list([], SRange, Acc) -> {PointTypes, _} = lists:unzip(Acc), {remove_point_types(SRange, PointTypes), Acc}. --spec update_switch(#icode_switch_val{}, [{#range{},label()}], boolean()) -> +-spec update_switch(#icode_switch_val{}, [{range(),label()}], boolean()) -> #icode_switch_val{}. update_switch(Switch, LabelRangeList, KeepFail) -> @@ -531,7 +533,7 @@ update_switch(Switch, LabelRangeList, KeepFail) -> true -> S2 end. --spec label_range_list_to_cases([{#range{},label()}], [{#icode_const{},label()}]) -> +-spec label_range_list_to_cases([{range(),label()}], [{#icode_const{},label()}]) -> 'no_update' | [{#icode_const{},label()}]. label_range_list_to_cases([{#range{range={C,C},other=false},Label}|Rest], @@ -605,7 +607,7 @@ analyse_if(If, Info, Rewrite) -> end. -spec analyse_sane_if(#icode_if{}, info(), [argument(),...], - [#range{},...], boolean()) -> + [range(),...], boolean()) -> {#icode_goto{} | #icode_if{}, [{label(), info()}]}. analyse_sane_if(If, Info, [Arg1, Arg2], [Range1, Range2], Rewrite) -> @@ -688,8 +690,8 @@ normalize_name(Name) -> Name -> Name end. --spec range_equality_propagation(#range{}, #range{}) -> - {#range{}, #range{}, #range{}, #range{}}. +-spec range_equality_propagation(range(), range()) -> + {range(), range(), range(), range()}. range_equality_propagation(Range_1, Range_2) -> True_range = inf(Range_1, Range_2), @@ -712,8 +714,8 @@ range_equality_propagation(Range_1, Range_2) -> end, {True_range, True_range, False_range_1, False_range_2}. --spec range_inequality_propagation(#range{}, #range{}) -> - {#range{}, #range{}, #range{}, #range{}}. +-spec range_inequality_propagation(range(), range()) -> + {range(), range(), range(), range()}. %% Range1 < Range2 range_inequality_propagation(Range1, Range2) -> @@ -816,7 +818,7 @@ analyse_type(Type, Info, Rewrite) -> end, {NewType, True ++ False}. --spec compare_with_integer(integer(), #range{}) -> {#range{}, #range{}}. +-spec compare_with_integer(integer(), range()) -> {range(), range()}. compare_with_integer(N, OldVarRange) -> TestRange = range_init({N, N}, false), @@ -843,7 +845,7 @@ compare_with_integer(N, OldVarRange) -> %%== Ranges ================================================================== --spec pp_ann(#ann{} | erl_types:erl_type()) -> string(). +-spec pp_ann(ann() | erl_types:erl_type()) -> string(). pp_ann(#ann{range = #range{range = R, other = false}}) -> pp_range(R); @@ -867,12 +869,12 @@ val_to_string(pos_inf) -> "inf"; val_to_string(neg_inf) -> "-inf"; val_to_string(X) when is_integer(X) -> integer_to_list(X). --spec range_from_type(erl_types:erl_type()) -> [#range{}]. +-spec range_from_type(erl_types:erl_type()) -> [range()]. range_from_type(Type) -> [range_from_simple_type(T) || T <- t_to_tlist(Type)]. --spec range_from_simple_type(erl_types:erl_type()) -> #range{}. +-spec range_from_simple_type(erl_types:erl_type()) -> range(). range_from_simple_type(Type) -> None = t_none(), @@ -887,7 +889,7 @@ range_from_simple_type(Type) -> #range{range = Range, other = true} end. --spec range_init(range_rep(), boolean()) -> #range{}. +-spec range_init(range_rep(), boolean()) -> range(). range_init({Min, Max} = Range, Other) -> case inf_geq(Max, Min) of @@ -899,39 +901,39 @@ range_init({Min, Max} = Range, Other) -> range_init(empty, Other) -> #range{range = empty, other = Other}. --spec range(#range{}) -> range_rep(). +-spec range(range()) -> range_rep(). range(#range{range = R}) -> R. --spec other(#range{}) -> boolean(). +-spec other(range()) -> boolean(). other(#range{other = O}) -> O. --spec set_other(#range{}, boolean()) -> #range{}. +-spec set_other(range(), boolean()) -> range(). set_other(R, O) -> R#range{other = O}. --spec range__min(#range{}) -> 'empty' | 'neg_inf' | integer(). +-spec range__min(range()) -> 'empty' | 'neg_inf' | integer(). range__min(#range{range = empty}) -> empty; range__min(#range{range = {Min,_}}) -> Min. --spec range__max(#range{}) -> 'empty' | 'pos_inf' | integer(). +-spec range__max(range()) -> 'empty' | 'pos_inf' | integer(). range__max(#range{range = empty}) -> empty; range__max(#range{range = {_,Max}}) -> Max. --spec range__is_none(#range{}) -> boolean(). +-spec range__is_none(range()) -> boolean(). range__is_none(#range{range = empty, other = false}) -> true; range__is_none(#range{}) -> false. --spec range__is_empty(#range{}) -> boolean(). +-spec range__is_empty(range()) -> boolean(). range__is_empty(#range{range = empty}) -> true; range__is_empty(#range{range = {_,_}}) -> false. --spec remove_point_types(#range{}, [#range{}]) -> #range{}. +-spec remove_point_types(range(), [range()]) -> range(). remove_point_types(Range, Ranges) -> Sorted = lists:sort(Ranges), @@ -939,7 +941,7 @@ remove_point_types(Range, Ranges) -> Range1 = lists:foldl(FoldFun, Range, Sorted), lists:foldl(FoldFun, Range1, lists:reverse(Sorted)). --spec range__remove_constant(#range{}, #range{}) -> #range{}. +-spec range__remove_constant(range(), range()) -> range(). range__remove_constant(#range{range = {C, C}} = R, #range{range = {C, C}}) -> R#range{range = empty}; @@ -952,22 +954,22 @@ range__remove_constant(#range{} = R, #range{range = {C,C}}) -> range__remove_constant(#range{} = R, _) -> R. --spec any_type() -> #range{}. +-spec any_type() -> range(). any_type() -> #range{range = any_r(), other = true}. --spec any_range() -> #range{}. +-spec any_range() -> range(). any_range() -> #range{range = any_r(), other = false}. --spec none_range() -> #range{}. +-spec none_range() -> range(). none_range() -> #range{range = empty, other = true}. --spec none_type() -> #range{}. +-spec none_type() -> range(). none_type() -> #range{range = empty, other = false}. @@ -976,12 +978,12 @@ none_type() -> any_r() -> {neg_inf, pos_inf}. --spec get_range_from_args([argument()]) -> [#range{}]. +-spec get_range_from_args([argument()]) -> [range()]. get_range_from_args(Args) -> [get_range_from_arg(Arg) || Arg <- Args]. --spec get_range_from_arg(argument()) -> #range{}. +-spec get_range_from_arg(argument()) -> range(). get_range_from_arg(Arg) -> case hipe_icode:is_const(Arg) of @@ -1012,7 +1014,7 @@ get_range_from_arg(Arg) -> %% inf([R1,R2|Rest]) -> %% inf([inf(R1,R2)|Rest]). --spec inf(#range{}, #range{}) -> #range{}. +-spec inf(range(), range()) -> range(). inf(#range{range=R1, other=O1}, #range{range=R2, other=O2}) -> #range{range=range_inf(R1,R2), other=other_inf(O1,O2)}. @@ -1035,14 +1037,14 @@ range_inf({Min1,Max1}, {Min2,Max2}) -> other_inf(O1, O2) -> O1 and O2. --spec sup([#range{},...]) -> #range{}. +-spec sup([range(),...]) -> range(). sup([R]) -> R; sup([R1,R2|Rest]) -> sup([sup(R1, R2)|Rest]). --spec sup(#range{}, #range{}) -> #range{}. +-spec sup(range(), range()) -> range(). sup(#range{range=R1,other=O1}, #range{range=R2,other=O2}) -> #range{range=range_sup(R1,R2), other=other_sup(O1,O2)}. @@ -1063,7 +1065,7 @@ other_sup(O1, O2) -> O1 or O2. %%== Call Support ============================================================= -spec analyse_call_or_enter_fun(fun_name(), [argument()], - icode_call_type(), call_fun()) -> [#range{}]. + icode_call_type(), call_fun()) -> [range()]. analyse_call_or_enter_fun(Fun, Args, CallType, LookupFun) -> %%io:format("Fun: ~p~n Args: ~p~n CT: ~p~n LF: ~p~n", [Fun, Args, CallType, LookupFun]), @@ -1111,8 +1113,8 @@ analyse_call_or_enter_fun(Fun, Args, CallType, LookupFun) -> range_from_type(Type) end. --type bin_operation() :: fun((#range{},#range{}) -> #range{}). --type unary_operation() :: fun((#range{}) -> #range{}). +-type bin_operation() :: fun((range(), range()) -> range()). +-type unary_operation() :: fun((range()) -> range()). -spec basic_type(fun_name()) -> 'not_int' | 'not_analysed' | {'bin', bin_operation()} @@ -1214,7 +1216,7 @@ analyse_bs_get_integer(Size, Flags, false) when is_integer(Size), %% Arithmetic --spec range_add(#range{}, #range{}) -> #range{}. +-spec range_add(range(), range()) -> range(). range_add(Range1, Range2) -> NewMin = inf_add(range__min(Range1), range__min(Range2)), @@ -1222,7 +1224,7 @@ range_add(Range1, Range2) -> Other = other(Range1) orelse other(Range2), range_init({NewMin, NewMax}, Other). --spec range_sub(#range{}, #range{}) -> #range{}. +-spec range_sub(range(), range()) -> range(). range_sub(Range1, Range2) -> Min_sub = inf_min([inf_inv(range__max(Range2)), @@ -1234,7 +1236,7 @@ range_sub(Range1, Range2) -> Other = other(Range1) orelse other(Range2), range_init({NewMin, NewMax}, Other). --spec range_mult(#range{}, #range{}) -> #range{}. +-spec range_mult(range(), range()) -> range(). range_mult(#range{range=empty, other=true}, _Range2) -> range_init(empty, true); @@ -1274,7 +1276,7 @@ range_mult(Range1, Range2) -> Other = other(Range1) orelse other(Range2), range_init(Range, Other). --spec extreme_divisors(#range{}) -> range_tuple(). +-spec extreme_divisors(range()) -> range_tuple(). extreme_divisors(#range{range={0,0}}) -> {0,0}; extreme_divisors(#range{range={0,Max}}) -> {1,Max}; @@ -1289,7 +1291,7 @@ extreme_divisors(#range{range={Min,Max}}) -> end end. --spec range_div(#range{}, #range{}) -> #range{}. +-spec range_div(range(), range()) -> range(). %% this is div, not /. range_div(_, #range{range={0,0}}) -> @@ -1306,7 +1308,7 @@ range_div(Range1, Den) -> inf_div(Max1, Min2), inf_div(Max1, Max2)], range_init({inf_min(Min_max_list), inf_max(Min_max_list)}, false). --spec range_rem(#range{}, #range{}) -> #range{}. +-spec range_rem(range(), range()) -> range(). range_rem(Range1, Range2) -> %% Range1 desides the sign of the answer. @@ -1332,7 +1334,7 @@ range_rem(Range1, Range2) -> %%--- Bit operations ---------------------------- --spec range_bsr(#range{}, #range{}) -> #range{}. +-spec range_bsr(range(), range()) -> range(). range_bsr(Range1, Range2=#range{range={Min, Max}}) -> New_Range2 = range_init({inf_inv(Max), inf_inv(Min)}, other(Range2)), @@ -1340,7 +1342,7 @@ range_bsr(Range1, Range2=#range{range={Min, Max}}) -> %% io:format("bsr res:~w~nInput:= ~w~n", [Ans, {Range1,Range2}]), Ans. --spec range_bsl(#range{}, #range{}) -> #range{}. +-spec range_bsl(range(), range()) -> range(). range_bsl(Range1, Range2) -> Min1 = range__min(Range1), @@ -1359,7 +1361,7 @@ range_bsl(Range1, Range2) -> end, range_init(MinMax, false). --spec range_bnot(#range{}) -> #range{}. +-spec range_bnot(range()) -> range(). range_bnot(Range) -> Minus_one = range_init({-1,-1}, false), @@ -1389,7 +1391,7 @@ negwidth(X, N) -> false -> negwidth(X, N+1) end. --spec range_band(#range{}, #range{}) -> #range{}. +-spec range_band(range(), range()) -> range(). range_band(R1, R2) -> {_Min1, Max1} = MM1 = range(R1), @@ -1423,7 +1425,7 @@ range_band(R1, R2) -> end, range_init(Range, false). --spec range_bor(#range{}, #range{}) -> #range{}. +-spec range_bor(range(), range()) -> range(). range_bor(R1, R2) -> {Min1, _Max1} = MM1 = range(R1), @@ -1457,7 +1459,7 @@ range_bor(R1, R2) -> end, range_init(Range, false). --spec classify_range(#range{}) -> 'minus_minus' | 'minus_plus' | 'plus_plus'. +-spec classify_range(range()) -> 'minus_minus' | 'minus_plus' | 'plus_plus'. classify_range(Range) -> case range(Range) of @@ -1480,7 +1482,7 @@ classify_int_range(_Number1, Number2) when Number2 < 0 -> classify_int_range(_Number1, _Number2) -> minus_plus. --spec range_bxor(#range{}, #range{}) -> #range{}. +-spec range_bxor(range(), range()) -> range(). range_bxor(R1, R2) -> {Min1, Max1} = MM1 = range(R1), @@ -1895,7 +1897,7 @@ convert_ann_to_types(#ann{range=#range{other=true}, type=Type}) -> %% Icode Coordinator Callbacks %%===================================================================== --spec replace_nones([#range{}]) -> [#range{}]. +-spec replace_nones([range()]) -> [range()]. replace_nones(Args) -> [replace_none(Arg) || Arg <- Args]. @@ -1905,7 +1907,7 @@ replace_none(Arg) -> false -> Arg end. --spec update__info([#range{}], [#range{}]) -> {boolean(), [#ann{}]}. +-spec update__info([range()], [range()]) -> {boolean(), [ann()]}. update__info(NewRanges, OldRanges) -> SupFun = fun (Ann, Range) -> join_info(Ann, Range, fun safe_widen/3) @@ -1915,19 +1917,19 @@ update__info(NewRanges, OldRanges) -> Change = lists:zipwith(EqFun, ResRanges, OldRanges), {lists:all(fun (X) -> X end, Change), ResRanges}. --spec new__info/1 :: ([#range{}]) -> [#ann{}]. +-spec new__info([range()]) -> [ann()]. new__info(NewRanges) -> [#ann{range=Range,count=1,type=t_any()} || Range <- NewRanges]. --spec return__info/1 :: ([#ann{}]) -> [#range{}]. +-spec return__info([ann()]) -> [range()]. return__info(Ranges) -> [Range || #ann{range=Range} <- Ranges]. --spec return_none/0 :: () -> [#range{},...]. +-spec return_none() -> [range(),...]. return_none() -> [none_type()]. --spec return_none_args/2 :: (#cfg{}, mfa()) -> [#range{}]. +-spec return_none_args(cfg(), mfa()) -> [range()]. return_none_args(Cfg, {_M,_F,A}) -> NoArgs = case hipe_icode_cfg:is_closure(Cfg) of @@ -1936,7 +1938,7 @@ return_none_args(Cfg, {_M,_F,A}) -> end, lists:duplicate(NoArgs, none_type()). --spec return_any_args/2 :: (#cfg{}, mfa()) -> [#range{}]. +-spec return_any_args(cfg(), mfa()) -> [range()]. return_any_args(Cfg, {_M,_F,A}) -> NoArgs = case hipe_icode_cfg:is_closure(Cfg) of -- cgit v1.2.3 From c730d2fb0342523fa9014373b234b426bd9ca6f2 Mon Sep 17 00:00:00 2001 From: Seth Falcon Date: Tue, 18 Jan 2011 17:34:41 -0800 Subject: Improved support for RSA and DSA public keys This patch allows the public_key module to decode and encode RSA and DSA keys encoded using the SubjectPublicKeyInfo format. When pem_entry_encode is called on an RSA or DSA public key type, the key is wrapped in the SubjectPublicKeyInfo format. --- lib/public_key/doc/src/public_key.xml | 21 +++++++++++------ lib/public_key/include/public_key.hrl | 5 +++-- lib/public_key/src/pubkey_cert_records.erl | 16 +++++++++---- lib/public_key/src/pubkey_pem.erl | 25 +++++++++++++++++---- lib/public_key/src/public_key.erl | 24 ++++++++++++++++++++ lib/public_key/test/public_key_SUITE.erl | 26 ++++++++++++++++++++++ .../test/public_key_SUITE_data/dsa_pub.pem | 12 ++++++++++ .../test/public_key_SUITE_data/rsa_pub.pem | 4 ++++ .../test/public_key_SUITE_data/rsa_pub_key.pem | 4 ++++ 9 files changed, 120 insertions(+), 17 deletions(-) create mode 100644 lib/public_key/test/public_key_SUITE_data/dsa_pub.pem create mode 100644 lib/public_key/test/public_key_SUITE_data/rsa_pub.pem create mode 100644 lib/public_key/test/public_key_SUITE_data/rsa_pub_key.pem diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml index c72719fac4..91e058f74e 100644 --- a/lib/public_key/doc/src/public_key.xml +++ b/lib/public_key/doc/src/public_key.xml @@ -64,8 +64,8 @@

decrypt_der() = binary()

-

pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| - 'DSAPrivateKey' | 'DHParameter'

+

pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey' + 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo'

pem_entry () = {pki_asn1_type(), der_encoded() | decrypt_der(), not_encrypted | {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)}}.

@@ -207,17 +207,24 @@ Password = string() -

Decodes a pem entry. pem_decode/1 returns a list of - pem entries.

+

Decodes a pem entry. pem_decode/1 returns a list of pem + entries. Note that if the pem entry is of type + 'SubjectPublickeyInfo' it will be further decoded to an + rsa_public_key() or dsa_public_key().

pem_entry_encode(Asn1Type, Entity [,{CipherInfo, Password}]) -> pem_entry() - Creates a pem entry that can be feed to pem_encode/1. + Creates a pem entry that can be fed to pem_encode/1. - Asn1Type = atom() - Entity = term() + Asn1Type = pki_asn1_type() + Entity = term() - The Erlang representation of + Asn1Type. If Asn1Type is 'SubjectPublicKeyInfo' + then Entity must be either an rsa_public_key() or a + dsa_public_key() and this function will create the appropriate + 'SubjectPublicKeyInfo' entry. + CipherInfo = {"DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)} Password = string() diff --git a/lib/public_key/include/public_key.hrl b/lib/public_key/include/public_key.hrl index 4950597fb5..f29ab859ed 100644 --- a/lib/public_key/include/public_key.hrl +++ b/lib/public_key/include/public_key.hrl @@ -73,8 +73,9 @@ -type der_encoded() :: binary(). -type decrypt_der() :: binary(). --type pki_asn1_type() :: 'Certificate' | 'RSAPrivateKey' - | 'DSAPrivateKey' | 'DHParameter'. +-type pki_asn1_type() :: 'Certificate' | 'RSAPrivateKey' | 'RSAPublicKey' + | 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' + | 'SubjectPublicKeyInfo'. -type pem_entry() :: {pki_asn1_type(), der_encoded() | decrypt_der(), not_encrypted | {Cipher :: string(), Salt :: binary()}}. -type asn1_type() :: atom(). %% see "OTP-PUB-KEY.hrl diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl index 20b322b4a4..7a387e487c 100644 --- a/lib/public_key/src/pubkey_cert_records.erl +++ b/lib/public_key/src/pubkey_cert_records.erl @@ -23,7 +23,7 @@ -include("public_key.hrl"). --export([decode_cert/1, transform/2]). +-export([decode_cert/1, transform/2, supportedPublicKeyAlgorithms/1]). %%==================================================================== %% Internal application API @@ -80,16 +80,24 @@ transform(Other,_) -> Other. %%-------------------------------------------------------------------- -%%% Internal functions +-spec supportedPublicKeyAlgorithms(Oid::tuple()) -> asn1_type(). +%% +%% Description: Returns the public key type for an algorithm +%% identifier tuple as found in SubjectPublicKeyInfo. +%% %%-------------------------------------------------------------------- - -%%% SubjectPublicKey supportedPublicKeyAlgorithms(?'rsaEncryption') -> 'RSAPublicKey'; supportedPublicKeyAlgorithms(?'id-dsa') -> 'DSAPublicKey'; supportedPublicKeyAlgorithms(?'dhpublicnumber') -> 'DHPublicKey'; supportedPublicKeyAlgorithms(?'id-keyExchangeAlgorithm') -> 'KEA-PublicKey'; supportedPublicKeyAlgorithms(?'id-ecPublicKey') -> 'ECPoint'. +%%-------------------------------------------------------------------- +%%% Internal functions +%%-------------------------------------------------------------------- + +%%% SubjectPublicKey + decode_supportedPublicKey(#'OTPSubjectPublicKeyInfo'{algorithm= PA = #'PublicKeyAlgorithm'{algorithm=Algo}, subjectPublicKey = {0,SPK0}}) -> diff --git a/lib/public_key/src/pubkey_pem.erl b/lib/public_key/src/pubkey_pem.erl index 31d881973a..78870e5cd7 100644 --- a/lib/public_key/src/pubkey_pem.erl +++ b/lib/public_key/src/pubkey_pem.erl @@ -93,11 +93,11 @@ encode_pem_entries(Entries) -> encode_pem_entry({Asn1Type, Der, not_encrypted}) -> StartStr = pem_start(Asn1Type), - [StartStr, "\n", b64encode_and_split(Der), pem_end(StartStr) ,"\n\n"]; + [StartStr, "\n", b64encode_and_split(Der), "\n", pem_end(StartStr) ,"\n\n"]; encode_pem_entry({Asn1Type, Der, {Cipher, Salt}}) -> StartStr = pem_start(Asn1Type), [StartStr,"\n", pem_decrypt(),"\n", pem_decrypt_info(Cipher, Salt),"\n", - b64encode_and_split(Der), pem_end(StartStr) ,"\n\n"]. + b64encode_and_split(Der), "\n", pem_end(StartStr) ,"\n\n"]. decode_pem_entries([], Entries) -> lists:reverse(Entries); @@ -145,16 +145,22 @@ split_bin(N, Bin) -> b64encode_and_split(Bin) -> split_lines(base64:encode(Bin)). +split_lines(<>) -> + [Text]; split_lines(<>) -> [Text, $\n | split_lines(Rest)]; split_lines(Bin) -> - [Bin, $\n]. + [Bin]. %% Ignore white space at end of line join_entry([<<"-----END CERTIFICATE-----", _/binary>>| Lines], Entry) -> {lists:reverse(Entry), Lines}; join_entry([<<"-----END RSA PRIVATE KEY-----", _/binary>>| Lines], Entry) -> {lists:reverse(Entry), Lines}; +join_entry([<<"-----END PUBLIC KEY-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; +join_entry([<<"-----END RSA PUBLIC KEY-----", _/binary>>| Lines], Entry) -> + {lists:reverse(Entry), Lines}; join_entry([<<"-----END DSA PRIVATE KEY-----", _/binary>>| Lines], Entry) -> {lists:reverse(Entry), Lines}; join_entry([<<"-----END DH PARAMETERS-----", _/binary>>| Lines], Entry) -> @@ -210,15 +216,22 @@ pem_start('Certificate') -> <<"-----BEGIN CERTIFICATE-----">>; pem_start('RSAPrivateKey') -> <<"-----BEGIN RSA PRIVATE KEY-----">>; +pem_start('RSAPublicKey') -> + <<"-----BEGIN RSA PUBLIC KEY-----">>; +pem_start('SubjectPublicKeyInfo') -> + <<"-----BEGIN PUBLIC KEY-----">>; pem_start('DSAPrivateKey') -> <<"-----BEGIN DSA PRIVATE KEY-----">>; pem_start('DHParameter') -> <<"-----BEGIN DH PARAMETERS-----">>. - pem_end(<<"-----BEGIN CERTIFICATE-----">>) -> <<"-----END CERTIFICATE-----">>; pem_end(<<"-----BEGIN RSA PRIVATE KEY-----">>) -> <<"-----END RSA PRIVATE KEY-----">>; +pem_end(<<"-----BEGIN RSA PUBLIC KEY-----">>) -> + <<"-----END RSA PUBLIC KEY-----">>; +pem_end(<<"-----BEGIN PUBLIC KEY-----">>) -> + <<"-----END PUBLIC KEY-----">>; pem_end(<<"-----BEGIN DSA PRIVATE KEY-----">>) -> <<"-----END DSA PRIVATE KEY-----">>; pem_end(<<"-----BEGIN DH PARAMETERS-----">>) -> @@ -230,6 +243,10 @@ asn1_type(<<"-----BEGIN CERTIFICATE-----">>) -> 'Certificate'; asn1_type(<<"-----BEGIN RSA PRIVATE KEY-----">>) -> 'RSAPrivateKey'; +asn1_type(<<"-----BEGIN RSA PUBLIC KEY-----">>) -> + 'RSAPublicKey'; +asn1_type(<<"-----BEGIN PUBLIC KEY-----">>) -> + 'SubjectPublicKeyInfo'; asn1_type(<<"-----BEGIN DSA PRIVATE KEY-----">>) -> 'DSAPrivateKey'; asn1_type(<<"-----BEGIN DH PARAMETERS-----">>) -> diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 30398df9cc..fad73e8e92 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -62,6 +62,7 @@ -type dss_digest_type() :: 'none' | 'sha'. -define(UINT32(X), X:32/unsigned-big-integer). +-define(DER_NULL, <<5, 0>>). %%==================================================================== %% API @@ -90,6 +91,17 @@ pem_encode(PemEntries) when is_list(PemEntries) -> %% Description: Decodes a pem entry. pem_decode/1 returns a list of %% pem entries. %%-------------------------------------------------------------------- +pem_entry_decode({'SubjectPublicKeyInfo', Der, _}) -> + {_, {'AlgorithmIdentifier', AlgId, Params}, {0, Key0}} + = der_decode('SubjectPublicKeyInfo', Der), + KeyType = pubkey_cert_records:supportedPublicKeyAlgorithms(AlgId), + case KeyType of + 'RSAPublicKey' -> + der_decode(KeyType, Key0); + 'DSAPublicKey' -> + {params, DssParams} = der_decode('DSAParams', Params), + {der_decode(KeyType, Key0), DssParams} + end; pem_entry_decode({Asn1Type, Der, not_encrypted}) when is_atom(Asn1Type), is_binary(Der) -> der_decode(Asn1Type, Der). @@ -114,6 +126,18 @@ pem_entry_decode({Asn1Type, CryptDer, {Cipher, Salt}} = PemEntry, % %% Description: Creates a pem entry that can be feed to pem_encode/1. %%-------------------------------------------------------------------- +pem_entry_encode('SubjectPublicKeyInfo', Entity=#'RSAPublicKey'{}) -> + Der = der_encode('RSAPublicKey', Entity), + Spki = {'SubjectPublicKeyInfo', + {'AlgorithmIdentifier', ?'rsaEncryption', ?DER_NULL}, {0, Der}}, + pem_entry_encode('SubjectPublicKeyInfo', Spki); +pem_entry_encode('SubjectPublicKeyInfo', + {DsaInt, Params=#'Dss-Parms'{}}) when is_integer(DsaInt) -> + KeyDer = der_encode('DSAPublicKey', DsaInt), + ParamDer = der_encode('DSAParams', {params, Params}), + Spki = {'SubjectPublicKeyInfo', + {'AlgorithmIdentifier', ?'id-dsa', ParamDer}, {0, KeyDer}}, + pem_entry_encode('SubjectPublicKeyInfo', Spki); pem_entry_encode(Asn1Type, Entity) when is_atom(Asn1Type) -> Der = der_encode(Asn1Type, Entity), {Asn1Type, Der, not_encrypted}. diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 1bc1c8ec75..e74ff8051d 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -139,6 +139,14 @@ pk_decode_encode(Config) when is_list(Config) -> DSAKey = public_key:der_decode('DSAPrivateKey', DerDSAKey), DSAKey = public_key:pem_entry_decode(Entry0), + + {ok, DSAPubPem} = file:read_file(filename:join(Datadir, "dsa_pub.pem")), + [{'SubjectPublicKeyInfo', _, _} = PubEntry0] = + public_key:pem_decode(DSAPubPem), + DSAPubKey = public_key:pem_entry_decode(PubEntry0), + true = check_entry_type(DSAPubKey, 'DSAPublicKey'), + PubEntry0 = public_key:pem_entry_encode('SubjectPublicKeyInfo', DSAPubKey), + DSAPubPem = public_key:pem_encode([PubEntry0]), [{'RSAPrivateKey', DerRSAKey, not_encrypted} = Entry1 ] = erl_make_certs:pem_to_der(filename:join(Datadir, "client_key.pem")), @@ -153,6 +161,20 @@ pk_decode_encode(Config) when is_list(Config) -> true = check_entry_type(public_key:pem_entry_decode(Entry2, "abcd1234"), 'RSAPrivateKey'), + {ok, RSAPubPem} = file:read_file(filename:join(Datadir, "rsa_pub.pem")), + [{'SubjectPublicKeyInfo', _, _} = PubEntry1] = + public_key:pem_decode(RSAPubPem), + RSAPubKey = public_key:pem_entry_decode(PubEntry1), + true = check_entry_type(RSAPubKey, 'RSAPublicKey'), + PubEntry1 = public_key:pem_entry_encode('SubjectPublicKeyInfo', RSAPubKey), + RSAPubPem = public_key:pem_encode([PubEntry1]), + + {ok, RSARawPem} = file:read_file(filename:join(Datadir, "rsa_pub_key.pem")), + [{'RSAPublicKey', _, _} = PubEntry2] = + public_key:pem_decode(RSARawPem), + RSAPubKey = public_key:pem_entry_decode(PubEntry2), + RSARawPem = public_key:pem_encode([PubEntry2]), + Salt0 = crypto:rand_bytes(8), Entry3 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey0, {{"DES-EDE3-CBC", Salt0}, "1234abcd"}), @@ -432,6 +454,10 @@ check_entry_type(#'DSAPrivateKey'{}, 'DSAPrivateKey') -> true; check_entry_type(#'RSAPrivateKey'{}, 'RSAPrivateKey') -> true; +check_entry_type(#'RSAPublicKey'{}, 'RSAPublicKey') -> + true; +check_entry_type({_Int, #'Dss-Parms'{}}, 'DSAPublicKey') when is_integer(_Int) -> + true; check_entry_type(#'DHParameter'{}, 'DHParameter') -> true; check_entry_type(#'Certificate'{}, 'Certificate') -> diff --git a/lib/public_key/test/public_key_SUITE_data/dsa_pub.pem b/lib/public_key/test/public_key_SUITE_data/dsa_pub.pem new file mode 100644 index 0000000000..d3635e5b20 --- /dev/null +++ b/lib/public_key/test/public_key_SUITE_data/dsa_pub.pem @@ -0,0 +1,12 @@ +-----BEGIN PUBLIC KEY----- +MIIBtzCCASwGByqGSM44BAEwggEfAoGBALez5tklY5CdFeTMos899pA6i4u4uCts +zgBzrdBk6cl5FVqzdzWMGTQiynnTpGsrOESinzP06Ip+pG15We2OORwgvCxD/W95 +aCiN0/+MdiXqlsmboBARMzsa+SmBENN3gF/+tuuEAFzOXU1q2cmEywRLyfbM2KIB +VE/TChWYw2eRAhUA1R64VvcQ90XA8SOKVDmMA0dBzukCgYEAlLMYP0pbgBlgHQVO +3/avAHlWNrIq52Lxk7SdPJWgMvPjTK9Z6sv88kxsCcydtjvO439j1yqcwk50GQc+ +86ktBWWz93/HkIdnFyqafef4mmWvm2Uq6ClQKS+A0Asfaj8Mys+HUMiI+qsfdjRb +yIpwb7MX1nsVdsKzALnZNMW27A0DgYQAAoGAfEIAb3mLjtFfiF/tsZb4/DGHdWSb +6Ir0hFkoBUZ9ymBO70wlfZVSQGs240kZtOMpAOpJL1Dy8oH6PUQ+JyacwZIo8fdq +19/Kwm6CPrpaEhzErmMvwT2CZJYZ+HOk55ljLkVCiyG7MzEj2+odLKym9yoQsbsJ +olHzIRpkLk45y4c= +-----END PUBLIC KEY----- diff --git a/lib/public_key/test/public_key_SUITE_data/rsa_pub.pem b/lib/public_key/test/public_key_SUITE_data/rsa_pub.pem new file mode 100644 index 0000000000..cbe81343f7 --- /dev/null +++ b/lib/public_key/test/public_key_SUITE_data/rsa_pub.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANRiyZg0uci74Nc6mnqZ8AoDl88aT7x6 +JA0MfgHIHzteEj7Qg+lE5QxMGAafurVE5vqoHkDfwk4uzzsCAJuz91MCAwEAAQ== +-----END PUBLIC KEY----- diff --git a/lib/public_key/test/public_key_SUITE_data/rsa_pub_key.pem b/lib/public_key/test/public_key_SUITE_data/rsa_pub_key.pem new file mode 100644 index 0000000000..3b9d7568ff --- /dev/null +++ b/lib/public_key/test/public_key_SUITE_data/rsa_pub_key.pem @@ -0,0 +1,4 @@ +-----BEGIN RSA PUBLIC KEY----- +MEgCQQDUYsmYNLnIu+DXOpp6mfAKA5fPGk+8eiQNDH4ByB87XhI+0IPpROUMTBgG +n7q1ROb6qB5A38JOLs87AgCbs/dTAgMBAAE= +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 5ee6233265d6d8e6a3d2e079908dd9f12235fe70 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 15 Feb 2011 12:46:53 +0100 Subject: Updated light weight tests. --- lib/orber/test/multi_ORB_SUITE.erl | 4 ++-- lib/orber/test/orber_test_lib.erl | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index d1931f5393..810e09836f 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1372,7 +1372,7 @@ light_orber2_api(_Config) -> LocalHost = net_adm:localhost(), {ok, Node, _Host} = ?match({ok,_,_}, orber_test_lib:js_node([], - {lightweigth, ["iiop://"++LocalHost++":"++integer_to_list(orber:iiop_port())]})), + {lightweight, ["iiop://"++LocalHost++":"++integer_to_list(orber:iiop_port())]})), ?match(ok, orber:info(io)), ?match([_], orber_test_lib:remote_apply(Node, orber_env, get_lightweight_nodes,[])), diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl index b95cf4b0ec..e22e3bdb0a 100644 --- a/lib/orber/test/orber_test_lib.erl +++ b/lib/orber/test/orber_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -287,9 +287,11 @@ start_ssl(true, Node) -> start_ssl(_, _) -> ok. -start_orber({lightweigth, Options}, Node) -> +start_orber({lightweight, Options}, Node) -> + ok = rpc:call(Node, mnesia, start, []), ok = rpc:call(Node, orber, start_lightweight, [Options]); start_orber(lightweight, Node) -> + ok = rpc:call(Node, mnesia, start, []), ok = rpc:call(Node, orber, start_lightweight, []); start_orber(_, Node) -> ok = rpc:call(Node, orber, jump_start, []). -- cgit v1.2.3 From 05a18c6877dde2e7d0d64edb384607098cf8af90 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 20 Jan 2011 17:38:30 +0100 Subject: Update test spec parser to not group suites, groups and cases which are hierarchically related if merge_tests config i set to false --- lib/common_test/doc/src/run_test_chapter.xml | 10 +- lib/common_test/src/ct_testspec.erl | 133 +++++++---- lib/common_test/src/ct_util.hrl | 3 +- lib/common_test/test/ct_testspec_1_SUITE.erl | 342 ++++++++++++++++++++++++--- 4 files changed, 408 insertions(+), 80 deletions(-) diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 94fcf6bf01..1662923a69 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -365,15 +365,17 @@ either one or more suites, one or more test case groups, or one or more test cases in a group or suite.

An arbitrary number of test terms may be declared in sequence. - Common Test will compile the terms into one or more tests to be - performed in one resulting test run. Note that a term that + Common Test will by default compile the terms into one or more tests + to be performed in one resulting test run. Note that a term that specifies a set of test cases will "swallow" one that only specifies a subset of these cases. E.g. the result of merging one term that specifies that all cases in suite S should be executed, with another term specifying only test case X and Y in S, is a test of all cases in S. However, if a term specifying test case X and Y in S is merged with a term specifying case Z - in S, the result is a test of X, Y and Z in S.

+ in S, the result is a test of X, Y and Z in S. To disable this + behaviour, it is possible in test specification to set the + merge_tests term to false.

A test term can also specify one or more test suites, groups, or test cases to be skipped. Skipped suites, groups and cases are not executed and show up in the HTML test log files as @@ -432,6 +434,8 @@ {userconfig, NodeRefs, {CallbackModule, ConfigStrings}}. {alias, DirAlias, Dir}. + + {merge_tests, Bool}. {logdir, LogDir}. {logdir, NodeRefs, LogDir}. diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index f5069427a2..bf9282900b 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -68,7 +68,8 @@ prepare_tests(TestSpec) when is_record(TestSpec,testspec) -> %% Create initial list of {Node,{Run,Skip}} tuples NodeList = lists:map(fun(N) -> {N,{[],[]}} end, list_nodes(TestSpec)), %% Get all Run tests sorted per node basis. - NodeList1 = run_per_node(Run,NodeList), + NodeList1 = run_per_node(Run,NodeList, + TestSpec#testspec.merge_tests), %% Get all Skip entries sorted per node basis. NodeList2 = skip_per_node(Skip,NodeList1), %% Change representation. @@ -89,11 +90,17 @@ prepare_tests(TestSpec) when is_record(TestSpec,testspec) -> %% run_per_node/2 takes the Run list as input and returns a list %% of {Node,RunPerNode,[]} tuples where the tests have been sorted %% on a per node basis. -run_per_node([{{Node,Dir},Test}|Ts],Result) -> +run_per_node([{{Node,Dir},Test}|Ts],Result, MergeTests) -> {value,{Node,{Run,Skip}}} = lists:keysearch(Node,1,Result), - Run1 = merge_tests(Dir,Test,Run), - run_per_node(Ts,insert_in_order({Node,{Run1,Skip}},Result)); -run_per_node([],Result) -> + Run1 = case MergeTests of + false -> + append({Dir, Test}, Run); + true -> + merge_tests(Dir,Test,Run) + end, + run_per_node(Ts,insert_in_order({Node,{Run1,Skip}},Result), + MergeTests); +run_per_node([],Result,_) -> Result. merge_tests(Dir,Test={all,_},TestDirs) -> @@ -281,6 +288,8 @@ collect_tests(Terms,TestSpec,Relaxed) -> {Terms2, TestSpec3} = filter_init_terms(Terms, [], TestSpec2), add_tests(Terms2,TestSpec3). +get_global([{merge_tests, Bool} | Ts], Spec) -> + get_global(Ts,Spec#testspec{ merge_tests = Bool }); get_global([{alias,Ref,Dir}|Ts],Spec=#testspec{alias=Refs}) -> get_global(Ts,Spec#testspec{alias=[{Ref,get_absdir(Dir,Spec)}|Refs]}); get_global([{node,Ref,Node}|Ts],Spec=#testspec{nodes=Refs}) -> @@ -656,7 +665,7 @@ add_tests([{suites,Node,Dir,Ss}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = insert_suites(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Ss,Tests), + Ss,Tests, Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- groups --- @@ -682,13 +691,15 @@ add_tests([{groups,Node,Dir,Suite,Gs}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = insert_groups(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Gs,all,Tests), + Suite,Gs,all,Tests, + Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); add_tests([{groups,Node,Dir,Suite,Gs,{cases,TCs}}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = insert_groups(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Gs,TCs,Tests), + Suite,Gs,TCs,Tests, + Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- cases --- @@ -703,7 +714,7 @@ add_tests([{cases,Node,Dir,Suite,Cs}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = insert_cases(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Cs,Tests), + Suite,Cs,Tests, Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- skip_suites --- @@ -718,7 +729,8 @@ add_tests([{skip_suites,Node,Dir,Ss,Cmt}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = skip_suites(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Ss,Cmt,Tests), + Ss,Cmt,Tests, + Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- skip_groups --- @@ -740,13 +752,15 @@ add_tests([{skip_groups,Node,Dir,Suite,Gs,Cmt}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = skip_groups(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Gs,all,Cmt,Tests), + Suite,Gs,all,Cmt,Tests, + Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); add_tests([{skip_groups,Node,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = skip_groups(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Gs,TCs,Cmt,Tests), + Suite,Gs,TCs,Cmt,Tests, + Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- skip_cases --- @@ -761,7 +775,7 @@ add_tests([{skip_cases,Node,Dir,Suite,Cs,Cmt}|Ts],Spec) -> Tests = Spec#testspec.tests, Tests1 = skip_cases(ref2node(Node,Spec#testspec.nodes), ref2dir(Dir,Spec#testspec.alias), - Suite,Cs,Cmt,Tests), + Suite,Cs,Cmt,Tests,Spec#testspec.merge_tests), add_tests(Ts,Spec#testspec{tests=Tests1}); %% --- handled/errors --- @@ -771,6 +785,9 @@ add_tests([{alias,_,_}|Ts],Spec) -> % handled add_tests([{node,_,_}|Ts],Spec) -> % handled add_tests(Ts,Spec); +add_tests([{merge_tests, _} | Ts], Spec) -> % handled + add_tests(Ts,Spec); + %% check if it's a CT term that has bad format or if the user seems to %% have added something of his/her own, which we'll let pass if relaxed %% mode is enabled. @@ -823,17 +840,22 @@ separate([],_,_,_) -> %% {Suite2,[{GrOrCase21,{skip,Cmt}},GrOrCase22,...]},...]} %% GrOrCase = {GroupName,[Case1,Case2,...]} | Case -insert_suites(Node,Dir,[S|Ss],Tests) -> - Tests1 = insert_cases(Node,Dir,S,all,Tests), - insert_suites(Node,Dir,Ss,Tests1); -insert_suites(_Node,_Dir,[],Tests) -> +insert_suites(Node,Dir,[S|Ss],Tests, MergeTests) -> + Tests1 = insert_cases(Node,Dir,S,all,Tests,MergeTests), + insert_suites(Node,Dir,Ss,Tests1,MergeTests); +insert_suites(_Node,_Dir,[],Tests,_MergeTests) -> Tests; -insert_suites(Node,Dir,S,Tests) -> - insert_suites(Node,Dir,[S],Tests). +insert_suites(Node,Dir,S,Tests,MergeTests) -> + insert_suites(Node,Dir,[S],Tests,MergeTests). -insert_groups(Node,Dir,Suite,Group,Cases,Tests) when is_atom(Group) -> - insert_groups(Node,Dir,Suite,[Group],Cases,Tests); -insert_groups(Node,Dir,Suite,Groups,Cases,Tests) when +insert_groups(Node,Dir,Suite,Group,Cases,Tests,MergeTests) + when is_atom(Group) -> + insert_groups(Node,Dir,Suite,[Group],Cases,Tests,MergeTests); +insert_groups(Node,Dir,Suite,Groups,Cases,Tests,false) when + ((Cases == all) or is_list(Cases)) and is_list(Groups) -> + Groups1 = [{Gr,Cases} || Gr <- Groups], + append({{Node,Dir},[{Suite,Groups1}]},Tests); +insert_groups(Node,Dir,Suite,Groups,Cases,Tests,true) when ((Cases == all) or is_list(Cases)) and is_list(Groups) -> case lists:keysearch({Node,Dir},1,Tests) of {value,{{Node,Dir},[{all,_}]}} -> @@ -847,9 +869,10 @@ insert_groups(Node,Dir,Suite,Groups,Cases,Tests) when Groups1 = [{Gr,Cases} || Gr <- Groups], insert_in_order({{Node,Dir},[{Suite,Groups1}]},Tests) end; -insert_groups(Node,Dir,Suite,Groups,Case,Tests) when is_atom(Case) -> +insert_groups(Node,Dir,Suite,Groups,Case,Tests, MergeTests) + when is_atom(Case) -> Cases = if Case == all -> all; true -> [Case] end, - insert_groups(Node,Dir,Suite,Groups,Cases,Tests). + insert_groups(Node,Dir,Suite,Groups,Cases,Tests, MergeTests). insert_groups1(_Suite,_Groups,all) -> all; @@ -879,7 +902,9 @@ insert_groups2([Group={GrName,Cases}|Groups],GrAndCases) -> insert_groups2([],GrAndCases) -> GrAndCases. -insert_cases(Node,Dir,Suite,Cases,Tests) when is_list(Cases) -> +insert_cases(Node,Dir,Suite,Cases,Tests,false) when is_list(Cases) -> + append({{Node,Dir},[{Suite,Cases}]},Tests); +insert_cases(Node,Dir,Suite,Cases,Tests,true) when is_list(Cases) -> case lists:keysearch({Node,Dir},1,Tests) of {value,{{Node,Dir},[{all,_}]}} -> Tests; @@ -889,8 +914,8 @@ insert_cases(Node,Dir,Suite,Cases,Tests) when is_list(Cases) -> false -> insert_in_order({{Node,Dir},[{Suite,Cases}]},Tests) end; -insert_cases(Node,Dir,Suite,Case,Tests) when is_atom(Case) -> - insert_cases(Node,Dir,Suite,[Case],Tests). +insert_cases(Node,Dir,Suite,Case,Tests,MergeTests) when is_atom(Case) -> + insert_cases(Node,Dir,Suite,[Case],Tests,MergeTests). insert_cases1(_Suite,_Cases,all) -> all; @@ -905,22 +930,28 @@ insert_cases1(Suite,Cases,Suites0) -> insert_in_order({Suite,Cases},Suites0) end. -skip_suites(Node,Dir,[S|Ss],Cmt,Tests) -> - Tests1 = skip_cases(Node,Dir,S,all,Cmt,Tests), - skip_suites(Node,Dir,Ss,Cmt,Tests1); -skip_suites(_Node,_Dir,[],_Cmt,Tests) -> +skip_suites(Node,Dir,[S|Ss],Cmt,Tests,MergeTests) -> + Tests1 = skip_cases(Node,Dir,S,all,Cmt,Tests,MergeTests), + skip_suites(Node,Dir,Ss,Cmt,Tests1,MergeTests); +skip_suites(_Node,_Dir,[],_Cmt,Tests,_MergeTests) -> Tests; -skip_suites(Node,Dir,S,Cmt,Tests) -> - skip_suites(Node,Dir,[S],Cmt,Tests). - -skip_groups(Node,Dir,Suite,Group,all,Cmt,Tests) when is_atom(Group) -> - skip_groups(Node,Dir,Suite,[Group],all,Cmt,Tests); -skip_groups(Node,Dir,Suite,Group,Cases,Cmt,Tests) when is_atom(Group) -> - skip_groups(Node,Dir,Suite,[Group],Cases,Cmt,Tests); -skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests) when is_atom(Case), - Case =/= all -> - skip_groups(Node,Dir,Suite,Groups,[Case],Cmt,Tests); -skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests) when +skip_suites(Node,Dir,S,Cmt,Tests,MergeTests) -> + skip_suites(Node,Dir,[S],Cmt,Tests,MergeTests). + +skip_groups(Node,Dir,Suite,Group,all,Cmt,Tests,MergeTests) + when is_atom(Group) -> + skip_groups(Node,Dir,Suite,[Group],all,Cmt,Tests,MergeTests); +skip_groups(Node,Dir,Suite,Group,Cases,Cmt,Tests,MergeTests) + when is_atom(Group) -> + skip_groups(Node,Dir,Suite,[Group],Cases,Cmt,Tests,MergeTests); +skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests,MergeTests) + when is_atom(Case),Case =/= all -> + skip_groups(Node,Dir,Suite,Groups,[Case],Cmt,Tests,MergeTests); +skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests,false) when + ((Cases == all) or is_list(Cases)) and is_list(Groups) -> + Suites1 = skip_groups1(Suite,[{Gr,Cases} || Gr <- Groups],Cmt,[]), + append({{Node,Dir},Suites1},Tests); +skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests,true) when ((Cases == all) or is_list(Cases)) and is_list(Groups) -> Suites = case lists:keysearch({Node,Dir},1,Tests) of @@ -931,9 +962,10 @@ skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests) when end, Suites1 = skip_groups1(Suite,[{Gr,Cases} || Gr <- Groups],Cmt,Suites), insert_in_order({{Node,Dir},Suites1},Tests); -skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests) when is_atom(Case) -> +skip_groups(Node,Dir,Suite,Groups,Case,Cmt,Tests,MergeTests) + when is_atom(Case) -> Cases = if Case == all -> all; true -> [Case] end, - skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests). + skip_groups(Node,Dir,Suite,Groups,Cases,Cmt,Tests,MergeTests). skip_groups1(Suite,Groups,Cmt,Suites0) -> SkipGroups = lists:map(fun(Group) -> @@ -947,7 +979,10 @@ skip_groups1(Suite,Groups,Cmt,Suites0) -> insert_in_order({Suite,SkipGroups},Suites0) end. -skip_cases(Node,Dir,Suite,Cases,Cmt,Tests) when is_list(Cases) -> +skip_cases(Node,Dir,Suite,Cases,Cmt,Tests,false) when is_list(Cases) -> + Suites1 = skip_cases1(Suite,Cases,Cmt,[]), + append({{Node,Dir},Suites1},Tests); +skip_cases(Node,Dir,Suite,Cases,Cmt,Tests,true) when is_list(Cases) -> Suites = case lists:keysearch({Node,Dir},1,Tests) of {value,{{Node,Dir},Suites0}} -> @@ -957,8 +992,8 @@ skip_cases(Node,Dir,Suite,Cases,Cmt,Tests) when is_list(Cases) -> end, Suites1 = skip_cases1(Suite,Cases,Cmt,Suites), insert_in_order({{Node,Dir},Suites1},Tests); -skip_cases(Node,Dir,Suite,Case,Cmt,Tests) when is_atom(Case) -> - skip_cases(Node,Dir,Suite,[Case],Cmt,Tests). +skip_cases(Node,Dir,Suite,Case,Cmt,Tests,MergeTests) when is_atom(Case) -> + skip_cases(Node,Dir,Suite,[Case],Cmt,Tests,MergeTests). skip_cases1(Suite,Cases,Cmt,Suites0) -> SkipCases = lists:map(fun(C) -> @@ -972,6 +1007,9 @@ skip_cases1(Suite,Cases,Cmt,Suites0) -> insert_in_order({Suite,SkipCases},Suites0) end. +append(Elem, List) -> + List ++ [Elem]. + insert_in_order([E|Es],List) -> List1 = insert_elem(E,List,[]), insert_in_order(Es,List1); @@ -1044,6 +1082,7 @@ valid_terms() -> {userconfig,2}, {userconfig,3}, {alias,3}, + {merge_tests,1}, {logdir,2}, {logdir,3}, {label,2}, diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl index ee973f6220..66021ae99b 100644 --- a/lib/common_test/src/ct_util.hrl +++ b/lib/common_test/src/ct_util.hrl @@ -40,7 +40,8 @@ multiply_timetraps=[], scale_timetraps=[], alias=[], - tests=[]}). + tests=[], + merge_tests = true }). -record(cover, {app=none, level=details, diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index f592d697bd..7b09310e2e 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -60,25 +60,35 @@ all(doc) -> ["Run smoke tests of Common Test."]; all(suite) -> - [all_suites, skip_all_suites, - suite, skip_suite, - all_testcases, skip_all_testcases, - testcase, skip_testcase, - all_groups, skip_all_groups, - group, skip_group, - group_all_testcases, skip_group_all_testcases, - group_testcase, skip_group_testcase, - topgroup, - subgroup, skip_subgroup, - subgroup_all_testcases, skip_subgroup_all_testcases, - subgroup_testcase, skip_subgroup_testcase, - sub_skipped_by_top, - testcase_in_multiple_groups, - order_of_tests_in_multiple_dirs, - order_of_tests_in_multiple_suites, - order_of_suites_in_multiple_dirs, - order_of_groups_in_multiple_dirs, - order_of_groups_in_multiple_suites + [ + %% all_suites, skip_all_suites, + %% suite, skip_suite, + %% all_testcases, skip_all_testcases, + %% testcase, skip_testcase, + %% all_groups, skip_all_groups, + %% group, skip_group, + %% group_all_testcases, skip_group_all_testcases, + %% group_testcase, skip_group_testcase, + %% topgroup, + %% subgroup, skip_subgroup, + %% subgroup_all_testcases, skip_subgroup_all_testcases, + %% subgroup_testcase, skip_subgroup_testcase, + %% sub_skipped_by_top, + %% testcase_in_multiple_groups, + %% order_of_tests_in_multiple_dirs_no_merge_tests, + %% order_of_tests_in_multiple_suites_no_merge_tests, + %% order_of_suites_in_multiple_dirs_no_merge_tests, + %% order_of_groups_in_multiple_dirs_no_merge_tests, + %% order_of_groups_in_multiple_suites_no_merge_tests, + %% order_of_tests_in_multiple_dirs, + %% order_of_tests_in_multiple_suites, + %% order_of_suites_in_multiple_dirs, + %% order_of_groups_in_multiple_dirs, + %% order_of_groups_in_multiple_suites, + order_of_tests_in_multiple_suites_with_skip_no_merge_tests, + order_of_tests_in_multiple_suites_with_skip, + all_plus_one_tc_no_merge_tests, + all_plus_one_tc ]. %%-------------------------------------------------------------------- @@ -374,6 +384,105 @@ testcase_in_multiple_groups(Config) when is_list(Config) -> %%%----------------------------------------------------------------- %%% +order_of_tests_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{merge_tests, false}, + {cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir2,groups_22_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], + + setup_and_execute(order_of_tests_in_multiple_dirs_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_tests_in_multiple_suites_no_merge_tests(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{merge_tests, false}, + {cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir1,groups_11_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], + + setup_and_execute(order_of_tests_in_multiple_suites_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_suites_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{merge_tests, false}, + {suites,TestDir1,groups_12_SUITE}, + {suites,TestDir2,groups_22_SUITE}, + {suites,TestDir1,groups_11_SUITE}], + + setup_and_execute(order_of_suites_in_multiple_dirs_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_groups_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestDir2 = filename:join(DataDir, "groups_2"), + TestSpec = [{merge_tests, false}, + {groups,TestDir1,groups_12_SUITE,test_group_1a}, + {groups,TestDir2,groups_22_SUITE,test_group_1a}, + {groups,TestDir1,groups_12_SUITE,test_group_1b}], + + setup_and_execute(order_of_groups_in_multiple_dirs_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_groups_in_multiple_suites_no_merge_tests(Config) + when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{merge_tests, false}, + {groups,TestDir1,groups_12_SUITE,test_group_1a}, + {groups,TestDir1,groups_11_SUITE,test_group_1a}, + {groups,TestDir1,groups_12_SUITE,test_group_1b}], + + setup_and_execute(order_of_groups_in_multiple_suites_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_tests_in_multiple_suites_with_skip_no_merge_tests(Config) + when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{merge_tests, false}, + {cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir1,groups_11_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}, + {cases,TestDir1,groups_11_SUITE,[testcase_2]}, + {skip_cases,TestDir1,groups_12_SUITE,[testcase_1b],"Skip it"}], + + setup_and_execute( + order_of_tests_in_multiple_suites_with_skip_no_merge_tests, + TestSpec, Config). + + +%%%----------------------------------------------------------------- +%%% + order_of_tests_in_multiple_dirs(Config) when is_list(Config) -> DataDir = ?config(data_dir, Config), @@ -383,7 +492,8 @@ order_of_tests_in_multiple_dirs(Config) when is_list(Config) -> {cases,TestDir2,groups_22_SUITE,[testcase_1]}, {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], - setup_and_execute(order_of_tests_in_multiple_dirs, TestSpec, Config). + setup_and_execute(order_of_tests_in_multiple_dirs, + TestSpec, Config). %%%----------------------------------------------------------------- %%% @@ -396,7 +506,8 @@ order_of_tests_in_multiple_suites(Config) when is_list(Config) -> {cases,TestDir1,groups_11_SUITE,[testcase_1]}, {cases,TestDir1,groups_12_SUITE,[testcase_1b]}], - setup_and_execute(order_of_tests_in_multiple_suites, TestSpec, Config). + setup_and_execute(order_of_tests_in_multiple_suites, + TestSpec, Config). %%%----------------------------------------------------------------- %%% @@ -410,7 +521,8 @@ order_of_suites_in_multiple_dirs(Config) when is_list(Config) -> {suites,TestDir2,groups_22_SUITE}, {suites,TestDir1,groups_11_SUITE}], - setup_and_execute(order_of_suites_in_multiple_dirs, TestSpec, Config). + setup_and_execute(order_of_suites_in_multiple_dirs, + TestSpec, Config). %%%----------------------------------------------------------------- %%% @@ -424,7 +536,8 @@ order_of_groups_in_multiple_dirs(Config) when is_list(Config) -> {groups,TestDir2,groups_22_SUITE,test_group_1a}, {groups,TestDir1,groups_12_SUITE,test_group_1b}], - setup_and_execute(order_of_groups_in_multiple_dirs, TestSpec, Config). + setup_and_execute(order_of_groups_in_multiple_dirs, + TestSpec, Config). %%%----------------------------------------------------------------- %%% @@ -437,7 +550,53 @@ order_of_groups_in_multiple_suites(Config) when is_list(Config) -> {groups,TestDir1,groups_11_SUITE,test_group_1a}, {groups,TestDir1,groups_12_SUITE,test_group_1b}], - setup_and_execute(order_of_groups_in_multiple_suites, TestSpec, Config). + setup_and_execute(order_of_groups_in_multiple_suites, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +order_of_tests_in_multiple_suites_with_skip(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{cases,TestDir1,groups_12_SUITE,[testcase_1a]}, + {cases,TestDir1,groups_11_SUITE,[testcase_1]}, + {cases,TestDir1,groups_12_SUITE,[testcase_1b]}, + {cases,TestDir1,groups_11_SUITE,[testcase_2]}, + {skip_cases,TestDir1,groups_12_SUITE,[testcase_1b],"Skip it!"}], + + setup_and_execute(order_of_tests_in_multiple_suites_with_skip, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +all_plus_one_tc_no_merge_tests(Config) when is_list(Config) -> + + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{merge_tests,false}, + {suites,TestDir1,groups_12_SUITE}, + {cases,TestDir1,groups_12_SUITE,[testcase_1a]}], + + setup_and_execute(all_plus_one_tc_no_merge_tests, + TestSpec, Config). + +%%%----------------------------------------------------------------- +%%% + +all_plus_one_tc(Config) when is_list(Config) -> + + DataDir = ?config(data_dir, Config), + + TestDir1 = filename:join(DataDir, "groups_1"), + TestSpec = [{suites,TestDir1,groups_12_SUITE}, + {cases,TestDir1,groups_12_SUITE,[testcase_1a]}], + + setup_and_execute(all_plus_one_tc, + TestSpec, Config). %%%----------------------------------------------------------------- %%% HELP FUNCTIONS @@ -503,7 +662,7 @@ events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). -test_events(order_of_tests_in_multiple_dirs) -> +test_events(order_of_tests_in_multiple_dirs_no_merge_tests) -> [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, {ct_test_support_eh,tc_done, @@ -517,7 +676,7 @@ test_events(order_of_tests_in_multiple_dirs) -> {failed,{error,{test_case_failed,no_group_data}}}}}, {ct_test_support_eh,stop_logging,[]} ]; -test_events(order_of_tests_in_multiple_suites) -> +test_events(order_of_tests_in_multiple_suites_no_merge_tests) -> [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, @@ -527,7 +686,7 @@ test_events(order_of_tests_in_multiple_suites) -> {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, {ct_test_support_eh,stop_logging,[]} ]; -test_events(order_of_suites_in_multiple_dirs) -> +test_events(order_of_suites_in_multiple_dirs_no_merge_tests) -> [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, {ct_test_support_eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, @@ -542,7 +701,7 @@ test_events(order_of_suites_in_multiple_dirs) -> {ct_test_support_eh,tc_start,{groups_11_SUITE,end_per_suite}}, {ct_test_support_eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, {ct_test_support_eh,stop_logging,[]}]; -test_events(order_of_groups_in_multiple_dirs) -> +test_events(order_of_groups_in_multiple_dirs_no_merge_tests) -> [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, {ct_test_support_eh,tc_start, @@ -561,7 +720,7 @@ test_events(order_of_groups_in_multiple_dirs) -> {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, {ct_test_support_eh,stop_logging,[]}]; -test_events(order_of_groups_in_multiple_suites) -> +test_events(order_of_groups_in_multiple_suites_no_merge_tests) -> [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, {ct_test_support_eh,tc_start, @@ -580,6 +739,131 @@ test_events(order_of_groups_in_multiple_suites) -> {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, {ct_test_support_eh,stop_logging,[]}]; +test_events(order_of_tests_in_multiple_suites_with_skip_no_merge_tests) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {ct_test_support_eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_2}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, + {ct_test_support_eh,stop_logging,[]} + ]; + +test_events(order_of_tests_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,testcase_1a, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,testcase_1b, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {ct_test_support_eh,tc_start,{groups_22_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, + {ct_test_support_eh,stop_logging,[]} + ]; +test_events(order_of_tests_in_multiple_suites) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, + + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {ct_test_support_eh,stop_logging,[]} + ]; +test_events(order_of_suites_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + + {ct_test_support_eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + + {ct_test_support_eh,tc_start,{groups_22_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_22_SUITE,end_per_suite}}, + {ct_test_support_eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,stop_logging,[]}]; +test_events(order_of_groups_in_multiple_dirs) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,stop_logging,[]}]; +test_events(order_of_groups_in_multiple_suites) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + + {ct_test_support_eh,tc_start, + {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, + {ct_test_support_eh,tc_done, + {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {ct_test_support_eh,stop_logging,[]}]; + +test_events(order_of_tests_in_multiple_suites_with_skip) -> + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {ct_test_support_eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_2}}, + {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, + {ct_test_support_eh,stop_logging,[]} + ]; + +test_events(all_plus_one_tc_no_merge_tests) -> + + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {ct_test_support_eh,stop_logging,[]} + ]; + +test_events(all_plus_one_tc) -> + + [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {ct_test_support_eh,stop_logging,[]}} + ]; + test_events(_) -> [ ]. -- cgit v1.2.3 From d66d7ad951d89e5af7f10c171dd1c7a848990273 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 10 Feb 2011 17:03:08 +0100 Subject: Add test event info for the old tests --- lib/common_test/test/ct_testspec_1_SUITE.erl | 870 +++++++++++++++++++++------ 1 file changed, 690 insertions(+), 180 deletions(-) diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index 7b09310e2e..88273edc22 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -61,30 +61,30 @@ all(doc) -> all(suite) -> [ - %% all_suites, skip_all_suites, - %% suite, skip_suite, - %% all_testcases, skip_all_testcases, - %% testcase, skip_testcase, - %% all_groups, skip_all_groups, - %% group, skip_group, - %% group_all_testcases, skip_group_all_testcases, - %% group_testcase, skip_group_testcase, - %% topgroup, - %% subgroup, skip_subgroup, - %% subgroup_all_testcases, skip_subgroup_all_testcases, - %% subgroup_testcase, skip_subgroup_testcase, - %% sub_skipped_by_top, - %% testcase_in_multiple_groups, - %% order_of_tests_in_multiple_dirs_no_merge_tests, - %% order_of_tests_in_multiple_suites_no_merge_tests, - %% order_of_suites_in_multiple_dirs_no_merge_tests, - %% order_of_groups_in_multiple_dirs_no_merge_tests, - %% order_of_groups_in_multiple_suites_no_merge_tests, - %% order_of_tests_in_multiple_dirs, - %% order_of_tests_in_multiple_suites, - %% order_of_suites_in_multiple_dirs, - %% order_of_groups_in_multiple_dirs, - %% order_of_groups_in_multiple_suites, + all_suites, skip_all_suites, + suite, skip_suite, + all_testcases, skip_all_testcases, + testcase, skip_testcase, + all_groups, skip_all_groups, + group, skip_group, + group_all_testcases, skip_group_all_testcases, + group_testcase, skip_group_testcase, + topgroup, + subgroup, skip_subgroup, + subgroup_all_testcases, skip_subgroup_all_testcases, + subgroup_testcase, skip_subgroup_testcase, + sub_skipped_by_top, + testcase_in_multiple_groups, + order_of_tests_in_multiple_dirs_no_merge_tests, + order_of_tests_in_multiple_suites_no_merge_tests, + order_of_suites_in_multiple_dirs_no_merge_tests, + order_of_groups_in_multiple_dirs_no_merge_tests, + order_of_groups_in_multiple_suites_no_merge_tests, + order_of_tests_in_multiple_dirs, + order_of_tests_in_multiple_suites, + order_of_suites_in_multiple_dirs, + order_of_groups_in_multiple_dirs, + order_of_groups_in_multiple_suites, order_of_tests_in_multiple_suites_with_skip_no_merge_tests, order_of_tests_in_multiple_suites_with_skip, all_plus_one_tc_no_merge_tests, @@ -661,207 +661,717 @@ events_to_check(_, 0) -> events_to_check(Test, N) -> test_events(Test) ++ events_to_check(Test, N-1). +test_events(all_suites) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{simple_1_SUITE,init_per_suite}}, + {?eh,tc_done,{simple_1_SUITE,end_per_suite,'_'}}, + {?eh,tc_start,{simple_2_SUITE,init_per_suite}}, + {?eh,test_stats,{4,0,{0,0}}}, + {?eh,tc_done,{simple_2_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_all_suites) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_user_skip,{simple_1_SUITE,all,"SKIPPED!"}}, + {?eh,tc_user_skip,{simple_2_SUITE,all,"SKIPPED!"}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(suite) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{simple_1_SUITE,init_per_suite}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{simple_1_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_suite) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_user_skip,{simple_1_SUITE,all,"SKIPPED!"}}, + {?eh,tc_done,{simple_2_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{simple_1_SUITE,init_per_suite}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{simple_1_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_user_skip,{simple_1_SUITE,all,"SKIPPED!"}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(testcase) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{simple_1_SUITE,init_per_suite}}, + {?eh,test_stats,{1,0,{0,0}}}, + {negative,{?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{simple_1_SUITE,end_per_suite,'_'}}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_testcase) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{simple_1_SUITE,init_per_suite}}, + {?eh,tc_user_skip,{simple_1_SUITE,tc1,"SKIPPED!"}}, + {?eh,tc_start,{simple_1_SUITE,tc2}}, + {?eh,tc_start,{simple_1_SUITE,end_per_suite}}, + + {?eh,tc_start,{simple_2_SUITE,init_per_suite}}, + {?eh,tc_user_skip,{simple_2_SUITE,tc2,"SKIPPED!"}}, + {?eh,tc_start,{simple_2_SUITE,tc1}}, + {?eh,test_stats,{2,0,{2,0}}}, + {?eh,tc_start,{simple_2_SUITE,end_per_suite}}, + + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(all_groups) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,test_stats,{12,0,{0,0}}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_all_groups) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_1a},"SKIPPED!"}}, + {?eh,test_stats,{0,0,{1,0}}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_1b},"SKIPPED!"}}, + {?eh,test_stats,{0,0,{2,0}}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_2},"SKIPPED!"}}, + {?eh,test_stats,{0,0,{3,0}}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_4},"SKIPPED!"}}, + {?eh,test_stats,{0,0,{4,0}}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(group) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1a,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1a}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1b}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1a,[]},'_'}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_group) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1a,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1a}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1b}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1a,[]},'_'}}, + + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_1b},"SKIPPED!"}}, + {?eh,test_stats,{2,0,{1,0}}}, + {negative,{?eh,tc_user_skip,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(group_all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1a,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1a}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1b}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1a,[]},'_'}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_group_all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_1a},"SKIPPED!"}}, + {?eh,tc_user_skip, {groups_11_SUITE,{group,test_group_1b},"SKIPPED!"}}, + {?eh,test_stats,{0,0,{2,0}}}, + {?eh,tc_start,{groups_11_SUITE,end_per_suite}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(group_testcase) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1a,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1a}}, + {?eh,test_stats,{1,0,{0,0}}}, + {negative,{?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1a,[]},'_'}}}, + + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_group_testcase) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1a,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1a}}, + {?eh,tc_user_skip,{groups_11_SUITE,testcase_1b,"SKIPPED!"}}, + {?eh,test_stats,{1,0,{1,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1a,[]},'_'}}, + + {?eh,tc_start,{groups_11_SUITE,{init_per_group,test_group_1b,[]}}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1b}}, + {?eh,tc_user_skip,{groups_11_SUITE,testcase_1a,"SKIPPED!"}}, + {?eh,test_stats,{2,0,{2,0}}}, + {?eh,tc_done,{groups_11_SUITE,{end_per_group,test_group_1b,[]},'_'}}, + + {negative,{?eh,tc_user_skip,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(topgroup) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]},ok}}, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[{repeat,2}]}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[{repeat,2}]}}} + ], + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[]}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[]}}} + ], + {?eh,test_stats,{6,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]},ok}}]}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]},ok}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]},ok}}, + [{?eh,tc_start,{groups_12_SUITE,{init_per_group,test_group_7,'_'}}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_7,'_'}}}], + {shuffle, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]},ok}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]}}}, + {?eh,tc_done,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]},ok}} + ]}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]},ok}} + ]}, + {?eh,test_stats,{12,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]},ok}}]}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}], + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(subgroup) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]},ok}}, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[{repeat,2}]}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[{repeat,2}]}}} + ], + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[]}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[]}}} + ], + {?eh,test_stats,{4,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]},ok}}]}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_subgroup) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]},ok}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]},ok}}, + [{?eh,tc_start,{groups_12_SUITE,{init_per_group,test_group_7,'_'}}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_7,'_'}}}], + {?eh,tc_user_skip, + {groups_12_SUITE,{group,test_group_8},"SKIPPED!"}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]},ok}} + ]}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]},ok}}]}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}], + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(subgroup_all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]},ok}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]},ok}}, + [{?eh,tc_start,{groups_12_SUITE,{init_per_group,test_group_7,'_'}}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_7,'_'}}}], + {shuffle, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]},ok}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]}}}, + {?eh,tc_done,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]},ok}} + ]}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]},ok}} + ]}, + {?eh,test_stats,{6,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]},ok}}]}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}], + + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]},ok}}, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[{repeat,2}]}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[{repeat,2}]}}} + ], + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[]}}}, + {?eh,test_stats,{10,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[]}}} + ], + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]},ok}}]}, + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_subgroup_all_testcases) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_4,[]},ok}}, + {?eh,tc_user_skip,{groups_12_SUITE,{group,test_group_5},"SKIPPED!"}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}, + {?eh,tc_done,{groups_12_SUITE,{end_per_group,test_group_4,[]},ok}} + ], + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(subgroup_testcase) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]},ok}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]},ok}}, + [{?eh,tc_start,{groups_12_SUITE,{init_per_group,test_group_7,'_'}}}, + {?eh,test_stats,{1,0,{0,0}}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_7,'_'}}}], + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]},ok}} + ]}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]},ok}}]}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}], + + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_2,[parallel]},ok}}, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[{repeat,2}]}}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[{repeat,2}]}}} + ], + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_3,[]}}}, + {?eh,test_stats,{3,0,{0,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_3,[]}}} + ], + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_2,[parallel]},ok}}]}, + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(skip_subgroup_testcase) -> + [ + + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_4,[]}}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_5,[parallel]},ok}}, + {parallel, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_6,[parallel]},ok}}, + [{?eh,tc_start,{groups_12_SUITE,{init_per_group,test_group_7,'_'}}}, + {?eh,tc_user_skip, {groups_12_SUITE,testcase_7a,"SKIPPED!"}}, + {?eh,test_stats,{1,0,{1,0}}}, + {?eh,tc_user_skip, {groups_12_SUITE,testcase_7b,"SKIPPED!"}}, + {?eh,test_stats,{1,0,{2,0}}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_7,'_'}}}], + {shuffle, + [{?eh,tc_start, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]}}}, + {?eh,tc_done, + {groups_12_SUITE,{init_per_group,test_group_8, + [{shuffle,'_'},sequence]},ok}}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]}}}, + {?eh,tc_done,{groups_12_SUITE,{end_per_group,test_group_8, + [shuffle,sequence]},ok}} + ]}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_6,[parallel]},ok}} + ]}, + {?eh,test_stats,{4,0,{2,0}}}, + {?eh,tc_start, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]}}}, + {?eh,tc_done, + {groups_12_SUITE,{end_per_group,test_group_5,[parallel]},ok}}]}, + {?eh,tc_start,{groups_12_SUITE,{end_per_group,test_group_4,[]}}}], + + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + + ]; + +test_events(sub_skipped_by_top) -> + [ + {?eh,start_logging,'_'}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + + {?eh,tc_user_skip,{groups_12_SUITE,{group,test_group_4},"SKIPPED!"}}, + + {negative, + {?eh,tc_user_skip,{groups_12_SUITE,{group,test_group_4},"SKIPPED!"}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}}, + + {negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}} + ]; + +test_events(testcase_in_multiple_groups) -> + []; test_events(order_of_tests_in_multiple_dirs_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,testcase_1a, - {failed,{error,{test_case_failed,no_group_data}}}}}, - {ct_test_support_eh,tc_start,{groups_22_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,testcase_1b, - {failed,{error,{test_case_failed,no_group_data}}}}}, - {ct_test_support_eh,stop_logging,[]} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done, {groups_12_SUITE,testcase_1a, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {?eh,tc_start,{groups_22_SUITE,testcase_1}}, + {?eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {?eh,tc_done, {groups_12_SUITE,testcase_1b, + {failed,{error,{test_case_failed,no_group_data}}}}}, + {?eh,stop_logging,[]} ]; test_events(order_of_tests_in_multiple_suites_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, - {ct_test_support_eh,stop_logging,[]} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1}}, + {?eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, + {?eh,stop_logging,[]} ]; test_events(order_of_suites_in_multiple_dirs_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_22_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_22_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,stop_logging,[]}]; + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_12_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {?eh,tc_start,{groups_22_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_22_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_11_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + {?eh,stop_logging,[]}]; test_events(order_of_groups_in_multiple_dirs_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + [{?eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - - {ct_test_support_eh,tc_start, - {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {?eh,tc_start, {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, - {ct_test_support_eh,stop_logging,[]}]; + {?eh,stop_logging,[]}]; test_events(order_of_groups_in_multiple_suites_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + [{?eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - - {ct_test_support_eh,tc_start, - {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {?eh,tc_start, {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, - {ct_test_support_eh,stop_logging,[]}]; + {?eh,stop_logging,[]}]; test_events(order_of_tests_in_multiple_suites_with_skip_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, - {ct_test_support_eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_2}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, - {ct_test_support_eh,stop_logging,[]} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1}}, + {?eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {?eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, + {?eh,tc_start,{groups_11_SUITE,testcase_2}}, + {?eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, + {?eh,stop_logging,[]} ]; test_events(order_of_tests_in_multiple_dirs) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done, + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done, {groups_12_SUITE,testcase_1a, {failed,{error,{test_case_failed,no_group_data}}}}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, - {ct_test_support_eh,tc_done, + {?eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {?eh,tc_done, {groups_12_SUITE,testcase_1b, {failed,{error,{test_case_failed,no_group_data}}}}}, - {ct_test_support_eh,tc_start,{groups_22_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, - {ct_test_support_eh,stop_logging,[]} + {?eh,tc_start,{groups_22_SUITE,testcase_1}}, + {?eh,tc_done,{groups_22_SUITE,testcase_1,ok}}, + {?eh,stop_logging,[]} ]; test_events(order_of_tests_in_multiple_suites) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1b}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1b}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, - {ct_test_support_eh,stop_logging,[]} + {?eh,tc_start,{groups_11_SUITE,testcase_1}}, + {?eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {?eh,stop_logging,[]} ]; test_events(order_of_suites_in_multiple_dirs) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, - - {ct_test_support_eh,tc_start,{groups_11_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, - - {ct_test_support_eh,tc_start,{groups_22_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_22_SUITE,end_per_suite}}, - {ct_test_support_eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,stop_logging,[]}]; + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_12_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + + {?eh,tc_start,{groups_11_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_11_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_11_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}}, + + {?eh,tc_start,{groups_22_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_22_SUITE,init_per_suite,'_'}}, + {?eh,tc_start,{groups_22_SUITE,end_per_suite}}, + {?eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}}, + {?eh,stop_logging,[]}]; test_events(order_of_groups_in_multiple_dirs) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + [{?eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, - - {ct_test_support_eh,tc_start, - {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - - {ct_test_support_eh,stop_logging,[]}]; + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + + {?eh,tc_start, {groups_22_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + + {?eh,stop_logging,[]}]; test_events(order_of_groups_in_multiple_suites) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, + [{?eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - {ct_test_support_eh,tc_start, - {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, + {?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1b,'_'}}}, + {?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}}, - {ct_test_support_eh,tc_start, - {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, - {ct_test_support_eh,tc_done, - {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, + {?eh,tc_start, {groups_11_SUITE,{init_per_group,test_group_1a,'_'}}}, + {?eh,tc_done, {groups_11_SUITE,{end_per_group,test_group_1a,'_'},'_'}}, - {ct_test_support_eh,stop_logging,[]}]; + {?eh,stop_logging,[]}]; test_events(order_of_tests_in_multiple_suites_with_skip) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,testcase_1a}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, - {ct_test_support_eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_1}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, - {ct_test_support_eh,tc_start,{groups_11_SUITE,testcase_2}}, - {ct_test_support_eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, - {ct_test_support_eh,stop_logging,[]} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,testcase_1a}}, + {?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}}, + {?eh,tc_user_skip,{groups_12_SUITE,testcase_1b,'_'}}, + {?eh,tc_start,{groups_11_SUITE,testcase_1}}, + {?eh,tc_done,{groups_11_SUITE,testcase_1,ok}}, + {?eh,tc_start,{groups_11_SUITE,testcase_2}}, + {?eh,tc_done,{groups_11_SUITE,testcase_2,ok}}, + {?eh,stop_logging,[]} ]; test_events(all_plus_one_tc_no_merge_tests) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, - {ct_test_support_eh,stop_logging,[]} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {?eh,stop_logging,[]} ]; test_events(all_plus_one_tc) -> - [{ct_test_support_eh,start_logging,{'DEF','RUNDIR'}}, - {ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, - {negative,{ct_test_support_eh,tc_start,{groups_12_SUITE,init_per_suite}}, - {ct_test_support_eh,stop_logging,[]}} + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,tc_done,{groups_12_SUITE,end_per_suite,'_'}}, + {negative,{?eh,tc_start,{groups_12_SUITE,init_per_suite}}, + {?eh,stop_logging,[]}} ]; test_events(_) -> -- cgit v1.2.3 From 8b86cd551352ac06bccbeab4c76849d3978876ec Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 15 Feb 2011 19:58:13 +0100 Subject: Update TEST_SERVER_FRAMEWORK os variable to be regarded as undet if set to undefined --- lib/test_server/src/test_server.erl | 2 +- lib/test_server/src/test_server_ctrl.erl | 8 ++++---- lib/test_server/src/test_server_node.erl | 2 +- lib/test_server/src/test_server_sup.erl | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index ee121e5bb6..0176b68579 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -856,7 +856,7 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) -> %% a framework function failed CB = os:getenv("TEST_SERVER_FRAMEWORK"), Loc = case CB of - false -> + FW when FW =:= false; FW =:= "undefined" -> {test_server,Func}; _ -> {list_to_atom(CB),Func} diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index 00278c0165..0c363085f4 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -643,7 +643,7 @@ contact_main_target(local) -> %% When used by a general framework, global registration of %% test_server should not be required. case os:getenv("TEST_SERVER_FRAMEWORK") of - false -> + FW when FW =:= false; FW =:= "undefined" -> %% Local target! The global test_server process implemented by %% test_server.erl will not be started, so we simulate it by %% globally registering this process instead. @@ -1710,7 +1710,7 @@ do_test_cases(TopCases, SkipCases, [erlang:system_info(version), code:root_dir()]), case os:getenv("TEST_SERVER_FRAMEWORK") of - false -> + FW when FW =:= false; FW =:= "undefined" -> print(html, "

Target:
\n"), print_who(TI#target_info.host, TI#target_info.username), print(html, "
Used Erlang ~s in ~s.\n", @@ -4063,7 +4063,7 @@ get_font_style1(default) -> format_exception(Reason={_Error,Stack}) when is_list(Stack) -> case os:getenv("TEST_SERVER_FRAMEWORK") of - false -> + FW when FW =:= false; FW =:= "undefined" -> case application:get_env(test_server, format_exception) of {ok,false} -> {"~p",Reason}; @@ -4636,7 +4636,7 @@ collect_case([Case | Cases], St, Acc) -> collect_case_invoke(Mod, Case, MFA, St) -> case os:getenv("TEST_SERVER_FRAMEWORK") of - false -> + FW when FW =:= false; FW =:= "undefined" -> case catch apply(Mod, Case, [suite]) of {'EXIT',_} -> {ok,[MFA],St}; diff --git a/lib/test_server/src/test_server_node.erl b/lib/test_server/src/test_server_node.erl index 49025b1a3d..056d18da96 100644 --- a/lib/test_server/src/test_server_node.erl +++ b/lib/test_server/src/test_server_node.erl @@ -84,7 +84,7 @@ start_remote_main_target(Parameters) -> MasterNode,MasterCookie), Cmd = case os:getenv("TEST_SERVER_FRAMEWORK") of - false -> Cmd0; + FW when FW =:= false; FW =:= "undefined" -> Cmd0; FW -> Cmd0 ++ " -env TEST_SERVER_FRAMEWORK " ++ FW end, diff --git a/lib/test_server/src/test_server_sup.erl b/lib/test_server/src/test_server_sup.erl index 625724fbb5..4a7804a482 100644 --- a/lib/test_server/src/test_server_sup.erl +++ b/lib/test_server/src/test_server_sup.erl @@ -494,7 +494,8 @@ framework_call(Func,Args) -> framework_call(Func,Args,DefaultReturn) -> CB = os:getenv("TEST_SERVER_FRAMEWORK"), framework_call(CB,Func,Args,DefaultReturn). -framework_call(false,_Func,_Args,DefaultReturn) -> +framework_call(FW,_Func,_Args,DefaultReturn) + when FW =:= false; FW =:= "undefined" -> DefaultReturn; framework_call(Callback,Func,Args,DefaultReturn) -> Mod = list_to_atom(Callback), -- cgit v1.2.3 From 00db7dddae0c6f1acddf52d97c9e6c65393d2459 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 16 Feb 2011 09:48:56 +0100 Subject: Update ts to take the config path as an invironmental and as a variables passed with all_tests and also with the normal run --- lib/test_server/src/ts.erl | 17 +++++++++++++---- lib/test_server/src/ts_run.erl | 19 ++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl index befa6bf7f1..3d55f41b8c 100644 --- a/lib/test_server/src/ts.erl +++ b/lib/test_server/src/ts.erl @@ -150,6 +150,14 @@ help(installed) -> " TraceSpec is the name of a file containing\n", " trace specifications or a list of trace\n", " specification elements.\n", + " {config, Path} - Specify which directory ts should get it's \n" + " config files from. The files should follow\n" + " the convention lib/test_server/src/ts*.config.\n" + " These config files can also be specified by\n" + " setting the TEST_CONFIG_PATH environment\n" + " variable to the directory where the config\n" + " files are. The default location is\n" + " tests/test_server/.\n" "\n", "Supported trace information elements\n", " {tp | tpl, Mod, [] | match_spec()}\n", @@ -330,10 +338,11 @@ check_test_get_opts(Testspec, Config) -> validate_test(Testspec), Mode = configmember(batch, {batch, interactive}, Config), Vars = configvars(Config), - Trace = configtrace(Config), + Trace = get_config(trace,Config), + ConfigPath = get_config(config,Config), KeepTopcase = configmember(keep_topcase, {keep_topcase,[]}, Config), Cover = configcover(Testspec,Config), - lists:flatten([Vars,Mode,Trace,KeepTopcase,Cover]). + lists:flatten([Vars,Mode,Trace,KeepTopcase,Cover,ConfigPath]). to_erlang_term(Atom) -> String = atom_to_list(Atom), @@ -401,8 +410,8 @@ special_vars(Config) -> SpecVars1 end. -configtrace(Config) -> - case lists:keysearch(trace,1,Config) of +get_config(Key,Config) -> + case lists:keysearch(Key,1,Config) of {value,Value} -> Value; false -> [] end. diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index d1e0e2e99c..60e01600e1 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -632,15 +632,20 @@ make_common_test_args(Args0, Options, _Vars) -> [{logdir,"../test_server"}] end, - ConfigFile = case lists:keysearch(config, 1, Options) of - {value, {config, _}} -> - []; - false -> - [{config, [filename:join("../test_server",File) - || File <- get_config_files()]}] + ConfigPath = case {os:getenv("TEST_CONFIG_PATH"), + lists:keysearch(config, 1, Options)} of + {false,{value, {config, Path}}} -> + Path; + {false,false} -> + "../test_server"; + {Path,_} -> + Path end, + ConfigFiles = [{config,[filename:join(ConfigPath,File) + || File <- get_config_files()]}], - io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++ConfigFile++Options]). + io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++ + ConfigFiles++Options]). make_test_server_args(Args0,Options,Vars) -> Parameters = -- cgit v1.2.3 From cd8c12a5c1e7ecb4bef85f23629bd1efe6a5968a Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 10:33:14 +0100 Subject: Removed spec:s that wasn't needed. --- lib/orber/src/corba.erl | 4 ++-- lib/orber/src/orber.erl | 24 +++++++++++------------- lib/orber/src/orber_socket.erl | 12 ++---------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/lib/orber/src/corba.erl b/lib/orber/src/corba.erl index f4a17c10e9..ecec768544 100644 --- a/lib/orber/src/corba.erl +++ b/lib/orber/src/corba.erl @@ -621,7 +621,7 @@ get_pid(Objkey) -> %% Description: %%---------------------------------------------------------------------- %% To avoid dialyzer warnings due to the use of exit/throw. --spec(raise/1 :: (_) -> no_return()). +-spec raise(term()) -> no_return(). raise(E) -> throw({'EXCEPTION', E}). @@ -632,7 +632,7 @@ raise(E) -> %% Description: %%---------------------------------------------------------------------- %% To avoid dialyzer warnings due to the use of exit/throw. --spec(raise_with_state/2 :: (_, _) -> no_return()). +-spec raise_with_state(term(), term()) -> no_return(). raise_with_state(E, State) -> throw({reply, {'EXCEPTION', E}, State}). diff --git a/lib/orber/src/orber.erl b/lib/orber/src/orber.erl index f0820811f5..665b3cb383 100644 --- a/lib/orber/src/orber.erl +++ b/lib/orber/src/orber.erl @@ -95,13 +95,7 @@ -define(DEBUG_LEVEL, 5). -define(FORMAT(_F, _A), lists:flatten(io_lib:format(_F, _A))). --define(EFORMAT(_F, _A), do_exit(lists:flatten(io_lib:format(_F, _A)))). - - -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(do_exit/1 :: (_) -> no_return()). -do_exit(Reason) -> - exit(Reason). +-define(EFORMAT(_F, _A), exit(lists:flatten(io_lib:format(_F, _A)))). %%----------------------------------------------------------------- @@ -1033,12 +1027,18 @@ remove_node(Node) when is_atom(Node) -> remove_tables(Tables, Node) -> - remove_tables(Tables, Node, []). + case remove_tables(Tables, Node, []) of + ok -> + ok; + {error, Node, Failed} -> + ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", + [Node, Failed]) + end. -remove_tables([], _, []) -> ok; +remove_tables([], _, []) -> + ok; remove_tables([], Node, Failed) -> - ?EFORMAT("orber:remove_node(~p) failed. Unable to remove table(s): ~p", - [Node, Failed]); + {error, Node, Failed}; remove_tables([T1|Trest], Node, Failed) -> case mnesia:del_table_copy(T1, Node) of {atomic, ok} -> @@ -1047,8 +1047,6 @@ remove_tables([T1|Trest], Node, Failed) -> remove_tables(Trest, Node, [{T1, Reason}|Failed]) end. - - %%----------------------------------------------------------------- %% Internal interface functions %%----------------------------------------------------------------- diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl index 84ed193ebb..ec2cf8f42a 100644 --- a/lib/orber/src/orber_socket.erl +++ b/lib/orber/src/orber_socket.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,7 +37,7 @@ %%----------------------------------------------------------------- -export([start/0, connect/4, listen/3, listen/4, accept/2, accept/3, write/3, controlling_process/3, close/2, peername/2, sockname/2, - peerdata/2, peercert/2, peercert/3, sockdata/2, setopts/3, + peerdata/2, peercert/2, sockdata/2, setopts/3, clear/2, shutdown/3, post_accept/2, post_accept/3]). %%----------------------------------------------------------------- @@ -366,14 +366,6 @@ peercert(Type, _Socket) -> [?LINE, Type], ?DEBUG_LEVEL), {error, ebadsocket}. -peercert(ssl, Socket, Opts) -> - ssl:peercert(Socket, Opts); -peercert(Type, _Socket, Opts) -> - orber:dbg("[~p] orber_socket:peercert(~p, ~p);~n" - "Only available for SSL sockets.", - [?LINE, Type, Opts], ?DEBUG_LEVEL), - {error, ebadsocket}. - %%----------------------------------------------------------------- %% Get peerdata %% -- cgit v1.2.3 From 1b4303f812d5968fc6de961146b39a1b20f75e42 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 17 Feb 2011 11:09:55 +0100 Subject: Update testcases which need crypto to be skipped on platforms which does not have crypto --- lib/tools/test/cover_SUITE.erl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 4beb433839..f632409208 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -49,6 +49,13 @@ all(suite) -> "Can't run cover test."} end. +init_per_testcase(TC, Config) when TC =:= misc; TC =:= compile -> + case code:which(crypto) of + Path when is_list(Path) -> + init_per_testcase(dummy_tc, Config); + _Else -> + {skip, "No crypto file to test with"} + end; init_per_testcase(_TestCase, Config) -> Config. -- cgit v1.2.3 From 397d9f598aaa1f84706f45565b0f347eea502820 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 17 Feb 2011 11:20:06 +0100 Subject: Strip new lines at end of PEM entry when comparing as it may be more than one --- lib/public_key/test/public_key_SUITE.erl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index e74ff8051d..185618e58e 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -146,7 +146,8 @@ pk_decode_encode(Config) when is_list(Config) -> DSAPubKey = public_key:pem_entry_decode(PubEntry0), true = check_entry_type(DSAPubKey, 'DSAPublicKey'), PubEntry0 = public_key:pem_entry_encode('SubjectPublicKeyInfo', DSAPubKey), - DSAPubPem = public_key:pem_encode([PubEntry0]), + DSAPubPemNoEndNewLines = strip_ending_newlines(DSAPubPem), + DSAPubPemEndNoNewLines = strip_ending_newlines(public_key:pem_encode([PubEntry0])), [{'RSAPrivateKey', DerRSAKey, not_encrypted} = Entry1 ] = erl_make_certs:pem_to_der(filename:join(Datadir, "client_key.pem")), @@ -167,13 +168,15 @@ pk_decode_encode(Config) when is_list(Config) -> RSAPubKey = public_key:pem_entry_decode(PubEntry1), true = check_entry_type(RSAPubKey, 'RSAPublicKey'), PubEntry1 = public_key:pem_entry_encode('SubjectPublicKeyInfo', RSAPubKey), - RSAPubPem = public_key:pem_encode([PubEntry1]), + RSAPubPemNoEndNewLines = strip_ending_newlines(RSAPubPem), + RSAPubPemNoEndNewLines = strip_ending_newlines(public_key:pem_encode([PubEntry1])), {ok, RSARawPem} = file:read_file(filename:join(Datadir, "rsa_pub_key.pem")), [{'RSAPublicKey', _, _} = PubEntry2] = public_key:pem_decode(RSARawPem), RSAPubKey = public_key:pem_entry_decode(PubEntry2), - RSARawPem = public_key:pem_encode([PubEntry2]), + RSARawPemNoEndNewLines = strip_ending_newlines(RSARawPem), + RSARawPemNoEndNewLines = strip_ending_newlines(public_key:pem_encode([PubEntry2])), Salt0 = crypto:rand_bytes(8), Entry3 = public_key:pem_entry_encode('RSAPrivateKey', RSAKey0, @@ -464,3 +467,6 @@ check_entry_type(#'Certificate'{}, 'Certificate') -> true; check_entry_type(_,_) -> false. + +strip_ending_newlines(Bin) -> + string:strip(binary_to_list(Bin), right, 10). -- cgit v1.2.3 From 7cd1a358ed784e8872dcc7fa6c6f719401b12f52 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 11:23:33 +0100 Subject: Some cosmetic changes... --- lib/snmp/doc/src/snmp_agent_config_files.xml | 11 ++++++----- lib/snmp/vsn.mk | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/lib/snmp/doc/src/snmp_agent_config_files.xml b/lib/snmp/doc/src/snmp_agent_config_files.xml index 0bab563f87..b62269d506 100644 --- a/lib/snmp/doc/src/snmp_agent_config_files.xml +++ b/lib/snmp/doc/src/snmp_agent_config_files.xml @@ -4,7 +4,7 @@

- 19972009 + 19972011 Ericsson AB. All Rights Reserved. @@ -178,11 +178,12 @@ community.conf. It must be present if the agent is configured for SNMPv1 or SNMPv2c.

+

An SNMP community is a relationship between an SNMP + agent and a set of SNMP managers that defines authentication, access + control and proxy characteristics.

The corresponding table is snmpCommunityTable in the - SNMP-COMMUNITY-MIB. -

-

Each entry is a term: -

+ SNMP-COMMUNITY-MIB.

+

Each entry is a term:

{CommunityIndex, CommunityName, SecurityName, ContextName, TransportTag}.

CommunityIndex is a non-empty string. diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 1229b12ae2..e70c97dcb8 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -1,3 +1,22 @@ -SNMP_VSN = 4.18 +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2011. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From dd99864e18829150951285d3819096e04ebda3de Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 12:02:54 +0100 Subject: No auto-import of erlang:error/1,2. --- lib/snmp/test/snmp_appup_test.erl | 4 +++- lib/snmp/test/snmp_test_mgr_misc.erl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 18509526cf..756636f79c 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,6 +30,8 @@ ]). +-compile({no_auto_import, [error/1]}). + -include("test_server.hrl"). -include("snmp_test_lib.hrl"). diff --git a/lib/snmp/test/snmp_test_mgr_misc.erl b/lib/snmp/test/snmp_test_mgr_misc.erl index ef1ba0b948..fc6dedd96d 100644 --- a/lib/snmp/test/snmp_test_mgr_misc.erl +++ b/lib/snmp/test/snmp_test_mgr_misc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,6 +33,8 @@ %% internal exports -export([init_packet/10]). +-compile({no_auto_import, [error/2]}). + -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). -- cgit v1.2.3 From f5a6e678c9044896782230368ff8de266bfd9415 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 12:28:17 +0100 Subject: Removed more spec:s that wasn't needed. --- lib/cosEvent/src/cosEventApp.erl | 44 ++++++++++++++++++-------------- lib/cosTime/src/cosTime.erl | 54 +++++++++++++++++++++++++--------------- lib/orber/test/csiv2_SUITE.erl | 10 ++++---- 3 files changed, 65 insertions(+), 43 deletions(-) diff --git a/lib/cosEvent/src/cosEventApp.erl b/lib/cosEvent/src/cosEventApp.erl index 373e2d170b..143c241448 100644 --- a/lib/cosEvent/src/cosEventApp.erl +++ b/lib/cosEvent/src/cosEventApp.erl @@ -66,26 +66,31 @@ %% Effect : Install necessary data in the IFR DB %%------------------------------------------------------------ install() -> - install_loop(?IDL_MODULES, []). + case install_loop(?IDL_MODULES, []) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. install_loop([], _) -> ok; install_loop([H|T], Accum) -> case catch H:'oe_register'() of {'EXIT',{unregistered,App}} -> - ?write_ErrorMsg("Unable to register '~p'; application ~p not registered. -Trying to unregister ~p~n", [H,App,Accum]), + ?write_ErrorMsg("Unable to register '~p'; application ~p not registered.\n" + "Trying to unregister ~p~n", [H,App,Accum]), uninstall_loop(Accum, {exit, register}); {'EXCEPTION',_} -> - ?write_ErrorMsg("Unable to register '~p'; propably already registered. -You are adviced to confirm this. -Trying to unregister ~p~n", [H,Accum]), + ?write_ErrorMsg("Unable to register '~p'; propably already registered.\n" + "You are adviced to confirm this.\n" + "Trying to unregister ~p~n", [H,Accum]), uninstall_loop(Accum, {exit, register}); ok -> install_loop(T, [H|Accum]); _ -> - ?write_ErrorMsg("Unable to register '~p'; reason unknown. -Trying to unregister ~p~n", [H,Accum]), + ?write_ErrorMsg("Unable to register '~p'; reason unknown.\n" + "Trying to unregister ~p~n", [H,Accum]), uninstall_loop(Accum, {exit, register}) end. @@ -96,29 +101,32 @@ Trying to unregister ~p~n", [H,Accum]), %% Effect : Remove data related to cosEvent from the IFR DB %%------------------------------------------------------------ uninstall() -> - uninstall_loop(lists:reverse(?IDL_MODULES), ok). + case uninstall_loop(lists:reverse(?IDL_MODULES), ok) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. -%% To avoid dialyzer warnings due to the use of exit(..). --spec(uninstall_loop/2 :: (_, _) -> no_return()). uninstall_loop([],ok) -> ok; uninstall_loop([],{exit, register}) -> - exit({?MODULE, "oe_register failed"}); + {error, {?MODULE, "oe_register failed"}}; uninstall_loop([],{exit, unregister}) -> - exit({?MODULE, "oe_unregister failed"}); + {error, {?MODULE, "oe_unregister failed"}}; uninstall_loop([],{exit, both}) -> - exit({?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}); + {error, {?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}}; uninstall_loop([H|T], Status) -> case catch H:'oe_unregister'() of ok -> uninstall_loop(T, Status); _ when Status == ok -> - ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered. -You are adviced to confirm this.~n",[H]), + ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered.\n" + "You are adviced to confirm this.\n",[H]), uninstall_loop(T, {exit, unregister}); _ -> - ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered. -You are adviced to confirm this.~n",[H]), + ?write_ErrorMsg("Unable to unregister '~p'; propably already unregistered.\n" + "You are adviced to confirm this.\n",[H]), uninstall_loop(T, {exit, both}) end. diff --git a/lib/cosTime/src/cosTime.erl b/lib/cosTime/src/cosTime.erl index b02cb72509..f7d03650af 100644 --- a/lib/cosTime/src/cosTime.erl +++ b/lib/cosTime/src/cosTime.erl @@ -71,29 +71,39 @@ %%------------------------------------------------------------ install_time() -> - install_loop(?IDL_TIME_MODULES,[]). + case install_loop(?IDL_TIME_MODULES,[]) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. install_timerevent() -> - install_loop(?IDL_TIMEREVENT_MODULES,[]). + case install_loop(?IDL_TIMEREVENT_MODULES,[]) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. install_loop([], _) -> ok; install_loop([H|T], Accum) -> case catch H:'oe_register'() of {'EXIT',{unregistered,App}} -> - ?write_ErrorMsg("Unable to register '~p'; application ~p not registered. -Trying to unregister ~p~n", [H,App,Accum]), + ?write_ErrorMsg("Unable to register '~p'; application ~p not registered.\n" + "Trying to unregister ~p\n", [H,App,Accum]), uninstall_loop(Accum, {exit, register}); {'EXCEPTION',_} -> - ?write_ErrorMsg("Unable to register '~p'; propably already registered. -You are adviced to confirm this. -Trying to unregister ~p~n", [H,Accum]), + ?write_ErrorMsg("Unable to register '~p'; propably already registered.\n" + "You are adviced to confirm this.\n" + "Trying to unregister ~p\n", [H,Accum]), uninstall_loop(Accum, {exit, register}); ok -> install_loop(T, [H|Accum]); _ -> - ?write_ErrorMsg("Unable to register '~p'; reason unknown. -Trying to unregister ~p~n", [H,Accum]), + ?write_ErrorMsg("Unable to register '~p'; reason unknown.\n" + "Trying to unregister ~p\n", [H,Accum]), uninstall_loop(Accum, {exit, register}) end. @@ -105,19 +115,29 @@ Trying to unregister ~p~n", [H,Accum]), %%------------------------------------------------------------ uninstall_time() -> - uninstall_loop(lists:reverse(?IDL_TIME_MODULES),ok). + case uninstall_loop(lists:reverse(?IDL_TIME_MODULES),ok) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. uninstall_timerevent() -> - uninstall_loop(lists:reverse(?IDL_TIMEREVENT_MODULES),ok). + case uninstall_loop(lists:reverse(?IDL_TIMEREVENT_MODULES),ok) of + ok -> + ok; + {error, Reason} -> + exit(Reason) + end. uninstall_loop([],ok) -> ok; uninstall_loop([],{exit, register}) -> - do_exit({?MODULE, "oe_register failed"}); + {error, {?MODULE, "oe_register failed"}}; uninstall_loop([],{exit, unregister}) -> - do_exit({?MODULE, "oe_unregister failed"}); + {error, {?MODULE, "oe_unregister failed"}}; uninstall_loop([],{exit, both}) -> - do_exit({?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}); + {error, {?MODULE, "oe_register and, for some of those already registered, oe_unregister failed"}}; uninstall_loop([H|T], Status) -> case catch H:'oe_unregister'() of ok -> @@ -132,12 +152,6 @@ uninstall_loop([H|T], Status) -> uninstall_loop(T, {exit, both}) end. - -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(do_exit/1 :: (_) -> no_return()). -do_exit(Reason) -> - exit(Reason). - %%------------------------------------------------------------ %% function : start/stop %% Arguments: diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 8103fd81ac..855c1b6b3f 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -694,8 +694,8 @@ ssl_server_peercert_api(_Config) -> {ok, Socket} = ?match({ok, _}, fake_client_ORB(ssl, ServerHost, ServerPort, SSLOptions)), {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), % ?match({ok, #'Certificate'{}}, % 'OrberCSIv2':decode('Certificate', PeerCert)), destroy_fake_ORB(ssl, Socket), @@ -734,8 +734,8 @@ ssl_client_peercert_api(_Config) -> ?match(ok, ssl:ssl_accept(Socket)), {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), - ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])), +%% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])), % ?match({ok, #'Certificate'{}}, % 'OrberCSIv2':decode('Certificate', PeerCert)), ssl:close(Socket), -- cgit v1.2.3 From cc147b3b7f9cde5a521d42e50bce8464597a4965 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 14:09:39 +0100 Subject: More specs removed. --- .../src/CosEventDomainAdmin_EventDomain_impl.erl | 26 +++++++++++++--------- lib/cosEventDomain/src/cosEventDomainApp.erl | 13 ++++++----- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl index ddff0f8632..f5dd6d5c14 100644 --- a/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl +++ b/lib/cosEventDomain/src/CosEventDomainAdmin_EventDomain_impl.erl @@ -778,14 +778,17 @@ get_qos(_OE_This, #state{cyclic = Cyclic, diamonds = Diamonds} = State) -> %%---------------------------------------------------------------------- set_qos(_OE_This, State, NewQoS) -> QoS = cosEventDomainApp:get_qos(NewQoS), - set_qos_helper(QoS, State, []). + case set_qos_helper(QoS, State, []) of + {ok, NewState} -> + {reply, ok, NewState}; + {error, Errors} -> + corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Errors}) + end. -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(set_qos_helper/3 :: (_, _, _) -> no_return()). set_qos_helper([], State, []) -> - {reply, ok, State}; + {ok, State}; %{reply, ok, State}; set_qos_helper([], _, Errors) -> - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Errors}); + {error, Errors}; set_qos_helper([{?DiamondDetection, Diamonds}|T], #state{diamonds = Diamonds} = State, Errors) -> set_qos_helper(T, State, Errors); @@ -830,14 +833,17 @@ set_qos_helper([{?CycleDetection, _}|T], #state{cyclic = Cyclic} = State, Errors %%---------------------------------------------------------------------- validate_qos(_OE_This, State, WantedQoS) -> QoS = cosEventDomainApp:get_qos(WantedQoS), - {reply, {ok, validate_qos_helper(QoS, State, [], [])}, State}. + case validate_qos_helper(QoS, State, [], []) of + {ok, Properties} -> + {reply, {ok, Properties}, State}; + {error, Errors} -> + corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Errors}) + end. -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(validate_qos_helper/4 :: (_, _, _, _) -> no_return()). validate_qos_helper([], _, Properties, []) -> - Properties; + {ok, Properties}; validate_qos_helper([], _, _, Errors) -> - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Errors}); + {error, Errors}; validate_qos_helper([{?DiamondDetection, ?ForbidDiamonds}|T], State, Properties, Errors) -> case get_diamonds_helper(State, false) of diff --git a/lib/cosEventDomain/src/cosEventDomainApp.erl b/lib/cosEventDomain/src/cosEventDomainApp.erl index 3cb4055fba..734e4deccb 100644 --- a/lib/cosEventDomain/src/cosEventDomainApp.erl +++ b/lib/cosEventDomain/src/cosEventDomainApp.erl @@ -270,14 +270,17 @@ create_id() -> get_qos([]) -> []; get_qos(Properties) -> - get_qos(Properties, [], []). + case get_qos(Properties, [], []) of + {ok, Supported} -> + Supported; + {error, Unsupported} -> + corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupported}) + end. -%% To avoid dialyzer warnings due to the use of exit/throw. --spec(get_qos/3 :: (_, _, _) -> no_return()). get_qos([], Supported, []) -> - Supported; + {ok, Supported}; get_qos([], _, Unsupported) -> - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupported}); + {error, Unsupported}; get_qos([#'CosNotification_Property'{name = ?CycleDetection, value= #any{value = ?AuthorizeCycles}}|T], Supported, Unsupported) -> -- cgit v1.2.3 From a31efb6b4f9581dcd3f52df68fe4704e052e9f20 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 14:20:54 +0100 Subject: More specs removed. --- .../src/CosPropertyService_PropertySetDefFactory_impl.erl | 11 ++++++++--- .../src/CosPropertyService_PropertySetFactory_impl.erl | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl index 82bc00aa7f..202df42b61 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetDefFactory_impl.erl @@ -152,13 +152,18 @@ create_initial_propertysetdef(_OE_This, State, PropDefs) -> %% Internal functions %%====================================================================== evaluate_propertysetdef(SetDefs) -> - evaluate_propertysetdef(SetDefs, [], []). + case evaluate_propertysetdef(SetDefs, [], []) of + {ok, NewProperties} -> + NewProperties; + {error, Exc} -> + corba:raise(#'CosPropertyService_MultipleExceptions'{exceptions = Exc}) + end. evaluate_propertysetdef([], NewProperties, []) -> %% No exceptions found. - NewProperties; + {ok, NewProperties}; evaluate_propertysetdef([], _, Exc) -> - corba:raise(#'CosPropertyService_MultipleExceptions'{exceptions = Exc}); + {error, Exc}; evaluate_propertysetdef([#'CosPropertyService_PropertyDef' {property_name = Name, property_value = Value, diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl index 1a8f83617a..4bc29b99ac 100644 --- a/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl +++ b/lib/cosProperty/src/CosPropertyService_PropertySetFactory_impl.erl @@ -153,13 +153,18 @@ create_initial_propertyset(_OE_This, State, Properties) -> %% Internal functions %%====================================================================== evaluate_propertyset(Sets) -> - evaluate_propertyset(Sets, [], []). + case evaluate_propertyset(Sets, [], []) of + {ok, NewProperties} -> + NewProperties; + {error, Exc} -> + corba:raise(#'CosPropertyService_MultipleExceptions'{exceptions = Exc}) + end. evaluate_propertyset([], NewProperties, []) -> %% No exceptions found. - NewProperties; + {ok, NewProperties}; evaluate_propertyset([], _, Exc) -> - corba:raise(#'CosPropertyService_MultipleExceptions'{exceptions = Exc}); + {error, Exc}; evaluate_propertyset([#'CosPropertyService_Property' {property_name = Name, property_value = Value}|T], X, Exc) -> -- cgit v1.2.3 From ed66dca80af9f203b9e2ae26c334820586b37fa5 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 15:51:05 +0100 Subject: More specs removed. --- lib/cosNotification/src/CosNotification_Common.erl | 44 ++++++++++++++-------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index bcd241f3a8..d3607a5eed 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -944,15 +944,19 @@ check_limits(LQS, NPR) -> %% supported. %%------------------------------------------------------------ validate_event_qos(Wanted, Curr) -> - v_e_q_helper(Wanted, Curr, []), - []. + case v_e_q_helper(Wanted, Curr, []) of + ok -> + []; + {error, Unsupp} -> + corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}) + end. v_e_q_helper([], _Curr, []) -> - %% Parsed all and foynd no conflicts. + %% Parsed all and found no conflicts. ok; v_e_q_helper([], _Curr, Unsupp) -> %% Not possible to use these requested QoS. - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); + {error, Unsupp}; %%--- EventReliability ---%% v_e_q_helper([#'CosNotification_Property'{name=?not_EventReliability, @@ -1071,30 +1075,40 @@ v_e_q_helper(What, _, _) -> %% LQS - local representation of QoS. %% Returns : {NewOMGStyleQoS, NewLocalQoS} | #'CosNotification_UnsupportedQoS'{} %%------------------------------------------------------------ -set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> +set_properties(Wanted, Current, Type, Supported, Unsupp, NewQoS, Parent, Childs, LQS) -> + case do_set_properties(Wanted, Current, Type, Supported, Unsupp, NewQoS, Parent, Childs, LQS) of + {error, Exc} -> + corba:raise(Exc); + Result -> + Result + end. + +do_set_properties([], Curr, channelAdm, _, [], NewQoS,_,_,LAS) -> merge_properties(NewQoS, Curr, LAS); -set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> +do_set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> %% set_local_qos and merge_properties are help functions found at the end of QoS %% functions. NewLQS = set_local_qos(NewQoS, LQS), merge_properties(NewQoS, Curr, NewLQS); -set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> - corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); -set_properties([], _, _, _, Unsupp, _,_,_,_) -> - corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); +do_set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> + {error, #'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}}; +% corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); +do_set_properties([], _, _, _, Unsupp, _,_,_,_) -> + {error, #'CosNotification_UnsupportedQoS'{qos_err = Unsupp}}; +%corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); -set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> +do_set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> %% set_values and is_supported are help functions found at the end of QoS %% functions. case set_values(is_supported(Supported, Req), Req, Type, Curr, Parent, Childs,LQS) of {unsupported, U} -> - set_properties(Tail, Curr, Type, Supported, [U|Unsupp], NewQoS, Parent, Childs,LQS); + do_set_properties(Tail, Curr, Type, Supported, [U|Unsupp], NewQoS, Parent, Childs,LQS); {ok, S, NewLQS} -> - set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,NewLQS); + do_set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,NewLQS); {ok, S} -> - set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,LQS); + do_set_properties(Tail, Curr, Type, Supported, Unsupp, [S|NewQoS], Parent, Childs,LQS); ok -> - set_properties(Tail, Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) + do_set_properties(Tail, Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) end. -- cgit v1.2.3 From 4414036566181c45f592036a03a3b5898f725d95 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 17 Feb 2011 15:52:20 +0100 Subject: Removed code commented out. --- lib/cosNotification/src/CosNotification_Common.erl | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl index d3607a5eed..af9b2d4368 100644 --- a/lib/cosNotification/src/CosNotification_Common.erl +++ b/lib/cosNotification/src/CosNotification_Common.erl @@ -1092,10 +1092,8 @@ do_set_properties([], Curr, _, _, [], NewQoS,_,_,LQS) -> merge_properties(NewQoS, Curr, NewLQS); do_set_properties([], _, channelAdm, _, Unsupp, _,_,_,_) -> {error, #'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}}; -% corba:raise(#'CosNotification_UnsupportedAdmin'{admin_err = Unsupp}); do_set_properties([], _, _, _, Unsupp, _,_,_,_) -> {error, #'CosNotification_UnsupportedQoS'{qos_err = Unsupp}}; -%corba:raise(#'CosNotification_UnsupportedQoS'{qos_err = Unsupp}); do_set_properties([Req|Tail], Curr, Type, Supported, Unsupp, NewQoS, Parent, Childs,LQS) -> %% set_values and is_supported are help functions found at the end of QoS -- cgit v1.2.3 From 15e8dd20b5ba2c82e683e87254f18c9af3625481 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 16:54:20 +0100 Subject: Add documentation for SCBs --- lib/common_test/doc/src/Makefile | 1 + lib/common_test/doc/src/common_test_app.xml | 10 +- lib/common_test/doc/src/ct_suite_callbacks.xml | 503 ++++++++++++++++++++- lib/common_test/doc/src/event_handler_chapter.xml | 11 +- lib/common_test/doc/src/part.xml | 1 + lib/common_test/doc/src/run_test_chapter.xml | 11 +- .../doc/src/suite_callbacks_chapter.xml | 394 ++++++++++++++++ lib/common_test/doc/src/write_test_chapter.xml | 1 + lib/common_test/src/ct.erl | 6 +- 9 files changed, 910 insertions(+), 28 deletions(-) create mode 100644 lib/common_test/doc/src/suite_callbacks_chapter.xml diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile index be066143e0..a3f740852c 100644 --- a/lib/common_test/doc/src/Makefile +++ b/lib/common_test/doc/src/Makefile @@ -71,6 +71,7 @@ XML_CHAPTER_FILES = \ cover_chapter.xml \ ct_master_chapter.xml \ event_handler_chapter.xml \ + suite_callbacks_chapter.xml \ dependencies_chapter.xml \ notes.xml \ notes_history.xml diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml index e30eef2488..a735dc85a8 100644 --- a/lib/common_test/doc/src/common_test_app.xml +++ b/lib/common_test/doc/src/common_test_app.xml @@ -131,7 +131,8 @@ Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | - {silent_connections,Conns} | {stylesheet,CSSFile} + {silent_connections,Conns} | {stylesheet,CSSFile} | + {suite_callbacks, SCBs} Time = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()} MilliSec = integer() @@ -143,6 +144,9 @@ UserData = term() Conns = [atom()] CSSFile = string() + SCBs = [SCBModule | {SCBModule, SCBInitArgs}] + SCBModule = atom() + SCBInitArgs = term() @@ -170,6 +174,10 @@

With userdata, it is possible for the user to specify arbitrary test suite related information which can be read by calling ct:userdata/2.

+ +

The suite_callbacks tag specifies which + Suite Callbacks + are to be run together with this suite.

Other tuples than the ones defined will simply be ignored.

diff --git a/lib/common_test/doc/src/ct_suite_callbacks.xml b/lib/common_test/doc/src/ct_suite_callbacks.xml index 28a496a47b..cea5804825 100644 --- a/lib/common_test/doc/src/ct_suite_callbacks.xml +++ b/lib/common_test/doc/src/ct_suite_callbacks.xml @@ -1,4 +1,4 @@ - + @@ -33,24 +33,43 @@ suite_callback.sgml
ct_suite_callback - A callback interface on top of common test + A callback interface on top of Common Test -

The Suite Callback framework allows extensions of the default - behaviour of Common Test by means of callbacks before and after all - test suite calls.

+

This feature is in alpha release right now. This means that the + interface may change in the future and that there may be bugs. We + encourage you to use this feature, but be prepared + that there might be bugs and that the interface might change + inbetween releases.

+ +

The Suite Callback (henceforth called SCB) framework allows + extensions of the default behaviour of Common Test by means of callbacks + before and after all test suite calls. It is meant for advanced users of + Common Test which want to abstract out behaviour which is common to + multiple test suites.

In brief, Suite Callbacks allows you to:

- Manipulating the runtime config before each suite configuration calls - Manipulating the return of all suite configuration calls + Manipulate the runtime config before each suite + configuration calls + Manipulate the return of all suite configuration calls and in + extension the result of the test themselves. -

The following sections describe the mandatory and optional suite callback - functions Common Test will call during test execution. For more details - see Suite Callbacks in the User's Guide.

+

The following sections describe the mandatory and optional SCB + functions Common Test will call during test execution. For more details + see Suite Callbacks in + the User's Guide.

+ +

For information about how to add a SCB to your suite see + Installing an SCB + in the User's Guide.

+ +

See the + Example SCB + in the User's Guide for a minimal example of an SCB.

@@ -62,31 +81,469 @@ - Module:init(Opts) -> {Id,State} - asdas + Module:init(Id, Opts) -> State + Initiates the Suite Callback + Id = reference() | term() Opts = term() - Id = term() - GroupName = term() + State = term()

MANDATORY

+ +

Always called before any other callback function. + Use this to initiate any common state. + It should return a state for this SCB.

+ +

Id is the return value of + id/1, or a reference + if id/1 is not implemented. +

+ +

For details about when init is called see + scope + in the User's Guide.

+ +
+
+ + + Module:pre_init_per_suite(SuiteName, Config, SCBState) -> + Result + Called before init_per_suite + + SuiteName = atom() + Config = NewConfig = [{Key,Value}] + SCBState = NewSCBState = term() + Result = {Return, NewSCBState} + Return = NewConfig | SkipOrFail + SkipOrFail = {fail, Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + init_per_suite if it exists. + It typically contains initialization/logging which needs to be done + before init_per_suite is called. + If {skip,Reason} or {fail,Reason} is returned, + init_per_suite and all test cases of the suite will be skipped and + Reason printed in the overview log of the suite.

-

+

SuiteName is the name of the suite to be run.

+ +

Config is the original config list of the test suite.

+ +

SCBState is the current internal state of the SCB.

+ +

Return is the result of the init_per_suite function. + If it is {skip,Reason} or {fail,Reason} + init_per_suite + will never be called, instead the initiation is considered + to be skipped/failed respectively. If a NewConfig list + is returned, + init_per_suite will be called with that NewConfig list. + See + Manipulating tests in the User's Guide for more details.

+ + +

Note that this function is only called if the SCB has been added + before init_per_suite is run, see + SCB Scoping + in the User's Guide for details.

+
+
+ + + Module:post_init_per_suite(SuiteName, Config, Return, SCBState) -> + Result + Called after init_per_suite + + SuiteName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail, Reason} | {skip, Reason} | term() + SCBState = NewSCBState = term() + Result = {NewReturn, NewSCBState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

Return is what + init_per_suite + returned, i.e. {fail,Reason}, {skip,Reason}, a Config + list or a term describing how + init_per_suite + failed.

+ +

NewReturn is the possibly modified return value of + init_per_suite + . It is here possible to recover from a failure in + init_per_suite + by returning the ConfigList with the tc_status + element removed.

+ +

SCBState is the current internal state of the SCB.

+ +

This function is called after + + init_per_suite if it exists.

+ +

Note that this function is only called if the SCB has been added + before or in init_per_suite, see + SCB Scoping + in the User's Guide for details.

+
+
+ + + Module:pre_init_per_group(GroupName, Config, SCBState) -> + Result + Called before init_per_group + + GroupName = atom() + Config = NewConfig = [{Key,Value}] + SCBState = NewSCBState = term() + Result = {NewConfig | SkipOrFail, NewSCBState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

-

If {skip,Reason} is returned, all test cases - in the module will be skipped, and the Reason will - be printed on the HTML result page.

+

This function is called before + + init_per_group if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + init_per_group instead.

+
+
+ + + Module:post_init_per_group(GroupName, Config, Return, SCBState) -> + Result + Called after init_per_group + + GroupName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + SCBState = NewSCBState = term() + Result = {NewReturn, NewSCBState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

-

For details on groups, see - Test case - groups in the User's Guide.

+

This function is called after + + init_per_group if it exists. It behaves the same way as + + post_init_per_suite, but for the + + init_per_group instead.

+
+
+ + + Module:pre_init_per_testcase(TestcaseName, Config, SCBState) -> + Result + Called before init_per_testcase + + TestcaseName = atom() + Config = NewConfig = [{Key,Value}] + SCBState = NewSCBState = term() + Result = {NewConfig | SkipOrFail, NewSCBState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + - + +

OPTIONAL

+ +

This function is called before + + init_per_testcase if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + init_per_testcase function instead.

+ +

Note that it is not possible to add SCB's here right now, + that feature might be added later, + but it would right now break backwards compatability.

+
+
+ + + Module:post_end_per_testcase(TestcaseName, Config, Return, SCBState) + -> Result + Called after end_per_testcase + + TestcaseName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + SCBState = NewSCBState = term() + Result = {NewReturn, NewSCBState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_testcase if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_testcase function instead.

+
+
+ + + Module:pre_end_per_group(GroupName, Config, SCBState) -> + Result + Called before end_per_group + + GroupName = atom() + Config = NewConfig = [{Key,Value}] + SCBState = NewSCBState = term() + Result = {NewConfig | SkipOrFail, NewSCBState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + end_per_group if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + end_per_group function instead.

+
+
+ + + Module:post_end_per_group(GroupName, Config, Return, SCBState) -> + Result + Called after end_per_group + + GroupName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + SCBState = NewSCBState = term() + Result = {NewReturn, NewSCBState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_group if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_group function instead.

+
+
+ + + Module:pre_end_per_suite(SuiteName, Config, SCBState) -> + Result + Called before end_per_suite + + SuiteName = atom() + Config = NewConfig = [{Key,Value}] + SCBState = NewSCBState = term() + Result = {NewConfig | SkipOrFail, NewSCBState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + end_per_suite if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + end_per_suite function instead.

+
+
+ + + Module:post_end_per_suite(SuiteName, Config, Return, SCBState) -> + Result + Called after end_per_suite + + SuiteName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + SCBState = NewSCBState = term() + Result = {NewReturn, NewSCBState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_suite if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_suite function instead.

+
+
+ + + Module:on_tc_fail(TestcaseName, Reason, SCBState) -> + NewSCBState + Called after the SCB scope ends + + TestcaseName = init_per_suite | end_per_suite | + init_per_group | end_per_group | atom() + Reason = term() + SCBState = NewSCBState = term() + + + +

OPTIONAL

+ +

This function is called whenever a testcase fails. + It is called after the post function has been called for + the testcase which failed. i.e. + if init_per_suite fails this function is called after + + post_init_per_suite, and if a testcase fails it is called + after + post_end_per_testcase.

+ +

The data which comes with the Reason follows the same format as the + FailReason + in the tc_done event. + See Event Handling + in the User's Guide for details.

+
+
+ + + Module:on_tc_skip(TestcaseName, Reason, SCBState) -> + NewSCBState + Called after the SCB scope ends + + TestcaseName = end_per_suite | init_per_group | + end_per_group | atom() + Reason = {tc_auto_skip | tc_user_skip, term()} + SCBState = NewSCBState = term() + + + +

OPTIONAL

+ +

This function is called whenever a testcase is skipped. + It is called after the post function has been called for the + testcase which was skipped. + i.e. if init_per_group is skipped this function is called after + post_init_per_group + , and if a testcase is skipped it is called after + post_end_per_testcase + .

+ +

The data which comes with the Reason follows the same format as + tc_auto_skip + and + tc_user_skip events. + See Event Handling + in the User's Guide for details.

+
+
+ + + Module:terminate(SCBState) + Called after the SCB scope ends + + SCBState = term() + + + +

OPTIONAL

+ +

This function is called at the end of an SCB's + scope. +

+
+
+ + + Module:id(Opts) -> Id + Called before the init function of an SCB + + Opts = term() + Id = term() + + + +

OPTIONAL

+ +

The Id is used to uniquely identify an SCB instance, + if two SCB's return the same Id the second SCB is ignored + and subsequent calls to the SCB will only be made to the first + instance. For more information see + Installing an SCB + in the User's Guide. +

+ +

This function should NOT have any side effects as it might + be called multiple times by Common Test.

+ +

If not implemented the SCB will act as if this function returned a + call to make_ref/0.

+
-
diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml index 904876ac46..a01feb59d1 100644 --- a/lib/common_test/doc/src/event_handler_chapter.xml +++ b/lib/common_test/doc/src/event_handler_chapter.xml @@ -61,6 +61,7 @@ itself.

+ Usage

Event handlers may be installed by means of an event_handler start flag (ct_run) or option (ct:run_test/1), where the @@ -120,6 +121,7 @@ node the event has originated from (only relevant for CT Master event handlers). data is specific for the particular event.

+

General events:

@@ -172,6 +174,7 @@ are also given.

+ #event{name = tc_done, data = {Suite,FuncOrGroup,Result}}

Suite = atom(), name of the suite.

FuncOrGroup = Func | {Conf,GroupName,GroupProperties}

@@ -181,12 +184,14 @@ (unknown if init- or end function times out).

GroupProperties = list(), list of execution properties for the group.

Result = ok | {skipped,SkipReason} | {failed,FailReason}, the result.

+

SkipReason = {require_failed,RequireInfo} | {require_failed_in_suite0,RequireInfo} | {failed,{Suite,init_per_testcase,FailInfo}} | UserTerm, the reason why the case has been skipped.

-

FailReason = {error,FailInfo} | + +

FailReason = {error,FailInfo} | {error,{RunTimeError,StackTrace}} | {timetrap_timeout,integer()} | {failed,{Suite,end_per_testcase,FailInfo}}, reason for failure.

@@ -209,6 +214,7 @@ end_per_testcase for the case failed.

+ #event{name = tc_auto_skip, data = {Suite,Func,Reason}}

Suite = atom(), the name of the suite.

Func = atom(), the name of the test case or configuration function.

@@ -234,7 +240,8 @@ skipped because of init_per_testcase failing, since that information is carried with the tc_done event.

- + + #event{name = tc_user_skip, data = {Suite,TestCase,Comment}}

Suite = atom(), name of the suite.

TestCase = atom(), name of the test case.

diff --git a/lib/common_test/doc/src/part.xml b/lib/common_test/doc/src/part.xml index 53a4cb1bbf..1a09ec1da2 100644 --- a/lib/common_test/doc/src/part.xml +++ b/lib/common_test/doc/src/part.xml @@ -75,6 +75,7 @@ + diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 94fcf6bf01..81e752680b 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -105,6 +105,7 @@ RPC from a remote node.

+
Running tests from the OS command line @@ -147,6 +148,8 @@ event handlers. ]]>, to install event handlers including start arguments. + ]]>, to install + Suite Callbacks including start arguments. , specifies include directories (see above). , disables the automatic test suite compilation feature (see above). ]]>, extends timetrap @@ -333,8 +336,8 @@ with dir.

+
- Using test specifications

The most flexible way to specify what to test, is to use a so @@ -440,6 +443,9 @@ {event_handler, NodeRefs, EventHandlers}. {event_handler, EventHandlers, InitArgs}. {event_handler, NodeRefs, EventHandlers, InitArgs}. + + {suite_callbacks, SCBModules}. + {suite_callbacks, NodeRefs, SCBModules}.

Test terms:

@@ -478,6 +484,9 @@
       LogDir        = string()
       EventHandlers = atom() | [atom()]
       InitArgs      = [term()]
+      SCBModules    = [SCBModule | {SCBModule, SCBInitArgs}]
+      SCBModule     = atom()
+      SCBInitArgs   = term()
       DirRef        = DirAlias | Dir
       Suites        = atom() | [atom()] | all
       Suite         = atom()
diff --git a/lib/common_test/doc/src/suite_callbacks_chapter.xml b/lib/common_test/doc/src/suite_callbacks_chapter.xml
new file mode 100644
index 0000000000..89f78898d4
--- /dev/null
+++ b/lib/common_test/doc/src/suite_callbacks_chapter.xml
@@ -0,0 +1,394 @@
+
+
+
+
+  
+ + 20112011 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Suite Callbacks + Lukas Larsson + + + + suite_callbacks_chapter.xml +
+ + +
+ General +

This feature is in alpha release right now. This means that the + interface may change in the future and that there may be bugs. We + encourage you to use this feature, but be prepared + that there might be bugs and that the interface might change + inbetween releases.

+

+ The Suite Callback (henceforth called SCB) framework allows + extensions of the default behaviour of Common Test by means of callbacks + before and after all test suite calls. SCBs allow advanced Common Test + users to abstract out behaviour which is common to multiple test suites + without littering all test suites with library calls. Some example + usages are: logging, starting and monitoring external systems, + building C files needed by the tests and much more!

+ +

In brief, Suite Callbacks allows you to:

+ + + Manipulate the runtime config before each suite + configuration calls + Manipulate the return of all suite configuration calls and in + extension the result of the test themselves. + + +

The following sections describe how to use SCBs, when they are run + and how to manipulate your test results in an SCB

+ +

When executing within an SCB all timetraps are shutoff. So + if your SCB never returns, the entire test run will be stalled!

+
+ +
+ + +
+ Installing an SCB +

There are multiple ways to install an SCB in your test run. You can do it + for all tests in a run, for specific test suites and for specific groups + within a test suite. If you want an SCB to be present in all test suites + within your testrun there are three different ways to accomplish that.

+ + + Add -suite_callbacks as an argument to + ct_run. + To add multiple SCBs using this method append them to each other + using the keyword and, i.e. + ct_run -suite_callbacks scb1 [{debug,true}] and scb2 .... + Add the suite_callbacks tag to your + + Test Specification + Add the suite_callbacks tag to your call to + ct:run_test/1 + + +

You can also add SCBs within a test suite. This is done by returning + {suite_callbacks,[SCB]} in the config list from + suite/0, + + init_per_suite/1 or + + init_per_group/2. SCB in this case can be either + only the module name of the SCB or a tuple with the module name and the + initial arguments to the SCB. Eg: + {suite_callbacks,[my_scb_module]} or + {suite_callbacks,[{my_scb_module,[{debug,true}]}]}

+ +
+ Overriding SCBs +

By default each installation of an SCB will cause a new instance of it + to be activated. This can cause problems if you want to be able to + override SCBs in testspecifications while still having them in the + suite info function. The + id/1 + callback exists to address this problem. By returning the same + id in both places, Common Test knows that this SCB + has already been installed and will not try to install it again.

+
+ +
+ + +
+ SCB Scope +

Once the SCB is installed into a certain test run it will be there until + it's scope is expired. The scope of an SCB depends on when it is + installed. + The init/2 is + called at the beginning of the scope and the + terminate/1 + function is called when the scope ends.

+ + + SCB Installed in + SCB scope begins before + SCB scope ends after + + + ct_run + the first test suite is to be run. + the last test suite has been run. + + + ct:run_test + the first test suite is to be run. + the last test suite has been run. + + + + Test Specification + the first test suite is to be run. + the last test suite has been run. + + + suite/0 + + + pre_init_per_suite/3 is called. + + post_end_per_suite/4 has been called for that test suite. + + + + init_per_suite/1 + + post_init_per_suite/4 is called. + + post_end_per_suite/4 has been called for that test suite. + + + + init_per_group/2 + + post_init_per_group/4 is called. + + post_end_per_group/4 has been called for that group. + + Scope of an SCB +
+ +
+ CTH Processes and Tables +

CTHs are run with the same process scoping as normal test suites + i.e. a different process will execute the init_per_suite hooks then the + init_per_group or per_testcase hooks. So if you want to spawn a + process in the CTH you cannot link with the CTH process as it will exit + after the post hook ends. Also if you for some reason need an ETS + table with your CTH, you will have to spawn a process which handles + it.

+
+ +
+ + +
+ Manipulating tests +

It is through SCB's possible to manipulate the results of tests and + configuration functions. The main purpose of doing this with SCBs is to + allow common patterns to be abstracted out from test test suites and applied to + multiple test suites without duplicating any code. All of the callback + functions for an SCB follow a common interface, this interface is + described below.

+ + +
+ Pre test manipulation +

+ It is possible in an SCB to hook in behaviour before + init_per_suite, + init_per_group, + init_per_testcase, + end_per_group and + end_per_suite. + This is done in the SCB functions called pre_<name of function>. + All of these function take the same three arguments: Name, + Config and SCBState. The return value of the SCB function + is always a combination of an result for the suite/group/test and an + updated SCBState. If you want the test suite to continue on + executing you should return the config list which you want the test to + use as the result. If you for some reason want to skip/fail the test, + return a tuple with skip or fail and a reason as the + result. Example: +

+ pre_init_per_suite(SuiteName, Config, SCBState) -> + case db:connect() of + {error,_Reason} -> + {{fail, "Could not connect to DB"}, SCBState}; + {ok, Handle} -> + {[{db_handle, Handle} | Config], SCBState#state{ handle = Handle }} + end. + +
+ + +
+ Post test manipulation +

It is also possible in an SCB to hook in behaviour after + init_per_suite, + init_per_group, + end_per_testcase, + end_per_group and + end_per_suite. + This is done in the SCB functions called post_<name of function>. + All of these function take the same four arguments: Name, + Config, Return and SCBState. Config in this + case is the same Config as the testcase is called with. + Return is the value returned by the testcase. If the testcase + failed by crashing, Return will be + {'EXIT',{{Error,Reason},Stacktrace}}.

+ +

The return value of the SCB function is always a combination of an + result for the suite/group/test and an updated SCBState. If + you want the callback to not affect the outcome of the test you should + return the Return data as it is given to the SCB. You can also + modify the result of the test. By returning the Config list + with the tc_status element removed you can recover from a test + failure. As in all the pre hooks, it is also possible to fail/skip + the test case in the post hook. Example:

+ + post_end_per_testcase(_TC, Config, {'EXIT',{_,_}}, SCBState) -> + case db:check_consistency() of + true -> + %% DB is good, pass the test. + {proplists:delete(tc_status, Config), SCBState}; + false -> + %% DB is not good, mark as skipped instead of failing + {{skip, "DB is inconsisten!"}, SCBState} + end; +post_end_per_testcase(_TC, Config, Return, SCBState) -> + %% Do nothing if tc does not crash. + {Return, SCBState}. + + Recovering from a testcase failure using SCBs should only be done as + a last resort. If used wrongly it could become very difficult to + determine which tests pass or fail in a test run + +
+ + +
+ Skip and Fail +

+ After any post hook has been executed for all installed SCBs, + on_tc_fail + or on_tc_skip + might be called if the testcase failed or was skipped + respectively. You cannot affect the outcome of the tests any further at + this point. +

+
+ +
+ + +
+ Example SCB +

The SCB below will log information about a test run into a format + parseable by file:consult/1. +

+ %%% @doc Common Test Example Suite Callback module. +-module(example_scb). + +%% Suite Callbacks +-export([id/1]). +-export([init/2]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/4]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/4]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/4]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/4]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/4]). + +-export([on_tc_fail/3]). +-export([on_tc_skip/3]). + +-export([terminate/1]). + +-record(state, { file_handle, total, suite_total, ts, tcs, data }). + +%% @doc Return a unique id for this SCB. +id(Opts) -> + proplists:get_value(filename, Opts, "/tmp/file.log"). + +%% @doc Always called before any other callback function. Use this to initiate +%% any common state. +init(Id, Opts) -> + {ok,D} = file:open(Id,[write]), + #state{ file_handle = D, total = 0, data = [] }. + +%% @doc Called before init_per_suite is called. +pre_init_per_suite(Suite,Config,State) -> + {Config, State#state{ suite_total = 0, tcs = [] }}. + +%% @doc Called after init_per_suite. +post_init_per_suite(Suite,Config,Return,State) -> + {Return, State}. + +%% @doc Called before end_per_suite. +pre_end_per_suite(Suite,Config,State) -> + {Config, State}. + +%% @doc Called after end_per_suite. +post_end_per_suite(Suite,Config,Return,State) -> + Data = {suites, Suite, State#state.suite_total, lists:reverse(State#state.tcs)}, + {Return, State#state{ data = [Data | State#state.data] , + total = State#state.total + State#state.suite_total } }. + +%% @doc Called before each init_per_group. +pre_init_per_group(Group,Config,State) -> + {Config, State}. + +%% @doc Called after each init_per_group. +post_init_per_group(Group,Config,Return,State) -> + {Return, State}. + +%% @doc Called after each end_per_group. +pre_end_per_group(Group,Config,State) -> + {Config, State}. + +%% @doc Called after each end_per_group. +post_end_per_group(Group,Config,Return,State) -> + {Return, State}. + +%% @doc Called before each test case. +pre_init_per_testcase(TC,Config,State) -> + {Config, State#state{ ts = now(), total = State#state.suite_total + 1 } }. + +%% @doc Called after each test case. +post_end_per_testcase(TC,Config,Return,State) -> + TCInfo = {testcase, TC, Return, timer:now_diff(now(), State#state.ts)}, + {Return, State#state{ ts = undefined, tcs = [TCInfo | State#state.tcs] } }. + +%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, +%% post_end_per_group and post_end_per_testcase if the suite, group or test case failed. +on_tc_fail(TC, Reason, State) -> + State. + +%% @doc Called when a test case is skipped by either user action +%% or due to an init function failing. +on_tc_skip(TC, Reason, State) -> + State. + +%% @doc Called when the scope of the SCB is done +terminate(State) -> + io:format(State#state.file_handle, "~p.~n", + [{test_run, State#state.total, State#state.data}]), + file:close(State#state.file_handle), + ok. +
+ +
+ + + + diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml index 5afec6de6a..76493d3616 100644 --- a/lib/common_test/doc/src/write_test_chapter.xml +++ b/lib/common_test/doc/src/write_test_chapter.xml @@ -115,6 +115,7 @@

+
Init and end per test case diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index 405dc40c8b..eb0eceeb46 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -148,7 +148,8 @@ run(TestDirs) -> %%% {auto_compile,Bool} | {multiply_timetraps,M} | {scale_timetraps,Bool} | %%% {repeat,N} | {duration,DurTime} | {until,StopTime} | %%% {force_stop,Bool} | {decrypt,DecryptKeyOrFile} | -%%% {refresh_logs,LogDir} | {basic_html,Bool} +%%% {refresh_logs,LogDir} | {basic_html,Bool} | +%%% {suite_callbacks, SCBs} %%% TestDirs = [string()] | string() %%% Suites = [string()] | string() %%% Cases = [atom()] | atom() @@ -176,6 +177,9 @@ run(TestDirs) -> %%% DecryptKeyOrFile = {key,DecryptKey} | {file,DecryptFile} %%% DecryptKey = string() %%% DecryptFile = string() +%%% SCBs = [SCBModule | {SCBModule, SCBInitArgs}] +%%% SCBModule = atom() +%%% SCBInitArgs = term() %%% Result = [TestResult] | {error,Reason} %%% @doc Run tests as specified by the combination of options in Opts. %%% The options are the same as those used with the -- cgit v1.2.3 From e34cd721545915266a00b1ec55a9a5867c8459a4 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 13:59:50 +0100 Subject: Update SCBs to use a specific id/1 function for SCb overriding instead of returning it from init/1. --- lib/common_test/src/ct_suite_callback.erl | 43 +++++----- lib/common_test/test/ct_suite_callback_SUITE.erl | 97 ++++++++++++++++------ .../scb/tests/crash_id_scb.erl | 34 ++++++++ .../scb/tests/crash_init_scb.erl | 6 +- .../scb/tests/empty_scb.erl | 26 ++++-- .../scb/tests/fail_post_suite_scb.erl | 4 +- .../scb/tests/fail_pre_suite_scb.erl | 4 +- .../scb/tests/id_no_init_scb.erl | 32 +++++++ .../scb/tests/minimal_scb.erl | 6 +- .../scb/tests/recover_post_suite_scb.erl | 4 +- .../scb/tests/same_id_scb.erl | 9 +- .../scb/tests/skip_post_suite_scb.erl | 4 +- .../scb/tests/skip_pre_suite_scb.erl | 4 +- .../scb/tests/state_update_scb.erl | 6 +- .../scb/tests/undef_scb.erl | 4 +- .../scb/tests/update_config_scb.erl | 4 +- 16 files changed, 206 insertions(+), 81 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 508d3b5bd6..947fa0c716 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -45,7 +45,7 @@ -spec init(State :: term()) -> ok | {error, Reason :: term()}. init(Opts) -> - call([{CB, call_init, undefined} || CB <- get_new_callbacks(Opts)], + call([{CB, call_id, undefined} || CB <- get_new_callbacks(Opts)], ok, init, []). @@ -130,12 +130,16 @@ on_tc_fail(_How, {_Suite, Case, Reason}) -> %% ------------------------------------------------------------------------- %% Internal Functions %% ------------------------------------------------------------------------- -call_init(Mod, Config, Meta) when is_atom(Mod) -> - call_init({Mod, []}, Config, Meta); -call_init({Mod, State}, Config, Scope) -> - {Id, NewState} = Mod:init(State), - {Config, {Id, scope(Scope), {Mod, NewState}}}. +call_id(Mod, Config, Meta) when is_atom(Mod) -> + call_id({Mod, []}, Config, Meta); +call_id({Mod, Opts}, Config, Scope) -> + Id = catch_apply(Mod,id,[Opts], make_ref()), + {Config, {Id, scope(Scope), {Mod, {Id,Opts}}}}. +call_init({Mod,{Id,Opts}},Config,_Meta) -> + NewState = Mod:init(Id, Opts), + {Config, {Mod, NewState}}. + call_terminate({Mod, State}, _, _) -> catch_apply(Mod,terminate,[State], ok), {[],{Mod,State}}. @@ -166,19 +170,20 @@ call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) -> NewReturn -> NewReturn end; -call([{CB, call_init, NextFun} | Rest], Config, Meta, CBs) -> +call([{CB, call_id, NextFun} | Rest], Config, Meta, CBs) -> try - {Config, {NewId, _, {Mod,_State}} = NewCB} = call_init(CB, Config, Meta), - {NewCBs, NewRest} = case lists:keyfind(NewId, 1, CBs) of - false when NextFun == undefined -> - {CBs ++ [NewCB],Rest}; - ExistingCB when is_tuple(ExistingCB) -> - {CBs, Rest}; - _ -> - {CBs ++ [NewCB],[{NewId, NextFun} | Rest]} - end, - ct_logs:log("Suite Callback","Started a SCB: Mod: ~p, Id: ~p", - [Mod,NewId]), + {Config, {NewId, _, _} = NewCB} = call_id(CB, Config, Meta), + {NewCBs, NewRest} = + case lists:keyfind(NewId, 1, CBs) of + false when NextFun =:= undefined -> + {CBs ++ [NewCB], + [{NewId, fun call_init/3} | Rest]}; + ExistingCB when is_tuple(ExistingCB) -> + {CBs, Rest}; + _ -> + {CBs ++ [NewCB], + [{NewId, fun call_init/3},{NewId,NextFun} | Rest]} + end, call(NewRest, Config, Meta, NewCBs) catch Error:Reason -> Trace = erlang:get_stacktrace(), @@ -237,7 +242,7 @@ terminate_if_scope_ends(CBId, Function, CBs) -> %% Fetch callback functions get_new_callbacks(Config, Fun) -> lists:foldl(fun(NewCB, Acc) -> - [{NewCB, call_init, Fun} | Acc] + [{NewCB, call_id, Fun} | Acc] end, [], get_new_callbacks(Config)). get_new_callbacks(Config) when is_list(Config) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index adb950614e..19feacad1d 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -72,7 +72,8 @@ all() -> all(suite) -> lists:reverse( [ - one_scb, two_scb, faulty_scb_no_init, faulty_scb_exit_in_init, + one_scb, two_scb, faulty_scb_no_init, faulty_scb_id_no_init, + faulty_scb_exit_in_init, faulty_scb_exit_in_id, faulty_scb_exit_in_init_scope_suite, minimal_scb, minimal_and_maximal_scb, faulty_scb_undef, scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, @@ -104,6 +105,11 @@ faulty_scb_no_init(Config) when is_list(Config) -> Config,{error,"Failed to start SCB, see the " "CT Log for details"}). +faulty_scb_id_no_init(Config) when is_list(Config) -> + do_test(faulty_scb_id_no_init, "ct_scb_empty_SUITE.erl",[id_no_init_scb], + Config,{error,"Failed to start SCB, see the " + "CT Log for details"}). + minimal_scb(Config) when is_list(Config) -> do_test(minimal_scb, "ct_scb_empty_SUITE.erl",[minimal_scb],Config). @@ -126,6 +132,12 @@ faulty_scb_exit_in_init(Config) when is_list(Config) -> {error,"Failed to start SCB, see the " "CT Log for details"}). +faulty_scb_exit_in_id(Config) when is_list(Config) -> + do_test(faulty_scb_exit_in_id, "ct_scb_empty_SUITE.erl", + [crash_id_scb], Config, + {error,"Failed to start SCB, see the " + "CT Log for details"}). + scope_per_suite_scb(Config) when is_list(Config) -> do_test(scope_per_suite_scb, "ct_scope_per_suite_scb_SUITE.erl", [],Config). @@ -243,7 +255,8 @@ events_to_check(Test, N) -> test_events(one_empty_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,id,[[]]}}, + {?eh,scb,{empty_scb,init,[{'_','_','_'},[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{empty_scb,pre_init_per_suite, @@ -270,8 +283,10 @@ test_events(one_empty_scb) -> test_events(two_empty_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, @@ -307,10 +322,21 @@ test_events(faulty_scb_no_init) -> {?eh,stop_logging,[]} ]; +test_events(faulty_scb_id_no_init) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {negative,{?eh,tc_start,'_'}, + {?eh,test_done,{'DEF','STOP_TIME'}}}, + {?eh,stop_logging,[]} + ]; + test_events(minimal_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {negative,{?eh,scb,{'_',id,['_',[]]}}, + {?eh,scb,{'_',init,['_',[]]}}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, @@ -327,8 +353,10 @@ test_events(minimal_scb) -> test_events(minimal_and_maximal_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',init,[[]]}}, + {negative,{?eh,scb,{'_',id,['_',[]]}}, + {?eh,scb,{'_',init,['_',[]]}}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, @@ -355,7 +383,7 @@ test_events(faulty_scb_undef) -> {failed,FailReasonStr}}, [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, @@ -378,7 +406,7 @@ test_events(faulty_scb_exit_in_init_scope_suite) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{'_',init_per_suite}}, - {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,init,['_',[]]}}, {?eh,tc_done, {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, {failed, @@ -401,17 +429,26 @@ test_events(faulty_scb_exit_in_init_scope_suite) -> test_events(faulty_scb_exit_in_init) -> [{?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,[[]]}}, + {?eh,scb,{empty_scb,init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]}]; +test_events(faulty_scb_exit_in_id) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{empty_scb,id,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {negative, {?eh,tc_start,'_'}, + {?eh,test_done,{'DEF','STOP_TIME'}}}, + {?eh,stop_logging,[]}]; + test_events(scope_per_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}}, @@ -435,7 +472,8 @@ test_events(scope_suite_scb) -> {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}}, @@ -462,7 +500,8 @@ test_events(scope_per_group_scb) -> {?eh,tc_done,{ct_scope_per_group_scb_SUITE,init_per_suite,ok}}, [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}}, {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}}, @@ -488,7 +527,8 @@ test_events(scope_per_suite_state_scb) -> {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',init,[[test]]}}, + {?eh,scb,{'_',id,[[test]]}}, + {?eh,scb,{'_',init,['_',[test]]}}, {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}}, {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,init_per_suite,ok}}, @@ -512,7 +552,8 @@ test_events(scope_suite_state_scb) -> {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',init,[[test]]}}, + {?eh,scb,{'_',id,[[test]]}}, + {?eh,scb,{'_',init,['_',[test]]}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}}, {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}}, {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,init_per_suite,ok}}, @@ -539,7 +580,8 @@ test_events(scope_per_group_state_scb) -> {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,init_per_suite,ok}}, [{?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]}}}, - {?eh,scb,{'_',init,[[test]]}}, + {?eh,scb,{'_',id,[[test]]}}, + {?eh,scb,{'_',init,['_',[test]]}}, {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}}, {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]},ok}}, @@ -563,7 +605,7 @@ test_events(scope_per_group_state_scb) -> test_events(fail_pre_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, @@ -603,7 +645,7 @@ test_events(fail_pre_suite_scb) -> test_events(fail_post_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, @@ -630,7 +672,7 @@ test_events(fail_post_suite_scb) -> test_events(skip_pre_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, @@ -653,7 +695,7 @@ test_events(skip_pre_suite_scb) -> test_events(skip_post_suite_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, @@ -678,7 +720,7 @@ test_events(recover_post_suite_scb) -> Suite = ct_scb_fail_per_suite_SUITE, [ {?eh,start_logging,'_'}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{Suite,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}}, @@ -707,7 +749,7 @@ test_events(recover_post_suite_scb) -> test_events(update_config_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}}, @@ -818,8 +860,8 @@ test_events(update_config_scb) -> test_events(state_update_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, + {?eh,scb,{'_',init,['_',[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{'_',init_per_suite}}, @@ -856,7 +898,7 @@ test_events(state_update_scb) -> test_events(options_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,[[test]]}}, + {?eh,scb,{empty_scb,init,['_',[test]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{empty_scb,pre_init_per_suite, @@ -883,8 +925,9 @@ test_events(options_scb) -> test_events(same_id_scb) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,[[]]}}, - {?eh,scb,{'_',init,[[]]}}, + {?eh,scb,{'_',id,[[]]}}, + {?eh,scb,{'_',init,[same_id_scb,[]]}}, + {?eh,scb,{'_',id,[[]]}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl new file mode 100644 index 0000000000..2c256c46df --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl @@ -0,0 +1,34 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(crash_id_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-export([id/1]). + +id(Opts) -> + empty_scb:id(Opts), + exit(diediedie). + diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl index 683459853f..c4138bbcef 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl @@ -26,9 +26,9 @@ %% Suite Callbacks --export([init/1]). +-export([init/2]). -init(Opts) -> - empty_scb:init(Opts), +init(Id, Opts) -> + empty_scb:init(Id, Opts), exit(diediedie). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl index d9aa1e77e4..a82ca02d04 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl @@ -35,7 +35,8 @@ -module(empty_scb). %% Suite Callbacks --export([init/1]). +-export([id/1]). +-export([init/2]). -export([pre_init_per_suite/3]). -export([post_init_per_suite/4]). @@ -68,16 +69,23 @@ -record(state, { id = ?MODULE :: term()}). %% @doc Always called before any other callback function. Use this to initiate -%% any common state. It should return an ID for this SCB and a state. The ID -%% is used to uniquly identify an SCB instance, if two SCB's return the same -%% ID the seconds SCB is ignored. This function should NOT have any side -%% effects as it might be called multiple times by common test. --spec init(Opts :: proplist()) -> +%% any common state. It should return an ID for this SCB and a state. +-spec init(Id :: term(), Opts :: proplist()) -> {Id :: term(), State :: #state{}}. -init(Opts) -> +init(Id, Opts) -> gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, init, [Opts]}}), - {now(), Opts}. + data = {?MODULE, init, [Id, Opts]}}), + Opts. + +%% @doc The ID is used to uniquly identify an SCB instance, if two SCB's +%% return the same ID the seconds SCB is ignored. This function should NOT +%% have any side effects as it might be called multiple times by common test. +-spec id(Opts :: proplist()) -> + Id :: term(). +id(Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), + data = {?MODULE, id, [Opts]}}), + now(). %% @doc Called before init_per_suite is called. Note that this callback is %% only called if the SCB is added before init_per_suite is run (eg. in a test diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl index b3a3a5f94c..44c72f6795 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl index d49387ff8c..90f10d7531 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State), diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl new file mode 100644 index 0000000000..11fb8d739f --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl @@ -0,0 +1,32 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(id_no_init_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-export([id/1]). + +id(Opts) -> + empty_scb:id(Opts). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl index e5fdbfb8a0..b3feb1383c 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl @@ -26,8 +26,8 @@ %% Suite Callbacks --export([init/1]). +-export([init/2]). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl index 864a09e3d0..26468f0789 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl index 6853aa52e8..0fa708d5b6 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl @@ -28,9 +28,12 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - {_,State} = empty_scb:init(Opts), - {?MODULE,State}. +id(Opts) -> + empty_scb:id(Opts), + ?MODULE. + +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl index a2e0578814..bb93ebee0f 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl index 4a0725ce2f..9818964e7f 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl index 1da0f7a6e4..13c50cf1a1 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl @@ -27,9 +27,9 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - {Id,State} = empty_scb:init(Opts), - {Id,[init|State]}. +init(Id, Opts) -> + State = empty_scb:init(Id, Opts), + [init|State]. pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State), diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl index 9479f9d937..1cb64574c3 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(_Suite, _Config, _State) -> lists:flaten([1,2,[3,4]]). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl index 6f21e49656..46a027403d 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl @@ -28,8 +28,8 @@ %% Suite Callbacks -compile(export_all). -init(Opts) -> - empty_scb:init(Opts). +init(Id, Opts) -> + empty_scb:init(Id, Opts). pre_init_per_suite(Suite, Config, State) -> empty_scb:pre_init_per_suite(Suite,Config,State), -- cgit v1.2.3 From ff8d3f0f39b0d1347cd94e1d0d3ab422ad7b06d7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 14:01:39 +0100 Subject: Fix bug where the state of an SCB was altered when no on_tc_* existed --- lib/common_test/src/ct_suite_callback.erl | 4 +-- lib/common_test/test/ct_suite_callback_SUITE.erl | 21 ++++++++++-- .../scb/tests/minimal_terminate_scb.erl | 38 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl index 947fa0c716..a93b05b1d2 100644 --- a/lib/common_test/src/ct_suite_callback.erl +++ b/lib/common_test/src/ct_suite_callback.erl @@ -34,8 +34,6 @@ -type proplist() :: [{atom(),term()}]. -define(config_name, suite_callbacks). --define(LOCK_STATE_TIMEOUT, 500). --define(LOCK_NAME, '$ct_suite_callback_lock'). %% ------------------------------------------------------------------------- %% API Functions @@ -146,7 +144,7 @@ call_terminate({Mod, State}, _, _) -> call_cleanup({Mod, State}, Reason, [Function | Args]) -> NewState = catch_apply(Mod,Function, Args ++ [Reason, State], - {Reason,State}), + State), {Reason, {Mod, NewState}}. call_generic({Mod, State}, Value, [Function | Args]) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl index 19feacad1d..67f3cf430a 100644 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ b/lib/common_test/test/ct_suite_callback_SUITE.erl @@ -81,7 +81,8 @@ all(suite) -> scope_suite_state_scb, fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, skip_post_suite_scb, recover_post_suite_scb, update_config_scb, - state_update_scb, options_scb, same_id_scb + state_update_scb, options_scb, same_id_scb, + fail_n_skip_with_minimal_scb ] ) . @@ -197,7 +198,10 @@ options_scb(Config) when is_list(Config) -> same_id_scb(Config) when is_list(Config) -> do_test(same_id_scb, "ct_scb_empty_SUITE.erl", [same_id_scb,same_id_scb],Config). - + +fail_n_skip_with_minimal_scb(Config) when is_list(Config) -> + do_test(fail_n_skip_with_minimal_scb, "ct_scb_fail_one_skip_one_SUITE.erl", + [minimal_terminate_scb],Config). %%%----------------------------------------------------------------- %%% HELP FUNCTIONS @@ -963,6 +967,17 @@ test_events(same_id_scb) -> {?eh,stop_logging,[]} ]; +test_events(fail_n_skip_with_minimal_scb) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,scb,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + + {?eh,tc_done,{'_',end_per_suite,ok}}, + {?eh,scb,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + test_events(ok) -> ok. @@ -995,7 +1010,7 @@ contains([],_) -> contains_parallel([Key | T], Elems) -> contains([Key],Elems), contains_parallel(T,Elems); -contains_parallel([],Elems) -> +contains_parallel([],_Elems) -> match. not_contains(List) -> diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl new file mode 100644 index 0000000000..3f76d2f47d --- /dev/null +++ b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl @@ -0,0 +1,38 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(minimal_terminate_scb). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% Suite Callbacks +-export([init/2]). +-export([terminate/1]). + +init(Id, Opts) -> + empty_scb:init(Id, Opts). + +terminate(State) -> + empty_scb:terminate(State). + + -- cgit v1.2.3 From ade343808a1a634bd39ab1c94ecadfd070a189de Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 15:49:32 +0100 Subject: Rename Suite Callback to Common Test Hook in code and testcases --- lib/common_test/src/Makefile | 4 +- lib/common_test/src/ct.erl | 8 +- lib/common_test/src/ct_framework.erl | 40 +- lib/common_test/src/ct_hooks.erl | 305 ++++++ lib/common_test/src/ct_hooks_lock.erl | 132 +++ lib/common_test/src/ct_run.erl | 110 +-- lib/common_test/src/ct_suite_callback.erl | 304 ------ lib/common_test/src/ct_suite_callback_lock.erl | 131 --- lib/common_test/src/ct_testspec.erl | 24 +- lib/common_test/src/ct_util.erl | 14 +- lib/common_test/src/ct_util.hrl | 2 +- lib/common_test/test/Makefile | 2 +- .../ct_error_SUITE_data/error/test/empty_scb.erl | 187 ---- lib/common_test/test/ct_hooks_SUITE.erl | 1021 ++++++++++++++++++++ .../ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl | 34 + .../cth/tests/crash_init_cth.erl | 34 + .../cth/tests/ct_cth_empty_SUITE.erl | 47 + .../cth/tests/ct_cth_fail_one_skip_one_SUITE.erl | 64 ++ .../cth/tests/ct_cth_fail_per_suite_SUITE.erl | 47 + .../ct_exit_in_init_scope_suite_cth_SUITE.erl | 50 + .../cth/tests/ct_scope_per_group_cth_SUITE.erl | 56 ++ .../tests/ct_scope_per_group_state_cth_SUITE.erl | 56 ++ .../cth/tests/ct_scope_per_suite_cth_SUITE.erl | 47 + .../tests/ct_scope_per_suite_state_cth_SUITE.erl | 47 + .../cth/tests/ct_scope_per_tc_cth_SUITE.erl | 110 +++ .../cth/tests/ct_scope_suite_cth_SUITE.erl | 50 + .../cth/tests/ct_scope_suite_state_cth_SUITE.erl | 50 + .../cth/tests/ct_update_config_SUITE.erl | 56 ++ .../ct_hooks_SUITE_data/cth/tests/empty_cth.erl | 277 ++++++ .../cth/tests/fail_post_suite_cth.erl | 72 ++ .../cth/tests/fail_pre_suite_cth.erl | 72 ++ .../cth/tests/id_no_init_cth.erl | 32 + .../ct_hooks_SUITE_data/cth/tests/minimal_cth.erl | 33 + .../cth/tests/minimal_terminate_cth.erl | 38 + .../cth/tests/recover_post_suite_cth.erl | 74 ++ .../ct_hooks_SUITE_data/cth/tests/same_id_cth.erl | 75 ++ .../cth/tests/skip_post_suite_cth.erl | 72 ++ .../cth/tests/skip_pre_suite_cth.erl | 73 ++ .../cth/tests/state_update_cth.erl | 83 ++ .../ct_hooks_SUITE_data/cth/tests/undef_cth.erl | 71 ++ .../cth/tests/update_config_cth.erl | 82 ++ lib/common_test/test/ct_suite_callback_SUITE.erl | 1021 -------------------- .../scb/tests/crash_id_scb.erl | 34 - .../scb/tests/crash_init_scb.erl | 34 - .../ct_exit_in_init_scope_suite_scb_SUITE.erl | 50 - .../scb/tests/ct_scb_empty_SUITE.erl | 47 - .../scb/tests/ct_scb_fail_one_skip_one_SUITE.erl | 64 -- .../scb/tests/ct_scb_fail_per_suite_SUITE.erl | 47 - .../scb/tests/ct_scope_per_group_scb_SUITE.erl | 56 -- .../tests/ct_scope_per_group_state_scb_SUITE.erl | 56 -- .../scb/tests/ct_scope_per_suite_scb_SUITE.erl | 47 - .../tests/ct_scope_per_suite_state_scb_SUITE.erl | 47 - .../scb/tests/ct_scope_per_tc_scb_SUITE.erl | 110 --- .../scb/tests/ct_scope_suite_scb_SUITE.erl | 50 - .../scb/tests/ct_scope_suite_state_scb_SUITE.erl | 50 - .../scb/tests/ct_update_config_SUITE.erl | 56 -- .../scb/tests/empty_scb.erl | 277 ------ .../scb/tests/fail_post_suite_scb.erl | 72 -- .../scb/tests/fail_pre_suite_scb.erl | 72 -- .../scb/tests/id_no_init_scb.erl | 32 - .../scb/tests/minimal_scb.erl | 33 - .../scb/tests/minimal_terminate_scb.erl | 38 - .../scb/tests/recover_post_suite_scb.erl | 74 -- .../scb/tests/same_id_scb.erl | 75 -- .../scb/tests/skip_post_suite_scb.erl | 72 -- .../scb/tests/skip_pre_suite_scb.erl | 73 -- .../scb/tests/state_update_scb.erl | 83 -- .../scb/tests/undef_scb.erl | 71 -- .../scb/tests/update_config_scb.erl | 82 -- 69 files changed, 3362 insertions(+), 3547 deletions(-) create mode 100644 lib/common_test/src/ct_hooks.erl create mode 100644 lib/common_test/src/ct_hooks_lock.erl delete mode 100644 lib/common_test/src/ct_suite_callback.erl delete mode 100644 lib/common_test/src/ct_suite_callback_lock.erl delete mode 100644 lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl create mode 100644 lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl delete mode 100644 lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile index abf7816a91..378a7ba08c 100644 --- a/lib/common_test/src/Makefile +++ b/lib/common_test/src/Makefile @@ -68,8 +68,8 @@ MODULES= \ ct_config_plain \ ct_config_xml \ ct_slave \ - ct_suite_callback\ - ct_suite_callback_lock + ct_hooks\ + ct_hooks_lock TARGET_MODULES= $(MODULES:%=$(EBIN)/%) diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl index eb0eceeb46..b0a92dcc15 100644 --- a/lib/common_test/src/ct.erl +++ b/lib/common_test/src/ct.erl @@ -149,7 +149,7 @@ run(TestDirs) -> %%% {repeat,N} | {duration,DurTime} | {until,StopTime} | %%% {force_stop,Bool} | {decrypt,DecryptKeyOrFile} | %%% {refresh_logs,LogDir} | {basic_html,Bool} | -%%% {suite_callbacks, SCBs} +%%% {ct_hooks, CTHs} %%% TestDirs = [string()] | string() %%% Suites = [string()] | string() %%% Cases = [atom()] | atom() @@ -177,9 +177,9 @@ run(TestDirs) -> %%% DecryptKeyOrFile = {key,DecryptKey} | {file,DecryptFile} %%% DecryptKey = string() %%% DecryptFile = string() -%%% SCBs = [SCBModule | {SCBModule, SCBInitArgs}] -%%% SCBModule = atom() -%%% SCBInitArgs = term() +%%% CTHs = [CTHModule | {CTHModule, CTHInitArgs}] +%%% CTHModule = atom() +%%% CTHInitArgs = term() %%% Result = [TestResult] | {error,Reason} %%% @doc Run tests as specified by the combination of options in Opts. %%% The options are the same as those used with the diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl index d05c30f5e1..04829004f4 100644 --- a/lib/common_test/src/ct_framework.erl +++ b/lib/common_test/src/ct_framework.erl @@ -229,7 +229,7 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) -> end. ct_suite_init(Mod, Func, [Config]) when is_list(Config) -> - case ct_suite_callback:init_tc( Mod, Func, Config) of + case ct_hooks:init_tc( Mod, Func, Config) of NewConfig when is_list(NewConfig) -> {ok, [NewConfig]}; Else -> @@ -251,9 +251,9 @@ add_defaults(Mod,Func,FuncInfo,DoInit) -> (_) -> false end, SuiteInfo) of true -> - SuiteInfoNoSCB = - lists:keydelete(suite_callbacks,1,SuiteInfo), - SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfoNoSCB), + SuiteInfoNoCTH = + lists:keydelete(ct_hooks,1,SuiteInfo), + SuiteInfo1 = merge_with_suite_defaults(Mod,SuiteInfoNoCTH), case add_defaults1(Mod,Func,FuncInfo,SuiteInfo1,DoInit) of Error = {error,_} -> {SuiteInfo1,Error}; MergedInfo -> {SuiteInfo1,MergedInfo} @@ -376,8 +376,8 @@ configure([{timetrap,off}|Rest],Info,SuiteInfo,Scope,Config) -> configure([{timetrap,Time}|Rest],Info,SuiteInfo,Scope,Config) -> Dog = test_server:timetrap(Time), configure(Rest,Info,SuiteInfo,Scope,[{watchdog,Dog}|Config]); -configure([{suite_callbacks, CB} | Rest], Info, SuiteInfo, Scope, Config) -> - configure(Rest, Info, SuiteInfo, Scope, [{suite_callbacks, CB} | Config]); +configure([{ct_hooks, Hook} | Rest], Info, SuiteInfo, Scope, Config) -> + configure(Rest, Info, SuiteInfo, Scope, [{ct_hooks, Hook} | Config]); configure([_|Rest],Info,SuiteInfo,Scope,Config) -> configure(Rest,Info,SuiteInfo,Scope,Config); configure([],_,_,_,Config) -> @@ -487,7 +487,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> case get('$test_server_framework_test') of undefined -> {FinalResult,FinalNotify} = - case ct_suite_callback:end_tc( + case ct_hooks:end_tc( Mod, FuncSpec, Args, Result, Return) of '$ct_no_change' -> {FinalResult = ok,Result}; @@ -499,7 +499,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) -> ct_event:sync_notify(#event{name=tc_done, node=node(), data={Mod,FuncSpec, - tag_scb(FinalNotify)}}); + tag_cth(FinalNotify)}}); Fun -> % send sync notification so that event handlers may print % in the log file before it gets closed @@ -545,19 +545,19 @@ tag(E = testcase_aborted_or_killed) -> tag(Other) -> Other. -tag_scb({STag,Reason}) when STag == skip; STag == skipped -> +tag_cth({STag,Reason}) when STag == skip; STag == skipped -> {skipped,Reason}; -tag_scb({fail, Reason}) -> +tag_cth({fail, Reason}) -> {failed, {error,Reason}}; -tag_scb(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; +tag_cth(E = {ETag,_}) when ETag == error; ETag == 'EXIT'; ETag == timetrap_timeout; ETag == testcase_aborted -> {failed,E}; -tag_scb(E = testcase_aborted_or_killed) -> +tag_cth(E = testcase_aborted_or_killed) -> {failed,E}; -tag_scb(List) when is_list(List) -> +tag_cth(List) when is_list(List) -> ok; -tag_scb(Other) -> +tag_cth(Other) -> Other. %%%----------------------------------------------------------------- @@ -1188,13 +1188,13 @@ report(What,Data) -> {_Suite,Case,Result} = Data, case Result of {failed, _} -> - ct_suite_callback:on_tc_fail(What, Data); + ct_hooks:on_tc_fail(What, Data); {skipped,{failed,{_,init_per_testcase,_}}} -> - ct_suite_callback:on_tc_skip(tc_auto_skip, Data); + ct_hooks:on_tc_skip(tc_auto_skip, Data); {skipped,{require_failed,_}} -> - ct_suite_callback:on_tc_skip(tc_auto_skip, Data); + ct_hooks:on_tc_skip(tc_auto_skip, Data); {skipped,_} -> - ct_suite_callback:on_tc_skip(tc_user_skip, Data); + ct_hooks:on_tc_skip(tc_user_skip, Data); _Else -> ok end, @@ -1224,7 +1224,7 @@ report(What,Data) -> ct_event:sync_notify(#event{name=tc_user_skip, node=node(), data=Data}), - ct_suite_callback:on_tc_skip(What, Data), + ct_hooks:on_tc_skip(What, Data), add_to_stats(user_skipped); tc_auto_skip -> %% test case skipped because of error in init_per_suite @@ -1237,7 +1237,7 @@ report(What,Data) -> ct_event:sync_notify(#event{name=tc_auto_skip, node=node(), data=Data}), - ct_suite_callback:on_tc_skip(What, Data), + ct_hooks:on_tc_skip(What, Data), if Case /= end_per_suite, Case /= end_per_group -> add_to_stats(auto_skipped); true -> diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl new file mode 100644 index 0000000000..8e80ce8f37 --- /dev/null +++ b/lib/common_test/src/ct_hooks.erl @@ -0,0 +1,305 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Framework test execution control module. +%%% +%%%

This module is a proxy for calling and handling common test hooks.

+ +-module(ct_hooks). + +%% API Exports +-export([init/1]). +-export([init_tc/3]). +-export([end_tc/5]). +-export([terminate/1]). +-export([on_tc_skip/2]). +-export([on_tc_fail/2]). + +-type proplist() :: [{atom(),term()}]. + +%% If you change this, remember to update ct_util:look -> stop clause as well. +-define(config_name, ct_hooks). + +%% ------------------------------------------------------------------------- +%% API Functions +%% ------------------------------------------------------------------------- + +%% @doc Called before any suites are started +-spec init(State :: term()) -> ok | + {error, Reason :: term()}. +init(Opts) -> + call([{Hook, call_id, undefined} || Hook <- get_new_hooks(Opts)], + ok, init, []). + + +%% @doc Called after all suites are done. +-spec terminate(Hooks :: term()) -> + ok. +terminate(Hooks) -> + call([{HookId, fun call_terminate/3} || {HookId,_,_} <- Hooks], + ct_hooks_terminate_dummy, terminate, Hooks), + ok. + +%% @doc Called as each test case is started. This includes all configuration +%% tests. +-spec init_tc(Mod :: atom(), Func :: atom(), Args :: list()) -> + NewConfig :: proplist() | + {skip, Reason :: term()} | + {auto_skip, Reason :: term()} | + {fail, Reason :: term()}. +init_tc(ct_framework, _Func, Args) -> + Args; +init_tc(Mod, init_per_suite, Config) -> + Info = case catch proplists:get_value(ct_hooks, Mod:suite()) of + List when is_list(List) -> + [{ct_hooks,List}]; + _Else -> + [] + end, + call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]); +init_tc(Mod, end_per_suite, Config) -> + call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); +init_tc(Mod, {init_per_group, GroupName, Opts}, Config) -> + maybe_start_locker(Mod, GroupName, Opts), + call(fun call_generic/3, Config, [pre_init_per_group, GroupName]); +init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> + call(fun call_generic/3, Config, [pre_end_per_group, GroupName]); +init_tc(_Mod, TC, Config) -> + call(fun call_generic/3, Config, [pre_init_per_testcase, TC]). + +%% @doc Called as each test case is completed. This includes all configuration +%% tests. +-spec end_tc(Mod :: atom(), + Func :: atom(), + Args :: list(), + Result :: term(), + Resturn :: term()) -> + NewConfig :: proplist() | + {skip, Reason :: term()} | + {auto_skip, Reason :: term()} | + {fail, Reason :: term()} | + ok. +end_tc(ct_framework, _Func, _Args, Result, _Return) -> + Result; + +end_tc(Mod, init_per_suite, Config, _Result, Return) -> + call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config], + '$ct_no_change'); + +end_tc(Mod, end_per_suite, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config], + '$ct_no_change'); + +end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) -> + call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config], + '$ct_no_change'); + +end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) -> + Res = call(fun call_generic/3, Result, + [post_end_per_group, GroupName, Config], '$ct_no_change'), + maybe_stop_locker(Mod, GroupName,Opts), + Res; + +end_tc(_Mod, TC, Config, Result, _Return) -> + call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config], + '$ct_no_change'). + +on_tc_skip(How, {_Suite, Case, Reason}) -> + call(fun call_cleanup/3, {How, Reason}, [on_tc_skip, Case]). + +on_tc_fail(_How, {_Suite, Case, Reason}) -> + call(fun call_cleanup/3, Reason, [on_tc_fail, Case]). + +%% ------------------------------------------------------------------------- +%% Internal Functions +%% ------------------------------------------------------------------------- +call_id(Mod, Config, Meta) when is_atom(Mod) -> + call_id({Mod, []}, Config, Meta); +call_id({Mod, Opts}, Config, Scope) -> + Id = catch_apply(Mod,id,[Opts], make_ref()), + {Config, {Id, scope(Scope), {Mod, {Id,Opts}}}}. + +call_init({Mod,{Id,Opts}},Config,_Meta) -> + NewState = Mod:init(Id, Opts), + {Config, {Mod, NewState}}. + +call_terminate({Mod, State}, _, _) -> + catch_apply(Mod,terminate,[State], ok), + {[],{Mod,State}}. + +call_cleanup({Mod, State}, Reason, [Function | Args]) -> + NewState = catch_apply(Mod,Function, Args ++ [Reason, State], + State), + {Reason, {Mod, NewState}}. + +call_generic({Mod, State}, Value, [Function | Args]) -> + {NewValue, NewState} = catch_apply(Mod, Function, Args ++ [Value, State], + {Value,State}), + {NewValue, {Mod, NewState}}. + +%% Generic call function +call(Fun, Config, Meta) -> + maybe_lock(), + Hooks = get_hooks(), + Res = call([{HookId,Fun} || {HookId,_, _} <- Hooks] ++ + get_new_hooks(Config, Fun), + remove(?config_name,Config), Meta, Hooks), + maybe_unlock(), + Res. + +call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) -> + case call(Fun,Config,Meta) of + Config -> NoChangeRet; + NewReturn -> NewReturn + end; + +call([{Hook, call_id, NextFun} | Rest], Config, Meta, Hooks) -> + try + {Config, {NewId, _, _} = NewHook} = call_id(Hook, Config, Meta), + {NewHooks, NewRest} = + case lists:keyfind(NewId, 1, Hooks) of + false when NextFun =:= undefined -> + {Hooks ++ [NewHook], + [{NewId, fun call_init/3} | Rest]}; + ExistingHook when is_tuple(ExistingHook) -> + {Hooks, Rest}; + _ -> + {Hooks ++ [NewHook], + [{NewId, fun call_init/3},{NewId,NextFun} | Rest]} + end, + call(NewRest, Config, Meta, NewHooks) + catch Error:Reason -> + Trace = erlang:get_stacktrace(), + ct_logs:log("Suite Hook","Failed to start a CTH: ~p:~p", + [Error,{Reason,Trace}]), + call([], {fail,"Failed to start CTH" + ", see the CT Log for details"}, Meta, Hooks) + end; +call([{HookId, Fun} | Rest], Config, Meta, Hooks) -> + try + {_,Scope,ModState} = lists:keyfind(HookId, 1, Hooks), + {NewConf, NewHookInfo} = Fun(ModState, Config, Meta), + NewCalls = get_new_hooks(NewConf, Fun), + NewHooks = lists:keyreplace(HookId, 1, Hooks, {HookId, Scope, NewHookInfo}), + call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, + terminate_if_scope_ends(HookId, Meta, NewHooks)) + catch throw:{error_in_cth_call,Reason} -> + call(Rest, {fail, Reason}, Meta, + terminate_if_scope_ends(HookId, Meta, Hooks)) + end; +call([], Config, _Meta, Hooks) -> + save_suite_data_async(Hooks), + Config. + +remove(Key,List) when is_list(List) -> + [Conf || Conf <- List, is_tuple(Conf) =:= false + orelse element(1, Conf) =/= Key]; +remove(_, Else) -> + Else. + +%% Translate scopes, i.e. init_per_group,group1 -> end_per_group,group1 etc +scope([pre_init_per_testcase, TC|_]) -> + [post_end_per_testcase, TC]; +scope([pre_init_per_group, GroupName|_]) -> + [post_end_per_group, GroupName]; +scope([post_init_per_group, GroupName|_]) -> + [post_end_per_group, GroupName]; +scope([pre_init_per_suite, SuiteName|_]) -> + [post_end_per_suite, SuiteName]; +scope([post_init_per_suite, SuiteName|_]) -> + [post_end_per_suite, SuiteName]; +scope(init) -> + none. + +terminate_if_scope_ends(HookId, [Function,Tag|T], Hooks) when T =/= [] -> + terminate_if_scope_ends(HookId,[Function,Tag],Hooks); +terminate_if_scope_ends(HookId, Function, Hooks) -> + case lists:keyfind(HookId, 1, Hooks) of + {HookId, Function, _ModState} = Hook -> + terminate([Hook]), + lists:keydelete(HookId, 1, Hooks); + _ -> + Hooks + end. + +%% Fetch hook functions +get_new_hooks(Config, Fun) -> + lists:foldl(fun(NewHook, Acc) -> + [{NewHook, call_id, Fun} | Acc] + end, [], get_new_hooks(Config)). + +get_new_hooks(Config) when is_list(Config) -> + lists:flatmap(fun({?config_name, HookConfigs}) -> + HookConfigs; + (_) -> + [] + end, Config); +get_new_hooks(_Config) -> + []. + +save_suite_data_async(Hooks) -> + ct_util:save_suite_data_async(?config_name, Hooks). + +get_hooks() -> + ct_util:read_suite_data(?config_name). + +catch_apply(M,F,A, Default) -> + try + apply(M,F,A) + catch error:Reason -> + case erlang:get_stacktrace() of + %% Return the default if it was the CTH module which did not have the function. + [{M,F,A}|_] when Reason == undef -> + Default; + Trace -> + ct_logs:log("Suite Hook","Call to CTH failed: ~p:~p", + [error,{Reason,Trace}]), + throw({error_in_cth_call, + lists:flatten( + io_lib:format("~p:~p/~p CTH call failed", + [M,F,length(A)]))}) + end + end. + + +%% We need to lock around the state for parallel groups only. This is because +%% we will get several processes reading and writing the state for a single +%% cth at the same time. +maybe_start_locker(Mod,GroupName,Opts) -> + case lists:member(parallel,Opts) of + true -> + {ok, _Pid} = ct_hooks_lock:start({Mod,GroupName}); + false -> + ok + end. + +maybe_stop_locker(Mod,GroupName,Opts) -> + case lists:member(parallel,Opts) of + true -> + stopped = ct_hooks_lock:stop({Mod,GroupName}); + false -> + ok + end. + + +maybe_lock() -> + locked = ct_hooks_lock:request(). + +maybe_unlock() -> + unlocked = ct_hooks_lock:release(). diff --git a/lib/common_test/src/ct_hooks_lock.erl b/lib/common_test/src/ct_hooks_lock.erl new file mode 100644 index 0000000000..98794201bb --- /dev/null +++ b/lib/common_test/src/ct_hooks_lock.erl @@ -0,0 +1,132 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Framework test execution control module. +%%% +%%%

This module is a proxy for calling and handling locks in +%%% common test hooks.

+ +-module(ct_hooks_lock). + +-behaviour(gen_server). + +%% API +-export([start/1, stop/1, request/0, release/0]). + +%% gen_server callbacks +-export([init/1, handle_call/3, handle_cast/2, handle_info/2, + terminate/2, code_change/3]). + +-define(SERVER, ?MODULE). + +-record(state, { id, locked = false, requests = [] }). + +%%%=================================================================== +%%% API +%%%=================================================================== + +%% @doc Starts the server +start(Id) -> + case gen_server:start({local, ?SERVER}, ?MODULE, Id, []) of + {error,{already_started, Pid}} -> + {ok,Pid}; + Else -> + Else + end. + +stop(Id) -> + try + gen_server:call(?SERVER, {stop,Id}) + catch exit:{noproc,_} -> + stopped + end. + +request() -> + try + gen_server:call(?SERVER,{request,self()},infinity) + catch exit:{noproc,_} -> + locked + end. + +release() -> + try + gen_server:call(?SERVER,{release,self()}) + catch exit:{noproc,_} -> + unlocked + end. + +%%%=================================================================== +%%% gen_server callbacks +%%%=================================================================== + +%% @doc Initiates the server +init(Id) -> + {ok, #state{ id = Id }}. + +%% @doc Handling call messages +handle_call({stop,Id}, _From, #state{ id = Id, requests = Reqs } = State) -> + [gen_server:reply(Req, locker_stopped) || {Req,_ReqId} <- Reqs], + {stop, normal, stopped, State}; +handle_call({stop,_Id}, _From, State) -> + {reply, stopped, State}; +handle_call({request, Pid}, _From, #state{ locked = false, + requests = [] } = State) -> + Ref = monitor(process, Pid), + {reply, locked, State#state{ locked = {true, Pid, Ref}} }; +handle_call({request, Pid}, From, #state{ requests = Reqs } = State) -> + {noreply, State#state{ requests = Reqs ++ [{From,Pid}] }}; +handle_call({release, Pid}, _From, #state{ locked = {true, Pid, Ref}, + requests = []} = State) -> + demonitor(Ref,[flush]), + {reply, unlocked, State#state{ locked = false }}; +handle_call({release, Pid}, _From, + #state{ locked = {true, Pid, Ref}, + requests = [{NextFrom,NextPid}|Rest]} = State) -> + demonitor(Ref,[flush]), + gen_server:reply(NextFrom,locked), + NextRef = monitor(process, NextPid), + {reply,unlocked,State#state{ locked = {true, NextPid, NextRef}, + requests = Rest } }; +handle_call({release, _Pid}, _From, State) -> + {reply, not_locked, State}. + +%% @doc Handling cast messages +handle_cast(_Msg, State) -> + {noreply, State}. + +%% @doc Handling all non call/cast messages +handle_info({'DOWN',Ref,process,Pid,_}, + #state{ locked = {true, Pid, Ref}, + requests = [{NextFrom,NextPid}|Rest] } = State) -> + gen_server:reply(NextFrom, locked), + NextRef = monitor(process, NextPid), + {noreply,State#state{ locked = {true, NextPid, NextRef}, + requests = Rest } }. + +%% @doc This function is called by a gen_server when it is about to terminate. +terminate(_Reason, _State) -> + ok. + +%% @doc Convert process state when code is changed +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%% ------------------------------------------------------------------------- +%% Internal Functions +%% ------------------------------------------------------------------------- diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index a12d4d6f18..36fccf65f3 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -54,7 +54,7 @@ logdir, config = [], event_handlers = [], - suite_callbacks = [], + ct_hooks = [], include = [], silent_connections, stylesheet, @@ -172,7 +172,7 @@ script_start1(Parent, Args) -> ([]) -> true end, false, Args), EvHandlers = event_handler_args2opts(Args), - SuiteCBs = suite_callbacks_args2opts(Args), + CTHooks = ct_hooks_args2opts(Args), %% check flags and set corresponding application env variables @@ -236,7 +236,7 @@ script_start1(Parent, Args) -> StartOpts = #opts{label = Label, vts = Vts, shell = Shell, cover = Cover, logdir = LogDir, event_handlers = EvHandlers, - suite_callbacks = SuiteCBs, + ct_hooks = CTHooks, include = IncludeDirs, silent_connections = SilentConns, stylesheet = Stylesheet, @@ -308,9 +308,9 @@ script_start2(StartOpts = #opts{vts = undefined, SpecStartOpts#opts.scale_timetraps), AllEvHs = merge_vals([StartOpts#opts.event_handlers, SpecStartOpts#opts.event_handlers]), - AllSuiteCBs = merge_vals( - [StartOpts#opts.suite_callbacks, - SpecStartOpts#opts.suite_callbacks]), + AllCTHooks = merge_vals( + [StartOpts#opts.ct_hooks, + SpecStartOpts#opts.ct_hooks]), AllInclude = merge_vals([StartOpts#opts.include, SpecStartOpts#opts.include]), @@ -322,7 +322,7 @@ script_start2(StartOpts = #opts{vts = undefined, logdir = LogDir, config = SpecStartOpts#opts.config, event_handlers = AllEvHs, - suite_callbacks = AllSuiteCBs, + ct_hooks = AllCTHooks, include = AllInclude, multiply_timetraps = MultTT, scale_timetraps = ScaleTT}} @@ -341,7 +341,7 @@ script_start2(StartOpts = #opts{vts = undefined, {undefined,_} -> % no testspec used case check_and_install_configfiles(InitConfig, TheLogDir, Opts#opts.event_handlers, - Opts#opts.suite_callbacks) of + Opts#opts.ct_hooks) of ok -> % go on read tests from start flags script_start3(Opts#opts{config=InitConfig, logdir=TheLogDir}, Args); @@ -353,7 +353,7 @@ script_start2(StartOpts = #opts{vts = undefined, AllConfig = merge_vals([InitConfig, Opts#opts.config]), case check_and_install_configfiles(AllConfig, TheLogDir, Opts#opts.event_handlers, - Opts#opts.suite_callbacks) of + Opts#opts.ct_hooks) of ok -> % read tests from spec {Run,Skip} = ct_testspec:prepare_tests(Terms, node()), do_run(Run, Skip, Opts#opts{config=AllConfig, @@ -369,7 +369,7 @@ script_start2(StartOpts, Args) -> LogDir = which(logdir, StartOpts#opts.logdir), case check_and_install_configfiles(InitConfig, LogDir, StartOpts#opts.event_handlers, - StartOpts#opts.suite_callbacks) of + StartOpts#opts.ct_hooks) of ok -> % go on read tests from start flags script_start3(StartOpts#opts{config=InitConfig, logdir=LogDir}, Args); @@ -377,12 +377,12 @@ script_start2(StartOpts, Args) -> Error end. -check_and_install_configfiles(Configs, LogDir, EvHandlers, SuiteCBs) -> +check_and_install_configfiles(Configs, LogDir, EvHandlers, CTHooks) -> case ct_config:check_config_files(Configs) of false -> install([{config,Configs}, {event_handler,EvHandlers}, - {suite_callbacks,SuiteCBs}], LogDir); + {ct_hooks,CTHooks}], LogDir); {value,{error,{nofile,File}}} -> {error,{cant_read_config_file,File}}; {value,{error,{wrong_config,Message}}}-> @@ -450,13 +450,13 @@ script_start4(#opts{vts = true, config = Config, event_handlers = EvHandlers, script_start4(#opts{label = Label, shell = true, config = Config, event_handlers = EvHandlers, - suite_callbacks = SuiteCBs, + ct_hooks = CTHooks, logdir = LogDir, testspecs = Specs}, _Args) -> %% label - used by ct_logs application:set_env(common_test, test_label, Label), InstallOpts = [{config,Config},{event_handler,EvHandlers}, - {suite_callbacks, SuiteCBs}], + {ct_hooks, CTHooks}], if Config == [] -> ok; true -> @@ -522,7 +522,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" - "\n\t[-suite_callbacks SuiteCB1 SuiteCB2 .. SuiteCBN]" + "\n\t[-ct_hooks CTHook1 CTHook2 .. CTHookN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" @@ -541,7 +541,7 @@ script_usage() -> "\n\t[-stylesheet CSSFile]" "\n\t[-cover CoverCfgFile]" "\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]" - "\n\t[-suite_callbacks SuiteCB1 SuiteCB2 .. SuiteCBN]" + "\n\t[-ct_hooks CTHook1 CTHook2 .. CTHookN]" "\n\t[-include InclDir1 InclDir2 .. InclDirN]" "\n\t[-no_auto_compile]" "\n\t[-multiply_timetraps N]" @@ -680,8 +680,8 @@ run_test1(StartOpts) -> end, Hs)) end, - %% Suite Callbacks - SuiteCBs = get_start_opt(suite_callbacks, value, [], StartOpts), + %% CT Hooks + CTHooks = get_start_opt(ct_hooks, value, [], StartOpts), %% silent connections SilentConns = get_start_opt(silent_connections, @@ -753,7 +753,7 @@ run_test1(StartOpts) -> Opts = #opts{label = Label, cover = Cover, step = Step, logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers, - suite_callbacks = SuiteCBs, + ct_hooks = CTHooks, include = Include, silent_connections = SilentConns, stylesheet = Stylesheet, @@ -806,15 +806,15 @@ run_spec_file(Relaxed, AllInclude = merge_vals([Opts#opts.include, SpecOpts#opts.include]), - AllSuiteCBs = merge_vals([Opts#opts.suite_callbacks, - SpecOpts#opts.suite_callbacks]), + AllCTHooks = merge_vals([Opts#opts.ct_hooks, + SpecOpts#opts.ct_hooks]), application:set_env(common_test, include, AllInclude), case check_and_install_configfiles(AllConfig, which(logdir,LogDir), AllEvHs, - AllSuiteCBs) of + AllCTHooks) of ok -> Opts1 = Opts#opts{label = Label, cover = Cover, @@ -825,7 +825,7 @@ run_spec_file(Relaxed, testspecs = AbsSpecs, multiply_timetraps = MultTT, scale_timetraps = ScaleTT, - suite_callbacks = AllSuiteCBs}, + ct_hooks = AllCTHooks}, {Run,Skip} = ct_testspec:prepare_tests(TS, node()), reformat_result(catch do_run(Run, Skip, Opts1, StartOpts)); {error,GCFReason} -> @@ -836,11 +836,11 @@ run_spec_file(Relaxed, run_prepared(Run, Skip, Opts = #opts{logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers, - suite_callbacks = SuiteCBs}, + ct_hooks = CTHooks}, StartOpts) -> LogDir1 = which(logdir, LogDir), case check_and_install_configfiles(CfgFiles, LogDir1, - EvHandlers, SuiteCBs) of + EvHandlers, CTHooks) of ok -> reformat_result(catch do_run(Run, Skip, Opts#opts{logdir = LogDir1}, StartOpts)); @@ -872,7 +872,7 @@ check_config_file(Callback, File)-> run_dir(Opts = #opts{logdir = LogDir, config = CfgFiles, event_handlers = EvHandlers, - suite_callbacks = SuiteCB }, StartOpts) -> + ct_hooks = CTHook }, StartOpts) -> LogDir1 = which(logdir, LogDir), Opts1 = Opts#opts{logdir = LogDir1}, AbsCfgFiles = @@ -895,7 +895,7 @@ run_dir(Opts = #opts{logdir = LogDir, end, CfgFiles), case install([{config,AbsCfgFiles}, {event_handler,EvHandlers}, - {suite_callbacks, SuiteCB}], LogDir1) of + {ct_hooks, CTHook}], LogDir1) of ok -> ok; {error,IReason} -> exit(IReason) end, @@ -1001,7 +1001,7 @@ run_testspec1(TestSpec) -> LogDir1 = which(logdir,Opts#opts.logdir), case check_and_install_configfiles(Opts#opts.config, LogDir1, Opts#opts.event_handlers, - Opts#opts.suite_callbacks) of + Opts#opts.ct_hooks) of ok -> Opts1 = Opts#opts{testspecs = [], logdir = LogDir1, @@ -1019,7 +1019,7 @@ get_data_for_node(#testspec{label = Labels, config = Cfgs, userconfig = UsrCfgs, event_handler = EvHs, - suite_callbacks = SuCBs, + ct_hooks = CTHooks, include = Incl, multiply_timetraps = MTs, scale_timetraps = STs}, Node) -> @@ -1034,14 +1034,14 @@ get_data_for_node(#testspec{label = Labels, ConfigFiles = [{?ct_config_txt,F} || {N,F} <- Cfgs, N==Node] ++ [CBF || {N,CBF} <- UsrCfgs, N==Node], EvHandlers = [{H,A} || {N,H,A} <- EvHs, N==Node], - SuiteCBs = [CB || {N,CB} <- SuCBs, N==Node], + FiltCTHooks = [Hook || {N,Hook} <- CTHooks, N==Node], Include = [I || {N,I} <- Incl, N==Node], #opts{label = Label, logdir = LogDir, cover = Cover, config = ConfigFiles, event_handlers = EvHandlers, - suite_callbacks = SuiteCBs, + ct_hooks = FiltCTHooks, include = Include, multiply_timetraps = MT, scale_timetraps = ST}. @@ -2074,23 +2074,23 @@ get_start_opt(Key, IfExists, IfNotExists, Args) -> IfNotExists end. -suite_callbacks_args2opts(Args) -> - suite_callbacks_args2opts( - proplists:get_value(suite_callbacks, Args, []),[]). - -suite_callbacks_args2opts([SCB,Arg,"and"| Rest],Acc) -> - suite_callbacks_args2opts(Rest,[{list_to_atom(SCB), - parse_scb_args(Arg)}|Acc]); -suite_callbacks_args2opts([SCB], Acc) -> - suite_callbacks_args2opts([SCB,"and"],Acc); -suite_callbacks_args2opts([SCB, "and" | Rest], Acc) -> - suite_callbacks_args2opts(Rest,[list_to_atom(SCB)|Acc]); -suite_callbacks_args2opts([SCB, Args], Acc) -> - suite_callbacks_args2opts([SCB, Args, "and"],Acc); -suite_callbacks_args2opts([],Acc) -> +ct_hooks_args2opts(Args) -> + ct_hooks_args2opts( + proplists:get_value(ct_hooks, Args, []),[]). + +ct_hooks_args2opts([CTH,Arg,"and"| Rest],Acc) -> + ct_hooks_args2opts(Rest,[{list_to_atom(CTH), + parse_cth_args(Arg)}|Acc]); +ct_hooks_args2opts([CTH], Acc) -> + ct_hooks_args2opts([CTH,"and"],Acc); +ct_hooks_args2opts([CTH, "and" | Rest], Acc) -> + ct_hooks_args2opts(Rest,[list_to_atom(CTH)|Acc]); +ct_hooks_args2opts([CTH, Args], Acc) -> + ct_hooks_args2opts([CTH, Args, "and"],Acc); +ct_hooks_args2opts([],Acc) -> lists:reverse(Acc). -parse_scb_args(String) -> +parse_cth_args(String) -> try true = io_lib:printable_list(String), {ok,Toks,_} = erl_scan:string(String++"."), @@ -2228,22 +2228,22 @@ opts2args(EnvStartOpts) -> end, EHs), [_LastAnd|StrsR] = lists:reverse(lists:flatten(Strs)), [{event_handler_init,lists:reverse(StrsR)}]; - ({suite_callbacks,[]}) -> + ({ct_hooks,[]}) -> []; - ({suite_callbacks,SCBs}) when is_list(SCBs) -> - io:format(user,"suite_callbacks: ~p",[SCBs]), + ({ct_hooks,CTHs}) when is_list(CTHs) -> + io:format(user,"ct_hooks: ~p",[CTHs]), Strs = lists:flatmap( - fun({SCB,Arg}) -> - [atom_to_list(SCB), + fun({CTH,Arg}) -> + [atom_to_list(CTH), lists:flatten( io_lib:format("~p",[Arg])), "and"]; - (SCB) when is_atom(SCB) -> - [atom_to_list(SCB),"and"] - end,SCBs), + (CTH) when is_atom(CTH) -> + [atom_to_list(CTH),"and"] + end,CTHs), [_LastAnd|StrsR] = lists:reverse(Strs), io:format(user,"return: ~p",[lists:reverse(StrsR)]), - [{suite_callbacks,lists:reverse(StrsR)}]; + [{ct_hooks,lists:reverse(StrsR)}]; ({Opt,As=[A|_]}) when is_atom(A) -> [{Opt,[atom_to_list(Atom) || Atom <- As]}]; ({Opt,Strs=[S|_]}) when is_list(S) -> diff --git a/lib/common_test/src/ct_suite_callback.erl b/lib/common_test/src/ct_suite_callback.erl deleted file mode 100644 index a93b05b1d2..0000000000 --- a/lib/common_test/src/ct_suite_callback.erl +++ /dev/null @@ -1,304 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%% @doc Common Test Framework test execution control module. -%%% -%%%

This module is a proxy for calling and handling suite callbacks.

- --module(ct_suite_callback). - -%% API Exports --export([init/1]). --export([init_tc/3]). --export([end_tc/5]). --export([terminate/1]). --export([on_tc_skip/2]). --export([on_tc_fail/2]). - --type proplist() :: [{atom(),term()}]. - --define(config_name, suite_callbacks). - -%% ------------------------------------------------------------------------- -%% API Functions -%% ------------------------------------------------------------------------- - -%% @doc Called before any suites are started --spec init(State :: term()) -> ok | - {error, Reason :: term()}. -init(Opts) -> - call([{CB, call_id, undefined} || CB <- get_new_callbacks(Opts)], - ok, init, []). - - -%% @doc Called after all suites are done. --spec terminate(Callbacks :: term()) -> - ok. -terminate(Callbacks) -> - call([{CBId, fun call_terminate/3} || {CBId,_,_} <- Callbacks], - ct_suite_callback_terminate_dummy, terminate, Callbacks), - ok. - -%% @doc Called as each test case is started. This includes all configuration -%% tests. --spec init_tc(Mod :: atom(), Func :: atom(), Args :: list()) -> - NewConfig :: proplist() | - {skip, Reason :: term()} | - {auto_skip, Reason :: term()} | - {fail, Reason :: term()}. -init_tc(ct_framework, _Func, Args) -> - Args; -init_tc(Mod, init_per_suite, Config) -> - Info = case catch proplists:get_value(suite_callbacks, Mod:suite()) of - List when is_list(List) -> - [{suite_callbacks,List}]; - _Else -> - [] - end, - call(fun call_generic/3, Config ++ Info, [pre_init_per_suite, Mod]); -init_tc(Mod, end_per_suite, Config) -> - call(fun call_generic/3, Config, [pre_end_per_suite, Mod]); -init_tc(Mod, {init_per_group, GroupName, Opts}, Config) -> - maybe_start_locker(Mod, GroupName, Opts), - call(fun call_generic/3, Config, [pre_init_per_group, GroupName]); -init_tc(_Mod, {end_per_group, GroupName, _}, Config) -> - call(fun call_generic/3, Config, [pre_end_per_group, GroupName]); -init_tc(_Mod, TC, Config) -> - call(fun call_generic/3, Config, [pre_init_per_testcase, TC]). - -%% @doc Called as each test case is completed. This includes all configuration -%% tests. --spec end_tc(Mod :: atom(), - Func :: atom(), - Args :: list(), - Result :: term(), - Resturn :: term()) -> - NewConfig :: proplist() | - {skip, Reason :: term()} | - {auto_skip, Reason :: term()} | - {fail, Reason :: term()} | - ok. -end_tc(ct_framework, _Func, _Args, Result, _Return) -> - Result; - -end_tc(Mod, init_per_suite, Config, _Result, Return) -> - call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config], - '$ct_no_change'); - -end_tc(Mod, end_per_suite, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config], - '$ct_no_change'); - -end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) -> - call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config], - '$ct_no_change'); - -end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) -> - Res = call(fun call_generic/3, Result, - [post_end_per_group, GroupName, Config], '$ct_no_change'), - maybe_stop_locker(Mod, GroupName,Opts), - Res; - -end_tc(_Mod, TC, Config, Result, _Return) -> - call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config], - '$ct_no_change'). - -on_tc_skip(How, {_Suite, Case, Reason}) -> - call(fun call_cleanup/3, {How, Reason}, [on_tc_skip, Case]). - -on_tc_fail(_How, {_Suite, Case, Reason}) -> - call(fun call_cleanup/3, Reason, [on_tc_fail, Case]). - -%% ------------------------------------------------------------------------- -%% Internal Functions -%% ------------------------------------------------------------------------- -call_id(Mod, Config, Meta) when is_atom(Mod) -> - call_id({Mod, []}, Config, Meta); -call_id({Mod, Opts}, Config, Scope) -> - Id = catch_apply(Mod,id,[Opts], make_ref()), - {Config, {Id, scope(Scope), {Mod, {Id,Opts}}}}. - -call_init({Mod,{Id,Opts}},Config,_Meta) -> - NewState = Mod:init(Id, Opts), - {Config, {Mod, NewState}}. - -call_terminate({Mod, State}, _, _) -> - catch_apply(Mod,terminate,[State], ok), - {[],{Mod,State}}. - -call_cleanup({Mod, State}, Reason, [Function | Args]) -> - NewState = catch_apply(Mod,Function, Args ++ [Reason, State], - State), - {Reason, {Mod, NewState}}. - -call_generic({Mod, State}, Value, [Function | Args]) -> - {NewValue, NewState} = catch_apply(Mod, Function, Args ++ [Value, State], - {Value,State}), - {NewValue, {Mod, NewState}}. - -%% Generic call function -call(Fun, Config, Meta) -> - maybe_lock(), - CBs = get_callbacks(), - Res = call([{CBId,Fun} || {CBId,_, _} <- CBs] ++ - get_new_callbacks(Config, Fun), - remove(?config_name,Config), Meta, CBs), - maybe_unlock(), - Res. - -call(Fun, Config, Meta, NoChangeRet) when is_function(Fun) -> - case call(Fun,Config,Meta) of - Config -> NoChangeRet; - NewReturn -> NewReturn - end; - -call([{CB, call_id, NextFun} | Rest], Config, Meta, CBs) -> - try - {Config, {NewId, _, _} = NewCB} = call_id(CB, Config, Meta), - {NewCBs, NewRest} = - case lists:keyfind(NewId, 1, CBs) of - false when NextFun =:= undefined -> - {CBs ++ [NewCB], - [{NewId, fun call_init/3} | Rest]}; - ExistingCB when is_tuple(ExistingCB) -> - {CBs, Rest}; - _ -> - {CBs ++ [NewCB], - [{NewId, fun call_init/3},{NewId,NextFun} | Rest]} - end, - call(NewRest, Config, Meta, NewCBs) - catch Error:Reason -> - Trace = erlang:get_stacktrace(), - ct_logs:log("Suite Callback","Failed to start a SCB: ~p:~p", - [Error,{Reason,Trace}]), - call([], {fail,"Failed to start SCB" - ", see the CT Log for details"}, Meta, CBs) - end; -call([{CBId, Fun} | Rest], Config, Meta, CBs) -> - try - {_,Scope,ModState} = lists:keyfind(CBId, 1, CBs), - {NewConf, NewCBInfo} = Fun(ModState, Config, Meta), - NewCalls = get_new_callbacks(NewConf, Fun), - NewCBs = lists:keyreplace(CBId, 1, CBs, {CBId, Scope, NewCBInfo}), - call(NewCalls ++ Rest, remove(?config_name, NewConf), Meta, - terminate_if_scope_ends(CBId, Meta, NewCBs)) - catch throw:{error_in_scb_call,Reason} -> - call(Rest, {fail, Reason}, Meta, - terminate_if_scope_ends(CBId, Meta, CBs)) - end; -call([], Config, _Meta, CBs) -> - save_suite_data_async(CBs), - Config. - -remove(Key,List) when is_list(List) -> - [Conf || Conf <- List, is_tuple(Conf) =:= false - orelse element(1, Conf) =/= Key]; -remove(_, Else) -> - Else. - -%% Translate scopes, i.e. init_per_group,group1 -> end_per_group,group1 etc -scope([pre_init_per_testcase, TC|_]) -> - [post_end_per_testcase, TC]; -scope([pre_init_per_group, GroupName|_]) -> - [post_end_per_group, GroupName]; -scope([post_init_per_group, GroupName|_]) -> - [post_end_per_group, GroupName]; -scope([pre_init_per_suite, SuiteName|_]) -> - [post_end_per_suite, SuiteName]; -scope([post_init_per_suite, SuiteName|_]) -> - [post_end_per_suite, SuiteName]; -scope(init) -> - none. - -terminate_if_scope_ends(CBId, [Function,Tag|T], CBs) when T =/= [] -> - terminate_if_scope_ends(CBId,[Function,Tag],CBs); -terminate_if_scope_ends(CBId, Function, CBs) -> - case lists:keyfind(CBId, 1, CBs) of - {CBId, Function, _ModState} = CB -> - terminate([CB]), - lists:keydelete(CBId, 1, CBs); - _ -> - CBs - end. - -%% Fetch callback functions -get_new_callbacks(Config, Fun) -> - lists:foldl(fun(NewCB, Acc) -> - [{NewCB, call_id, Fun} | Acc] - end, [], get_new_callbacks(Config)). - -get_new_callbacks(Config) when is_list(Config) -> - lists:flatmap(fun({?config_name, CallbackConfigs}) -> - CallbackConfigs; - (_) -> - [] - end, Config); -get_new_callbacks(_Config) -> - []. - -save_suite_data_async(CBs) -> - ct_util:save_suite_data_async(?config_name, CBs). - -get_callbacks() -> - ct_util:read_suite_data(?config_name). - -catch_apply(M,F,A, Default) -> - try - apply(M,F,A) - catch error:Reason -> - case erlang:get_stacktrace() of - %% Return the default if it was the SCB module which did not have the function. - [{M,F,A}|_] when Reason == undef -> - Default; - Trace -> - ct_logs:log("Suite Callback","Call to SCB failed: ~p:~p", - [error,{Reason,Trace}]), - throw({error_in_scb_call, - lists:flatten( - io_lib:format("~p:~p/~p SCB call failed", - [M,F,length(A)]))}) - end - end. - - -%% We need to lock around the state for parallel groups only. This is because -%% we will get several processes reading and writing the state for a single -%% scb at the same time. -maybe_start_locker(Mod,GroupName,Opts) -> - case lists:member(parallel,Opts) of - true -> - {ok, _Pid} = ct_suite_callback_lock:start({Mod,GroupName}); - false -> - ok - end. - -maybe_stop_locker(Mod,GroupName,Opts) -> - case lists:member(parallel,Opts) of - true -> - stopped = ct_suite_callback_lock:stop({Mod,GroupName}); - false -> - ok - end. - - -maybe_lock() -> - locked = ct_suite_callback_lock:request(). - -maybe_unlock() -> - unlocked = ct_suite_callback_lock:release(). diff --git a/lib/common_test/src/ct_suite_callback_lock.erl b/lib/common_test/src/ct_suite_callback_lock.erl deleted file mode 100644 index 84dafd1e42..0000000000 --- a/lib/common_test/src/ct_suite_callback_lock.erl +++ /dev/null @@ -1,131 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%% @doc Common Test Framework test execution control module. -%%% -%%%

This module is a proxy for calling and handling locks in suite callbacks.

- --module(ct_suite_callback_lock). - --behaviour(gen_server). - -%% API --export([start/1, stop/1, request/0, release/0]). - -%% gen_server callbacks --export([init/1, handle_call/3, handle_cast/2, handle_info/2, - terminate/2, code_change/3]). - --define(SERVER, ?MODULE). - --record(state, { id, locked = false, requests = [] }). - -%%%=================================================================== -%%% API -%%%=================================================================== - -%% @doc Starts the server -start(Id) -> - case gen_server:start({local, ?SERVER}, ?MODULE, Id, []) of - {error,{already_started, Pid}} -> - {ok,Pid}; - Else -> - Else - end. - -stop(Id) -> - try - gen_server:call(?SERVER, {stop,Id}) - catch exit:{noproc,_} -> - stopped - end. - -request() -> - try - gen_server:call(?SERVER,{request,self()},infinity) - catch exit:{noproc,_} -> - locked - end. - -release() -> - try - gen_server:call(?SERVER,{release,self()}) - catch exit:{noproc,_} -> - unlocked - end. - -%%%=================================================================== -%%% gen_server callbacks -%%%=================================================================== - -%% @doc Initiates the server -init(Id) -> - {ok, #state{ id = Id }}. - -%% @doc Handling call messages -handle_call({stop,Id}, _From, #state{ id = Id, requests = Reqs } = State) -> - [gen_server:reply(Req, locker_stopped) || {Req,_ReqId} <- Reqs], - {stop, normal, stopped, State}; -handle_call({stop,_Id}, _From, State) -> - {reply, stopped, State}; -handle_call({request, Pid}, _From, #state{ locked = false, - requests = [] } = State) -> - Ref = monitor(process, Pid), - {reply, locked, State#state{ locked = {true, Pid, Ref}} }; -handle_call({request, Pid}, From, #state{ requests = Reqs } = State) -> - {noreply, State#state{ requests = Reqs ++ [{From,Pid}] }}; -handle_call({release, Pid}, _From, #state{ locked = {true, Pid, Ref}, - requests = []} = State) -> - demonitor(Ref,[flush]), - {reply, unlocked, State#state{ locked = false }}; -handle_call({release, Pid}, _From, - #state{ locked = {true, Pid, Ref}, - requests = [{NextFrom,NextPid}|Rest]} = State) -> - demonitor(Ref,[flush]), - gen_server:reply(NextFrom,locked), - NextRef = monitor(process, NextPid), - {reply,unlocked,State#state{ locked = {true, NextPid, NextRef}, - requests = Rest } }; -handle_call({release, _Pid}, _From, State) -> - {reply, not_locked, State}. - -%% @doc Handling cast messages -handle_cast(_Msg, State) -> - {noreply, State}. - -%% @doc Handling all non call/cast messages -handle_info({'DOWN',Ref,process,Pid,_}, - #state{ locked = {true, Pid, Ref}, - requests = [{NextFrom,NextPid}|Rest] } = State) -> - gen_server:reply(NextFrom, locked), - NextRef = monitor(process, NextPid), - {noreply,State#state{ locked = {true, NextPid, NextRef}, - requests = Rest } }. - -%% @doc This function is called by a gen_server when it is about to terminate. -terminate(_Reason, _State) -> - ok. - -%% @doc Convert process state when code is changed -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - -%% ------------------------------------------------------------------------- -%% Internal Functions -%% ------------------------------------------------------------------------- diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index 942241da6c..db1d4c5fb0 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -625,19 +625,19 @@ add_tests([{event_handler,Node,H,Args}|Ts],Spec) when is_atom(H) -> Node1 = ref2node(Node,Spec#testspec.nodes), add_tests(Ts,Spec#testspec{event_handler=[{Node1,H,Args}|EvHs]}); -%% --- suite_callbacks -- -add_tests([{suite_callbacks, all_nodes, CBs} | Ts], Spec) -> - Tests = [{suite_callbacks,N,CBs} || N <- list_nodes(Spec)], +%% --- ct_hooks -- +add_tests([{ct_hooks, all_nodes, Hooks} | Ts], Spec) -> + Tests = [{ct_hooks,N,Hooks} || N <- list_nodes(Spec)], add_tests(Tests ++ Ts, Spec); -add_tests([{suite_callbacks, Node, [CB|CBs]}|Ts], Spec) -> - SuiteCbs = Spec#testspec.suite_callbacks, +add_tests([{ct_hooks, Node, [Hook|Hooks]}|Ts], Spec) -> + SuiteCbs = Spec#testspec.ct_hooks, Node1 = ref2node(Node,Spec#testspec.nodes), - add_tests([{suite_callbacks, Node, CBs} | Ts], - Spec#testspec{suite_callbacks = [{Node1,CB} | SuiteCbs]}); -add_tests([{suite_callbacks, _Node, []}|Ts], Spec) -> + add_tests([{ct_hooks, Node, Hooks} | Ts], + Spec#testspec{ct_hooks = [{Node1,Hook} | SuiteCbs]}); +add_tests([{ct_hooks, _Node, []}|Ts], Spec) -> add_tests(Ts, Spec); -add_tests([{suite_callbacks, CBs}|Ts], Spec) -> - add_tests([{suite_callbacks, all_nodes, CBs}|Ts], Spec); +add_tests([{ct_hooks, Hooks}|Ts], Spec) -> + add_tests([{ct_hooks, all_nodes, Hooks}|Ts], Spec); %% --- include --- add_tests([{include,all_nodes,InclDirs}|Ts],Spec) -> @@ -1065,8 +1065,8 @@ valid_terms() -> {event_handler,2}, {event_handler,3}, {event_handler,4}, - {suite_callbacks,2}, - {suite_callbacks,3}, + {ct_hooks,2}, + {ct_hooks,3}, {multiply_timetraps,2}, {multiply_timetraps,3}, {scale_timetraps,2}, diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 2f5a90a543..45146de57c 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -162,13 +162,13 @@ do_start(Parent,Mode,LogDir) -> end, {StartTime,TestLogDir} = ct_logs:init(Mode), - %% Initiate suite_callbacks - case catch ct_suite_callback:init(Opts) of + %% Initiate ct_hooks + case catch ct_hooks:init(Opts) of ok -> ok; - {_,SCBReason} -> - ct_logs:tc_print('Suite Callback',SCBReason,[]), - Parent ! {self(), SCBReason}, + {_,CTHReason} -> + ct_logs:tc_print('Suite Callback',CTHReason,[]), + Parent ! {self(), CTHReason}, self() ! {{stop,normal},{self(),make_ref()}} end, @@ -320,9 +320,9 @@ loop(Mode,TestData,StartDir) -> node=node(), data=Time}), Callbacks = ets:lookup_element(?suite_table, - suite_callbacks, + ct_hooks, #suite_data.value), - ct_suite_callback:terminate(Callbacks), + ct_hooks:terminate(Callbacks), close_connections(ets:tab2list(?conn_table)), ets:delete(?conn_table), ets:delete(?board_table), diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl index 99f029bc0e..4ed29bdcd1 100644 --- a/lib/common_test/src/ct_util.hrl +++ b/lib/common_test/src/ct_util.hrl @@ -36,7 +36,7 @@ config=[], userconfig=[], event_handler=[], - suite_callbacks=[], + ct_hooks=[], include=[], multiply_timetraps=[], scale_timetraps=[], diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile index 28be9f56f1..be4b4c32b8 100644 --- a/lib/common_test/test/Makefile +++ b/lib/common_test/test/Makefile @@ -41,7 +41,7 @@ MODULES= \ ct_config_SUITE \ ct_master_SUITE \ ct_misc_1_SUITE \ - ct_suite_callback_SUITE + ct_hooks_SUITE ERL_FILES= $(MODULES:%=%.erl) diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl deleted file mode 100644 index 41808b4f1d..0000000000 --- a/lib/common_test/test/ct_error_SUITE_data/error/test/empty_scb.erl +++ /dev/null @@ -1,187 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%% @doc Common Test Example Suite Callback module. -%%% -%%%

This module gives an example of a common test SCB (Suite CallBack). -%%% There are many ways to add a SCB to a test run, you can do it either in -%%% the command line using -suite_callback, in a test spec using -%%% {suite_callback,M} or in the suite it self by returning suite_callback -%%% from either suite/0, init_per_suite/1, init_per_group/2 and -%%% init_per_testcase/2. The scope of the SCB is determined by where is it -%%% started. If it is started in the command line or test spec then it will -%%% be stopped at the end of all tests. If it is started in init_per_suite, -%%% it will be stopped after end_per_suite and so on. See terminate -%%% documentation for a table describing the scoping machanics. -%%% -%%% All of callbacks except init/1 in a SCB are optional.

- --module(empty_scb). - -%% Suite Callbacks --export([init/1]). - --export([pre_init_suite/3]). --export([post_init_suite/3]). --export([pre_end_suite/3]). --export([post_end_suite/3]). - --export([pre_init_group/3]). --export([post_init_group/3]). --export([pre_end_group/3]). --export([post_end_group/3]). - --export([pre_init_tc/3]). --export([post_end_tc/3]). - --export([on_tc_fail/3]). - --export([terminate/2]). - --type proplist() :: list({atom(),term()}). --type config() :: proplist(). --type reason() :: term(). --type skip_or_fail() :: {skip, reason()} | - {auto_skip, reason()} | - {fail, reason()}. - --record(state, { id = ?MODULE :: term()}). - -%% @doc Always called before any other callback function. Use this to initiate -%% any common state. It should return an ID for this SCB and a state. The ID -%% is used to uniquly identify an SCB instance, if two SCB's return the same -%% ID the seconds SCB is ignored. This function should NOT have any side -%% effects as it might be called multiple times by common test. --spec init(Opts :: proplist()) -> - {Id :: term(), State :: #state{}}. -init(Opts) -> - {?MODULE, #state{ }}. - -%% @doc Called before init_per_suite is called. Note that this callback is -%% only called if the SCB is added before init_per_suite is run (eg. in a test -%% specification, suite/0 function etc). -%% You can change the config in the this function. --spec pre_init_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_suite(Suite,Config,State) -> - {Config, State}. - -%% @doc Called after init_per_suite. -%% you can change the config in this function. --spec post_init_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_suite(Suite,Config,State) -> - {Config, State}. - -%% @doc Called before end_per_suite. Note that the config cannot be -%% changed here, only the status of the suite. --spec pre_end_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_suite(Suite,Config,State) -> {Config, State}. - -%% @doc Called after end_per_suite. Note that the config cannot be -%% changed here, only the status of the suite. --spec post_end_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_suite(Suite,Config,State) -> {Config, State}. - -%% @doc Called before each init_per_group. -%% You can change the config in this function. --spec pre_init_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_group(Group,Config,State) -> {Config, State}. - -%% @doc Called after each init_per_group. -%% You can change the config in this function. --spec post_init_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_group(Group,Config,State) -> {Config, State}. - -%% @doc Called after each end_per_group. Note that the config cannot be -%% changed here, only the status of the group. --spec pre_end_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_group(Group,Config,State) -> {Config, State}. - -%% @doc Called after each end_per_group. Note that the config cannot be -%% changed here, only the status of the group. --spec post_end_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_group(Group,Config,State) -> {Config, State}. - -%% @doc Called before each test case. -%% You can change the config in this function. --spec pre_init_tc(TC :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_tc(TC,Config,State) -> {Config, State}. - -%% @doc Called after each test case. Note that the config cannot be -%% changed here, only the status of the test case. --spec post_end_tc(TC :: atom(), - Config :: config(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_tc(TC,Config,State) -> {Config, State}. - -%% @doc Called after post_init_suite, post_end_suite, post_init_group, -%% post_end_group and post_end_tc if the suite, group or test case failed. -%% This function should be used for extra cleanup which might be needed. -%% It is not possible to modify the config or the status of the test run. --spec on_tc_fail(TC :: init_per_suite | end_per_suite | - init_per_group | end_per_group | atom(), - Config :: config(), State :: #state{}) -> - ok. -on_tc_fail(_TC, _Config, _State) -> - ok. - -%% @doc Called when the scope of the SCB is done, this depends on -%% when the SCB was specified. This translation table describes when this -%% function is called. -%% -%% | Started in | terminate called | -%% |---------------------|-------------------------| -%% | command_line | after all tests are run | -%% | test spec | after all tests are run | -%% | suite/0 | after SUITE is done | -%% | init_per_suite/1 | after SUITE is done | -%% | init_per_group/2 | after group is done | -%% | init_per_testcase/2 | after test case is done | -%% |-----------------------------------------------| -%% --spec terminate(Config :: proplist(), State :: #state{}) -> - term(). -terminate(Config,State) -> {Config, State}. diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl new file mode 100644 index 0000000000..1e187aa205 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE.erl @@ -0,0 +1,1021 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% File: ct_error_SUITE +%%% +%%% Description: +%%% Test various errors in Common Test suites. +%%% +%%% The suites used for the test are located in the data directory. +%%%------------------------------------------------------------------- +-module(ct_hooks_SUITE). + +-compile(export_all). + +-include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-define(eh, ct_test_support_eh). + +%%-------------------------------------------------------------------- +%% TEST SERVER CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- + +%%-------------------------------------------------------------------- +%% Description: Since Common Test starts another Test Server +%% instance, the tests need to be performed on a separate node (or +%% there will be clashes with logging processes etc). +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + DataDir = ?config(data_dir, Config), + TestDir = filename:join(DataDir,"cth/tests/"), + CTHs = filelib:wildcard(filename:join(TestDir,"*_cth.erl")), + io:format("CTHs: ~p",[CTHs]), + [io:format("Compiling ~p: ~p", + [FileName,compile:file(FileName,[{outdir,TestDir},debug_info])]) || + FileName <- CTHs], + ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]). + +end_per_suite(Config) -> + ct_test_support:end_per_suite(Config). + +init_per_testcase(TestCase, Config) -> + ct_test_support:init_per_testcase(TestCase, Config). + +end_per_testcase(TestCase, Config) -> + ct_test_support:end_per_testcase(TestCase, Config). + + +suite() -> + [{timetrap,{seconds,20}}]. + +all() -> + all(suite). + +all(suite) -> + lists:reverse( + [ + one_cth, two_cth, faulty_cth_no_init, faulty_cth_id_no_init, + faulty_cth_exit_in_init, faulty_cth_exit_in_id, + faulty_cth_exit_in_init_scope_suite, minimal_cth, + minimal_and_maximal_cth, faulty_cth_undef, + scope_per_suite_cth, scope_per_group_cth, scope_suite_cth, + scope_per_suite_state_cth, scope_per_group_state_cth, + scope_suite_state_cth, + fail_pre_suite_cth, fail_post_suite_cth, skip_pre_suite_cth, + skip_post_suite_cth, recover_post_suite_cth, update_config_cth, + state_update_cth, options_cth, same_id_cth, + fail_n_skip_with_minimal_cth + ] + ) + . + + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- + +%%%----------------------------------------------------------------- +%%% +one_cth(Config) when is_list(Config) -> + do_test(one_empty_cth, "ct_cth_empty_SUITE.erl",[empty_cth], Config). + +two_cth(Config) when is_list(Config) -> + do_test(two_empty_cth, "ct_cth_empty_SUITE.erl",[empty_cth,empty_cth], + Config). + +faulty_cth_no_init(Config) when is_list(Config) -> + do_test(faulty_cth_no_init, "ct_cth_empty_SUITE.erl",[askjhdkljashdkaj], + Config,{error,"Failed to start CTH, see the " + "CT Log for details"}). + +faulty_cth_id_no_init(Config) when is_list(Config) -> + do_test(faulty_cth_id_no_init, "ct_cth_empty_SUITE.erl",[id_no_init_cth], + Config,{error,"Failed to start CTH, see the " + "CT Log for details"}). + +minimal_cth(Config) when is_list(Config) -> + do_test(minimal_cth, "ct_cth_empty_SUITE.erl",[minimal_cth],Config). + +minimal_and_maximal_cth(Config) when is_list(Config) -> + do_test(minimal_and_maximal_cth, "ct_cth_empty_SUITE.erl", + [minimal_cth, empty_cth],Config). + +faulty_cth_undef(Config) when is_list(Config) -> + do_test(faulty_cth_undef, "ct_cth_empty_SUITE.erl", + [undef_cth],Config). + +faulty_cth_exit_in_init_scope_suite(Config) when is_list(Config) -> + do_test(faulty_cth_exit_in_init_scope_suite, + "ct_exit_in_init_scope_suite_cth_SUITE.erl", + [],Config). + +faulty_cth_exit_in_init(Config) when is_list(Config) -> + do_test(faulty_cth_exit_in_init, "ct_cth_empty_SUITE.erl", + [crash_init_cth], Config, + {error,"Failed to start CTH, see the " + "CT Log for details"}). + +faulty_cth_exit_in_id(Config) when is_list(Config) -> + do_test(faulty_cth_exit_in_id, "ct_cth_empty_SUITE.erl", + [crash_id_cth], Config, + {error,"Failed to start CTH, see the " + "CT Log for details"}). + +scope_per_suite_cth(Config) when is_list(Config) -> + do_test(scope_per_suite_cth, "ct_scope_per_suite_cth_SUITE.erl", + [],Config). + +scope_suite_cth(Config) when is_list(Config) -> + do_test(scope_suite_cth, "ct_scope_suite_cth_SUITE.erl", + [],Config). + +scope_per_group_cth(Config) when is_list(Config) -> + do_test(scope_per_group_cth, "ct_scope_per_group_cth_SUITE.erl", + [],Config). + +scope_per_suite_state_cth(Config) when is_list(Config) -> + do_test(scope_per_suite_state_cth, "ct_scope_per_suite_state_cth_SUITE.erl", + [],Config). + +scope_suite_state_cth(Config) when is_list(Config) -> + do_test(scope_suite_state_cth, "ct_scope_suite_state_cth_SUITE.erl", + [],Config). + +scope_per_group_state_cth(Config) when is_list(Config) -> + do_test(scope_per_group_state_cth, "ct_scope_per_group_state_cth_SUITE.erl", + [],Config). + +fail_pre_suite_cth(Config) when is_list(Config) -> + do_test(fail_pre_suite_cth, "ct_cth_empty_SUITE.erl", + [fail_pre_suite_cth],Config). + +fail_post_suite_cth(Config) when is_list(Config) -> + do_test(fail_post_suite_cth, "ct_cth_empty_SUITE.erl", + [fail_post_suite_cth],Config). + +skip_pre_suite_cth(Config) when is_list(Config) -> + do_test(skip_pre_suite_cth, "ct_cth_empty_SUITE.erl", + [skip_pre_suite_cth],Config). + +skip_post_suite_cth(Config) when is_list(Config) -> + do_test(skip_post_suite_cth, "ct_cth_empty_SUITE.erl", + [skip_post_suite_cth],Config). + +recover_post_suite_cth(Config) when is_list(Config) -> + do_test(recover_post_suite_cth, "ct_cth_fail_per_suite_SUITE.erl", + [recover_post_suite_cth],Config). + +update_config_cth(Config) when is_list(Config) -> + do_test(update_config_cth, "ct_update_config_SUITE.erl", + [update_config_cth],Config). + +state_update_cth(Config) when is_list(Config) -> + do_test(state_update_cth, "ct_cth_fail_one_skip_one_SUITE.erl", + [state_update_cth,state_update_cth],Config). + +options_cth(Config) when is_list(Config) -> + do_test(options_cth, "ct_cth_empty_SUITE.erl", + [{empty_cth,[test]}],Config). + +same_id_cth(Config) when is_list(Config) -> + do_test(same_id_cth, "ct_cth_empty_SUITE.erl", + [same_id_cth,same_id_cth],Config). + +fail_n_skip_with_minimal_cth(Config) when is_list(Config) -> + do_test(fail_n_skip_with_minimal_cth, "ct_cth_fail_one_skip_one_SUITE.erl", + [minimal_terminate_cth],Config). + +%%%----------------------------------------------------------------- +%%% HELP FUNCTIONS +%%%----------------------------------------------------------------- + +do_test(Tag, SWC, CTHs, Config) -> + do_test(Tag, SWC, CTHs, Config, ok). +do_test(Tag, SWC, CTHs, Config, {error,_} = Res) -> + do_test(Tag, SWC, CTHs, Config, Res, 1); +do_test(Tag, SWC, CTHs, Config, Res) -> + do_test(Tag, SWC, CTHs, Config, Res, 2). + +do_test(Tag, SuiteWildCard, CTHs, Config, Res, EC) -> + + DataDir = ?config(data_dir, Config), + Suites = filelib:wildcard( + filename:join([DataDir,"cth/tests",SuiteWildCard])), + {Opts,ERPid} = setup([{suite,Suites}, + {ct_hooks,CTHs},{label,Tag}], Config), + Res = ct_test_support:run(Opts, Config), + Events = ct_test_support:get_events(ERPid, Config), + + ct_test_support:log_events(Tag, + reformat(Events, ?eh), + ?config(priv_dir, Config)), + + TestEvents = events_to_check(Tag, EC), + ok = ct_test_support:verify_events(TestEvents, Events, Config). + +setup(Test, Config) -> + Opts0 = ct_test_support:get_opts(Config), + Level = ?config(trace_level, Config), + EvHArgs = [{cbm,ct_test_support},{trace_level,Level}], + Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test], + ERPid = ct_test_support:start_event_receiver(Config), + {Opts,ERPid}. + +reformat(Events, EH) -> + ct_test_support:reformat(Events, EH). +%reformat(Events, _EH) -> +% Events. + +%%%----------------------------------------------------------------- +%%% TEST EVENTS +%%%----------------------------------------------------------------- +events_to_check(Test) -> + %% 2 tests (ct:run_test + script_start) is default + events_to_check(Test, 2). + +events_to_check(_, 0) -> + []; +events_to_check(Test, N) -> + test_events(Test) ++ events_to_check(Test, N-1). + +test_events(one_empty_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{empty_cth,id,[[]]}}, + {?eh,cth,{empty_cth,init,[{'_','_','_'},[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{empty_cth,pre_init_per_suite, + [ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{empty_cth,post_init_per_suite, + [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,cth,{empty_cth,pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{empty_cth,post_end_per_testcase,[test_case,'$proplist','_',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,cth,{empty_cth,pre_end_per_suite, + [ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{empty_cth,post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{empty_cth,terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(two_empty_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_cth_no_init) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_cth_id_no_init) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {negative,{?eh,tc_start,'_'}, + {?eh,test_done,{'DEF','STOP_TIME'}}}, + {?eh,stop_logging,[]} + ]; + +test_events(minimal_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {negative,{?eh,cth,{'_',id,['_',[]]}}, + {?eh,cth,{'_',init,['_',[]]}}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(minimal_and_maximal_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {negative,{?eh,cth,{'_',id,['_',[]]}}, + {?eh,cth,{'_',init,['_',[]]}}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_cth_undef) -> + FailReasonStr = "undef_cth:pre_init_per_suite/3 CTH call failed", + FailReason = {ct_cth_empty_SUITE,init_per_suite, + {failed,FailReasonStr}}, + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite, + {failed, {error,FailReasonStr}}}}, + {?eh,cth,{'_',on_tc_fail,'_'}}, + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case, + {failed, FailReason}}}, + {?eh,cth,{'_',on_tc_skip,'_'}}, + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,end_per_suite, + {failed, FailReason}}}, + {?eh,cth,{'_',on_tc_skip,'_'}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(faulty_cth_exit_in_init_scope_suite) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + {?eh,cth,{empty_cth,init,['_',[]]}}, + {?eh,tc_done, + {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite, + {failed, + {error, + "Failed to start CTH, see the CT Log for details"}}}}, + {?eh,tc_auto_skip, + {ct_exit_in_init_scope_suite_cth_SUITE,test_case, + {failed, + {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite, + {failed, + "Failed to start CTH, see the CT Log for details"}}}}}, + {?eh,tc_auto_skip, + {ct_exit_in_init_scope_suite_cth_SUITE,end_per_suite, + {failed, + {ct_exit_in_init_scope_suite_cth_SUITE,init_per_suite, + {failed, + "Failed to start CTH, see the CT Log for details"}}}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]}]; + +test_events(faulty_cth_exit_in_init) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{empty_cth,init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]}]; + +test_events(faulty_cth_exit_in_id) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{empty_cth,id,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {negative, {?eh,tc_start,'_'}, + {?eh,test_done,{'DEF','STOP_TIME'}}}, + {?eh,stop_logging,[]}]; + +test_events(scope_per_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,init_per_suite}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_scope_per_suite_cth_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_cth_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite, + [ct_scope_per_suite_cth_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_scope_per_suite_cth_SUITE,'$proplist','_',[]]}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,tc_done,{ct_scope_per_suite_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_suite_cth_SUITE,init_per_suite}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_scope_suite_cth_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_scope_suite_cth_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_scope_suite_cth_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_suite_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_scope_suite_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_suite_cth_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_scope_suite_cth_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_scope_suite_cth_SUITE,'$proplist','_',[]]}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,tc_done,{ct_scope_suite_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_per_group_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_group_cth_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_cth_SUITE,init_per_suite,ok}}, + + [{?eh,tc_start,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]}}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,cth,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{init_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_scope_per_group_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_scope_per_group_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]}}}, + {?eh,cth,{'_',pre_end_per_group,[group1,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_group,[group1,'$proplist','_',[]]}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,tc_done,{ct_scope_per_group_cth_SUITE,{end_per_group,group1,[]},ok}}], + + {?eh,tc_start,{ct_scope_per_group_cth_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_per_suite_state_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,init_per_suite}}, + {?eh,cth,{'_',id,[[test]]}}, + {?eh,cth,{'_',init,['_',[test]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_scope_per_suite_state_cth_SUITE,'$proplist','$proplist',[test]]}}, + {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, + {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_suite_state_cth_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite, + [ct_scope_per_suite_state_cth_SUITE,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_scope_per_suite_state_cth_SUITE,'$proplist','_',[test]]}}, + {?eh,cth,{'_',terminate,[[test]]}}, + {?eh,tc_done,{ct_scope_per_suite_state_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_suite_state_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,init_per_suite}}, + {?eh,cth,{'_',id,[[test]]}}, + {?eh,cth,{'_',init,['_',[test]]}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist',[test]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist','$proplist',[test]]}}, + {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, + {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_suite_state_cth_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_scope_suite_state_cth_SUITE,'$proplist','_',[test]]}}, + {?eh,cth,{'_',terminate,[[test]]}}, + {?eh,tc_done,{ct_scope_suite_state_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(scope_per_group_state_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,init_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,init_per_suite,ok}}, + + [{?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,{init_per_group,group1,[]}}}, + {?eh,cth,{'_',id,[[test]]}}, + {?eh,cth,{'_',init,['_',[test]]}}, + {?eh,cth,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}}, + {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,{init_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, + {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,{end_per_group,group1,[]}}}, + {?eh,cth,{'_',pre_end_per_group,[group1,'$proplist',[test]]}}, + {?eh,cth,{'_',post_end_per_group,[group1,'$proplist','_',[test]]}}, + {?eh,cth,{'_',terminate,[[test]]}}, + {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,{end_per_group,group1,[]},ok}}], + + {?eh,tc_start,{ct_scope_per_group_state_cth_SUITE,end_per_suite}}, + {?eh,tc_done,{ct_scope_per_group_state_cth_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; + +test_events(fail_pre_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + + + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist', + {fail,"Test failure"},[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite, + {failed, {error,"Test failure"}}}}, + {?eh,cth,{'_',on_tc_fail, + [init_per_suite,{failed,"Test failure"},[]]}}, + + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case, + {failed,{ct_cth_empty_SUITE,init_per_suite, + {failed,"Test failure"}}}}}, + {?eh,cth,{'_',on_tc_skip, + [test_case, {tc_auto_skip, + {failed, {ct_cth_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}},[]]}}, + + + {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite, + {failed, {ct_cth_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}}}, + {?eh,cth,{'_',on_tc_skip, + [end_per_suite, {tc_auto_skip, + {failed, {ct_cth_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}},[]]}}, + + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth, {'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(fail_post_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite, + {failed,{error,"Test failure"}}}}, + {?eh,cth,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}}, + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case, + {failed,{ct_cth_empty_SUITE,init_per_suite, + {failed,"Test failure"}}}}}, + {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,'_'},[]]}}, + + {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite, + {failed, {ct_cth_empty_SUITE, init_per_suite, + {failed, "Test failure"}}}}}, + {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,'_'},[]]}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth, {'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(skip_pre_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist',{skip,"Test skip"},[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, + {?eh,cth,{'_',on_tc_skip, + [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,"Test skip"}}, + {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, + + {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,"Test skip"}}, + {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth, {'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(skip_post_suite_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite,[ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, + {?eh,cth,{'_',on_tc_skip, + [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, + + {?eh,tc_auto_skip,{ct_cth_empty_SUITE,test_case,"Test skip"}}, + {?eh,cth,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, + + {?eh,tc_auto_skip, {ct_cth_empty_SUITE, end_per_suite,"Test skip"}}, + {?eh,cth,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, + + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(recover_post_suite_cth) -> + Suite = ct_cth_fail_per_suite_SUITE, + [ + {?eh,start_logging,'_'}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{Suite,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}}, + {?eh,cth,{'_',post_init_per_suite,[Suite,contains([tc_status]), + {'EXIT',{'_','_'}},[]]}}, + {?eh,tc_done,{Suite,init_per_suite,ok}}, + + {?eh,tc_start,{Suite,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase, + [test_case, not_contains([tc_status]),[]]}}, + {?eh,cth,{'_',post_end_per_testcase, + [test_case, contains([tc_status]),'_',[]]}}, + {?eh,tc_done,{Suite,test_case,ok}}, + + {?eh,tc_start,{Suite,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite, + [Suite,not_contains([tc_status]),[]]}}, + {?eh,cth,{'_',post_end_per_suite, + [Suite,not_contains([tc_status]),'_',[]]}}, + {?eh,tc_done,{Suite,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(update_config_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + + {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite, + [ct_update_config_SUITE,contains([]),[]]}}, + {?eh,cth,{'_',post_init_per_suite, + [ct_update_config_SUITE, + '$proplist', + contains( + [init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,tc_done,{ct_update_config_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_update_config_SUITE, {init_per_group,group1,[]}}}, + {?eh,cth,{'_',pre_init_per_group, + [group1,contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,cth,{'_',post_init_per_group, + [group1, + contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + contains( + [init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,tc_done,{ct_update_config_SUITE,{init_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_update_config_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase, + [test_case,contains( + [post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,cth,{'_',post_end_per_testcase, + [test_case,contains( + [init_per_testcase, + pre_init_per_testcase, + post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + ok,[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_update_config_SUITE, {end_per_group,group1,[]}}}, + {?eh,cth,{'_',pre_end_per_group, + [group1,contains( + [post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,cth,{'_',post_end_per_group, + [group1, + contains( + [pre_end_per_group, + post_init_per_group, + init_per_group, + pre_init_per_group, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + ok,[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,{end_per_group,group1,[]},ok}}, + + {?eh,tc_start,{ct_update_config_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite, + [ct_update_config_SUITE,contains( + [post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + []]}}, + {?eh,cth,{'_',post_end_per_suite, + [ct_update_config_SUITE,contains( + [pre_end_per_suite, + post_init_per_suite, + init_per_suite, + pre_init_per_suite]), + '_',[]]}}, + {?eh,tc_done,{ct_update_config_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[contains( + [post_end_per_suite, + pre_end_per_suite, + post_init_per_suite, + init_per_suite, + pre_init_per_suite])]}}, + {?eh,stop_logging,[]} + ]; + +test_events(state_update_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + + {?eh,tc_done,{'_',end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[contains( + [post_end_per_suite,pre_end_per_suite, + post_end_per_group,pre_end_per_group, + {not_in_order, + [post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase] + }, + post_init_per_group,pre_init_per_group, + post_init_per_suite,pre_init_per_suite, + init])]}}, + {?eh,cth,{'_',terminate,[contains( + [post_end_per_suite,pre_end_per_suite, + post_end_per_group,pre_end_per_group, + {not_in_order, + [post_end_per_testcase,pre_init_per_testcase, + on_tc_skip,post_end_per_testcase, + pre_init_per_testcase,on_tc_fail, + post_end_per_testcase,pre_init_per_testcase] + }, + post_init_per_group,pre_init_per_group, + post_init_per_suite,pre_init_per_suite, + init] + )]}}, + {?eh,stop_logging,[]} + ]; + +test_events(options_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{empty_cth,init,['_',[test]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{empty_cth,pre_init_per_suite, + [ct_cth_empty_SUITE,'$proplist',[test]]}}, + {?eh,cth,{empty_cth,post_init_per_suite, + [ct_cth_empty_SUITE,'$proplist','$proplist',[test]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,cth,{empty_cth,pre_init_per_testcase,[test_case,'$proplist',[test]]}}, + {?eh,cth,{empty_cth,post_end_per_testcase,[test_case,'$proplist','_',[test]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,cth,{empty_cth,pre_end_per_suite, + [ct_cth_empty_SUITE,'$proplist',[test]]}}, + {?eh,cth,{empty_cth,post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[test]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{empty_cth,terminate,[[test]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(same_id_cth) -> + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,cth,{'_',init,[same_id_cth,[]]}}, + {?eh,cth,{'_',id,[[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{ct_cth_empty_SUITE,init_per_suite}}, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {negative, + {?eh,cth,{'_',pre_init_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_init_per_suite, + [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}}, + {negative, + {?eh,cth,{'_',post_init_per_suite, + [ct_cth_empty_SUITE,'$proplist','$proplist',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,init_per_suite,ok}}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,test_case}}, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {negative, + {?eh,cth,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}}, + {negative, + {?eh,cth,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,test_case,ok}}}, + + {?eh,tc_start,{ct_cth_empty_SUITE,end_per_suite}}, + {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {negative, + {?eh,cth,{'_',pre_end_per_suite,[ct_cth_empty_SUITE,'$proplist',[]]}}, + {?eh,cth,{'_',post_end_per_suite,[ct_cth_empty_SUITE,'$proplist','_',[]]}}}, + {negative, + {?eh,cth,{'_',post_end_per_suite, + [ct_cth_empty_SUITE,'$proplist','_',[]]}}, + {?eh,tc_done,{ct_cth_empty_SUITE,end_per_suite,ok}}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(fail_n_skip_with_minimal_cth) -> + [{?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,cth,{'_',init,['_',[]]}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,tc_start,{'_',init_per_suite}}, + + {?eh,tc_done,{'_',end_per_suite,ok}}, + {?eh,cth,{'_',terminate,[[]]}}, + {?eh,stop_logging,[]} + ]; + +test_events(ok) -> + ok. + + +%% test events help functions +contains(List) -> + fun(Proplist) when is_list(Proplist) -> + contains(List,Proplist) + end. + +contains([{not_in_order,List}|T],Rest) -> + contains_parallel(List,Rest), + contains(T,Rest); +contains([{Ele,Pos}|T] = L,[H|T2]) -> + case element(Pos,H) of + Ele -> + contains(T,T2); + _ -> + contains(L,T2) + end; +contains([Ele|T],[{Ele,_}|T2])-> + contains(T,T2); +contains([Ele|T],[Ele|T2])-> + contains(T,T2); +contains(List,[_|T]) -> + contains(List,T); +contains([],_) -> + match. + +contains_parallel([Key | T], Elems) -> + contains([Key],Elems), + contains_parallel(T,Elems); +contains_parallel([],_Elems) -> + match. + +not_contains(List) -> + fun(Proplist) when is_list(Proplist) -> + [] = [Ele || {Ele,_} <- Proplist, + Test <- List, + Test =:= Ele] + end. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl new file mode 100644 index 0000000000..02c36e378c --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_id_cth.erl @@ -0,0 +1,34 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(crash_id_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-export([id/1]). + +id(Opts) -> + empty_cth:id(Opts), + exit(diediedie). + diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl new file mode 100644 index 0000000000..6ed23565f6 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/crash_init_cth.erl @@ -0,0 +1,34 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(crash_init_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-export([init/2]). + +init(Id, Opts) -> + empty_cth:init(Id, Opts), + exit(diediedie). + diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl new file mode 100644 index 0000000000..499069b382 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_empty_SUITE.erl @@ -0,0 +1,47 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_cth_empty_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl new file mode 100644 index 0000000000..017812c719 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_one_skip_one_SUITE.erl @@ -0,0 +1,64 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_cth_fail_one_skip_one_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_Group,Config) -> + Config. + +end_per_group(_Group,_Config) -> + ok. + +init_per_testcase(test_case2, Config) -> + {skip,"skip it"}; +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +groups() -> + [{group1,[parallel],[{group2,[parallel],[test_case1,test_case2,test_case3]}]}]. + +all() -> + [{group,group1}]. + +%% Test cases starts here. +test_case1(Config) -> + ok = nok. + +test_case2(Config) -> + ok. + +test_case3(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl new file mode 100644 index 0000000000..136a15ec96 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_cth_fail_per_suite_SUITE.erl @@ -0,0 +1,47 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_cth_fail_per_suite_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + ok = nok. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl new file mode 100644 index 0000000000..42be0a659e --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_exit_in_init_scope_suite_cth_SUITE.erl @@ -0,0 +1,50 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_exit_in_init_scope_suite_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). + +%% Test server callback functions +suite() -> + [{ct_hooks,[crash_init_cth]}]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl new file mode 100644 index 0000000000..628bca774c --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_cth_SUITE.erl @@ -0,0 +1,56 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_group_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(GroupName, Config) -> + [{ct_hooks,[empty_cth]}|Config]. + +end_per_group(GroupName, Config) -> + ok. + +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl new file mode 100644 index 0000000000..14ea52bf8c --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_group_state_cth_SUITE.erl @@ -0,0 +1,56 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_group_state_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(_GroupName, Config) -> + [{ct_hooks,[{empty_cth,[test]}]}|Config]. + +end_per_group(_GroupName, _Config) -> + ok. + +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl new file mode 100644 index 0000000000..5c1658be44 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_cth_SUITE.erl @@ -0,0 +1,47 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_suite_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + [{ct_hooks,[empty_cth]}|Config]. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl new file mode 100644 index 0000000000..96d00e3b28 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_suite_state_cth_SUITE.erl @@ -0,0 +1,47 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_suite_state_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + [{ct_hooks,[{empty_cth,[test]}]}|Config]. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl new file mode 100644 index 0000000000..fa632444c5 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_per_tc_cth_SUITE.erl @@ -0,0 +1,110 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_per_tc_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before the whole suite +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% +%% @spec init_per_suite(Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_suite(Config) -> + Config. + +%%-------------------------------------------------------------------- +%% @doc +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after the whole suite +%% +%% @spec end_per_suite(Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_suite(_Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Initiation before each test case +%% +%% Note: This function is free to add any key/value pairs to the Config +%% variable, but should NOT alter/remove any existing entries. +%% Initiation before each test case +%% +%% @spec init_per_testcase(TestCase, Config) -> Config +%% @end +%%-------------------------------------------------------------------- +init_per_testcase(_TestCase, Config) -> + [{ct_hooks,[empty_cth]}|Config]. + +%%-------------------------------------------------------------------- +%% @doc +%% Case - atom() +%% Name of the test case that is about to be run. +%% Config - [tuple()] +%% A list of key/value pairs, holding the test case configuration. +%% +%% Cleanup after each test case +%% +%% @spec end_per_testcase(TestCase, Config) -> _ +%% @end +%%-------------------------------------------------------------------- +end_per_testcase(_TestCase, _Config) -> + ok. + +%%-------------------------------------------------------------------- +%% @doc +%% TestCases - [Case] +%% Case - atom() +%% Name of a test case. +%% +%% Returns a list of all test cases in this test suite +%% +%% @spec all() -> TestCases +%% @end +%%-------------------------------------------------------------------- +all() -> + [test_case]. + +%% Test cases starts here. +%%-------------------------------------------------------------------- +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl new file mode 100644 index 0000000000..988a0969ca --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_cth_SUITE.erl @@ -0,0 +1,50 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_suite_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +suite() -> + [{ct_hooks,[empty_cth]}]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl new file mode 100644 index 0000000000..18b68fbcdc --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_scope_suite_state_cth_SUITE.erl @@ -0,0 +1,50 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_scope_suite_state_cth_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +suite() -> + [{ct_hooks,[{empty_cth,[test]}]}]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + Config. + +end_per_testcase(_TestCase, _Config) -> + ok. + +all() -> + [test_case]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl new file mode 100644 index 0000000000..57fea347f6 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl @@ -0,0 +1,56 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +-module(ct_update_config_SUITE). + +-suite_defaults([{timetrap, {minutes, 10}}]). + +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include("ct.hrl"). + +%% Test server callback functions +init_per_suite(Config) -> + [{init_per_suite,now()}|Config]. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(_TestCase, Config) -> + [{init_per_testcase,now()}|Config]. + +end_per_testcase(_TestCase, _Config) -> + ok. + +init_per_group(GroupName, Config) -> + [{init_per_group,now()}|Config]. + +end_per_group(GroupName, Config) -> + ok. + +all() -> + [{group,group1}]. + +groups() -> + [{group1,[],[test_case]}]. + +%% Test cases starts here. +test_case(Config) when is_list(Config) -> + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl new file mode 100644 index 0000000000..7654a7ee2f --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl @@ -0,0 +1,277 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%% @doc Common Test Example Suite Callback module. +%%% +%%%

This module gives an example of a common test CTH (Common Test Hook). +%%% There are many ways to add a CTH to a test run, you can do it either in +%%% the command line using -ct_hook, in a test spec using +%%% {ct_hook,M} or in the suite it self by returning ct_hook +%%% from either suite/0, init_per_suite/1, init_per_group/2 and +%%% init_per_testcase/2. The scope of the CTH is determined by where is it +%%% started. If it is started in the command line or test spec then it will +%%% be stopped at the end of all tests. If it is started in init_per_suite, +%%% it will be stopped after end_per_suite and so on. See terminate +%%% documentation for a table describing the scoping machanics. +%%% +%%% All of callbacks except init/1 in a CTH are optional.

+ +-module(empty_cth). + +%% CT Hooks +-export([id/1]). +-export([init/2]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/4]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/4]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/4]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/4]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/4]). + +-export([on_tc_fail/3]). +-export([on_tc_skip/3]). + +-export([terminate/1]). + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +-type proplist() :: list({atom(),term()}). +-type config() :: proplist(). +-type reason() :: term(). +-type skip_or_fail() :: {skip, reason()} | + {auto_skip, reason()} | + {fail, reason()}. + +-record(state, { id = ?MODULE :: term()}). + +%% @doc Always called before any other callback function. Use this to initiate +%% any common state. It should return an state for this CTH. +-spec init(Id :: term(), Opts :: proplist()) -> + {Id :: term(), State :: #state{}}. +init(Id, Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, init, [Id, Opts]}}), + Opts. + +%% @doc The ID is used to uniquly identify an CTH instance, if two CTH's +%% return the same ID the seconds CTH is ignored. This function should NOT +%% have any side effects as it might be called multiple times by common test. +-spec id(Opts :: proplist()) -> + Id :: term(). +id(Opts) -> + gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, id, [Opts]}}), + now(). + +%% @doc Called before init_per_suite is called. Note that this callback is +%% only called if the CTH is added before init_per_suite is run (eg. in a test +%% specification, suite/0 function etc). +%% You can change the config in the this function. +-spec pre_init_per_suite(Suite :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, pre_init_per_suite, + [Suite,Config,State]}}), + {Config, State}. + +%% @doc Called after init_per_suite. +%% you can change the return value in this function. +-spec post_init_per_suite(Suite :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_suite(Suite,Config,Return,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_init_per_suite, + [Suite,Config,Return,State]}}), + {Return, State}. + +%% @doc Called before end_per_suite. The config/state can be changed here, +%% though it will only affect the *end_per_suite function. +-spec pre_end_per_suite(Suite :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_suite(Suite,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, pre_end_per_suite, + [Suite,Config,State]}}), + {Config, State}. + +%% @doc Called after end_per_suite. Note that the config cannot be +%% changed here, only the status of the suite. +-spec post_end_per_suite(Suite :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_suite(Suite,Config,Return,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_end_per_suite, + [Suite,Config,Return,State]}}), + {Return, State}. + +%% @doc Called before each init_per_group. +%% You can change the config in this function. +-spec pre_init_per_group(Group :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, pre_init_per_group, + [Group,Config,State]}}), + {Config, State}. + +%% @doc Called after each init_per_group. +%% You can change the return value in this function. +-spec post_init_per_group(Group :: atom(), + Config :: config(), + Return :: config() | skip_or_fail(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +post_init_per_group(Group,Config,Return,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_init_per_group, + [Group,Config,Return,State]}}), + {Return, State}. + +%% @doc Called after each end_per_group. The config/state can be changed here, +%% though it will only affect the *end_per_group functions. +-spec pre_end_per_group(Group :: atom(), + Config :: config() | skip_or_fail(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +pre_end_per_group(Group,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, pre_end_per_group, + [Group,Config,State]}}), + {Config, State}. + +%% @doc Called after each end_per_group. Note that the config cannot be +%% changed here, only the status of the group. +-spec post_end_per_group(Group :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_group(Group,Config,Return,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_end_per_group, + [Group,Config,Return,State]}}), + {Return, State}. + +%% @doc Called before each test case. +%% You can change the config in this function. +-spec pre_init_per_testcase(TC :: atom(), + Config :: config(), + State :: #state{}) -> + {config() | skip_or_fail(), NewState :: #state{}}. +pre_init_per_testcase(TC,Config,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, pre_init_per_testcase, + [TC,Config,State]}}), + {Config, State}. + +%% @doc Called after each test case. Note that the config cannot be +%% changed here, only the status of the test case. +-spec post_end_per_testcase(TC :: atom(), + Config :: config(), + Return :: term(), + State :: #state{}) -> + {ok | skip_or_fail(), NewState :: #state{}}. +post_end_per_testcase(TC,Config,Return,State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, post_end_per_testcase, + [TC,Config,Return,State]}}), + {Return, State}. + +%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, +%% post_end_per_group and post_end_per_tc if the suite, group or test case failed. +%% This function should be used for extra cleanup which might be needed. +%% It is not possible to modify the config or the status of the test run. +-spec on_tc_fail(TC :: init_per_suite | end_per_suite | + init_per_group | end_per_group | atom(), + Reason :: term(), State :: #state{}) -> + NewState :: #state{}. +on_tc_fail(TC, Reason, State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, on_tc_fail, + [TC,Reason,State]}}), + State. + +%% @doc Called when a test case is skipped by either user action +%% or due to an init function failing. Test case can be +%% end_per_suite, init_per_group, end_per_group and the actual test cases. +-spec on_tc_skip(TC :: end_per_suite | + init_per_group | end_per_group | atom(), + {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} | + {tc_user_skip, {skipped, Reason :: term()}}, + State :: #state{}) -> + NewState :: #state{}. +on_tc_skip(TC, Reason, State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, on_tc_skip, + [TC,Reason,State]}}), + State. + +%% @doc Called when the scope of the CTH is done, this depends on +%% when the CTH was specified. This translation table describes when this +%% function is called. +%% +%% | Started in | terminate called | +%% |---------------------|-------------------------| +%% | command_line | after all tests are run | +%% | test spec | after all tests are run | +%% | suite/0 | after SUITE is done | +%% | init_per_suite/1 | after SUITE is done | +%% | init_per_group/2 | after group is done | +%% |-----------------------------------------------| +%% +-spec terminate(State :: #state{}) -> + term(). +terminate(State) -> + gen_event:notify( + ?CT_EVMGR_REF, #event{ name = cth, node = node(), + data = {?MODULE, terminate, [State]}}), + ok. diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl new file mode 100644 index 0000000000..b4c26259a6 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_post_suite_cth.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(fail_post_suite_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {{fail, "Test failure"}, State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl new file mode 100644 index 0000000000..acf80a1b2e --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/fail_pre_suite_cth.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(fail_pre_suite_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State), + {{fail, "Test failure"}, State}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl new file mode 100644 index 0000000000..58ed400e1c --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/id_no_init_cth.erl @@ -0,0 +1,32 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(id_no_init_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-export([id/1]). + +id(Opts) -> + empty_cth:id(Opts). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl new file mode 100644 index 0000000000..a18f4bf2f3 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_cth.erl @@ -0,0 +1,33 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(minimal_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-export([init/2]). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl new file mode 100644 index 0000000000..79cd55f68e --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/minimal_terminate_cth.erl @@ -0,0 +1,38 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(minimal_terminate_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-export([init/2]). +-export([terminate/1]). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +terminate(State) -> + empty_cth:terminate(State). + + diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl new file mode 100644 index 0000000000..01a932bd59 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/recover_post_suite_cth.erl @@ -0,0 +1,74 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(recover_post_suite_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {lists:keydelete(tc_status,1,Config),State}; +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl new file mode 100644 index 0000000000..acfb93fe26 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/same_id_cth.erl @@ -0,0 +1,75 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(same_id_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +id(Opts) -> + empty_cth:id(Opts), + ?MODULE. + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl new file mode 100644 index 0000000000..6d4605b33b --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_post_suite_cth.erl @@ -0,0 +1,72 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(skip_post_suite_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State). + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {{skip, "Test skip"}, State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl new file mode 100644 index 0000000000..49efd0d0cd --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/skip_pre_suite_cth.erl @@ -0,0 +1,73 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(skip_pre_suite_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State), + {{skip, "Test skip"}, State}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl new file mode 100644 index 0000000000..53d75e6ce3 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/state_update_cth.erl @@ -0,0 +1,83 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(state_update_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + State = empty_cth:init(Id, Opts), + [init|State]. + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State), + {Config, [pre_init_per_suite|State]}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {Config, [post_init_per_suite|State]}. + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State), + {Config, [pre_end_per_suite|State]}. + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State), + {Return, [post_end_per_suite|State]}. + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State), + {Config, [pre_init_per_group|State]}. + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State), + {Return, [post_init_per_group|State]}. + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State), + {Config, [pre_end_per_group|State]}. + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State), + {Return, [post_end_per_group|State]}. + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State), + {Config, [pre_init_per_testcase|State]}. + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State), + {Return, [post_end_per_testcase|State]}. + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State), + [on_tc_fail|State]. + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State), + [on_tc_skip|State]. + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl new file mode 100644 index 0000000000..4c44ef025b --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/undef_cth.erl @@ -0,0 +1,71 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(undef_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(_Suite, _Config, _State) -> + lists:flaten([1,2,[3,4]]). + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State). + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State). + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State). + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State). + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State). + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State). + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State). + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State). + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State). + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl new file mode 100644 index 0000000000..788ef2cec2 --- /dev/null +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/update_config_cth.erl @@ -0,0 +1,82 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + + +-module(update_config_cth). + + +-include_lib("common_test/src/ct_util.hrl"). +-include_lib("common_test/include/ct_event.hrl"). + + +%% CT Hooks +-compile(export_all). + +init(Id, Opts) -> + empty_cth:init(Id, Opts). + +pre_init_per_suite(Suite, Config, State) -> + empty_cth:pre_init_per_suite(Suite,Config,State), + {[{pre_init_per_suite,now()}|Config],State}. + +post_init_per_suite(Suite,Config,Return,State) -> + empty_cth:post_init_per_suite(Suite,Config,Return,State), + {[{post_init_per_suite,now()}|Return],State}. + +pre_end_per_suite(Suite,Config,State) -> + empty_cth:pre_end_per_suite(Suite,Config,State), + {[{pre_end_per_suite,now()}|Config],State}. + +post_end_per_suite(Suite,Config,Return,State) -> + empty_cth:post_end_per_suite(Suite,Config,Return,State), + NewConfig = [{post_end_per_suite,now()}|Config], + {NewConfig,NewConfig}. + +pre_init_per_group(Group,Config,State) -> + empty_cth:pre_init_per_group(Group,Config,State), + {[{pre_init_per_group,now()}|Config],State}. + +post_init_per_group(Group,Config,Return,State) -> + empty_cth:post_init_per_group(Group,Config,Return,State), + {[{post_init_per_group,now()}|Return],State}. + +pre_end_per_group(Group,Config,State) -> + empty_cth:pre_end_per_group(Group,Config,State), + {[{pre_end_per_group,now()}|Config],State}. + +post_end_per_group(Group,Config,Return,State) -> + empty_cth:post_end_per_group(Group,Config,Return,State), + {[{post_end_per_group,now()}|Config],State}. + +pre_init_per_testcase(TC,Config,State) -> + empty_cth:pre_init_per_testcase(TC,Config,State), + {[{pre_init_per_testcase,now()}|Config],State}. + +post_end_per_testcase(TC,Config,Return,State) -> + empty_cth:post_end_per_testcase(TC,Config,Return,State), + {[{post_end_per_testcase,now()}|Config],State}. + +on_tc_fail(TC, Reason, State) -> + empty_cth:on_tc_fail(TC,Reason,State). + +on_tc_skip(TC, Reason, State) -> + empty_cth:on_tc_skip(TC,Reason,State). + +terminate(State) -> + empty_cth:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE.erl deleted file mode 100644 index 67f3cf430a..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE.erl +++ /dev/null @@ -1,1021 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%%------------------------------------------------------------------- -%%% File: ct_error_SUITE -%%% -%%% Description: -%%% Test various errors in Common Test suites. -%%% -%%% The suites used for the test are located in the data directory. -%%%------------------------------------------------------------------- --module(ct_suite_callback_SUITE). - --compile(export_all). - --include_lib("test_server/include/test_server.hrl"). --include_lib("common_test/include/ct_event.hrl"). - --define(eh, ct_test_support_eh). - -%%-------------------------------------------------------------------- -%% TEST SERVER CALLBACK FUNCTIONS -%%-------------------------------------------------------------------- - -%%-------------------------------------------------------------------- -%% Description: Since Common Test starts another Test Server -%% instance, the tests need to be performed on a separate node (or -%% there will be clashes with logging processes etc). -%%-------------------------------------------------------------------- -init_per_suite(Config) -> - DataDir = ?config(data_dir, Config), - TestDir = filename:join(DataDir,"scb/tests/"), - SCBs = filelib:wildcard(filename:join(TestDir,"*_scb.erl")), - io:format("SCBs: ~p",[SCBs]), - [io:format("Compiling ~p: ~p", - [FileName,compile:file(FileName,[{outdir,TestDir},debug_info])]) || - FileName <- SCBs], - ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]). - -end_per_suite(Config) -> - ct_test_support:end_per_suite(Config). - -init_per_testcase(TestCase, Config) -> - ct_test_support:init_per_testcase(TestCase, Config). - -end_per_testcase(TestCase, Config) -> - ct_test_support:end_per_testcase(TestCase, Config). - - -suite() -> - [{timetrap,{seconds,20}}]. - -all() -> - all(suite). - -all(suite) -> - lists:reverse( - [ - one_scb, two_scb, faulty_scb_no_init, faulty_scb_id_no_init, - faulty_scb_exit_in_init, faulty_scb_exit_in_id, - faulty_scb_exit_in_init_scope_suite, minimal_scb, - minimal_and_maximal_scb, faulty_scb_undef, - scope_per_suite_scb, scope_per_group_scb, scope_suite_scb, - scope_per_suite_state_scb, scope_per_group_state_scb, - scope_suite_state_scb, - fail_pre_suite_scb, fail_post_suite_scb, skip_pre_suite_scb, - skip_post_suite_scb, recover_post_suite_scb, update_config_scb, - state_update_scb, options_scb, same_id_scb, - fail_n_skip_with_minimal_scb - ] - ) - . - - -%%-------------------------------------------------------------------- -%% TEST CASES -%%-------------------------------------------------------------------- - -%%%----------------------------------------------------------------- -%%% -one_scb(Config) when is_list(Config) -> - do_test(one_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb], Config). - -two_scb(Config) when is_list(Config) -> - do_test(two_empty_scb, "ct_scb_empty_SUITE.erl",[empty_scb,empty_scb], - Config). - -faulty_scb_no_init(Config) when is_list(Config) -> - do_test(faulty_scb_no_init, "ct_scb_empty_SUITE.erl",[askjhdkljashdkaj], - Config,{error,"Failed to start SCB, see the " - "CT Log for details"}). - -faulty_scb_id_no_init(Config) when is_list(Config) -> - do_test(faulty_scb_id_no_init, "ct_scb_empty_SUITE.erl",[id_no_init_scb], - Config,{error,"Failed to start SCB, see the " - "CT Log for details"}). - -minimal_scb(Config) when is_list(Config) -> - do_test(minimal_scb, "ct_scb_empty_SUITE.erl",[minimal_scb],Config). - -minimal_and_maximal_scb(Config) when is_list(Config) -> - do_test(minimal_and_maximal_scb, "ct_scb_empty_SUITE.erl", - [minimal_scb, empty_scb],Config). - -faulty_scb_undef(Config) when is_list(Config) -> - do_test(faulty_scb_undef, "ct_scb_empty_SUITE.erl", - [undef_scb],Config). - -faulty_scb_exit_in_init_scope_suite(Config) when is_list(Config) -> - do_test(faulty_scb_exit_in_init_scope_suite, - "ct_exit_in_init_scope_suite_scb_SUITE.erl", - [],Config). - -faulty_scb_exit_in_init(Config) when is_list(Config) -> - do_test(faulty_scb_exit_in_init, "ct_scb_empty_SUITE.erl", - [crash_init_scb], Config, - {error,"Failed to start SCB, see the " - "CT Log for details"}). - -faulty_scb_exit_in_id(Config) when is_list(Config) -> - do_test(faulty_scb_exit_in_id, "ct_scb_empty_SUITE.erl", - [crash_id_scb], Config, - {error,"Failed to start SCB, see the " - "CT Log for details"}). - -scope_per_suite_scb(Config) when is_list(Config) -> - do_test(scope_per_suite_scb, "ct_scope_per_suite_scb_SUITE.erl", - [],Config). - -scope_suite_scb(Config) when is_list(Config) -> - do_test(scope_suite_scb, "ct_scope_suite_scb_SUITE.erl", - [],Config). - -scope_per_group_scb(Config) when is_list(Config) -> - do_test(scope_per_group_scb, "ct_scope_per_group_scb_SUITE.erl", - [],Config). - -scope_per_suite_state_scb(Config) when is_list(Config) -> - do_test(scope_per_suite_state_scb, "ct_scope_per_suite_state_scb_SUITE.erl", - [],Config). - -scope_suite_state_scb(Config) when is_list(Config) -> - do_test(scope_suite_state_scb, "ct_scope_suite_state_scb_SUITE.erl", - [],Config). - -scope_per_group_state_scb(Config) when is_list(Config) -> - do_test(scope_per_group_state_scb, "ct_scope_per_group_state_scb_SUITE.erl", - [],Config). - -fail_pre_suite_scb(Config) when is_list(Config) -> - do_test(fail_pre_suite_scb, "ct_scb_empty_SUITE.erl", - [fail_pre_suite_scb],Config). - -fail_post_suite_scb(Config) when is_list(Config) -> - do_test(fail_post_suite_scb, "ct_scb_empty_SUITE.erl", - [fail_post_suite_scb],Config). - -skip_pre_suite_scb(Config) when is_list(Config) -> - do_test(skip_pre_suite_scb, "ct_scb_empty_SUITE.erl", - [skip_pre_suite_scb],Config). - -skip_post_suite_scb(Config) when is_list(Config) -> - do_test(skip_post_suite_scb, "ct_scb_empty_SUITE.erl", - [skip_post_suite_scb],Config). - -recover_post_suite_scb(Config) when is_list(Config) -> - do_test(recover_post_suite_scb, "ct_scb_fail_per_suite_SUITE.erl", - [recover_post_suite_scb],Config). - -update_config_scb(Config) when is_list(Config) -> - do_test(update_config_scb, "ct_update_config_SUITE.erl", - [update_config_scb],Config). - -state_update_scb(Config) when is_list(Config) -> - do_test(state_update_scb, "ct_scb_fail_one_skip_one_SUITE.erl", - [state_update_scb,state_update_scb],Config). - -options_scb(Config) when is_list(Config) -> - do_test(options_scb, "ct_scb_empty_SUITE.erl", - [{empty_scb,[test]}],Config). - -same_id_scb(Config) when is_list(Config) -> - do_test(same_id_scb, "ct_scb_empty_SUITE.erl", - [same_id_scb,same_id_scb],Config). - -fail_n_skip_with_minimal_scb(Config) when is_list(Config) -> - do_test(fail_n_skip_with_minimal_scb, "ct_scb_fail_one_skip_one_SUITE.erl", - [minimal_terminate_scb],Config). - -%%%----------------------------------------------------------------- -%%% HELP FUNCTIONS -%%%----------------------------------------------------------------- - -do_test(Tag, SWC, SCBs, Config) -> - do_test(Tag, SWC, SCBs, Config, ok). -do_test(Tag, SWC, SCBs, Config, {error,_} = Res) -> - do_test(Tag, SWC, SCBs, Config, Res, 1); -do_test(Tag, SWC, SCBs, Config, Res) -> - do_test(Tag, SWC, SCBs, Config, Res, 2). - -do_test(Tag, SuiteWildCard, SCBs, Config, Res, EC) -> - - DataDir = ?config(data_dir, Config), - Suites = filelib:wildcard( - filename:join([DataDir,"scb/tests",SuiteWildCard])), - {Opts,ERPid} = setup([{suite,Suites}, - {suite_callbacks,SCBs},{label,Tag}], Config), - Res = ct_test_support:run(Opts, Config), - Events = ct_test_support:get_events(ERPid, Config), - - ct_test_support:log_events(Tag, - reformat(Events, ?eh), - ?config(priv_dir, Config)), - - TestEvents = events_to_check(Tag, EC), - ok = ct_test_support:verify_events(TestEvents, Events, Config). - -setup(Test, Config) -> - Opts0 = ct_test_support:get_opts(Config), - Level = ?config(trace_level, Config), - EvHArgs = [{cbm,ct_test_support},{trace_level,Level}], - Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test], - ERPid = ct_test_support:start_event_receiver(Config), - {Opts,ERPid}. - -reformat(Events, EH) -> - ct_test_support:reformat(Events, EH). -%reformat(Events, _EH) -> -% Events. - -%%%----------------------------------------------------------------- -%%% TEST EVENTS -%%%----------------------------------------------------------------- -events_to_check(Test) -> - %% 2 tests (ct:run_test + script_start) is default - events_to_check(Test, 2). - -events_to_check(_, 0) -> - []; -events_to_check(Test, N) -> - test_events(Test) ++ events_to_check(Test, N-1). - -test_events(one_empty_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,id,[[]]}}, - {?eh,scb,{empty_scb,init,[{'_','_','_'},[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,pre_init_per_suite, - [ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{empty_scb,post_init_per_suite, - [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite, - [ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{empty_scb,terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(two_empty_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(faulty_scb_no_init) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(faulty_scb_id_no_init) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {negative,{?eh,tc_start,'_'}, - {?eh,test_done,{'DEF','STOP_TIME'}}}, - {?eh,stop_logging,[]} - ]; - -test_events(minimal_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {negative,{?eh,scb,{'_',id,['_',[]]}}, - {?eh,scb,{'_',init,['_',[]]}}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(minimal_and_maximal_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {negative,{?eh,scb,{'_',id,['_',[]]}}, - {?eh,scb,{'_',init,['_',[]]}}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(faulty_scb_undef) -> - FailReasonStr = "undef_scb:pre_init_per_suite/3 SCB call failed", - FailReason = {ct_scb_empty_SUITE,init_per_suite, - {failed,FailReasonStr}}, - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, - {failed, {error,FailReasonStr}}}}, - {?eh,scb,{'_',on_tc_fail,'_'}}, - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, - {failed, FailReason}}}, - {?eh,scb,{'_',on_tc_skip,'_'}}, - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,end_per_suite, - {failed, FailReason}}}, - {?eh,scb,{'_',on_tc_skip,'_'}}, - - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(faulty_scb_exit_in_init_scope_suite) -> - [{?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{'_',init_per_suite}}, - {?eh,scb,{empty_scb,init,['_',[]]}}, - {?eh,tc_done, - {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, - {failed, - {error, - "Failed to start SCB, see the CT Log for details"}}}}, - {?eh,tc_auto_skip, - {ct_exit_in_init_scope_suite_scb_SUITE,test_case, - {failed, - {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, - {failed, - "Failed to start SCB, see the CT Log for details"}}}}}, - {?eh,tc_auto_skip, - {ct_exit_in_init_scope_suite_scb_SUITE,end_per_suite, - {failed, - {ct_exit_in_init_scope_suite_scb_SUITE,init_per_suite, - {failed, - "Failed to start SCB, see the CT Log for details"}}}}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]}]; - -test_events(faulty_scb_exit_in_init) -> - [{?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]}]; - -test_events(faulty_scb_exit_in_id) -> - [{?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,id,[[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {negative, {?eh,tc_start,'_'}, - {?eh,test_done,{'DEF','STOP_TIME'}}}, - {?eh,stop_logging,[]}]; - -test_events(scope_per_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_per_suite_scb_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite, - [ct_scope_per_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_scb_SUITE,'$proplist','_',[]]}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,tc_done,{ct_scope_per_suite_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(scope_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_suite_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scope_suite_scb_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scope_suite_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scope_suite_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_suite_scb_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_scb_SUITE,'$proplist','_',[]]}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,tc_done,{ct_scope_suite_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(scope_per_group_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_per_group_scb_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scope_per_group_scb_SUITE,init_per_suite,ok}}, - - [{?eh,tc_start,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]}}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{init_per_group,group1,[]},ok}}, - - {?eh,tc_start,{ct_scope_per_group_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scope_per_group_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]}}}, - {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[]]}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,tc_done,{ct_scope_per_group_scb_SUITE,{end_per_group,group1,[]},ok}}], - - {?eh,tc_start,{ct_scope_per_group_scb_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scope_per_group_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(scope_per_suite_state_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',id,[[test]]}}, - {?eh,scb,{'_',init,['_',[test]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}}, - {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, - {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_per_suite_state_scb_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite, - [ct_scope_per_suite_state_scb_SUITE,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_per_suite_state_scb_SUITE,'$proplist','_',[test]]}}, - {?eh,scb,{'_',terminate,[[test]]}}, - {?eh,tc_done,{ct_scope_per_suite_state_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(scope_suite_state_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,init_per_suite}}, - {?eh,scb,{'_',id,[[test]]}}, - {?eh,scb,{'_',init,['_',[test]]}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','$proplist',[test]]}}, - {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, - {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_suite_state_scb_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scope_suite_state_scb_SUITE,'$proplist','_',[test]]}}, - {?eh,scb,{'_',terminate,[[test]]}}, - {?eh,tc_done,{ct_scope_suite_state_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(scope_per_group_state_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,init_per_suite}}, - {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,init_per_suite,ok}}, - - [{?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]}}}, - {?eh,scb,{'_',id,[[test]]}}, - {?eh,scb,{'_',init,['_',[test]]}}, - {?eh,scb,{'_',post_init_per_group,[group1,'$proplist','$proplist',[test]]}}, - {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{init_per_group,group1,[]},ok}}, - - {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[test]]}}, - {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]}}}, - {?eh,scb,{'_',pre_end_per_group,[group1,'$proplist',[test]]}}, - {?eh,scb,{'_',post_end_per_group,[group1,'$proplist','_',[test]]}}, - {?eh,scb,{'_',terminate,[[test]]}}, - {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,{end_per_group,group1,[]},ok}}], - - {?eh,tc_start,{ct_scope_per_group_state_scb_SUITE,end_per_suite}}, - {?eh,tc_done,{ct_scope_per_group_state_scb_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} - ]; - -test_events(fail_pre_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - - - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist', - {fail,"Test failure"},[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, - {failed, {error,"Test failure"}}}}, - {?eh,scb,{'_',on_tc_fail, - [init_per_suite,{failed,"Test failure"},[]]}}, - - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, - {failed,{ct_scb_empty_SUITE,init_per_suite, - {failed,"Test failure"}}}}}, - {?eh,scb,{'_',on_tc_skip, - [test_case, {tc_auto_skip, - {failed, {ct_scb_empty_SUITE, init_per_suite, - {failed, "Test failure"}}}},[]]}}, - - - {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite, - {failed, {ct_scb_empty_SUITE, init_per_suite, - {failed, "Test failure"}}}}}, - {?eh,scb,{'_',on_tc_skip, - [end_per_suite, {tc_auto_skip, - {failed, {ct_scb_empty_SUITE, init_per_suite, - {failed, "Test failure"}}}},[]]}}, - - - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb, {'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(fail_post_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite, - {failed,{error,"Test failure"}}}}, - {?eh,scb,{'_',on_tc_fail,[init_per_suite, {failed,"Test failure"}, []]}}, - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case, - {failed,{ct_scb_empty_SUITE,init_per_suite, - {failed,"Test failure"}}}}}, - {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,'_'},[]]}}, - - {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite, - {failed, {ct_scb_empty_SUITE, init_per_suite, - {failed, "Test failure"}}}}}, - {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,'_'},[]]}}, - - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb, {'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(skip_pre_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist',{skip,"Test skip"},[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, - {?eh,scb,{'_',on_tc_skip, - [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}}, - {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, - - {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}}, - {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, - - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb, {'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(skip_post_suite_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite,[ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,{skipped,"Test skip"}}}, - {?eh,scb,{'_',on_tc_skip, - [init_per_suite,{tc_user_skip,{skipped,"Test skip"}},[]]}}, - - {?eh,tc_auto_skip,{ct_scb_empty_SUITE,test_case,"Test skip"}}, - {?eh,scb,{'_',on_tc_skip,[test_case,{tc_auto_skip,"Test skip"},[]]}}, - - {?eh,tc_auto_skip, {ct_scb_empty_SUITE, end_per_suite,"Test skip"}}, - {?eh,scb,{'_',on_tc_skip,[end_per_suite,{tc_auto_skip,"Test skip"},[]]}}, - - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(recover_post_suite_scb) -> - Suite = ct_scb_fail_per_suite_SUITE, - [ - {?eh,start_logging,'_'}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{Suite,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[Suite,'$proplist','$proplist']}}, - {?eh,scb,{'_',post_init_per_suite,[Suite,contains([tc_status]), - {'EXIT',{'_','_'}},[]]}}, - {?eh,tc_done,{Suite,init_per_suite,ok}}, - - {?eh,tc_start,{Suite,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase, - [test_case, not_contains([tc_status]),[]]}}, - {?eh,scb,{'_',post_end_per_testcase, - [test_case, contains([tc_status]),'_',[]]}}, - {?eh,tc_done,{Suite,test_case,ok}}, - - {?eh,tc_start,{Suite,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite, - [Suite,not_contains([tc_status]),[]]}}, - {?eh,scb,{'_',post_end_per_suite, - [Suite,not_contains([tc_status]),'_',[]]}}, - {?eh,tc_done,{Suite,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(update_config_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - - {?eh,tc_start,{ct_update_config_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite, - [ct_update_config_SUITE,contains([]),[]]}}, - {?eh,scb,{'_',post_init_per_suite, - [ct_update_config_SUITE, - '$proplist', - contains( - [init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,tc_done,{ct_update_config_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_update_config_SUITE, {init_per_group,group1,[]}}}, - {?eh,scb,{'_',pre_init_per_group, - [group1,contains( - [post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,scb,{'_',post_init_per_group, - [group1, - contains( - [post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - contains( - [init_per_group, - pre_init_per_group, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,tc_done,{ct_update_config_SUITE,{init_per_group,group1,[]},ok}}, - - {?eh,tc_start,{ct_update_config_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase, - [test_case,contains( - [post_init_per_group, - init_per_group, - pre_init_per_group, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,scb,{'_',post_end_per_testcase, - [test_case,contains( - [init_per_testcase, - pre_init_per_testcase, - post_init_per_group, - init_per_group, - pre_init_per_group, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - ok,[]]}}, - {?eh,tc_done,{ct_update_config_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_update_config_SUITE, {end_per_group,group1,[]}}}, - {?eh,scb,{'_',pre_end_per_group, - [group1,contains( - [post_init_per_group, - init_per_group, - pre_init_per_group, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,scb,{'_',post_end_per_group, - [group1, - contains( - [pre_end_per_group, - post_init_per_group, - init_per_group, - pre_init_per_group, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - ok,[]]}}, - {?eh,tc_done,{ct_update_config_SUITE,{end_per_group,group1,[]},ok}}, - - {?eh,tc_start,{ct_update_config_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite, - [ct_update_config_SUITE,contains( - [post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - []]}}, - {?eh,scb,{'_',post_end_per_suite, - [ct_update_config_SUITE,contains( - [pre_end_per_suite, - post_init_per_suite, - init_per_suite, - pre_init_per_suite]), - '_',[]]}}, - {?eh,tc_done,{ct_update_config_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[contains( - [post_end_per_suite, - pre_end_per_suite, - post_init_per_suite, - init_per_suite, - pre_init_per_suite])]}}, - {?eh,stop_logging,[]} - ]; - -test_events(state_update_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{'_',init_per_suite}}, - - {?eh,tc_done,{'_',end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[contains( - [post_end_per_suite,pre_end_per_suite, - post_end_per_group,pre_end_per_group, - {not_in_order, - [post_end_per_testcase,pre_init_per_testcase, - on_tc_skip,post_end_per_testcase, - pre_init_per_testcase,on_tc_fail, - post_end_per_testcase,pre_init_per_testcase] - }, - post_init_per_group,pre_init_per_group, - post_init_per_suite,pre_init_per_suite, - init])]}}, - {?eh,scb,{'_',terminate,[contains( - [post_end_per_suite,pre_end_per_suite, - post_end_per_group,pre_end_per_group, - {not_in_order, - [post_end_per_testcase,pre_init_per_testcase, - on_tc_skip,post_end_per_testcase, - pre_init_per_testcase,on_tc_fail, - post_end_per_testcase,pre_init_per_testcase] - }, - post_init_per_group,pre_init_per_group, - post_init_per_suite,pre_init_per_suite, - init] - )]}}, - {?eh,stop_logging,[]} - ]; - -test_events(options_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{empty_scb,init,['_',[test]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{empty_scb,pre_init_per_suite, - [ct_scb_empty_SUITE,'$proplist',[test]]}}, - {?eh,scb,{empty_scb,post_init_per_suite, - [ct_scb_empty_SUITE,'$proplist','$proplist',[test]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{empty_scb,pre_init_per_testcase,[test_case,'$proplist',[test]]}}, - {?eh,scb,{empty_scb,post_end_per_testcase,[test_case,'$proplist','_',[test]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{empty_scb,pre_end_per_suite, - [ct_scb_empty_SUITE,'$proplist',[test]]}}, - {?eh,scb,{empty_scb,post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[test]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{empty_scb,terminate,[[test]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(same_id_scb) -> - [ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,scb,{'_',init,[same_id_scb,[]]}}, - {?eh,scb,{'_',id,[[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{ct_scb_empty_SUITE,init_per_suite}}, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {negative, - {?eh,scb,{'_',pre_init_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_init_per_suite, - [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}}, - {negative, - {?eh,scb,{'_',post_init_per_suite, - [ct_scb_empty_SUITE,'$proplist','$proplist',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,init_per_suite,ok}}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,test_case}}, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {negative, - {?eh,scb,{'_',pre_init_per_testcase,[test_case,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}}, - {negative, - {?eh,scb,{'_',post_end_per_testcase,[test_case,'$proplist',ok,[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,test_case,ok}}}, - - {?eh,tc_start,{ct_scb_empty_SUITE,end_per_suite}}, - {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {negative, - {?eh,scb,{'_',pre_end_per_suite,[ct_scb_empty_SUITE,'$proplist',[]]}}, - {?eh,scb,{'_',post_end_per_suite,[ct_scb_empty_SUITE,'$proplist','_',[]]}}}, - {negative, - {?eh,scb,{'_',post_end_per_suite, - [ct_scb_empty_SUITE,'$proplist','_',[]]}}, - {?eh,tc_done,{ct_scb_empty_SUITE,end_per_suite,ok}}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(fail_n_skip_with_minimal_scb) -> - [{?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,scb,{'_',init,['_',[]]}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,tc_start,{'_',init_per_suite}}, - - {?eh,tc_done,{'_',end_per_suite,ok}}, - {?eh,scb,{'_',terminate,[[]]}}, - {?eh,stop_logging,[]} - ]; - -test_events(ok) -> - ok. - - -%% test events help functions -contains(List) -> - fun(Proplist) when is_list(Proplist) -> - contains(List,Proplist) - end. - -contains([{not_in_order,List}|T],Rest) -> - contains_parallel(List,Rest), - contains(T,Rest); -contains([{Ele,Pos}|T] = L,[H|T2]) -> - case element(Pos,H) of - Ele -> - contains(T,T2); - _ -> - contains(L,T2) - end; -contains([Ele|T],[{Ele,_}|T2])-> - contains(T,T2); -contains([Ele|T],[Ele|T2])-> - contains(T,T2); -contains(List,[_|T]) -> - contains(List,T); -contains([],_) -> - match. - -contains_parallel([Key | T], Elems) -> - contains([Key],Elems), - contains_parallel(T,Elems); -contains_parallel([],_Elems) -> - match. - -not_contains(List) -> - fun(Proplist) when is_list(Proplist) -> - [] = [Ele || {Ele,_} <- Proplist, - Test <- List, - Test =:= Ele] - end. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl deleted file mode 100644 index 2c256c46df..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_id_scb.erl +++ /dev/null @@ -1,34 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(crash_id_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --export([id/1]). - -id(Opts) -> - empty_scb:id(Opts), - exit(diediedie). - diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl deleted file mode 100644 index c4138bbcef..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/crash_init_scb.erl +++ /dev/null @@ -1,34 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(crash_init_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --export([init/2]). - -init(Id, Opts) -> - empty_scb:init(Id, Opts), - exit(diediedie). - diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl deleted file mode 100644 index bfaeb7ca3a..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_exit_in_init_scope_suite_scb_SUITE.erl +++ /dev/null @@ -1,50 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_exit_in_init_scope_suite_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include_lib("common_test/include/ct.hrl"). - -%% Test server callback functions -suite() -> - [{suite_callbacks,[crash_init_scb]}]. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl deleted file mode 100644 index 0eb40bce00..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_empty_SUITE.erl +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scb_empty_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl deleted file mode 100644 index 593bd4a534..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_one_skip_one_SUITE.erl +++ /dev/null @@ -1,64 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scb_fail_one_skip_one_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_Group,Config) -> - Config. - -end_per_group(_Group,_Config) -> - ok. - -init_per_testcase(test_case2, Config) -> - {skip,"skip it"}; -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -groups() -> - [{group1,[parallel],[{group2,[parallel],[test_case1,test_case2,test_case3]}]}]. - -all() -> - [{group,group1}]. - -%% Test cases starts here. -test_case1(Config) -> - ok = nok. - -test_case2(Config) -> - ok. - -test_case3(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl deleted file mode 100644 index dfc7c37e8d..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scb_fail_per_suite_SUITE.erl +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scb_fail_per_suite_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - ok = nok. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl deleted file mode 100644 index 8df4a6d522..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_scb_SUITE.erl +++ /dev/null @@ -1,56 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_per_group_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -init_per_group(GroupName, Config) -> - [{suite_callbacks,[empty_scb]}|Config]. - -end_per_group(GroupName, Config) -> - ok. - -all() -> - [{group,group1}]. - -groups() -> - [{group1,[],[test_case]}]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl deleted file mode 100644 index 63dd767b25..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_group_state_scb_SUITE.erl +++ /dev/null @@ -1,56 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_per_group_state_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -init_per_group(_GroupName, Config) -> - [{suite_callbacks,[{empty_scb,[test]}]}|Config]. - -end_per_group(_GroupName, _Config) -> - ok. - -all() -> - [{group,group1}]. - -groups() -> - [{group1,[],[test_case]}]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl deleted file mode 100644 index 5492243b1b..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_scb_SUITE.erl +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_per_suite_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - [{suite_callbacks,[empty_scb]}|Config]. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl deleted file mode 100644 index 02a011f91b..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_suite_state_scb_SUITE.erl +++ /dev/null @@ -1,47 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_per_suite_state_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - [{suite_callbacks,[{empty_scb,[test]}]}|Config]. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl deleted file mode 100644 index d99e741553..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_per_tc_scb_SUITE.erl +++ /dev/null @@ -1,110 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_per_tc_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before the whole suite -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% -%% @spec init_per_suite(Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_suite(Config) -> - Config. - -%%-------------------------------------------------------------------- -%% @doc -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after the whole suite -%% -%% @spec end_per_suite(Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_suite(_Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Initiation before each test case -%% -%% Note: This function is free to add any key/value pairs to the Config -%% variable, but should NOT alter/remove any existing entries. -%% Initiation before each test case -%% -%% @spec init_per_testcase(TestCase, Config) -> Config -%% @end -%%-------------------------------------------------------------------- -init_per_testcase(_TestCase, Config) -> - [{suite_callbacks,[empty_scb]}|Config]. - -%%-------------------------------------------------------------------- -%% @doc -%% Case - atom() -%% Name of the test case that is about to be run. -%% Config - [tuple()] -%% A list of key/value pairs, holding the test case configuration. -%% -%% Cleanup after each test case -%% -%% @spec end_per_testcase(TestCase, Config) -> _ -%% @end -%%-------------------------------------------------------------------- -end_per_testcase(_TestCase, _Config) -> - ok. - -%%-------------------------------------------------------------------- -%% @doc -%% TestCases - [Case] -%% Case - atom() -%% Name of a test case. -%% -%% Returns a list of all test cases in this test suite -%% -%% @spec all() -> TestCases -%% @end -%%-------------------------------------------------------------------- -all() -> - [test_case]. - -%% Test cases starts here. -%%-------------------------------------------------------------------- -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl deleted file mode 100644 index 7598c911b1..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_scb_SUITE.erl +++ /dev/null @@ -1,50 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_suite_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -suite() -> - [{suite_callbacks,[empty_scb]}]. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl deleted file mode 100644 index 869532f5cd..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_scope_suite_state_scb_SUITE.erl +++ /dev/null @@ -1,50 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_scope_suite_state_scb_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -suite() -> - [{suite_callbacks,[{empty_scb,[test]}]}]. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - Config. - -end_per_testcase(_TestCase, _Config) -> - ok. - -all() -> - [test_case]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl deleted file mode 100644 index 57fea347f6..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/ct_update_config_SUITE.erl +++ /dev/null @@ -1,56 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - --module(ct_update_config_SUITE). - --suite_defaults([{timetrap, {minutes, 10}}]). - -%% Note: This directive should only be used in test suites. --compile(export_all). - --include("ct.hrl"). - -%% Test server callback functions -init_per_suite(Config) -> - [{init_per_suite,now()}|Config]. - -end_per_suite(_Config) -> - ok. - -init_per_testcase(_TestCase, Config) -> - [{init_per_testcase,now()}|Config]. - -end_per_testcase(_TestCase, _Config) -> - ok. - -init_per_group(GroupName, Config) -> - [{init_per_group,now()}|Config]. - -end_per_group(GroupName, Config) -> - ok. - -all() -> - [{group,group1}]. - -groups() -> - [{group1,[],[test_case]}]. - -%% Test cases starts here. -test_case(Config) when is_list(Config) -> - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl deleted file mode 100644 index a82ca02d04..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/empty_scb.erl +++ /dev/null @@ -1,277 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%% @doc Common Test Example Suite Callback module. -%%% -%%%

This module gives an example of a common test SCB (Suite CallBack). -%%% There are many ways to add a SCB to a test run, you can do it either in -%%% the command line using -suite_callback, in a test spec using -%%% {suite_callback,M} or in the suite it self by returning suite_callback -%%% from either suite/0, init_per_suite/1, init_per_group/2 and -%%% init_per_testcase/2. The scope of the SCB is determined by where is it -%%% started. If it is started in the command line or test spec then it will -%%% be stopped at the end of all tests. If it is started in init_per_suite, -%%% it will be stopped after end_per_suite and so on. See terminate -%%% documentation for a table describing the scoping machanics. -%%% -%%% All of callbacks except init/1 in a SCB are optional.

- --module(empty_scb). - -%% Suite Callbacks --export([id/1]). --export([init/2]). - --export([pre_init_per_suite/3]). --export([post_init_per_suite/4]). --export([pre_end_per_suite/3]). --export([post_end_per_suite/4]). - --export([pre_init_per_group/3]). --export([post_init_per_group/4]). --export([pre_end_per_group/3]). --export([post_end_per_group/4]). - --export([pre_init_per_testcase/3]). --export([post_end_per_testcase/4]). - --export([on_tc_fail/3]). --export([on_tc_skip/3]). - --export([terminate/1]). - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - --type proplist() :: list({atom(),term()}). --type config() :: proplist(). --type reason() :: term(). --type skip_or_fail() :: {skip, reason()} | - {auto_skip, reason()} | - {fail, reason()}. - --record(state, { id = ?MODULE :: term()}). - -%% @doc Always called before any other callback function. Use this to initiate -%% any common state. It should return an ID for this SCB and a state. --spec init(Id :: term(), Opts :: proplist()) -> - {Id :: term(), State :: #state{}}. -init(Id, Opts) -> - gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, init, [Id, Opts]}}), - Opts. - -%% @doc The ID is used to uniquly identify an SCB instance, if two SCB's -%% return the same ID the seconds SCB is ignored. This function should NOT -%% have any side effects as it might be called multiple times by common test. --spec id(Opts :: proplist()) -> - Id :: term(). -id(Opts) -> - gen_event:notify(?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, id, [Opts]}}), - now(). - -%% @doc Called before init_per_suite is called. Note that this callback is -%% only called if the SCB is added before init_per_suite is run (eg. in a test -%% specification, suite/0 function etc). -%% You can change the config in the this function. --spec pre_init_per_suite(Suite :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_suite(Suite,Config,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, pre_init_per_suite, - [Suite,Config,State]}}), - {Config, State}. - -%% @doc Called after init_per_suite. -%% you can change the return value in this function. --spec post_init_per_suite(Suite :: atom(), - Config :: config(), - Return :: config() | skip_or_fail(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_suite(Suite,Config,Return,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, post_init_per_suite, - [Suite,Config,Return,State]}}), - {Return, State}. - -%% @doc Called before end_per_suite. The config/state can be changed here, -%% though it will only affect the *end_per_suite function. --spec pre_end_per_suite(Suite :: atom(), - Config :: config() | skip_or_fail(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_per_suite(Suite,Config,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, pre_end_per_suite, - [Suite,Config,State]}}), - {Config, State}. - -%% @doc Called after end_per_suite. Note that the config cannot be -%% changed here, only the status of the suite. --spec post_end_per_suite(Suite :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_suite(Suite,Config,Return,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, post_end_per_suite, - [Suite,Config,Return,State]}}), - {Return, State}. - -%% @doc Called before each init_per_group. -%% You can change the config in this function. --spec pre_init_per_group(Group :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_group(Group,Config,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, pre_init_per_group, - [Group,Config,State]}}), - {Config, State}. - -%% @doc Called after each init_per_group. -%% You can change the return value in this function. --spec post_init_per_group(Group :: atom(), - Config :: config(), - Return :: config() | skip_or_fail(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -post_init_per_group(Group,Config,Return,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, post_init_per_group, - [Group,Config,Return,State]}}), - {Return, State}. - -%% @doc Called after each end_per_group. The config/state can be changed here, -%% though it will only affect the *end_per_group functions. --spec pre_end_per_group(Group :: atom(), - Config :: config() | skip_or_fail(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -pre_end_per_group(Group,Config,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, pre_end_per_group, - [Group,Config,State]}}), - {Config, State}. - -%% @doc Called after each end_per_group. Note that the config cannot be -%% changed here, only the status of the group. --spec post_end_per_group(Group :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_group(Group,Config,Return,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, post_end_per_group, - [Group,Config,Return,State]}}), - {Return, State}. - -%% @doc Called before each test case. -%% You can change the config in this function. --spec pre_init_per_testcase(TC :: atom(), - Config :: config(), - State :: #state{}) -> - {config() | skip_or_fail(), NewState :: #state{}}. -pre_init_per_testcase(TC,Config,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, pre_init_per_testcase, - [TC,Config,State]}}), - {Config, State}. - -%% @doc Called after each test case. Note that the config cannot be -%% changed here, only the status of the test case. --spec post_end_per_testcase(TC :: atom(), - Config :: config(), - Return :: term(), - State :: #state{}) -> - {ok | skip_or_fail(), NewState :: #state{}}. -post_end_per_testcase(TC,Config,Return,State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, post_end_per_testcase, - [TC,Config,Return,State]}}), - {Return, State}. - -%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, -%% post_end_per_group and post_end_per_tc if the suite, group or test case failed. -%% This function should be used for extra cleanup which might be needed. -%% It is not possible to modify the config or the status of the test run. --spec on_tc_fail(TC :: init_per_suite | end_per_suite | - init_per_group | end_per_group | atom(), - Reason :: term(), State :: #state{}) -> - NewState :: #state{}. -on_tc_fail(TC, Reason, State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, on_tc_fail, - [TC,Reason,State]}}), - State. - -%% @doc Called when a test case is skipped by either user action -%% or due to an init function failing. Test case can be -%% end_per_suite, init_per_group, end_per_group and the actual test cases. --spec on_tc_skip(TC :: end_per_suite | - init_per_group | end_per_group | atom(), - {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} | - {tc_user_skip, {skipped, Reason :: term()}}, - State :: #state{}) -> - NewState :: #state{}. -on_tc_skip(TC, Reason, State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, on_tc_skip, - [TC,Reason,State]}}), - State. - -%% @doc Called when the scope of the SCB is done, this depends on -%% when the SCB was specified. This translation table describes when this -%% function is called. -%% -%% | Started in | terminate called | -%% |---------------------|-------------------------| -%% | command_line | after all tests are run | -%% | test spec | after all tests are run | -%% | suite/0 | after SUITE is done | -%% | init_per_suite/1 | after SUITE is done | -%% | init_per_group/2 | after group is done | -%% |-----------------------------------------------| -%% --spec terminate(State :: #state{}) -> - term(). -terminate(State) -> - gen_event:notify( - ?CT_EVMGR_REF, #event{ name = scb, node = node(), - data = {?MODULE, terminate, [State]}}), - ok. diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl deleted file mode 100644 index 44c72f6795..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_post_suite_scb.erl +++ /dev/null @@ -1,72 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(fail_post_suite_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State). - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State), - {{fail, "Test failure"}, State}. - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl deleted file mode 100644 index 90f10d7531..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/fail_pre_suite_scb.erl +++ /dev/null @@ -1,72 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(fail_pre_suite_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State), - {{fail, "Test failure"}, State}. - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State). - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl deleted file mode 100644 index 11fb8d739f..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/id_no_init_scb.erl +++ /dev/null @@ -1,32 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(id_no_init_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --export([id/1]). - -id(Opts) -> - empty_scb:id(Opts). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl deleted file mode 100644 index b3feb1383c..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_scb.erl +++ /dev/null @@ -1,33 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(minimal_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --export([init/2]). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl deleted file mode 100644 index 3f76d2f47d..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/minimal_terminate_scb.erl +++ /dev/null @@ -1,38 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(minimal_terminate_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --export([init/2]). --export([terminate/1]). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -terminate(State) -> - empty_scb:terminate(State). - - diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl deleted file mode 100644 index 26468f0789..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/recover_post_suite_scb.erl +++ /dev/null @@ -1,74 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(recover_post_suite_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State). - -post_init_per_suite(Suite,Config,{'EXIT',Reason} = Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State), - {lists:keydelete(tc_status,1,Config),State}; -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State). - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl deleted file mode 100644 index 0fa708d5b6..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/same_id_scb.erl +++ /dev/null @@ -1,75 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(same_id_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -id(Opts) -> - empty_scb:id(Opts), - ?MODULE. - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State). - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State). - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl deleted file mode 100644 index bb93ebee0f..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_post_suite_scb.erl +++ /dev/null @@ -1,72 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(skip_post_suite_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State). - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State), - {{skip, "Test skip"}, State}. - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl deleted file mode 100644 index 9818964e7f..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/skip_pre_suite_scb.erl +++ /dev/null @@ -1,73 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(skip_pre_suite_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State), - {{skip, "Test skip"}, State}. - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State). - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl deleted file mode 100644 index 13c50cf1a1..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/state_update_scb.erl +++ /dev/null @@ -1,83 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(state_update_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - State = empty_scb:init(Id, Opts), - [init|State]. - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State), - {Config, [pre_init_per_suite|State]}. - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State), - {Config, [post_init_per_suite|State]}. - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State), - {Config, [pre_end_per_suite|State]}. - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State), - {Return, [post_end_per_suite|State]}. - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State), - {Config, [pre_init_per_group|State]}. - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State), - {Return, [post_init_per_group|State]}. - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State), - {Config, [pre_end_per_group|State]}. - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State), - {Return, [post_end_per_group|State]}. - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State), - {Config, [pre_init_per_testcase|State]}. - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State), - {Return, [post_end_per_testcase|State]}. - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State), - [on_tc_fail|State]. - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State), - [on_tc_skip|State]. - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl deleted file mode 100644 index 1cb64574c3..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/undef_scb.erl +++ /dev/null @@ -1,71 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(undef_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(_Suite, _Config, _State) -> - lists:flaten([1,2,[3,4]]). - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State). - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State). - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State). - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State). - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State). - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State). - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State). - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State). - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State). - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). diff --git a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl b/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl deleted file mode 100644 index 46a027403d..0000000000 --- a/lib/common_test/test/ct_suite_callback_SUITE_data/scb/tests/update_config_scb.erl +++ /dev/null @@ -1,82 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - - --module(update_config_scb). - - --include_lib("common_test/src/ct_util.hrl"). --include_lib("common_test/include/ct_event.hrl"). - - -%% Suite Callbacks --compile(export_all). - -init(Id, Opts) -> - empty_scb:init(Id, Opts). - -pre_init_per_suite(Suite, Config, State) -> - empty_scb:pre_init_per_suite(Suite,Config,State), - {[{pre_init_per_suite,now()}|Config],State}. - -post_init_per_suite(Suite,Config,Return,State) -> - empty_scb:post_init_per_suite(Suite,Config,Return,State), - {[{post_init_per_suite,now()}|Return],State}. - -pre_end_per_suite(Suite,Config,State) -> - empty_scb:pre_end_per_suite(Suite,Config,State), - {[{pre_end_per_suite,now()}|Config],State}. - -post_end_per_suite(Suite,Config,Return,State) -> - empty_scb:post_end_per_suite(Suite,Config,Return,State), - NewConfig = [{post_end_per_suite,now()}|Config], - {NewConfig,NewConfig}. - -pre_init_per_group(Group,Config,State) -> - empty_scb:pre_init_per_group(Group,Config,State), - {[{pre_init_per_group,now()}|Config],State}. - -post_init_per_group(Group,Config,Return,State) -> - empty_scb:post_init_per_group(Group,Config,Return,State), - {[{post_init_per_group,now()}|Return],State}. - -pre_end_per_group(Group,Config,State) -> - empty_scb:pre_end_per_group(Group,Config,State), - {[{pre_end_per_group,now()}|Config],State}. - -post_end_per_group(Group,Config,Return,State) -> - empty_scb:post_end_per_group(Group,Config,Return,State), - {[{post_end_per_group,now()}|Config],State}. - -pre_init_per_testcase(TC,Config,State) -> - empty_scb:pre_init_per_testcase(TC,Config,State), - {[{pre_init_per_testcase,now()}|Config],State}. - -post_end_per_testcase(TC,Config,Return,State) -> - empty_scb:post_end_per_testcase(TC,Config,Return,State), - {[{post_end_per_testcase,now()}|Config],State}. - -on_tc_fail(TC, Reason, State) -> - empty_scb:on_tc_fail(TC,Reason,State). - -on_tc_skip(TC, Reason, State) -> - empty_scb:on_tc_skip(TC,Reason,State). - -terminate(State) -> - empty_scb:terminate(State). -- cgit v1.2.3 From 044f768b6545234461f173e8a959379630723e8f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 16:39:29 +0100 Subject: Rename Suite Callback to Common Test hook in documentation --- lib/common_test/doc/src/Makefile | 4 +- lib/common_test/doc/src/common_test_app.xml | 12 +- lib/common_test/doc/src/ct_hooks.xml | 556 +++++++++++++++++++++ lib/common_test/doc/src/ct_hooks_chapter.xml | 401 +++++++++++++++ lib/common_test/doc/src/ct_suite_callbacks.xml | 551 -------------------- lib/common_test/doc/src/part.xml | 2 +- lib/common_test/doc/src/ref_man.xml | 2 +- lib/common_test/doc/src/run_test_chapter.xml | 14 +- .../doc/src/suite_callbacks_chapter.xml | 394 --------------- 9 files changed, 974 insertions(+), 962 deletions(-) create mode 100644 lib/common_test/doc/src/ct_hooks.xml create mode 100644 lib/common_test/doc/src/ct_hooks_chapter.xml delete mode 100644 lib/common_test/doc/src/ct_suite_callbacks.xml delete mode 100644 lib/common_test/doc/src/suite_callbacks_chapter.xml diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile index a3f740852c..a914dd0c19 100644 --- a/lib/common_test/doc/src/Makefile +++ b/lib/common_test/doc/src/Makefile @@ -52,7 +52,7 @@ CT_XML_FILES = $(CT_MODULES:=.xml) XML_APPLICATION_FILES = ref_man.xml XML_REF1_FILES = ct_run.xml -XML_REF3_FILES = $(CT_XML_FILES) ct_suite_callbacks.xml +XML_REF3_FILES = $(CT_XML_FILES) ct_hooks.xml XML_REF6_FILES = common_test_app.xml XML_PART_FILES = part.xml @@ -71,7 +71,7 @@ XML_CHAPTER_FILES = \ cover_chapter.xml \ ct_master_chapter.xml \ event_handler_chapter.xml \ - suite_callbacks_chapter.xml \ + ct_hooks_chapter.xml \ dependencies_chapter.xml \ notes.xml \ notes_history.xml diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml index a735dc85a8..b4e4b45d62 100644 --- a/lib/common_test/doc/src/common_test_app.xml +++ b/lib/common_test/doc/src/common_test_app.xml @@ -132,7 +132,7 @@ Info = {timetrap,Time} | {require,Required} | {require,Name,Required} | {userdata,UserData} | {silent_connections,Conns} | {stylesheet,CSSFile} | - {suite_callbacks, SCBs} + {ct_hooks, CTHs} Time = MilliSec | {seconds,integer()} | {minutes,integer()} | {hours,integer()} MilliSec = integer() @@ -144,9 +144,9 @@ UserData = term() Conns = [atom()] CSSFile = string() - SCBs = [SCBModule | {SCBModule, SCBInitArgs}] - SCBModule = atom() - SCBInitArgs = term() + CTHs = [CTHModule | {CTHModule, CTHInitArgs}] + CTHModule = atom() + CTHInitArgs = term() @@ -175,8 +175,8 @@ specify arbitrary test suite related information which can be read by calling ct:userdata/2.

-

The suite_callbacks tag specifies which - Suite Callbacks +

The ct_hooks tag specifies which + Common Test Hooks are to be run together with this suite.

Other tuples than the ones defined will simply be ignored.

diff --git a/lib/common_test/doc/src/ct_hooks.xml b/lib/common_test/doc/src/ct_hooks.xml new file mode 100644 index 0000000000..0d59ce3b22 --- /dev/null +++ b/lib/common_test/doc/src/ct_hooks.xml @@ -0,0 +1,556 @@ + + + + + +
+ + 20102010 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Common Test Hooks + Lukas Larsson + Lukas Larsson + + + + 2010-12-02 + PA1 + ct_hooks.sgml +
+ ct_hooks + A callback interface on top of Common Test + + + +

This feature is in alpha release right now. This means that the + interface may change in the future and that there may be bugs. We + encourage you to use this feature, but be prepared + that there might be bugs and that the interface might change + inbetween releases.

+ +

The Common Test Hook (henceforth called CTH) framework allows + extensions of the default behaviour of Common Test by means of callbacks + before and after all test suite calls. It is meant for advanced users of + Common Test which want to abstract out behaviour which is common to + multiple test suites.

+ +

In brief, Common Test Hooks allows you to:

+ + + Manipulate the runtime config before each suite + configuration call + Manipulate the return of all suite configuration calls and in + extension the result of the test themselves. + + +

The following sections describe the mandatory and optional CTH + functions Common Test will call during test execution. For more details + see Common Test Hooks in + the User's Guide.

+ +

For information about how to add a CTH to your suite see + Installing a CTH + in the User's Guide.

+ +

See the + Example CTH + in the User's Guide for a minimal example of a CTH.

+ +
+ +
+ CALLBACK FUNCTIONS +

The following functions define the callback interface + for a Common Test Hook.

+
+ + + + Module:init(Id, Opts) -> State + Initiates the Common Test Hook + + Id = reference() | term() + Opts = term() + State = term() + + + +

MANDATORY

+ +

Always called before any other callback function. + Use this to initiate any common state. + It should return a state for this CTH.

+ +

Id is the return value of + id/1, or a reference + (created using + make_ref/0) + if id/1 is not implemented. +

+ +

For details about when init is called see + scope + in the User's Guide.

+ +
+
+ + + Module:pre_init_per_suite(SuiteName, Config, CTHState) -> + Result + Called before init_per_suite + + SuiteName = atom() + Config = NewConfig = [{Key,Value}] + CTHState = NewCTHState = term() + Result = {Return, NewCTHState} + Return = NewConfig | SkipOrFail + SkipOrFail = {fail, Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + init_per_suite if it exists. + It typically contains initialization/logging which needs to be done + before init_per_suite is called. + If {skip,Reason} or {fail,Reason} is returned, + init_per_suite and all test cases of the suite will be skipped and + Reason printed in the overview log of the suite.

+ +

SuiteName is the name of the suite to be run.

+ +

Config is the original config list of the test suite.

+ +

CTHState is the current internal state of the CTH.

+ +

Return is the result of the init_per_suite function. + If it is {skip,Reason} or {fail,Reason} + init_per_suite + will never be called, instead the initiation is considered + to be skipped/failed respectively. If a NewConfig list + is returned, + init_per_suite will be called with that NewConfig list. + See + Pre Hooks in the User's Guide for more details.

+ + +

Note that this function is only called if the CTH has been added + before init_per_suite is run, see + CTH Scoping + in the User's Guide for details.

+
+
+ + + Module:post_init_per_suite(SuiteName, Config, Return, CTHState) -> + Result + Called after init_per_suite + + SuiteName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail, Reason} | {skip, Reason} | term() + CTHState = NewCTHState = term() + Result = {NewReturn, NewCTHState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + init_per_suite if it exists. It typically contains extra + checks to make sure that all the correct dependencies have + been started correctly.

+ +

Return is what + init_per_suite + returned, i.e. {fail,Reason}, {skip,Reason}, a Config + list or a term describing how + init_per_suite + failed.

+ +

NewReturn is the possibly modified return value of + init_per_suite + . It is here possible to recover from a failure in + init_per_suite + by returning the ConfigList with the tc_status + element removed. See + Post Hooks in the User's Guide for more details.

+ +

CTHState is the current internal state of the CTH.

+ +

Note that this function is only called if the CTH has been added + before or in init_per_suite, see + CTH Scoping + in the User's Guide for details.

+
+
+ + + Module:pre_init_per_group(GroupName, Config, CTHState) -> + Result + Called before init_per_group + + GroupName = atom() + Config = NewConfig = [{Key,Value}] + CTHState = NewCTHState = term() + Result = {NewConfig | SkipOrFail, NewCTHState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + init_per_group if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + init_per_group instead.

+
+
+ + + Module:post_init_per_group(GroupName, Config, Return, CTHState) -> + Result + Called after init_per_group + + GroupName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + CTHState = NewCTHState = term() + Result = {NewReturn, NewCTHState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + init_per_group if it exists. It behaves the same way as + + post_init_per_suite, but for the + + init_per_group instead.

+
+
+ + + Module:pre_init_per_testcase(TestcaseName, Config, CTHState) -> + Result + Called before init_per_testcase + + TestcaseName = atom() + Config = NewConfig = [{Key,Value}] + CTHState = NewCTHState = term() + Result = {NewConfig | SkipOrFail, NewCTHState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + init_per_testcase if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + init_per_testcase function instead.

+ +

Note that it is not possible to add CTH's here right now, + that feature might be added later, + but it would right now break backwards compatability.

+
+
+ + + Module:post_end_per_testcase(TestcaseName, Config, Return, CTHState) + -> Result + Called after end_per_testcase + + TestcaseName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + CTHState = NewCTHState = term() + Result = {NewReturn, NewCTHState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_testcase if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_testcase function instead.

+
+
+ + + Module:pre_end_per_group(GroupName, Config, CTHState) -> + Result + Called before end_per_group + + GroupName = atom() + Config = NewConfig = [{Key,Value}] + CTHState = NewCTHState = term() + Result = {NewConfig | SkipOrFail, NewCTHState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + end_per_group if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + end_per_group function instead.

+
+
+ + + Module:post_end_per_group(GroupName, Config, Return, CTHState) -> + Result + Called after end_per_group + + GroupName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + CTHState = NewCTHState = term() + Result = {NewReturn, NewCTHState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_group if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_group function instead.

+
+
+ + + Module:pre_end_per_suite(SuiteName, Config, CTHState) -> + Result + Called before end_per_suite + + SuiteName = atom() + Config = NewConfig = [{Key,Value}] + CTHState = NewCTHState = term() + Result = {NewConfig | SkipOrFail, NewCTHState} + SkipOrFail = {fail,Reason} | {skip, Reason} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called before + + end_per_suite if it exists. It behaves the same way as + + pre_init_per_suite, but for the + + end_per_suite function instead.

+
+
+ + + Module:post_end_per_suite(SuiteName, Config, Return, CTHState) -> + Result + Called after end_per_suite + + SuiteName = atom() + Config = [{Key,Value}] + Return = NewReturn = Config | SkipOrFail | term() + SkipOrFail = {fail,Reason} | {skip, Reason} + CTHState = NewCTHState = term() + Result = {NewReturn, NewCTHState} + Key = atom() + Value = term() + Reason = term() + + + +

OPTIONAL

+ +

This function is called after + + end_per_suite if it exists. It behaves the same way as + + post_init_per_suite, but for the + + end_per_suite function instead.

+
+
+ + + Module:on_tc_fail(TestcaseName, Reason, CTHState) -> + NewCTHState + Called after the CTH scope ends + + TestcaseName = init_per_suite | end_per_suite | + init_per_group | end_per_group | atom() + Reason = term() + CTHState = NewCTHState = term() + + + +

OPTIONAL

+ +

This function is called whenever a testcase fails. + It is called after the post function has been called for + the testcase which failed. i.e. + if init_per_suite fails this function is called after + + post_init_per_suite, and if a testcase fails it is called + after + post_end_per_testcase.

+ +

The data which comes with the Reason follows the same format as the + FailReason + in the tc_done event. + See Event Handling + in the User's Guide for details.

+
+
+ + + Module:on_tc_skip(TestcaseName, Reason, CTHState) -> + NewCTHState + Called after the CTH scope ends + + TestcaseName = end_per_suite | init_per_group | + end_per_group | atom() + Reason = {tc_auto_skip | tc_user_skip, term()} + CTHState = NewCTHState = term() + + + +

OPTIONAL

+ +

This function is called whenever a testcase is skipped. + It is called after the post function has been called for the + testcase which was skipped. + i.e. if init_per_group is skipped this function is called after + post_init_per_group + , and if a testcase is skipped it is called after + post_end_per_testcase + .

+ +

The data which comes with the Reason follows the same format as + tc_auto_skip + and + tc_user_skip events. + See Event Handling + in the User's Guide for details.

+
+
+ + + Module:terminate(CTHState) + Called after the CTH scope ends + + CTHState = term() + + + +

OPTIONAL

+ +

This function is called at the end of a CTH's + scope. +

+
+
+ + + Module:id(Opts) -> Id + Called before the init function of a CTH + + Opts = term() + Id = term() + + + +

OPTIONAL

+ +

The Id is used to uniquely identify a CTH instance, + if two CTH's return the same Id the second CTH is ignored + and subsequent calls to the CTH will only be made to the first + instance. For more information see + Installing a CTH + in the User's Guide. +

+ +

This function should NOT have any side effects as it might + be called multiple times by Common Test.

+ +

If not implemented the CTH will act as if this function returned a + call to make_ref/0.

+
+
+ +
+ +
+ + diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml new file mode 100644 index 0000000000..fc5ab48e1b --- /dev/null +++ b/lib/common_test/doc/src/ct_hooks_chapter.xml @@ -0,0 +1,401 @@ + + + + +
+ + 20112011 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Common Test Hooks + Lukas Larsson + + + + ct_hooks_chapter.xml +
+ + +
+ General +

This feature is in alpha release right now. This means that the + interface may change in the future and that there may be bugs. We + encourage you to use this feature, but be prepared + that there might be bugs and that the interface might change + inbetween releases.

+

+ The Common Test Hook (henceforth called CTH) framework allows + extensions of the default behaviour of Common Test by means of hooks + before and after all test suite calls. CTHs allow advanced Common Test + users to abstract out behaviour which is common to multiple test suites + without littering all test suites with library calls. Some example + usages are: logging, starting and monitoring external systems, + building C files needed by the tests and much more!

+ +

In brief, Common Test Hooks allows you to:

+ + + Manipulate the runtime config before each suite + configuration call + Manipulate the return of all suite configuration calls and in + extension the result of the test themselves. + + +

The following sections describe how to use CTHs, when they are run + and how to manipulate your test results in a CTH

+ +

When executing within a CTH all timetraps are shutoff. So + if your CTH never returns, the entire test run will be stalled!

+
+ +
+ + +
+ Installing a CTH +

There are multiple ways to install a CTH in your test run. You can do it + for all tests in a run, for specific test suites and for specific groups + within a test suite. If you want a CTH to be present in all test suites + within your test run there are three different ways to accomplish that. +

+ + + Add -ct_hooks as an argument to + ct_run. + To add multiple CTHs using this method append them to each other + using the keyword and, i.e. + ct_run -ct_hooks cth1 [{debug,true}] and cth2 .... + Add the ct_hooks tag to your + + Test Specification + Add the ct_hooks tag to your call to + ct:run_test/1 + + +

You can also add CTHs within a test suite. This is done by returning + {ct_hooks,[CTH]} in the config list from + suite/0, + + init_per_suite/1 or + + init_per_group/2. CTH in this case can be either + only the module name of the CTH or a tuple with the module name and the + initial arguments to the CTH. Eg: + {ct_hooks,[my_cth_module]} or + {ct_hooks,[{my_cth_module,[{debug,true}]}]}

+ +
+ Overriding CTHs +

By default each installation of a CTH will cause a new instance of it + to be activated. This can cause problems if you want to be able to + override CTHs in test specifications while still having them in the + suite info function. The + id/1 + callback exists to address this problem. By returning the same + id in both places, Common Test knows that this CTH + has already been installed and will not try to install it again.

+
+ +
+ + +
+ CTH Scope +

Once the CTH is installed into a certain test run it will be there until + its scope is expired. The scope of a CTH depends on when it is + installed. + The init/2 is + called at the beginning of the scope and the + terminate/1 + function is called when the scope ends.

+ + + CTH Installed in + CTH scope begins before + CTH scope ends after + + + ct_run + the first test suite is to be run. + the last test suite has been run. + + + ct:run_test + the first test suite is to be run. + the last test suite has been run. + + + + Test Specification + the first test suite is to be run. + the last test suite has been run. + + + suite/0 + + + pre_init_per_suite/3 is called. + + post_end_per_suite/4 has been called for that test suite. + + + + init_per_suite/1 + + post_init_per_suite/4 is called. + + post_end_per_suite/4 has been called for that test suite. + + + + init_per_group/2 + + post_init_per_group/4 is called. + + post_end_per_group/4 has been called for that group. + + Scope of a CTH +
+ +
+ CTH Processes and Tables +

CTHs are run with the same process scoping as normal test suites + i.e. a different process will execute the init_per_suite hooks then the + init_per_group or per_testcase hooks. So if you want to spawn a + process in the CTH you cannot link with the CTH process as it will exit + after the post hook ends. Also if you for some reason need an ETS + table with your CTH, you will have to spawn a process which handles + it.

+
+ +
+ + +
+ Manipulating tests +

It is through CTHs possible to manipulate the results of tests and + configuration functions. The main purpose of doing this with CTHs is to + allow common patterns to be abstracted out from test test suites and applied to + multiple test suites without duplicating any code. All of the callback + functions for a CTH follow a common interface, this interface is + described below.

+ +

It is only possible to hook into test function which exists in the test + suite. So in order for a CTH to hook in before + init_per_suite, + the init_per_suite + function must exist in the test suite.

+ + +
+ Pre Hooks +

+ It is possible in a CTH to hook in behaviour before + init_per_suite, + init_per_group, + init_per_testcase, + end_per_group and + end_per_suite. + This is done in the CTH functions called pre_<name of function>. + All of these functions take the same three arguments: Name, + Config and CTHState. The return value of the CTH function + is always a combination of an result for the suite/group/test and an + updated CTHState. If you want the test suite to continue on + executing you should return the config list which you want the test to + use as the result. If you for some reason want to skip/fail the test, + return a tuple with skip or fail and a reason as the + result. Example: +

+ pre_init_per_suite(SuiteName, Config, CTHState) -> + case db:connect() of + {error,_Reason} -> + {{fail, "Could not connect to DB"}, CTHState}; + {ok, Handle} -> + {[{db_handle, Handle} | Config], CTHState#state{ handle = Handle }} + end. + +
+ + +
+ Post Hooks +

It is also possible in a CTH to hook in behaviour after + init_per_suite, + init_per_group, + end_per_testcase, + end_per_group and + end_per_suite. + This is done in the CTH functions called post_<name of function>. + All of these function take the same four arguments: Name, + Config, Return and CTHState. Config in this + case is the same Config as the testcase is called with. + Return is the value returned by the testcase. If the testcase + failed by crashing, Return will be + {'EXIT',{{Error,Reason},Stacktrace}}.

+ +

The return value of the CTH function is always a combination of an + result for the suite/group/test and an updated CTHState. If + you want the callback to not affect the outcome of the test you should + return the Return data as it is given to the CTH. You can also + modify the result of the test. By returning the Config list + with the tc_status element removed you can recover from a test + failure. As in all the pre hooks, it is also possible to fail/skip + the test case in the post hook. Example:

+ + post_end_per_testcase(_TC, Config, {'EXIT',{_,_}}, CTHState) -> + case db:check_consistency() of + true -> + %% DB is good, pass the test. + {proplists:delete(tc_status, Config), CTHState}; + false -> + %% DB is not good, mark as skipped instead of failing + {{skip, "DB is inconsisten!"}, CTHState} + end; +post_end_per_testcase(_TC, Config, Return, CTHState) -> + %% Do nothing if tc does not crash. + {Return, CTHState}. + + Recovering from a testcase failure using CTHs should only be done as + a last resort. If used wrongly it could become very difficult to + determine which tests pass or fail in a test run + +
+ + +
+ Skip and Fail hooks +

+ After any post hook has been executed for all installed CTHs, + on_tc_fail + or on_tc_skip + might be called if the testcase failed or was skipped + respectively. You cannot affect the outcome of the tests any further at + this point. +

+
+ +
+ + +
+ Example CTH +

The CTH below will log information about a test run into a format + parseable by file:consult/1. +

+ %%% @doc Common Test Example Common Test Hook module. +-module(example_cth). + +%% Callbacks +-export([id/1]). +-export([init/2]). + +-export([pre_init_per_suite/3]). +-export([post_init_per_suite/4]). +-export([pre_end_per_suite/3]). +-export([post_end_per_suite/4]). + +-export([pre_init_per_group/3]). +-export([post_init_per_group/4]). +-export([pre_end_per_group/3]). +-export([post_end_per_group/4]). + +-export([pre_init_per_testcase/3]). +-export([post_end_per_testcase/4]). + +-export([on_tc_fail/3]). +-export([on_tc_skip/3]). + +-export([terminate/1]). + +-record(state, { file_handle, total, suite_total, ts, tcs, data }). + +%% @doc Return a unique id for this CTH. +id(Opts) -> + proplists:get_value(filename, Opts, "/tmp/file.log"). + +%% @doc Always called before any other callback function. Use this to initiate +%% any common state. +init(Id, Opts) -> + {ok,D} = file:open(Id,[write]), + #state{ file_handle = D, total = 0, data = [] }. + +%% @doc Called before init_per_suite is called. +pre_init_per_suite(Suite,Config,State) -> + {Config, State#state{ suite_total = 0, tcs = [] }}. + +%% @doc Called after init_per_suite. +post_init_per_suite(Suite,Config,Return,State) -> + {Return, State}. + +%% @doc Called before end_per_suite. +pre_end_per_suite(Suite,Config,State) -> + {Config, State}. + +%% @doc Called after end_per_suite. +post_end_per_suite(Suite,Config,Return,State) -> + Data = {suites, Suite, State#state.suite_total, lists:reverse(State#state.tcs)}, + {Return, State#state{ data = [Data | State#state.data] , + total = State#state.total + State#state.suite_total } }. + +%% @doc Called before each init_per_group. +pre_init_per_group(Group,Config,State) -> + {Config, State}. + +%% @doc Called after each init_per_group. +post_init_per_group(Group,Config,Return,State) -> + {Return, State}. + +%% @doc Called after each end_per_group. +pre_end_per_group(Group,Config,State) -> + {Config, State}. + +%% @doc Called after each end_per_group. +post_end_per_group(Group,Config,Return,State) -> + {Return, State}. + +%% @doc Called before each test case. +pre_init_per_testcase(TC,Config,State) -> + {Config, State#state{ ts = now(), total = State#state.suite_total + 1 } }. + +%% @doc Called after each test case. +post_end_per_testcase(TC,Config,Return,State) -> + TCInfo = {testcase, TC, Return, timer:now_diff(now(), State#state.ts)}, + {Return, State#state{ ts = undefined, tcs = [TCInfo | State#state.tcs] } }. + +%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, +%% post_end_per_group and post_end_per_testcase if the suite, group or test case failed. +on_tc_fail(TC, Reason, State) -> + State. + +%% @doc Called when a test case is skipped by either user action +%% or due to an init function failing. +on_tc_skip(TC, Reason, State) -> + State. + +%% @doc Called when the scope of the CTH is done +terminate(State) -> + io:format(State#state.file_handle, "~p.~n", + [{test_run, State#state.total, State#state.data}]), + file:close(State#state.file_handle), + ok. +
+ +
+ + + + diff --git a/lib/common_test/doc/src/ct_suite_callbacks.xml b/lib/common_test/doc/src/ct_suite_callbacks.xml deleted file mode 100644 index cea5804825..0000000000 --- a/lib/common_test/doc/src/ct_suite_callbacks.xml +++ /dev/null @@ -1,551 +0,0 @@ - - - - - -
- - 20102010 - Ericsson AB. All Rights Reserved. - - - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - - - Suite Callbacks - Lukas Larsson - Lukas Larsson - - - - 2010-12-02 - PA1 - suite_callback.sgml -
- ct_suite_callback - A callback interface on top of Common Test - - - -

This feature is in alpha release right now. This means that the - interface may change in the future and that there may be bugs. We - encourage you to use this feature, but be prepared - that there might be bugs and that the interface might change - inbetween releases.

- -

The Suite Callback (henceforth called SCB) framework allows - extensions of the default behaviour of Common Test by means of callbacks - before and after all test suite calls. It is meant for advanced users of - Common Test which want to abstract out behaviour which is common to - multiple test suites.

- -

In brief, Suite Callbacks allows you to:

- - - Manipulate the runtime config before each suite - configuration calls - Manipulate the return of all suite configuration calls and in - extension the result of the test themselves. - - -

The following sections describe the mandatory and optional SCB - functions Common Test will call during test execution. For more details - see Suite Callbacks in - the User's Guide.

- -

For information about how to add a SCB to your suite see - Installing an SCB - in the User's Guide.

- -

See the - Example SCB - in the User's Guide for a minimal example of an SCB.

- -
- -
- CALLBACK FUNCTIONS -

The following functions define the callback interface - for a suite callback.

-
- - - - Module:init(Id, Opts) -> State - Initiates the Suite Callback - - Id = reference() | term() - Opts = term() - State = term() - - - -

MANDATORY

- -

Always called before any other callback function. - Use this to initiate any common state. - It should return a state for this SCB.

- -

Id is the return value of - id/1, or a reference - if id/1 is not implemented. -

- -

For details about when init is called see - scope - in the User's Guide.

- -
-
- - - Module:pre_init_per_suite(SuiteName, Config, SCBState) -> - Result - Called before init_per_suite - - SuiteName = atom() - Config = NewConfig = [{Key,Value}] - SCBState = NewSCBState = term() - Result = {Return, NewSCBState} - Return = NewConfig | SkipOrFail - SkipOrFail = {fail, Reason} | {skip, Reason} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called before - - init_per_suite if it exists. - It typically contains initialization/logging which needs to be done - before init_per_suite is called. - If {skip,Reason} or {fail,Reason} is returned, - init_per_suite and all test cases of the suite will be skipped and - Reason printed in the overview log of the suite.

- -

SuiteName is the name of the suite to be run.

- -

Config is the original config list of the test suite.

- -

SCBState is the current internal state of the SCB.

- -

Return is the result of the init_per_suite function. - If it is {skip,Reason} or {fail,Reason} - init_per_suite - will never be called, instead the initiation is considered - to be skipped/failed respectively. If a NewConfig list - is returned, - init_per_suite will be called with that NewConfig list. - See - Manipulating tests in the User's Guide for more details.

- - -

Note that this function is only called if the SCB has been added - before init_per_suite is run, see - SCB Scoping - in the User's Guide for details.

-
-
- - - Module:post_init_per_suite(SuiteName, Config, Return, SCBState) -> - Result - Called after init_per_suite - - SuiteName = atom() - Config = [{Key,Value}] - Return = NewReturn = Config | SkipOrFail | term() - SkipOrFail = {fail, Reason} | {skip, Reason} | term() - SCBState = NewSCBState = term() - Result = {NewReturn, NewSCBState} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

Return is what - init_per_suite - returned, i.e. {fail,Reason}, {skip,Reason}, a Config - list or a term describing how - init_per_suite - failed.

- -

NewReturn is the possibly modified return value of - init_per_suite - . It is here possible to recover from a failure in - init_per_suite - by returning the ConfigList with the tc_status - element removed.

- -

SCBState is the current internal state of the SCB.

- -

This function is called after - - init_per_suite if it exists.

- -

Note that this function is only called if the SCB has been added - before or in init_per_suite, see - SCB Scoping - in the User's Guide for details.

-
-
- - - Module:pre_init_per_group(GroupName, Config, SCBState) -> - Result - Called before init_per_group - - GroupName = atom() - Config = NewConfig = [{Key,Value}] - SCBState = NewSCBState = term() - Result = {NewConfig | SkipOrFail, NewSCBState} - SkipOrFail = {fail,Reason} | {skip, Reason} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called before - - init_per_group if it exists. It behaves the same way as - - pre_init_per_suite, but for the - - init_per_group instead.

-
-
- - - Module:post_init_per_group(GroupName, Config, Return, SCBState) -> - Result - Called after init_per_group - - GroupName = atom() - Config = [{Key,Value}] - Return = NewReturn = Config | SkipOrFail | term() - SkipOrFail = {fail,Reason} | {skip, Reason} - SCBState = NewSCBState = term() - Result = {NewReturn, NewSCBState} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called after - - init_per_group if it exists. It behaves the same way as - - post_init_per_suite, but for the - - init_per_group instead.

-
-
- - - Module:pre_init_per_testcase(TestcaseName, Config, SCBState) -> - Result - Called before init_per_testcase - - TestcaseName = atom() - Config = NewConfig = [{Key,Value}] - SCBState = NewSCBState = term() - Result = {NewConfig | SkipOrFail, NewSCBState} - SkipOrFail = {fail,Reason} | {skip, Reason} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called before - - init_per_testcase if it exists. It behaves the same way as - - pre_init_per_suite, but for the - - init_per_testcase function instead.

- -

Note that it is not possible to add SCB's here right now, - that feature might be added later, - but it would right now break backwards compatability.

-
-
- - - Module:post_end_per_testcase(TestcaseName, Config, Return, SCBState) - -> Result - Called after end_per_testcase - - TestcaseName = atom() - Config = [{Key,Value}] - Return = NewReturn = Config | SkipOrFail | term() - SkipOrFail = {fail,Reason} | {skip, Reason} - SCBState = NewSCBState = term() - Result = {NewReturn, NewSCBState} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called after - - end_per_testcase if it exists. It behaves the same way as - - post_init_per_suite, but for the - - end_per_testcase function instead.

-
-
- - - Module:pre_end_per_group(GroupName, Config, SCBState) -> - Result - Called before end_per_group - - GroupName = atom() - Config = NewConfig = [{Key,Value}] - SCBState = NewSCBState = term() - Result = {NewConfig | SkipOrFail, NewSCBState} - SkipOrFail = {fail,Reason} | {skip, Reason} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called before - - end_per_group if it exists. It behaves the same way as - - pre_init_per_suite, but for the - - end_per_group function instead.

-
-
- - - Module:post_end_per_group(GroupName, Config, Return, SCBState) -> - Result - Called after end_per_group - - GroupName = atom() - Config = [{Key,Value}] - Return = NewReturn = Config | SkipOrFail | term() - SkipOrFail = {fail,Reason} | {skip, Reason} - SCBState = NewSCBState = term() - Result = {NewReturn, NewSCBState} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called after - - end_per_group if it exists. It behaves the same way as - - post_init_per_suite, but for the - - end_per_group function instead.

-
-
- - - Module:pre_end_per_suite(SuiteName, Config, SCBState) -> - Result - Called before end_per_suite - - SuiteName = atom() - Config = NewConfig = [{Key,Value}] - SCBState = NewSCBState = term() - Result = {NewConfig | SkipOrFail, NewSCBState} - SkipOrFail = {fail,Reason} | {skip, Reason} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called before - - end_per_suite if it exists. It behaves the same way as - - pre_init_per_suite, but for the - - end_per_suite function instead.

-
-
- - - Module:post_end_per_suite(SuiteName, Config, Return, SCBState) -> - Result - Called after end_per_suite - - SuiteName = atom() - Config = [{Key,Value}] - Return = NewReturn = Config | SkipOrFail | term() - SkipOrFail = {fail,Reason} | {skip, Reason} - SCBState = NewSCBState = term() - Result = {NewReturn, NewSCBState} - Key = atom() - Value = term() - Reason = term() - - - -

OPTIONAL

- -

This function is called after - - end_per_suite if it exists. It behaves the same way as - - post_init_per_suite, but for the - - end_per_suite function instead.

-
-
- - - Module:on_tc_fail(TestcaseName, Reason, SCBState) -> - NewSCBState - Called after the SCB scope ends - - TestcaseName = init_per_suite | end_per_suite | - init_per_group | end_per_group | atom() - Reason = term() - SCBState = NewSCBState = term() - - - -

OPTIONAL

- -

This function is called whenever a testcase fails. - It is called after the post function has been called for - the testcase which failed. i.e. - if init_per_suite fails this function is called after - - post_init_per_suite, and if a testcase fails it is called - after - post_end_per_testcase.

- -

The data which comes with the Reason follows the same format as the - FailReason - in the tc_done event. - See Event Handling - in the User's Guide for details.

-
-
- - - Module:on_tc_skip(TestcaseName, Reason, SCBState) -> - NewSCBState - Called after the SCB scope ends - - TestcaseName = end_per_suite | init_per_group | - end_per_group | atom() - Reason = {tc_auto_skip | tc_user_skip, term()} - SCBState = NewSCBState = term() - - - -

OPTIONAL

- -

This function is called whenever a testcase is skipped. - It is called after the post function has been called for the - testcase which was skipped. - i.e. if init_per_group is skipped this function is called after - post_init_per_group - , and if a testcase is skipped it is called after - post_end_per_testcase - .

- -

The data which comes with the Reason follows the same format as - tc_auto_skip - and - tc_user_skip events. - See Event Handling - in the User's Guide for details.

-
-
- - - Module:terminate(SCBState) - Called after the SCB scope ends - - SCBState = term() - - - -

OPTIONAL

- -

This function is called at the end of an SCB's - scope. -

-
-
- - - Module:id(Opts) -> Id - Called before the init function of an SCB - - Opts = term() - Id = term() - - - -

OPTIONAL

- -

The Id is used to uniquely identify an SCB instance, - if two SCB's return the same Id the second SCB is ignored - and subsequent calls to the SCB will only be made to the first - instance. For more information see - Installing an SCB - in the User's Guide. -

- -

This function should NOT have any side effects as it might - be called multiple times by Common Test.

- -

If not implemented the SCB will act as if this function returned a - call to make_ref/0.

-
-
- -
- -
- - diff --git a/lib/common_test/doc/src/part.xml b/lib/common_test/doc/src/part.xml index 1a09ec1da2..41371b60be 100644 --- a/lib/common_test/doc/src/part.xml +++ b/lib/common_test/doc/src/part.xml @@ -75,7 +75,7 @@ - + diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml index 100c0fe5d7..631e3871c2 100644 --- a/lib/common_test/doc/src/ref_man.xml +++ b/lib/common_test/doc/src/ref_man.xml @@ -76,7 +76,7 @@ - + diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml index 81e752680b..7b485bdc35 100644 --- a/lib/common_test/doc/src/run_test_chapter.xml +++ b/lib/common_test/doc/src/run_test_chapter.xml @@ -148,8 +148,8 @@ event handlers. ]]>, to install event handlers including start arguments. - ]]>, to install - Suite Callbacks including start arguments. + ]]>, to install + Common Test Hooks including start arguments. , specifies include directories (see above). , disables the automatic test suite compilation feature (see above). ]]>, extends timetrap @@ -444,8 +444,8 @@ {event_handler, EventHandlers, InitArgs}. {event_handler, NodeRefs, EventHandlers, InitArgs}. - {suite_callbacks, SCBModules}. - {suite_callbacks, NodeRefs, SCBModules}. + {ct_hooks, CTHModules}. + {ct_hooks, NodeRefs, CTHModules}.

Test terms:

@@ -484,9 +484,9 @@
       LogDir        = string()
       EventHandlers = atom() | [atom()]
       InitArgs      = [term()]
-      SCBModules    = [SCBModule | {SCBModule, SCBInitArgs}]
-      SCBModule     = atom()
-      SCBInitArgs   = term()
+      CTHModules    = [CTHModule | {CTHModule, CTHInitArgs}]
+      CTHModule     = atom()
+      CTHInitArgs   = term()
       DirRef        = DirAlias | Dir
       Suites        = atom() | [atom()] | all
       Suite         = atom()
diff --git a/lib/common_test/doc/src/suite_callbacks_chapter.xml b/lib/common_test/doc/src/suite_callbacks_chapter.xml
deleted file mode 100644
index 89f78898d4..0000000000
--- a/lib/common_test/doc/src/suite_callbacks_chapter.xml
+++ /dev/null
@@ -1,394 +0,0 @@
-
-
-
-
-  
- - 20112011 - Ericsson AB. All Rights Reserved. - - - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - - - Suite Callbacks - Lukas Larsson - - - - suite_callbacks_chapter.xml -
- - -
- General -

This feature is in alpha release right now. This means that the - interface may change in the future and that there may be bugs. We - encourage you to use this feature, but be prepared - that there might be bugs and that the interface might change - inbetween releases.

-

- The Suite Callback (henceforth called SCB) framework allows - extensions of the default behaviour of Common Test by means of callbacks - before and after all test suite calls. SCBs allow advanced Common Test - users to abstract out behaviour which is common to multiple test suites - without littering all test suites with library calls. Some example - usages are: logging, starting and monitoring external systems, - building C files needed by the tests and much more!

- -

In brief, Suite Callbacks allows you to:

- - - Manipulate the runtime config before each suite - configuration calls - Manipulate the return of all suite configuration calls and in - extension the result of the test themselves. - - -

The following sections describe how to use SCBs, when they are run - and how to manipulate your test results in an SCB

- -

When executing within an SCB all timetraps are shutoff. So - if your SCB never returns, the entire test run will be stalled!

-
- -
- - -
- Installing an SCB -

There are multiple ways to install an SCB in your test run. You can do it - for all tests in a run, for specific test suites and for specific groups - within a test suite. If you want an SCB to be present in all test suites - within your testrun there are three different ways to accomplish that.

- - - Add -suite_callbacks as an argument to - ct_run. - To add multiple SCBs using this method append them to each other - using the keyword and, i.e. - ct_run -suite_callbacks scb1 [{debug,true}] and scb2 .... - Add the suite_callbacks tag to your - - Test Specification - Add the suite_callbacks tag to your call to - ct:run_test/1 - - -

You can also add SCBs within a test suite. This is done by returning - {suite_callbacks,[SCB]} in the config list from - suite/0, - - init_per_suite/1 or - - init_per_group/2. SCB in this case can be either - only the module name of the SCB or a tuple with the module name and the - initial arguments to the SCB. Eg: - {suite_callbacks,[my_scb_module]} or - {suite_callbacks,[{my_scb_module,[{debug,true}]}]}

- -
- Overriding SCBs -

By default each installation of an SCB will cause a new instance of it - to be activated. This can cause problems if you want to be able to - override SCBs in testspecifications while still having them in the - suite info function. The - id/1 - callback exists to address this problem. By returning the same - id in both places, Common Test knows that this SCB - has already been installed and will not try to install it again.

-
- -
- - -
- SCB Scope -

Once the SCB is installed into a certain test run it will be there until - it's scope is expired. The scope of an SCB depends on when it is - installed. - The init/2 is - called at the beginning of the scope and the - terminate/1 - function is called when the scope ends.

- - - SCB Installed in - SCB scope begins before - SCB scope ends after - - - ct_run - the first test suite is to be run. - the last test suite has been run. - - - ct:run_test - the first test suite is to be run. - the last test suite has been run. - - - - Test Specification - the first test suite is to be run. - the last test suite has been run. - - - suite/0 - - - pre_init_per_suite/3 is called. - - post_end_per_suite/4 has been called for that test suite. - - - - init_per_suite/1 - - post_init_per_suite/4 is called. - - post_end_per_suite/4 has been called for that test suite. - - - - init_per_group/2 - - post_init_per_group/4 is called. - - post_end_per_group/4 has been called for that group. - - Scope of an SCB -
- -
- CTH Processes and Tables -

CTHs are run with the same process scoping as normal test suites - i.e. a different process will execute the init_per_suite hooks then the - init_per_group or per_testcase hooks. So if you want to spawn a - process in the CTH you cannot link with the CTH process as it will exit - after the post hook ends. Also if you for some reason need an ETS - table with your CTH, you will have to spawn a process which handles - it.

-
- -
- - -
- Manipulating tests -

It is through SCB's possible to manipulate the results of tests and - configuration functions. The main purpose of doing this with SCBs is to - allow common patterns to be abstracted out from test test suites and applied to - multiple test suites without duplicating any code. All of the callback - functions for an SCB follow a common interface, this interface is - described below.

- - -
- Pre test manipulation -

- It is possible in an SCB to hook in behaviour before - init_per_suite, - init_per_group, - init_per_testcase, - end_per_group and - end_per_suite. - This is done in the SCB functions called pre_<name of function>. - All of these function take the same three arguments: Name, - Config and SCBState. The return value of the SCB function - is always a combination of an result for the suite/group/test and an - updated SCBState. If you want the test suite to continue on - executing you should return the config list which you want the test to - use as the result. If you for some reason want to skip/fail the test, - return a tuple with skip or fail and a reason as the - result. Example: -

- pre_init_per_suite(SuiteName, Config, SCBState) -> - case db:connect() of - {error,_Reason} -> - {{fail, "Could not connect to DB"}, SCBState}; - {ok, Handle} -> - {[{db_handle, Handle} | Config], SCBState#state{ handle = Handle }} - end. - -
- - -
- Post test manipulation -

It is also possible in an SCB to hook in behaviour after - init_per_suite, - init_per_group, - end_per_testcase, - end_per_group and - end_per_suite. - This is done in the SCB functions called post_<name of function>. - All of these function take the same four arguments: Name, - Config, Return and SCBState. Config in this - case is the same Config as the testcase is called with. - Return is the value returned by the testcase. If the testcase - failed by crashing, Return will be - {'EXIT',{{Error,Reason},Stacktrace}}.

- -

The return value of the SCB function is always a combination of an - result for the suite/group/test and an updated SCBState. If - you want the callback to not affect the outcome of the test you should - return the Return data as it is given to the SCB. You can also - modify the result of the test. By returning the Config list - with the tc_status element removed you can recover from a test - failure. As in all the pre hooks, it is also possible to fail/skip - the test case in the post hook. Example:

- - post_end_per_testcase(_TC, Config, {'EXIT',{_,_}}, SCBState) -> - case db:check_consistency() of - true -> - %% DB is good, pass the test. - {proplists:delete(tc_status, Config), SCBState}; - false -> - %% DB is not good, mark as skipped instead of failing - {{skip, "DB is inconsisten!"}, SCBState} - end; -post_end_per_testcase(_TC, Config, Return, SCBState) -> - %% Do nothing if tc does not crash. - {Return, SCBState}. - - Recovering from a testcase failure using SCBs should only be done as - a last resort. If used wrongly it could become very difficult to - determine which tests pass or fail in a test run - -
- - -
- Skip and Fail -

- After any post hook has been executed for all installed SCBs, - on_tc_fail - or on_tc_skip - might be called if the testcase failed or was skipped - respectively. You cannot affect the outcome of the tests any further at - this point. -

-
- -
- - -
- Example SCB -

The SCB below will log information about a test run into a format - parseable by file:consult/1. -

- %%% @doc Common Test Example Suite Callback module. --module(example_scb). - -%% Suite Callbacks --export([id/1]). --export([init/2]). - --export([pre_init_per_suite/3]). --export([post_init_per_suite/4]). --export([pre_end_per_suite/3]). --export([post_end_per_suite/4]). - --export([pre_init_per_group/3]). --export([post_init_per_group/4]). --export([pre_end_per_group/3]). --export([post_end_per_group/4]). - --export([pre_init_per_testcase/3]). --export([post_end_per_testcase/4]). - --export([on_tc_fail/3]). --export([on_tc_skip/3]). - --export([terminate/1]). - --record(state, { file_handle, total, suite_total, ts, tcs, data }). - -%% @doc Return a unique id for this SCB. -id(Opts) -> - proplists:get_value(filename, Opts, "/tmp/file.log"). - -%% @doc Always called before any other callback function. Use this to initiate -%% any common state. -init(Id, Opts) -> - {ok,D} = file:open(Id,[write]), - #state{ file_handle = D, total = 0, data = [] }. - -%% @doc Called before init_per_suite is called. -pre_init_per_suite(Suite,Config,State) -> - {Config, State#state{ suite_total = 0, tcs = [] }}. - -%% @doc Called after init_per_suite. -post_init_per_suite(Suite,Config,Return,State) -> - {Return, State}. - -%% @doc Called before end_per_suite. -pre_end_per_suite(Suite,Config,State) -> - {Config, State}. - -%% @doc Called after end_per_suite. -post_end_per_suite(Suite,Config,Return,State) -> - Data = {suites, Suite, State#state.suite_total, lists:reverse(State#state.tcs)}, - {Return, State#state{ data = [Data | State#state.data] , - total = State#state.total + State#state.suite_total } }. - -%% @doc Called before each init_per_group. -pre_init_per_group(Group,Config,State) -> - {Config, State}. - -%% @doc Called after each init_per_group. -post_init_per_group(Group,Config,Return,State) -> - {Return, State}. - -%% @doc Called after each end_per_group. -pre_end_per_group(Group,Config,State) -> - {Config, State}. - -%% @doc Called after each end_per_group. -post_end_per_group(Group,Config,Return,State) -> - {Return, State}. - -%% @doc Called before each test case. -pre_init_per_testcase(TC,Config,State) -> - {Config, State#state{ ts = now(), total = State#state.suite_total + 1 } }. - -%% @doc Called after each test case. -post_end_per_testcase(TC,Config,Return,State) -> - TCInfo = {testcase, TC, Return, timer:now_diff(now(), State#state.ts)}, - {Return, State#state{ ts = undefined, tcs = [TCInfo | State#state.tcs] } }. - -%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group, -%% post_end_per_group and post_end_per_testcase if the suite, group or test case failed. -on_tc_fail(TC, Reason, State) -> - State. - -%% @doc Called when a test case is skipped by either user action -%% or due to an init function failing. -on_tc_skip(TC, Reason, State) -> - State. - -%% @doc Called when the scope of the SCB is done -terminate(State) -> - io:format(State#state.file_handle, "~p.~n", - [{test_run, State#state.total, State#state.data}]), - file:close(State#state.file_handle), - ok. -
- -
- - - - -- cgit v1.2.3 From 8b9b6e1436e255b8cd40ed8ab44bc0c7a90ef798 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 15 Feb 2011 13:37:19 +0100 Subject: Cleanup code to fix dialyzer warning --- lib/common_test/src/ct_hooks.erl | 2 +- lib/common_test/src/ct_run.erl | 12 +----------- lib/common_test/src/ct_testspec.erl | 2 -- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl index 8e80ce8f37..77b7566d9e 100644 --- a/lib/common_test/src/ct_hooks.erl +++ b/lib/common_test/src/ct_hooks.erl @@ -94,7 +94,7 @@ init_tc(_Mod, TC, Config) -> {skip, Reason :: term()} | {auto_skip, Reason :: term()} | {fail, Reason :: term()} | - ok. + ok | '$ct_no_change'. end_tc(ct_framework, _Func, _Args, Result, _Return) -> Result; diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 36fccf65f3..f50a46a241 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -1072,15 +1072,7 @@ refresh_logs(LogDir) -> which(logdir, undefined) -> "."; which(logdir, Dir) -> - Dir; -which(multiply_timetraps, undefined) -> - 1; -which(multiply_timetraps, MT) -> - MT; -which(scale_timetraps, undefined) -> - false; -which(scale_timetraps, ST) -> - ST. + Dir. choose_val(undefined, V1) -> V1; @@ -2068,8 +2060,6 @@ get_start_opt(Key, IfExists, IfNotExists, Args) -> Val; {value,{Key,_Val}} -> IfExists; - _ when is_function(IfNotExists) -> - IfNotExists(); _ -> IfNotExists end. diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl index db1d4c5fb0..2b6abefb72 100644 --- a/lib/common_test/src/ct_testspec.erl +++ b/lib/common_test/src/ct_testspec.erl @@ -394,8 +394,6 @@ filter_init_terms([Term|Ts], NewTerms, Spec)-> filter_init_terms([], NewTerms, Spec)-> {lists:reverse(NewTerms), Spec}. -add_option([], _, List, _)-> - List; add_option({Key, Value}, Node, List, WarnIfExists) when is_list(Value)-> OldOptions = case lists:keyfind(Node, 1, List) of {Node, Options}-> -- cgit v1.2.3 From d87708bf18d29c0a66f6654368b4553067e62394 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 17 Feb 2011 16:57:56 +0100 Subject: Update example cth spec to reflect the implementation --- lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl index 7654a7ee2f..5d07cd3dea 100644 --- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl +++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl @@ -64,14 +64,15 @@ -type reason() :: term(). -type skip_or_fail() :: {skip, reason()} | {auto_skip, reason()} | - {fail, reason()}. + {fail, reason()} | + {'EXIT',reason()}. -record(state, { id = ?MODULE :: term()}). %% @doc Always called before any other callback function. Use this to initiate %% any common state. It should return an state for this CTH. -spec init(Id :: term(), Opts :: proplist()) -> - {Id :: term(), State :: #state{}}. + State :: #state{}. init(Id, Opts) -> gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(), data = {?MODULE, init, [Id, Opts]}}), -- cgit v1.2.3 From d161dc2b44f29f184e60efcd460ed27b1ee0a0e1 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Dec 2010 10:55:15 +0100 Subject: Update tests to work with ts -> ct migrations script. --- erts/emulator/test/distribution_SUITE.erl | 4 +++- erts/emulator/test/module_info_SUITE.erl | 7 +++++-- lib/et/test/et_wx_SUITE.erl | 4 +--- lib/odbc/test/odbc_connect_SUITE.erl | 22 ++++++++++------------ lib/odbc/test/odbc_data_type_SUITE.erl | 5 +---- lib/odbc/test/odbc_query_SUITE.erl | 18 ++++++++---------- lib/odbc/test/odbc_start_SUITE.erl | 6 +----- lib/reltool/test/reltool_app_SUITE.erl | 3 --- lib/reltool/test/reltool_server_SUITE.erl | 4 +--- lib/reltool/test/reltool_wx_SUITE.erl | 6 ++---- lib/wx/test/wx_app_SUITE.erl | 3 --- lib/wx/test/wx_basic_SUITE.erl | 6 ++---- lib/wx/test/wx_class_SUITE.erl | 4 +--- lib/wx/test/wx_event_SUITE.erl | 6 ++---- lib/wx/test/wx_opengl_SUITE.erl | 4 +--- lib/wx/test/wx_xtra_SUITE.erl | 4 +--- 16 files changed, 39 insertions(+), 67 deletions(-) diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index f26455e6da..8213cdcef9 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -267,7 +267,9 @@ local_send_big(doc) -> ["Sends several big message to an non-registered process on ", "the local node."]; local_send_big(Config) when is_list(Config) -> - Data0=local_send_big(doc)++local_send(doc), + Data0=local_send_big(doc)++ + ["Tests sending small and big messages to a non-existing ", + "local registered process."], Data1=[Data0,[Data0, Data0, [Data0], Data0],Data0], Data2=Data0++lists:flatten(Data1)++ list_to_binary(lists:flatten(Data1)), diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index f34a2b496c..17e8462cd3 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,6 +30,9 @@ -export([native_proj/1,native_filter/1]). all(suite) -> + modules(). + +modules() -> [exports,functions,native]. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> @@ -42,7 +45,7 @@ end_per_testcase(_Func, Config) -> %% Should return all functions exported from this module. (local) all_exported() -> - All = add_arity(all(suite)), + All = add_arity(modules()), lists:sort([{all,1},{init_per_testcase,2},{end_per_testcase,2}, {module_info,0},{module_info,1},{native_proj,1}, {native_filter,1}|All]). diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 1a16ca69a3..05e5187d82 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -18,7 +18,7 @@ -module(et_wx_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -40,8 +40,6 @@ fin_per_testcase(Func,Config) -> %% For test_server et_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ start_all_windows diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index 4d37a8f543..093b675fd5 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -40,20 +40,18 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Tests the ability to connect and disconnet to/from the database"]; + all(suite) -> case odbc_test_lib:odbc_check() of - ok -> all(); - Other -> {skip, Other} - end. - -all() -> - [not_exist_db, commit, rollback, not_explicit_commit, - no_c_node, port_dies, control_process_dies, client_dies, - connect_timeout, timeout, many_timeouts, timeout_reset, - disconnect_on_timeout, connection_closed, - disable_scrollable_cursors, return_rows_as_lists, api_missuse]. + ok -> + [not_exist_db, commit, rollback, not_explicit_commit, + no_c_node, port_dies, control_process_dies, client_dies, + connect_timeout, timeout, many_timeouts, timeout_reset, + disconnect_on_timeout, connection_closed, + disable_scrollable_cursors, return_rows_as_lists, api_missuse]; + Other -> + {skip, Other} + end. %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl index 7d4a0ca15f..f0e35edbb2 100644 --- a/lib/odbc/test/odbc_data_type_SUITE.erl +++ b/lib/odbc/test/odbc_data_type_SUITE.erl @@ -43,13 +43,10 @@ all(doc) -> ["Tests data types"]; all(suite) -> case odbc_test_lib:odbc_check() of - ok -> all(); + ok -> [char, int, floats, dec_and_num, timestamp]; Other -> {skip,Other} end. -all() -> - [char, int, floats, dec_and_num, timestamp]. - %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config %% Config - [tuple()] diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index 12b39be3b7..25f4c837fa 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -42,19 +42,17 @@ all(doc) -> ["Tests SQL queries"]; all(suite) -> case odbc_test_lib:odbc_check() of - ok -> all(); + ok -> + [sql_query, first, last, next, prev, select_count,select_next, + select_relative, select_absolute, create_table_twice, + delete_table_twice, duplicate_key, not_connection_owner, + no_result_set, query_error, multiple_select_result_sets, + multiple_mix_result_sets, multiple_result_sets_error, + parameterized_queries, describe_table, + delete_nonexisting_row]; Other -> {skip, Other} end. -all() -> - [sql_query, first, last, next, prev, select_count,select_next, - select_relative, select_absolute, create_table_twice, - delete_table_twice, duplicate_key, not_connection_owner, - no_result_set, query_error, multiple_select_result_sets, - multiple_mix_result_sets, multiple_result_sets_error, - parameterized_queries, describe_table, - delete_nonexisting_row]. - %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl index 2cca8e4546..07cda38c04 100644 --- a/lib/odbc/test/odbc_start_SUITE.erl +++ b/lib/odbc/test/odbc_start_SUITE.erl @@ -103,14 +103,10 @@ all(doc) -> all(suite) -> case odbc_test_lib:odbc_check() of - ok -> all(); + ok -> [start]; Other -> {skip, Other} end. -all() -> - [start]. - - %% Test cases starts here. %%-------------------------------------------------------------------- diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index f8433f73d0..656a5faa29 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -63,9 +63,6 @@ fin_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all() -> - all(suite). - all(suite) -> [ fields, diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index faf1bdbba2..0fb15239a2 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -18,7 +18,7 @@ -module(reltool_server_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -48,8 +48,6 @@ fin_per_testcase(Func,Config) -> %% For test_server %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification -all() -> - all(suite). all(suite) -> [ start_server, diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index 2e2b355e07..2a951d0e9e 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ -module(reltool_wx_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -40,8 +40,6 @@ fin_per_testcase(Func,Config) -> %% For test_server reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ start_all_windows diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index 8fff324913..cba7800f14 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -50,9 +50,6 @@ fin_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all() -> - all(suite). - all(suite) -> [ fields, diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index 599aa371ba..16fcac66d2 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_basic_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -45,8 +45,6 @@ fin_per_testcase(Func,Config) -> %% For test_server wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ create_window, diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 7b8d510d40..9d9e001d3d 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(wx_class_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -46,8 +46,6 @@ fin_per_testcase(Func,Config) -> %% For test_server wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ calendarCtrl, diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index dea10d892e..5204acb978 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_event_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -44,8 +44,6 @@ fin_per_testcase(Func,Config) -> %% For test_server wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ connect, diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 778d089bce..51c7064e7c 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_opengl_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -52,8 +52,6 @@ fin_per_testcase(Func,Config) -> %% For test_server wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ canvas, diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index d5888bbf94..bf0a467eac 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, +-export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -45,8 +45,6 @@ fin_per_testcase(Func,Config) -> %% For test_server wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). all(suite) -> [ destroy_app, -- cgit v1.2.3 From e993afa1fb9c7143e09c55dee58aee32e9876d78 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 4 Oct 2010 19:03:41 +0200 Subject: Updated test cases to work with ts conversion algorithm --- lib/inets/test/ftp_freebsd_x86_test.erl | 8 ++-- lib/inets/test/ftp_linux_ppc_test.erl | 8 ++-- lib/inets/test/ftp_linux_x86_test.erl | 8 ++-- lib/inets/test/ftp_macosx_ppc_test.erl | 8 ++-- lib/inets/test/ftp_macosx_x86_test.erl | 6 +-- lib/inets/test/ftp_netbsd_x86_test.erl | 8 ++-- lib/inets/test/ftp_openbsd_x86_test.erl | 8 ++-- lib/inets/test/ftp_solaris10_sparc_test.erl | 8 ++-- lib/inets/test/ftp_solaris10_x86_test.erl | 8 ++-- lib/inets/test/ftp_solaris8_sparc_test.erl | 8 ++-- lib/inets/test/ftp_solaris9_sparc_test.erl | 8 ++-- lib/inets/test/ftp_windows_2003_server_test.erl | 8 ++-- lib/inets/test/ftp_windows_xp_test.erl | 8 ++-- lib/megaco/test/megaco_codec_mini_test.erl | 51 ++++++++++++------------ lib/megaco/test/megaco_codec_prev3a_test.erl | 51 ++++++++++++------------ lib/megaco/test/megaco_codec_prev3b_test.erl | 51 ++++++++++++------------ lib/megaco/test/megaco_codec_prev3c_test.erl | 52 ++++++++++++------------ lib/megaco/test/megaco_codec_v1_test.erl | 51 ++++++++++++------------ lib/megaco/test/megaco_codec_v2_test.erl | 53 +++++++++++++------------ lib/megaco/test/megaco_codec_v3_test.erl | 51 ++++++++++++------------ lib/mnesia/test/mnesia_install_test.erl | 7 +++- lib/odbc/test/odbc_query_SUITE.erl | 4 -- lib/odbc/test/odbc_test_lib.erl | 2 +- lib/snmp/test/snmp_agent_test.erl | 8 ++-- lib/snmp/test/snmp_app_test.erl | 8 ++-- lib/snmp/test/snmp_appup_test.erl | 12 +++--- 26 files changed, 249 insertions(+), 254 deletions(-) diff --git a/lib/inets/test/ftp_freebsd_x86_test.erl b/lib/inets/test/ftp_freebsd_x86_test.erl index 457e18ffbe..81dc320a14 100644 --- a/lib/inets/test/ftp_freebsd_x86_test.erl +++ b/lib/inets/test/ftp_freebsd_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -98,11 +98,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_linux_ppc_test.erl b/lib/inets/test/ftp_linux_ppc_test.erl index ad38137678..d2e8e440e9 100644 --- a/lib/inets/test/ftp_linux_ppc_test.erl +++ b/lib/inets/test/ftp_linux_ppc_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,11 +99,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_linux_x86_test.erl b/lib/inets/test/ftp_linux_x86_test.erl index b9c88d121a..48a90579dd 100644 --- a/lib/inets/test/ftp_linux_x86_test.erl +++ b/lib/inets/test/ftp_linux_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -105,11 +105,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_macosx_ppc_test.erl b/lib/inets/test/ftp_macosx_ppc_test.erl index cf548a73c0..ced8debee1 100644 --- a/lib/inets/test/ftp_macosx_ppc_test.erl +++ b/lib/inets/test/ftp_macosx_ppc_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -97,11 +97,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_macosx_x86_test.erl b/lib/inets/test/ftp_macosx_x86_test.erl index 5566d4feaa..29d0d517ed 100644 --- a/lib/inets/test/ftp_macosx_x86_test.erl +++ b/lib/inets/test/ftp_macosx_x86_test.erl @@ -97,11 +97,11 @@ all(suite) -> %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_netbsd_x86_test.erl b/lib/inets/test/ftp_netbsd_x86_test.erl index a5711b7bde..ed30aee2b4 100644 --- a/lib/inets/test/ftp_netbsd_x86_test.erl +++ b/lib/inets/test/ftp_netbsd_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -97,11 +97,11 @@ all(suite) -> %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_openbsd_x86_test.erl b/lib/inets/test/ftp_openbsd_x86_test.erl index 4833b6332b..adde553196 100644 --- a/lib/inets/test/ftp_openbsd_x86_test.erl +++ b/lib/inets/test/ftp_openbsd_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,11 +99,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris10_sparc_test.erl b/lib/inets/test/ftp_solaris10_sparc_test.erl index 6066195f9b..9671afc069 100644 --- a/lib/inets/test/ftp_solaris10_sparc_test.erl +++ b/lib/inets/test/ftp_solaris10_sparc_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,11 +99,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) ->?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris10_x86_test.erl b/lib/inets/test/ftp_solaris10_x86_test.erl index 3bd99fc3f2..1d44e36578 100644 --- a/lib/inets/test/ftp_solaris10_x86_test.erl +++ b/lib/inets/test/ftp_solaris10_x86_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -100,11 +100,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris8_sparc_test.erl b/lib/inets/test/ftp_solaris8_sparc_test.erl index 9764071cd9..9e7511f162 100644 --- a/lib/inets/test/ftp_solaris8_sparc_test.erl +++ b/lib/inets/test/ftp_solaris8_sparc_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -97,11 +97,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris9_sparc_test.erl b/lib/inets/test/ftp_solaris9_sparc_test.erl index a9f77bbdac..fe61c8615a 100644 --- a/lib/inets/test/ftp_solaris9_sparc_test.erl +++ b/lib/inets/test/ftp_solaris9_sparc_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -96,11 +96,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_windows_2003_server_test.erl b/lib/inets/test/ftp_windows_2003_server_test.erl index d24318d04f..de019bd1cd 100644 --- a/lib/inets/test/ftp_windows_2003_server_test.erl +++ b/lib/inets/test/ftp_windows_2003_server_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -97,11 +97,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_windows_xp_test.erl b/lib/inets/test/ftp_windows_xp_test.erl index bc161e4f6a..53803ba3d8 100644 --- a/lib/inets/test/ftp_windows_xp_test.erl +++ b/lib/inets/test/ftp_windows_xp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -95,11 +95,11 @@ all(suite) -> open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:passive/1). -active(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:active/1). +passive(suite) -> ?LIB_MOD:passive(suite). +active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:progress_report/1). +progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl index e509739bb1..cb4cf09536 100644 --- a/lib/megaco/test/megaco_codec_mini_test.erl +++ b/lib/megaco/test/megaco_codec_mini_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -49,31 +49,6 @@ -define(SET_DBG(S,D), begin put(severity, S), put(dbg, D) end). -define(RESET_DBG(), begin erase(severity), erase(dbg) end). - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - expand(RootCase) -> expand([RootCase], []). @@ -125,6 +100,30 @@ tickets(suite) -> otp7672_msg02 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index 696a72343c..f3a68b045b 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -263,30 +263,7 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). + %% ---- @@ -569,6 +546,30 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index b5fe4d2038..5b47300891 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -281,31 +281,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -595,6 +570,30 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index 813d0cf57d..db2d1404a7 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -286,32 +286,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - - %% ---- t() -> megaco_test_lib:t(?MODULE). @@ -603,6 +577,30 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 7f2af37282..e070dd65e0 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -451,31 +451,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -754,6 +729,30 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index 1df1c6c93b..8b218a5250 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -431,31 +431,7 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - + %% ---- @@ -753,6 +729,31 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index f49c3a677a..16dd0c7f5d 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -285,31 +285,6 @@ expand([Case|Cases], Acc) -> expand(Cases, [Case|Acc]) end. - -%% ---- - -tickets() -> - Flag = process_flag(trap_exit, true), - Cases = expand(tickets), - Fun = fun(Case) -> - C = init_per_testcase(Case, [{tc_timeout, - timer:minutes(10)}]), - io:format("Eval ~w~n", [Case]), - Result = - case (catch apply(?MODULE, Case, [C])) of - {'EXIT', Reason} -> - io:format("~n~p exited:~n ~p~n", - [Case, Reason]), - {error, {Case, Reason}}; - Res -> - Res - end, - fin_per_testcase(Case, C), - Result - end, - process_flag(trap_exit, Flag), - lists:map(Fun, Cases). - %% ---- @@ -602,6 +577,30 @@ flex_pretty_tickets_cases() -> flex_pretty_otp7431_msg07 ]. +%% ---- + +tickets() -> + Flag = process_flag(trap_exit, true), + Cases = expand(tickets), + Fun = fun(Case) -> + C = init_per_testcase(Case, [{tc_timeout, + timer:minutes(10)}]), + io:format("Eval ~w~n", [Case]), + Result = + case (catch apply(?MODULE, Case, [C])) of + {'EXIT', Reason} -> + io:format("~n~p exited:~n ~p~n", + [Case, Reason]), + {error, {Case, Reason}}; + Res -> + Res + end, + fin_per_testcase(Case, C), + Result + end, + process_flag(trap_exit, Flag), + lists:map(Fun, Cases). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index 42a2a19f37..0c868a7449 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -86,11 +86,11 @@ silly2(Config) when is_list(Config) -> [schema])), MoveRes = silly_move(Config), UpgradeRes = silly_upgrade(Config), - StressRes = [StressFun(F) || F <- stress(suite)], + StressRes = [StressFun(F) || F <- stress_cases()], ?verify_mnesia([Node2], []), [Res, MoveRes, UpgradeRes] ++ StressRes; _ -> - StressRes = [StressFun(F) || F <- stress(suite)], + StressRes = [StressFun(F) || F <- stress_cases()], ?warning("Too few nodes. Perform net_adm:ping(OtherNode) " "and rerun!!!~n", []), [Res | StressRes] @@ -289,6 +289,9 @@ transform_some_records(Tab1, _Tab2, Old) -> stress(doc) -> ["Stress the system a little"]; stress(suite) -> + stress_cases(). + +stress_cases() -> [ conflict, dist diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index 25f4c837fa..96a3e3fa80 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -636,11 +636,7 @@ multiple_result_sets_error(Config) when is_list(Config) -> end. %%------------------------------------------------------------------------- -parameterized_queries(doc)-> - ["Tests diffrent variants of parameterized queries."]; parameterized_queries(suite) -> - %% Note timestamps are inserted with param_query in odbc_data_type_SUITE - %% so no need to test this again. [param_integers, param_insert_decimal, param_insert_numeric, param_insert_string, diff --git a/lib/odbc/test/odbc_test_lib.erl b/lib/odbc/test/odbc_test_lib.erl index 92e895eb87..012eb96e43 100644 --- a/lib/odbc/test/odbc_test_lib.erl +++ b/lib/odbc/test/odbc_test_lib.erl @@ -51,7 +51,7 @@ odbc_check() -> [Other])) end; Other -> - case test_server:os_type() of + case os:type() of {unix, linux} -> ok; Platform -> diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index 9d2e9969c4..ba438f0568 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -96,7 +96,7 @@ init_per_testcase(otp8395 = Case, Config) when is_list(Config) -> ?DBG("init_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p", [Case, Config]), - Config2 = init_per_testcase2(Case, init_suite(Config)), + Config2 = init_per_testcase2(Case, init_per_suite(Config)), otp8395({init, Config2}); init_per_testcase(otp_7157_test = _Case, Config) when is_list(Config) -> ?DBG("init_per_testcase -> entry with" @@ -134,8 +134,8 @@ fin_per_testcase(_Case, Config) when is_list(Config) -> Config. -init_suite(Config) -> - ?DBG("init_suite -> entry with" +init_per_suite(Config) -> + ?DBG("init_per_suite -> entry with" "~n Config: ~p", [Config]), %% Suite root dir for test suite @@ -170,7 +170,7 @@ init_suite(Config) -> {mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config1], - ?DBG("init_suite -> done when" + ?DBG("init_per_suite -> done when" "~n Config2: ~p", [Config2]), Config2. diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 5c5a5285a0..773f65be46 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -module(snmp_app_test). -export([ - all/1, init_suite/1, fin_suite/1, + all/1, init_per_suite/1, fin_suite/1, init_per_testcase/2, fin_per_testcase/2, fields/1, @@ -60,9 +60,9 @@ all(suite) -> undef_funcs, start_and_stop ], - {conf, init_suite, Cases, fin_suite}. + {conf, init_per_suite, Cases, fin_suite}. -init_suite(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?DISPLAY_SUITE_INFO(), PrivDir = ?config(priv_dir, Config), TopDir = filename:join(PrivDir, app), diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 18509526cf..37522b8e3a 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -module(snmp_appup_test). -export([ - all/1, init_suite/1, fin_suite/1, + all/1, init_per_suite/1, fin_suite/1, init_per_testcase/2, fin_per_testcase/2, appup_file/1 @@ -41,14 +41,14 @@ all(suite) -> [ appup_file ], - {conf, init_suite, Cases, fin_suite}. + {conf, init_per_suite, Cases, fin_suite}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -init_suite(suite) -> []; -init_suite(doc) -> []; -init_suite(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> PrivDir = ?config(priv_dir, Config), TopDir = filename:join(PrivDir, appup), case file:make_dir(TopDir) of -- cgit v1.2.3 From 2cbb5d191fd8f94c113cbf61c243999388f65c3b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 5 Oct 2010 17:58:16 +0200 Subject: Update all fin_per_testcase to end_per_testcase. --- lib/compiler/test/apply_SUITE.erl | 2 +- lib/compiler/test/beam_validator_SUITE.erl | 4 +- lib/compiler/test/bs_bit_binaries_SUITE.erl | 2 +- lib/compiler/test/bs_construct_SUITE.erl | 4 +- lib/compiler/test/bs_match_SUITE.erl | 4 +- lib/compiler/test/core_SUITE.erl | 6 +- lib/compiler/test/core_fold_SUITE.erl | 2 +- lib/compiler/test/fun_SUITE.erl | 2 +- lib/compiler/test/inline_SUITE.erl | 2 +- lib/compiler/test/lc_SUITE.erl | 4 +- lib/compiler/test/misc_SUITE.erl | 4 +- lib/compiler/test/parteval_SUITE.erl | 2 +- lib/compiler/test/pmod_SUITE.erl | 4 +- lib/compiler/test/receive_SUITE.erl | 6 +- lib/compiler/test/record_SUITE.erl | 4 +- lib/compiler/test/trycatch_SUITE.erl | 2 +- lib/compiler/test/warnings_SUITE.erl | 4 +- lib/cosEvent/test/event_channel_SUITE.erl | 6 +- lib/cosEvent/test/event_test_PullC_impl.erl | 2 +- lib/cosEvent/test/event_test_PullS_impl.erl | 2 +- lib/cosEvent/test/event_test_PushC_impl.erl | 2 +- lib/cosEvent/test/event_test_PushS_impl.erl | 2 +- lib/cosEvent/test/generated_SUITE.erl | 4 +- lib/cosEventDomain/test/event_domain_SUITE.erl | 6 +- lib/cosEventDomain/test/generated_SUITE.erl | 4 +- lib/cosNotification/test/eventDB_SUITE.erl | 6 +- lib/cosNotification/test/generated_SUITE.erl | 4 +- lib/cosNotification/test/grammar_SUITE.erl | 6 +- lib/cosNotification/test/notification_SUITE.erl | 6 +- lib/cosNotification/test/notify_test_impl.erl | 2 +- lib/cosProperty/test/generated_SUITE.erl | 4 +- lib/cosProperty/test/property_SUITE.erl | 6 +- lib/cosTime/test/generated_SUITE.erl | 4 +- lib/cosTime/test/time_SUITE.erl | 6 +- lib/cosTransactions/test/etrap_test_lib.erl | 2 +- lib/cosTransactions/test/generated_SUITE.erl | 4 +- lib/cosTransactions/test/transactions_SUITE.erl | 6 +- lib/crypto/test/crypto_SUITE.erl | 6 +- lib/debugger/test/andor_SUITE.erl | 4 +- lib/debugger/test/bs_bincomp_SUITE.erl | 4 +- lib/debugger/test/bs_construct_SUITE.erl | 4 +- lib/debugger/test/bs_match_bin_SUITE.erl | 4 +- lib/debugger/test/bs_match_int_SUITE.erl | 4 +- lib/debugger/test/bs_match_misc_SUITE.erl | 4 +- lib/debugger/test/bs_match_tail_SUITE.erl | 4 +- lib/debugger/test/bs_utf_SUITE.erl | 4 +- lib/debugger/test/dbg_ui_SUITE.erl | 4 +- lib/debugger/test/debugger_SUITE.erl | 4 +- lib/debugger/test/erl_eval_SUITE.erl | 4 +- lib/debugger/test/exception_SUITE.erl | 4 +- lib/debugger/test/guard_SUITE.erl | 4 +- lib/debugger/test/int_break_SUITE.erl | 4 +- lib/debugger/test/int_eval_SUITE.erl | 4 +- lib/debugger/test/lc_SUITE.erl | 4 +- lib/debugger/test/record_SUITE.erl | 4 +- lib/debugger/test/trycatch_SUITE.erl | 4 +- lib/erl_interface/test/ei_accept_SUITE.erl | 4 +- lib/erl_interface/test/ei_connect_SUITE.erl | 4 +- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 2 +- lib/erl_interface/test/ei_format_SUITE.erl | 2 +- lib/erl_interface/test/ei_print_SUITE.erl | 2 +- lib/erl_interface/test/ei_tmo_SUITE.erl | 4 +- lib/erl_interface/test/erl_connect_SUITE.erl | 6 +- lib/erl_interface/test/erl_eterm_SUITE.erl | 2 +- lib/erl_interface/test/erl_ext_SUITE.erl | 2 +- lib/erl_interface/test/erl_format_SUITE.erl | 2 +- lib/erl_interface/test/erl_match_SUITE.erl | 2 +- lib/erl_interface/test/port_call_SUITE.erl | 2 +- lib/erl_interface/test/runner.erl | 2 +- lib/et/test/et_test_lib.erl | 6 +- lib/et/test/et_wx_SUITE.erl | 4 +- lib/eunit/test/eunit_SUITE.erl | 2 +- lib/ic/test/c_client_erl_server_SUITE.erl | 6 +- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 6 +- .../test/c_client_erl_server_proto_tmo_SUITE.erl | 6 +- lib/ic/test/erl_client_c_server_SUITE.erl | 6 +- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 6 +- lib/ic/test/ic_be_SUITE.erl | 2 +- lib/ic/test/ic_pp_SUITE.erl | 2 +- lib/ic/test/ic_pragma_SUITE.erl | 2 +- lib/ic/test/ic_register_SUITE.erl | 2 +- lib/ic/test/java_client_erl_server_SUITE.erl | 6 +- lib/inets/test/ftp_SUITE.erl | 2 +- lib/inets/test/ftp_format_SUITE.erl | 2 +- lib/inets/test/httpd_1_1.erl | 2 +- lib/inets/test/httpd_load.erl | 2 +- lib/inets/test/inets_app_test.erl | 4 +- lib/inets/test/inets_appup_test.erl | 2 +- lib/inets/test/tftp_SUITE.erl | 6 +- lib/inets/test/tftp_test_lib.erl | 6 +- lib/inviso/test/inviso_tool_SUITE.erl | 22 +-- lib/kernel/test/appinc1.erl | 2 +- lib/kernel/test/appinc1x.erl | 2 +- lib/kernel/test/appinc2.erl | 2 +- lib/kernel/test/appinc2A.erl | 2 +- lib/kernel/test/appinc2B.erl | 2 +- lib/kernel/test/appinc2top.erl | 2 +- lib/kernel/test/application_SUITE.erl | 8 +- lib/kernel/test/bif_SUITE.erl | 4 +- lib/kernel/test/ch.erl | 2 +- lib/kernel/test/ch_sup.erl | 2 +- lib/kernel/test/code_SUITE.erl | 4 +- lib/kernel/test/code_a_test.erl | 2 +- lib/kernel/test/code_b_test.erl | 2 +- lib/kernel/test/disk_log_SUITE.erl | 4 +- lib/kernel/test/erl_boot_server_SUITE.erl | 2 +- lib/kernel/test/erl_distribution_SUITE.erl | 4 +- lib/kernel/test/erl_distribution_wb_SUITE.erl | 6 +- lib/kernel/test/erl_prim_loader_SUITE.erl | 4 +- lib/kernel/test/error_logger_warn_SUITE.erl | 6 +- lib/kernel/test/file_SUITE.erl | 4 +- lib/kernel/test/gen_sctp_SUITE.erl | 4 +- lib/kernel/test/gen_tcp_api_SUITE.erl | 4 +- lib/kernel/test/gen_tcp_echo_SUITE.erl | 6 +- lib/kernel/test/gen_tcp_misc_SUITE.erl | 4 +- lib/kernel/test/gen_udp_SUITE.erl | 4 +- lib/kernel/test/global_SUITE.erl | 2 +- lib/kernel/test/global_group_SUITE.erl | 4 +- lib/kernel/test/heart_SUITE.erl | 4 +- lib/kernel/test/inet_sockopt_SUITE.erl | 2 +- lib/kernel/test/init_SUITE.erl | 4 +- lib/kernel/test/interactive_shell_SUITE.erl | 2 +- lib/kernel/test/kernel_SUITE.erl | 4 +- lib/kernel/test/myApp.erl | 2 +- lib/kernel/test/pdict_SUITE.erl | 4 +- lib/kernel/test/pg2_SUITE.erl | 4 +- lib/kernel/test/ram_file_SUITE.erl | 4 +- lib/kernel/test/seq_trace_SUITE.erl | 4 +- lib/kernel/test/topApp.erl | 2 +- lib/kernel/test/topApp2.erl | 2 +- lib/kernel/test/topApp3.erl | 2 +- lib/kernel/test/wrap_log_reader_SUITE.erl | 4 +- lib/kernel/test/zlib_SUITE.erl | 4 +- lib/megaco/test/megaco_SUITE.erl | 6 +- lib/megaco/test/megaco_actions_test.erl | 6 +- lib/megaco/test/megaco_app_test.erl | 4 +- lib/megaco/test/megaco_appup_mg.erl | 2 +- lib/megaco/test/megaco_appup_mgc.erl | 2 +- lib/megaco/test/megaco_appup_test.erl | 6 +- lib/megaco/test/megaco_binary_term_id_test.erl | 8 +- lib/megaco/test/megaco_call_flow_test.erl | 6 +- lib/megaco/test/megaco_codec_flex_lib.erl | 2 +- lib/megaco/test/megaco_codec_mini_test.erl | 8 +- lib/megaco/test/megaco_codec_prev3a_test.erl | 8 +- lib/megaco/test/megaco_codec_prev3b_test.erl | 8 +- lib/megaco/test/megaco_codec_prev3c_test.erl | 8 +- lib/megaco/test/megaco_codec_test.erl | 6 +- lib/megaco/test/megaco_codec_test_lib.erl | 2 +- lib/megaco/test/megaco_codec_v1_test.erl | 8 +- lib/megaco/test/megaco_codec_v2_test.erl | 8 +- lib/megaco/test/megaco_codec_v3_test.erl | 8 +- lib/megaco/test/megaco_config_test.erl | 4 +- lib/megaco/test/megaco_digit_map_test.erl | 6 +- lib/megaco/test/megaco_examples_test.erl | 6 +- lib/megaco/test/megaco_flex_test.erl | 8 +- lib/megaco/test/megaco_load_test.erl | 6 +- lib/megaco/test/megaco_mess_otp8212_test.erl | 2 +- lib/megaco/test/megaco_mess_test.erl | 12 +- lib/megaco/test/megaco_mess_user_test.erl | 2 +- lib/megaco/test/megaco_mib_test.erl | 6 +- lib/megaco/test/megaco_mreq_test.erl | 6 +- lib/megaco/test/megaco_pending_limit_test.erl | 8 +- lib/megaco/test/megaco_profile.erl | 2 +- lib/megaco/test/megaco_sdp_test.erl | 8 +- lib/megaco/test/megaco_segment_test.erl | 8 +- lib/megaco/test/megaco_tc_controller.erl | 2 +- lib/megaco/test/megaco_tcp_test.erl | 10 +- lib/megaco/test/megaco_test_deliver.erl | 2 +- lib/megaco/test/megaco_test_generator.erl | 2 +- lib/megaco/test/megaco_test_generator_lib.erl | 2 +- lib/megaco/test/megaco_test_generic_transport.erl | 2 +- lib/megaco/test/megaco_test_lib.erl | 8 +- lib/megaco/test/megaco_test_megaco_generator.erl | 2 +- lib/megaco/test/megaco_test_mg.erl | 2 +- lib/megaco/test/megaco_test_mgc.erl | 2 +- lib/megaco/test/megaco_test_msg_prev3a_lib.erl | 2 +- lib/megaco/test/megaco_test_msg_prev3b_lib.erl | 2 +- lib/megaco/test/megaco_test_msg_prev3c_lib.erl | 2 +- lib/megaco/test/megaco_test_msg_v1_lib.erl | 2 +- lib/megaco/test/megaco_test_msg_v2_lib.erl | 2 +- lib/megaco/test/megaco_test_msg_v3_lib.erl | 2 +- lib/megaco/test/megaco_test_tcp_generator.erl | 2 +- lib/megaco/test/megaco_timer_test.erl | 12 +- lib/megaco/test/megaco_trans_test.erl | 6 +- lib/megaco/test/megaco_udp_test.erl | 10 +- lib/mnesia/test/mnesia_SUITE.erl | 4 +- lib/mnesia/test/mnesia_atomicity_test.erl | 4 +- lib/mnesia/test/mnesia_config_backup.erl | 2 +- lib/mnesia/test/mnesia_config_event.erl | 2 +- lib/mnesia/test/mnesia_config_test.erl | 6 +- lib/mnesia/test/mnesia_consistency_test.erl | 4 +- lib/mnesia/test/mnesia_cost.erl | 2 +- lib/mnesia/test/mnesia_dirty_access_test.erl | 4 +- lib/mnesia/test/mnesia_durability_test.erl | 4 +- lib/mnesia/test/mnesia_evil_backup.erl | 4 +- lib/mnesia/test/mnesia_evil_coverage_test.erl | 4 +- lib/mnesia/test/mnesia_examples_test.erl | 4 +- lib/mnesia/test/mnesia_frag_test.erl | 4 +- .../test/mnesia_inconsistent_database_test.erl | 2 +- lib/mnesia/test/mnesia_install_test.erl | 4 +- lib/mnesia/test/mnesia_isolation_test.erl | 6 +- lib/mnesia/test/mnesia_measure_test.erl | 6 +- lib/mnesia/test/mnesia_nice_coverage_test.erl | 4 +- lib/mnesia/test/mnesia_qlc_test.erl | 4 +- lib/mnesia/test/mnesia_recovery_test.erl | 4 +- lib/mnesia/test/mnesia_registry_test.erl | 4 +- lib/mnesia/test/mnesia_schema_recovery_test.erl | 4 +- lib/mnesia/test/mnesia_test_lib.erl | 10 +- lib/mnesia/test/mnesia_tpcb.erl | 2 +- lib/mnesia/test/mnesia_trans_access_test.erl | 6 +- lib/observer/test/etop_SUITE.erl | 4 +- lib/observer/test/ttb_SUITE.erl | 4 +- lib/orber/test/cdrcoding_10_SUITE.erl | 2 +- lib/orber/test/cdrcoding_11_SUITE.erl | 2 +- lib/orber/test/cdrcoding_12_SUITE.erl | 2 +- lib/orber/test/cdrlib_SUITE.erl | 4 +- lib/orber/test/corba_SUITE.erl | 2 +- lib/orber/test/csiv2_SUITE.erl | 4 +- lib/orber/test/data_types_SUITE.erl | 4 +- lib/orber/test/generated_SUITE.erl | 4 +- lib/orber/test/iiop_module_do_test_impl.erl | 2 +- lib/orber/test/iiop_module_test_impl.erl | 2 +- lib/orber/test/iiop_test_impl.erl | 2 +- lib/orber/test/interceptors_SUITE.erl | 4 +- lib/orber/test/iop_ior_10_SUITE.erl | 2 +- lib/orber/test/iop_ior_11_SUITE.erl | 2 +- lib/orber/test/iop_ior_12_SUITE.erl | 2 +- lib/orber/test/lname_SUITE.erl | 4 +- lib/orber/test/multi_ORB_SUITE.erl | 4 +- lib/orber/test/naming_context_SUITE.erl | 6 +- lib/orber/test/orber_SUITE.erl | 6 +- lib/orber/test/orber_acl_SUITE.erl | 2 +- lib/orber/test/orber_firewall_ipv4_in_SUITE.erl | 6 +- lib/orber/test/orber_firewall_ipv4_out_SUITE.erl | 6 +- lib/orber/test/orber_firewall_ipv6_in_SUITE.erl | 4 +- lib/orber/test/orber_firewall_ipv6_out_SUITE.erl | 6 +- lib/orber/test/orber_nat_SUITE.erl | 6 +- lib/orber/test/orber_test_timeout_server_impl.erl | 2 +- lib/orber/test/orber_web_SUITE.erl | 4 +- lib/orber/test/tc_SUITE.erl | 4 +- lib/os_mon/test/os_mon_SUITE.erl | 4 +- lib/parsetools/test/leex_SUITE.erl | 6 +- lib/parsetools/test/yecc_SUITE.erl | 4 +- lib/percept/test/percept_SUITE.erl | 2 +- lib/public_key/test/pkits_SUITE.erl | 2 +- lib/reltool/test/reltool_app_SUITE.erl | 2 +- lib/reltool/test/reltool_server_SUITE.erl | 4 +- lib/reltool/test/reltool_test_lib.erl | 6 +- lib/reltool/test/reltool_wx_SUITE.erl | 4 +- lib/reltool/test/rtt.erl | 2 +- lib/runtime_tools/test/dbg_SUITE.erl | 4 +- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 4 +- lib/runtime_tools/test/inviso_SUITE.erl | 6 +- lib/snmp/test/klas3.erl | 2 +- lib/snmp/test/sa.erl | 2 +- lib/snmp/test/snmp_SUITE.erl | 6 +- lib/snmp/test/snmp_agent_bl_test.erl | 4 +- lib/snmp/test/snmp_agent_mibs_test.erl | 12 +- lib/snmp/test/snmp_agent_ms_test.erl | 4 +- lib/snmp/test/snmp_agent_mt_test.erl | 4 +- lib/snmp/test/snmp_agent_nfilter_test.erl | 6 +- lib/snmp/test/snmp_agent_test.erl | 8 +- lib/snmp/test/snmp_agent_v1_test.erl | 4 +- lib/snmp/test/snmp_agent_v2_test.erl | 4 +- lib/snmp/test/snmp_agent_v3_test.erl | 4 +- lib/snmp/test/snmp_app_test.erl | 4 +- lib/snmp/test/snmp_appup_mgr.erl | 2 +- lib/snmp/test/snmp_appup_test.erl | 4 +- lib/snmp/test/snmp_compiler_test.erl | 4 +- lib/snmp/test/snmp_conf_test.erl | 6 +- lib/snmp/test/snmp_log_test.erl | 4 +- lib/snmp/test/snmp_manager_config_test.erl | 6 +- lib/snmp/test/snmp_manager_test.erl | 8 +- lib/snmp/test/snmp_manager_user.erl | 2 +- lib/snmp/test/snmp_manager_user_old.erl | 2 +- lib/snmp/test/snmp_manager_user_test.erl | 6 +- lib/snmp/test/snmp_manager_user_test_lib.erl | 2 +- lib/snmp/test/snmp_note_store_test.erl | 6 +- lib/snmp/test/snmp_pdus_test.erl | 4 +- lib/snmp/test/snmp_test_manager.erl | 2 +- lib/snmp/test/snmp_test_server.erl | 8 +- lib/snmp/test/snmp_test_suite.erl | 4 +- lib/snmp/test/test1.erl | 2 +- lib/snmp/test/test2.erl | 2 +- lib/ssl/test/make_certs.erl | 2 +- lib/ssl/test/old_ssl_active_SUITE.erl | 4 +- lib/ssl/test/old_ssl_active_once_SUITE.erl | 4 +- lib/ssl/test/old_ssl_dist_SUITE.erl | 4 +- lib/ssl/test/old_ssl_misc_SUITE.erl | 4 +- lib/ssl/test/old_ssl_passive_SUITE.erl | 4 +- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 4 +- lib/ssl/test/old_ssl_protocol_SUITE.erl | 4 +- lib/ssl/test/old_ssl_verify_SUITE.erl | 4 +- lib/ssl/test/old_transport_accept_SUITE.erl | 4 +- lib/stdlib/test/array_SUITE.erl | 6 +- lib/stdlib/test/beam_lib_SUITE.erl | 17 ++- lib/stdlib/test/binary_module_SUITE.erl | 22 ++- lib/stdlib/test/c_SUITE.erl | 2 +- lib/stdlib/test/dets_SUITE.erl | 4 +- lib/stdlib/test/dict_SUITE.erl | 6 +- lib/stdlib/test/dict_test_lib.erl | 2 +- lib/stdlib/test/digraph_SUITE.erl | 2 +- lib/stdlib/test/digraph_utils_SUITE.erl | 2 +- lib/stdlib/test/dummy_h.erl | 2 +- lib/stdlib/test/edlin_expand_SUITE.erl | 4 +- lib/stdlib/test/epp_SUITE.erl | 4 +- lib/stdlib/test/erl_eval_SUITE.erl | 4 +- lib/stdlib/test/erl_eval_helper.erl | 2 +- lib/stdlib/test/erl_expand_records_SUITE.erl | 6 +- lib/stdlib/test/erl_internal_SUITE.erl | 6 +- lib/stdlib/test/erl_lint_SUITE.erl | 4 +- lib/stdlib/test/erl_pp_SUITE.erl | 4 +- lib/stdlib/test/erl_scan_SUITE.erl | 4 +- lib/stdlib/test/error_logger_forwarder.erl | 2 +- lib/stdlib/test/escript_SUITE.erl | 4 +- lib/stdlib/test/ets_SUITE.erl | 4 +- lib/stdlib/test/ets_tough_SUITE.erl | 4 +- lib/stdlib/test/file_sorter_SUITE.erl | 6 +- lib/stdlib/test/filelib_SUITE.erl | 4 +- lib/stdlib/test/fixtable_SUITE.erl | 4 +- lib/stdlib/test/format_SUITE.erl | 4 +- lib/stdlib/test/gen_server_SUITE.erl | 4 +- lib/stdlib/test/id_transform_SUITE.erl | 2 +- lib/stdlib/test/io_SUITE.erl | 6 +- lib/stdlib/test/io_proto_SUITE.erl | 4 +- lib/stdlib/test/lists_SUITE.erl | 6 +- lib/stdlib/test/log_mf_h_SUITE.erl | 2 +- lib/stdlib/test/ms_transform_SUITE.erl | 4 +- lib/stdlib/test/naughty_child.erl | 2 +- lib/stdlib/test/proc_lib_SUITE.erl | 2 +- lib/stdlib/test/qlc_SUITE.erl | 4 +- lib/stdlib/test/queue_SUITE.erl | 4 +- lib/stdlib/test/random_SUITE.erl | 6 +- lib/stdlib/test/random_iolist.erl | 2 +- lib/stdlib/test/random_unicode_list.erl | 2 +- lib/stdlib/test/select_SUITE.erl | 4 +- lib/stdlib/test/sets_SUITE.erl | 6 +- lib/stdlib/test/sets_test_lib.erl | 2 +- lib/stdlib/test/shell_SUITE.erl | 4 +- lib/stdlib/test/sofs_SUITE.erl | 4 +- lib/stdlib/test/stdlib_SUITE.erl | 6 +- lib/stdlib/test/string_SUITE.erl | 4 +- lib/stdlib/test/supervisor_1.erl | 2 +- lib/stdlib/test/supervisor_bridge_SUITE.erl | 2 +- lib/stdlib/test/sys_SUITE.erl | 2 +- lib/stdlib/test/timer_simple_SUITE.erl | 2 +- lib/stdlib/test/unicode_SUITE.erl | 4 +- lib/stdlib/test/y2k_SUITE.erl | 2 +- lib/tools/test/cover_SUITE.erl | 2 +- lib/tools/test/cprof_SUITE.erl | 4 +- lib/tools/test/emem_SUITE.erl | 4 +- lib/tools/test/ignore_cores.erl | 159 ++++++++++++++++++++- lib/tools/test/instrument_SUITE.erl | 4 +- lib/tools/test/tools_SUITE.erl | 4 +- lib/tools/test/xref_SUITE.erl | 4 +- lib/wx/test/wx_app_SUITE.erl | 3 - lib/wx/test/wx_basic_SUITE.erl | 4 +- lib/wx/test/wx_class_SUITE.erl | 4 +- lib/wx/test/wx_event_SUITE.erl | 4 +- lib/wx/test/wx_opengl_SUITE.erl | 4 +- lib/wx/test/wx_test_lib.erl | 8 +- lib/wx/test/wx_xtra_SUITE.erl | 4 +- 362 files changed, 912 insertions(+), 735 deletions(-) mode change 120000 => 100644 lib/tools/test/ignore_cores.erl diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index f23dd6c2db..f955440402 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 74b5d7c7eb..94745e995c 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_validator_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, beam_files/1,compiler_bug/1,stupid_but_valid/1, xrange/1,yrange/1,stack/1,call_last/1,merge_undefined/1, uninit/1,unsafe_catch/1, @@ -36,7 +36,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(10)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 6337460b13..7d533861e0 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index dfe4301791..eafc2f4b0f 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -23,7 +23,7 @@ -module(bs_construct_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, two/1,test1/1,fail/1,float_bin/1,in_guard/1,in_catch/1, nasty_literals/1,coerce_to_float/1,side_effect/1, opt/1,otp_7556/1,float_arith/1,otp_8054/1]). @@ -39,7 +39,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index caaa587006..5dc57c2928 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_SUITE). -compile(nowarn_shadow_vars). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1, bin_tail/1,save_restore/1,shadowed_size_var/1, partitioned_bs_match/1,function_clause/1, @@ -52,7 +52,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 54cf799057..fa2e6be778 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ %% -module(core_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1]). -include("test_server.hrl"). @@ -30,7 +30,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(5)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 5f2c905d4a..2791aee782 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index fb2667245a..a740d63c06 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 396fb450b7..af93f5d4d7 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index 40bf67e1fa..d0c0397439 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -19,7 +19,7 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, basic/1,deeply_nested/1,no_generator/1, empty_generator/1]). @@ -33,7 +33,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index 450a4e279d..d01d53658c 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(misc_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, tobias/1,empty_string/1,md5/1,silly_coverage/1, confused_literals/1,integer_encoding/1,override_bif/1]). @@ -45,7 +45,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(10)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index 3ef84571b9..fda961346e 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index 13503ce905..a4fd2ecbd9 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -18,7 +18,7 @@ %% -module(pmod_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, basic/1, otp_8447/1]). -include("test_server.hrl"). @@ -31,7 +31,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> +end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 2a592dd669..8d53e2b6c0 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -20,8 +20,8 @@ -module(receive_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, - recv/1,coverage/1,otp_7980/1,ref_opt/1,export/1]). +-export([all/1,init_per_testcase/2,end_per_testcase/2, + recv/1,coverage/1,otp_7980/1,ref_opt/1]). -include("test_server.hrl"). @@ -29,7 +29,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(test_server:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index f26ff769c7..122f53ec73 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -22,7 +22,7 @@ -include("test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1, guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]). @@ -30,7 +30,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(test_server:minutes(2)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index c2f6dc24be..351289c1dc 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index 5ed8836c70..e9c381fe8b 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/1,init_per_testcase/2,end_per_testcase/2]). -export([pattern/1,pattern2/1,pattern3/1,pattern4/1, guard/1,bad_arith/1,bool_cases/1,bad_apply/1, @@ -44,7 +44,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl index 2b0cf1fe30..a83783bce7 100644 --- a/lib/cosEvent/test/event_channel_SUITE.erl +++ b/lib/cosEvent/test/event_channel_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -55,7 +55,7 @@ %%----------------------------------------------------------------- -export([all/1, event_objects_api/1, events_api/1, events_sync_api/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, app_test/1]). + init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Internal exports @@ -78,7 +78,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosEvent/test/event_test_PullC_impl.erl b/lib/cosEvent/test/event_test_PullC_impl.erl index 186d1cbd51..4b81572cad 100644 --- a/lib/cosEvent/test/event_test_PullC_impl.erl +++ b/lib/cosEvent/test/event_test_PullC_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosEvent/test/event_test_PullS_impl.erl b/lib/cosEvent/test/event_test_PullS_impl.erl index b7fa0c34f0..81685980fb 100644 --- a/lib/cosEvent/test/event_test_PullS_impl.erl +++ b/lib/cosEvent/test/event_test_PullS_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosEvent/test/event_test_PushC_impl.erl b/lib/cosEvent/test/event_test_PushC_impl.erl index 6eadf74a31..c2be1d4c08 100644 --- a/lib/cosEvent/test/event_test_PushC_impl.erl +++ b/lib/cosEvent/test/event_test_PushC_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosEvent/test/event_test_PushS_impl.erl b/lib/cosEvent/test/event_test_PushS_impl.erl index da82e97211..35cfc66e6b 100644 --- a/lib/cosEvent/test/event_test_PushS_impl.erl +++ b/lib/cosEvent/test/event_test_PushS_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index 2d75b18451..2880b922ed 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -105,7 +105,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl index ddf0af3489..06c194b44e 100644 --- a/lib/cosEventDomain/test/event_domain_SUITE.erl +++ b/lib/cosEventDomain/test/event_domain_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -58,7 +58,7 @@ %%----------------------------------------------------------------- -export([all/1, event_domain_api/1, event_domain_factory_api/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, app_test/1]). + init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Internal exports @@ -81,7 +81,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index 6c6996ca79..c74779d47c 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -103,7 +103,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl index 9ddfb3d902..ded1261a1c 100644 --- a/lib/cosNotification/test/eventDB_SUITE.erl +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -262,7 +262,7 @@ -export([all/1, cases/0, init_all/1, finish_all/1, reorder_api/1, lookup_api/1, discard_api/1, max_events_api/1, gc_api/1, auto_gc_api/1, start_stop_time_api/1, mapping_filter_api/1, persisten_event_api/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). %%----------------------------------------------------------------- %% Func: all/1 @@ -290,7 +290,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index 34b84041f0..dc5cfe0da6 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -138,7 +138,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl index 30aec89e5f..43ee80ee22 100644 --- a/lib/cosNotification/test/grammar_SUITE.erl +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -67,7 +67,7 @@ -export([all/1, cases/0, init_all/1, finish_all/1, union_api/1, enum_api/1, simple_types_api/1, components_api/1, positional_api/1, variable_api/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -import(cosNotification_Filter, [create_filter/1, eval/2]). @@ -96,7 +96,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl index e2c560e4de..9542f1283b 100644 --- a/lib/cosNotification/test/notification_SUITE.erl +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -126,7 +126,7 @@ -export([all/1, cases/0, init_all/1, finish_all/1, qos_api/1, adm_api/1, cosevent_api/1, filter_adm_api/1, events_api/1, events2_api/1, event_qos_api/1, filter_api/1, mapping_filter_api/1, subscription_api/1, - init_per_testcase/2, fin_per_testcase/2, persistent_max_events_api/1, + init_per_testcase/2, end_per_testcase/2, persistent_max_events_api/1, persistent_timeout_events_api/1, persistent_recover_events_api/1, app_test/1]). @@ -161,7 +161,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/cosNotification/test/notify_test_impl.erl b/lib/cosNotification/test/notify_test_impl.erl index 483610befd..dae7777089 100644 --- a/lib/cosNotification/test/notify_test_impl.erl +++ b/lib/cosNotification/test/notify_test_impl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 80a7953949..65508403b4 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -109,7 +109,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl index 8fed3128ef..999f37c62c 100644 --- a/lib/cosProperty/test/property_SUITE.erl +++ b/lib/cosProperty/test/property_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -87,7 +87,7 @@ %%----------------------------------------------------------------- %% Fixed exports -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). %% Test cases -export([create_setdef_api/1, create_set_api/1, define_with_mode_api/1, define_api/1, names_iterator_api/1, properties_iterator_api/1, @@ -120,7 +120,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index 3a2153528f..d8fcc7c890 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,7 +99,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index bb00395885..2459fffc22 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -68,7 +68,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, time_api/1, timerevent_api/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- @@ -97,7 +97,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/cosTransactions/test/etrap_test_lib.erl b/lib/cosTransactions/test/etrap_test_lib.erl index 913a94510f..18a1cda35b 100644 --- a/lib/cosTransactions/test/etrap_test_lib.erl +++ b/lib/cosTransactions/test/etrap_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index cc54eb168e..e3db56a991 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -108,7 +108,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl index 8385d5a0fb..da6ef86e82 100644 --- a/lib/cosTransactions/test/transactions_SUITE.erl +++ b/lib/cosTransactions/test/transactions_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,7 +37,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, resource_api/1, etrap_api/1, - init_per_testcase/2, fin_per_testcase/2, app_test/1]). + init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Func: all/1 @@ -67,7 +67,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> 'oe_etrap_test':'oe_unregister'(), 'oe_CosTransactions':'oe_unregister'(), Path = code:which(?MODULE), diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 19e10081d8..cc6db9a460 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -23,7 +23,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, info/1, link_test/1, md5/1, @@ -103,8 +103,8 @@ init_per_testcase(_Name,Config) -> ?line crypto:start(), Config. -fin_per_testcase(_Name,Config) -> - io:format("fin_per_testcase\n"), +end_per_testcase(_Name,Config) -> + io:format("end_per_testcase\n"), ?line crypto:stop(), Config. diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl index 3482a22a34..346ca42376 100644 --- a/lib/debugger/test/andor_SUITE.erl +++ b/lib/debugger/test/andor_SUITE.erl @@ -20,7 +20,7 @@ %% -module(andor_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1]). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index 8ca2b36f1c..0a574ecd5f 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -23,7 +23,7 @@ -module(bs_bincomp_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1]). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl index efc125c582..4416a675b8 100644 --- a/lib/debugger/test/bs_construct_SUITE.erl +++ b/lib/debugger/test/bs_construct_SUITE.erl @@ -19,7 +19,7 @@ -module(bs_construct_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, coerce_to_float/1]). @@ -37,7 +37,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl index 3966dc41ef..ab2ce88e12 100644 --- a/lib/debugger/test/bs_match_bin_SUITE.erl +++ b/lib/debugger/test/bs_match_bin_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_match_bin_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, byte_split_binary/1,bit_split_binary/1]). -include("test_server.hrl"). @@ -37,7 +37,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl index 1159ac9ef8..0cb9062575 100644 --- a/lib/debugger/test/bs_match_int_SUITE.erl +++ b/lib/debugger/test/bs_match_int_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_int_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1]). -include("test_server.hrl"). @@ -38,7 +38,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(4)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl index 5e1160a8e9..7414685f0c 100644 --- a/lib/debugger/test/bs_match_misc_SUITE.erl +++ b/lib/debugger/test/bs_match_misc_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_misc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1]). -include("test_server.hrl"). @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl index 7fa16b3c6a..9c8d753371 100644 --- a/lib/debugger/test/bs_match_tail_SUITE.erl +++ b/lib/debugger/test/bs_match_tail_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, aligned/1,unaligned/1,zero_tail/1]). -include("test_server.hrl"). @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index 3d69d2a101..a114bc2b46 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -22,7 +22,7 @@ -module(bs_utf_SUITE). -export([all/1,init_all/1,finish_all/1, - init_per_testcase/2,fin_per_testcase/2, + init_per_testcase/2,end_per_testcase/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1]). @@ -41,7 +41,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 629aac9fd6..00e75d6bb3 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -49,7 +49,7 @@ --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). @@ -57,7 +57,7 @@ init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(60*1000), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index 4bd9057f98..648c6808a9 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -24,7 +24,7 @@ -include("test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). @@ -34,7 +34,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> Dog=test_server:timetrap(?t:minutes(0.5)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index fd4d28b2c7..9c62e1713a 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -58,13 +58,13 @@ config(priv_dir,_) -> ".". -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl index a74a93fd22..1ba4945e33 100644 --- a/lib/debugger/test/exception_SUITE.erl +++ b/lib/debugger/test/exception_SUITE.erl @@ -20,7 +20,7 @@ %% -module(exception_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, badmatch/1,pending_errors/1,nil_arith/1]). -export([bad_guy/2]). @@ -42,7 +42,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl index b5269989c8..13a0e67041 100644 --- a/lib/debugger/test/guard_SUITE.erl +++ b/lib/debugger/test/guard_SUITE.erl @@ -20,7 +20,7 @@ %% -module(guard_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, bad_arith/1,bad_tuple/1,test_heap_guards/1,guard_bifs/1, type_tests/1,const_guard/1, const_cond/1,basic_not/1,complex_not/1, @@ -59,7 +59,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index b7b3c5598a..c70551de6e 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -24,7 +24,7 @@ -include("test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, basic/1,cleanup/1]). -export([auto_attach/1]). @@ -40,7 +40,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?t:minutes(0.5)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ?line ok = io:format("Interpreted modules: ~p", [int:interpreted()]), ?line Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index 1628ca69b1..390147147e 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -22,7 +22,7 @@ %% Purpose: Deeper test of the evaluator. --export([all/1,init_per_testcase/2, fin_per_testcase/2, +-export([all/1,init_per_testcase/2, end_per_testcase/2, bifs_outside_erlang/1, spawning/1, applying/1, catch_and_throw/1, external_call/1, test_module_info/1, apply_interpreted_fun/1, apply_uninterpreted_fun/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> erlang, exit, [self(), kill]), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ok = io:format("Interpreted modules: ~p", [int:interpreted()]), Dog = ?config(watchdog, Config), timer:cancel(Dog), diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl index a22a689ec8..daa53e41a3 100644 --- a/lib/debugger/test/lc_SUITE.erl +++ b/lib/debugger/test/lc_SUITE.erl @@ -21,7 +21,7 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, basic/1]). -include("test_server.hrl"). @@ -37,7 +37,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl index 06fd01555e..9021ad55d1 100644 --- a/lib/debugger/test/record_SUITE.erl +++ b/lib/debugger/test/record_SUITE.erl @@ -24,7 +24,7 @@ -include("test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, errors/1,record_test/1,eval_once/1]). all(suite) -> @@ -38,7 +38,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl index 5901cdc9e5..e039d0ff85 100644 --- a/lib/debugger/test/trycatch_SUITE.erl +++ b/lib/debugger/test/trycatch_SUITE.erl @@ -20,7 +20,7 @@ %% -module(trycatch_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,init_all/1,finish_all/1, +-export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1]). @@ -40,7 +40,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index a97c874e5f..c6a78a0065 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -23,7 +23,7 @@ -include("test_server.hrl"). -include("ei_accept_SUITE_data/ei_accept_test_cases.hrl"). --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/1, init_per_testcase/2, end_per_testcase/2, ei_accept/1, ei_threaded_accept/1]). -import(runner, [get_term/1,send_term/2]). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:seconds(30)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index 3c72188e16..fe9b270093 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -26,7 +26,7 @@ -export([ all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, ei_send/1, ei_reg_send/1, @@ -52,7 +52,7 @@ init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index c19c1d0887..8c8ec9bacb 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 6d44e0adf3..9ae4a715b0 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index a0f15338c6..61365fcd46 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index e7a2465421..e536fd2688 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -26,7 +26,7 @@ -define(dummy_host,test01). --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/1, init_per_testcase/2, end_per_testcase/2, framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). @@ -43,7 +43,7 @@ init_per_testcase(_Case, Config) -> end, [{vxsim,Bool},{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index 0d6539d98f..fd568e56b9 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -include("test_server.hrl"). -include("erl_connect_SUITE_data/erl_connect_test_cases.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]). -import(runner, [get_term/1,send_term/2]). @@ -35,7 +35,7 @@ init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index 634e2f9aa0..e77f114066 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index dbafea0e39..d1c27d8158 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index 81a0bca80f..c8809fdde9 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index f506638544..2c0cdc0c27 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 2c550e4c0c..55507b2a1b 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/erl_interface/test/runner.erl b/lib/erl_interface/test/runner.erl index b72723c6a5..e41440708a 100644 --- a/lib/erl_interface/test/runner.erl +++ b/lib/erl_interface/test/runner.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/et/test/et_test_lib.erl b/lib/et/test/et_test_lib.erl index b91b63786c..084e1de03b 100644 --- a/lib/et/test/et_test_lib.erl +++ b/lib/et/test/et_test_lib.erl @@ -295,7 +295,7 @@ eval_test_case(Mod, Fun, Config) -> test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). wait_for_evaluator(Pid, Mod, Fun, Config) -> @@ -311,12 +311,12 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log(" Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log(" Eval process ~w exited, because\n\t~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 05e5187d82..91b1cb72a2 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -19,7 +19,7 @@ -module(et_wx_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,7 +36,7 @@ init_per_testcase(Func,Config) -> et_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> et_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server +end_per_testcase(Func,Config) -> %% For test_server et_test_lib:end_per_testcase(Func,Config). %% SUITE specification diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index 4ebcec6f5d..406ff9d499 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 40c1395d10..9970ea0f6a 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ -module(c_client_erl_server_SUITE). -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2, +-export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, @@ -57,7 +57,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index 58309a2221..d44a599660 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ -module(c_client_erl_server_proto_SUITE). -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2, +-export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, @@ -56,7 +56,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index 595c5bf483..d3f7b08f6a 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ -module(c_client_erl_server_proto_tmo_SUITE). -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2, +-export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, @@ -56,7 +56,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index c5f5b6a218..03f628abd9 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ -module(erl_client_c_server_SUITE). -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2, all/1, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -57,7 +57,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index d75feb621a..5e1e84c6f9 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ -module(erl_client_c_server_proto_SUITE). -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2, all/1, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -57,7 +57,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index e3caf7bdff..5428fbc086 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl index d68242bf3a..8002d9644a 100644 --- a/lib/ic/test/ic_pp_SUITE.erl +++ b/lib/ic/test/ic_pp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index 0edb5d4717..ac5f2fd0c5 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index ae7578199a..0ddf8ff95c 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index ee77ef0c4e..67bc536e28 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ -include("test_server.hrl"). --export([all/1,init_all/1,finish_all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/1,init_all/1,finish_all/1,init_per_testcase/2,end_per_testcase/2]). -export([marshal_ll/1,marshal_ull/1, marshal_l/1,marshal_ul/1, marshal_s/1,marshal_us/1, @@ -98,7 +98,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(test_server:seconds(20)), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> DataDir = ?config(data_dir, Config), code:del_path(DataDir), WatchDog = ?config(watchdog, Config), diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl index e7404f945b..03af34ec3c 100644 --- a/lib/inets/test/ftp_SUITE.erl +++ b/lib/inets/test/ftp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 9ca6575b2d..0b5829c28c 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/inets/test/httpd_1_1.erl b/lib/inets/test/httpd_1_1.erl index 055d034bec..2a6110e3ea 100644 --- a/lib/inets/test/httpd_1_1.erl +++ b/lib/inets/test/httpd_1_1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/inets/test/httpd_load.erl b/lib/inets/test/httpd_load.erl index 9bb9f9f94e..83520033dc 100644 --- a/lib/inets/test/httpd_load.erl +++ b/lib/inets/test/httpd_load.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/inets/test/inets_app_test.erl b/lib/inets/test/inets_app_test.erl index 6bdb9bb308..11a669b930 100644 --- a/lib/inets/test/inets_app_test.erl +++ b/lib/inets/test/inets_app_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -39,7 +39,7 @@ init_per_testcase(undef_funcs, Config) -> init_per_testcase(_, Config) -> Config. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/inets/test/inets_appup_test.erl b/lib/inets/test/inets_appup_test.erl index 2c9c687c91..bb77823b85 100644 --- a/lib/inets/test/inets_appup_test.erl +++ b/lib/inets/test/inets_appup_test.erl @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> Config. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index 5768fff88b..7c75b809ae 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -64,8 +64,8 @@ default_config() -> init_per_testcase(Case, Config) -> tftp_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) when is_list(Config) -> - tftp_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) when is_list(Config) -> + tftp_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case diff --git a/lib/inets/test/tftp_test_lib.erl b/lib/inets/test/tftp_test_lib.erl index 3729309b0e..e9b691828f 100644 --- a/lib/inets/test/tftp_test_lib.erl +++ b/lib/inets/test/tftp_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -32,7 +32,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> ?IGNORE(application:stop(inets)), Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> ?IGNORE(application:stop(inets)), Config. @@ -143,7 +143,7 @@ eval(Mod, Fun, Config) -> Config2 = Mod:init_per_testcase(Fun, Config), Pid = spawn_link(?MODULE, do_eval, [self(), Mod, Fun, Config2]), R = wait_for_evaluator(Pid, Mod, Fun, Config2, []), - Mod:fin_per_testcase(Fun, Config2), + Mod:end_per_testcase(Fun, Config2), global:unregister_name(tftp_test_case_sup), process_flag(trap_exit, Flag), R. diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl index 206e117c86..29d1c8f539 100644 --- a/lib/inviso/test/inviso_tool_SUITE.erl +++ b/lib/inviso/test/inviso_tool_SUITE.erl @@ -1,19 +1,21 @@ -% ``The contents of this file are subject to the Erlang Public License, +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be -%% retrieved via the world wide web at http://www.erlang.org/. -%% +%% retrieved online at http://www.erlang.org/. +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% -%% The Initial Developer of the Original Code is Ericsson Utvecklings AB. -%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings -%% AB. All Rights Reserved.'' -%% -%% $Id$ +%% +%% %CopyrightEnd% +%% %% %% Description: %% Test suite for the inviso_tool. It is here assumed that inviso works @@ -89,7 +91,7 @@ init_per_testcase(_Case,Config) -> insert_timetraphandle_config(TH,NewConfig2). %% ----------------------------------------------------------------------------- -fin_per_testcase(_Case,Config) -> +end_per_testcase(_Case,Config) -> ?l test_server:stop_node(get_remotenode_config(inviso1,Config)), ?l test_server:stop_node(get_remotenode_config(inviso2,Config)), ?l test_server:timetrap_cancel(get_timetraphandle_config(Config)), diff --git a/lib/kernel/test/appinc1.erl b/lib/kernel/test/appinc1.erl index 8456b0eac2..343fefb25c 100644 --- a/lib/kernel/test/appinc1.erl +++ b/lib/kernel/test/appinc1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/appinc1x.erl b/lib/kernel/test/appinc1x.erl index 2e177727f2..8c144676ac 100644 --- a/lib/kernel/test/appinc1x.erl +++ b/lib/kernel/test/appinc1x.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/appinc2.erl b/lib/kernel/test/appinc2.erl index e41d58bb71..d2e0305109 100644 --- a/lib/kernel/test/appinc2.erl +++ b/lib/kernel/test/appinc2.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/appinc2A.erl b/lib/kernel/test/appinc2A.erl index b51a1f5035..604e31e3d3 100644 --- a/lib/kernel/test/appinc2A.erl +++ b/lib/kernel/test/appinc2A.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/appinc2B.erl b/lib/kernel/test/appinc2B.erl index cafb061ae3..abb60010aa 100644 --- a/lib/kernel/test/appinc2B.erl +++ b/lib/kernel/test/appinc2B.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/appinc2top.erl b/lib/kernel/test/appinc2top.erl index 5bd19a59e7..5a8d0d6687 100644 --- a/lib/kernel/test/appinc2top.erl +++ b/lib/kernel/test/appinc2top.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index 313b50f976..810689b4a3 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,7 +36,7 @@ -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). --export([init_per_testcase/2, fin_per_testcase/2, start_type/0, +-export([init_per_testcase/2, end_per_testcase/2, start_type/0, start_phase/0, conf_change/0]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). @@ -57,12 +57,12 @@ init_per_testcase(Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), [{?TESTCASE, Case}, {watchdog, Dog}|Config]. -fin_per_testcase(otp_2973, Config) -> +end_per_testcase(otp_2973, Config) -> code:del_path(?config(data_dir,Config)), Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok; -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index ae2a3a08ff..47532b0db4 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -33,7 +33,7 @@ run_fun/1, wilderness/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -43,7 +43,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/ch.erl b/lib/kernel/test/ch.erl index 25d1b4354c..25d6f6d200 100644 --- a/lib/kernel/test/ch.erl +++ b/lib/kernel/test/ch.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/ch_sup.erl b/lib/kernel/test/ch_sup.erl index 9d03628839..4c923b2909 100644 --- a/lib/kernel/test/ch_sup.erl +++ b/lib/kernel/test/ch_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index e52f8a0e37..a5fcaf188d 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -34,7 +34,7 @@ big_boot_embedded/1, on_load_embedded/1, on_load_errors/1, native_early_modules/1]). --export([init_per_testcase/2, fin_per_testcase/2, +-export([init_per_testcase/2, end_per_testcase/2, init_per_suite/1, end_per_suite/1, sticky_compiler/1]). @@ -76,7 +76,7 @@ init_per_testcase(_Func, Config) -> P=code:get_path(), P=code:get_path(), [{watchdog, Dog}, {code_path, P}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), P=?config(code_path, Config), diff --git a/lib/kernel/test/code_a_test.erl b/lib/kernel/test/code_a_test.erl index 745bbf032c..22830fff53 100644 --- a/lib/kernel/test/code_a_test.erl +++ b/lib/kernel/test/code_a_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/code_b_test.erl b/lib/kernel/test/code_b_test.erl index 0f0107a2b4..a8ff570e2e 100644 --- a/lib/kernel/test/code_b_test.erl +++ b/lib/kernel/test/code_b_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index 1bfe76f5ea..f3fa2921ed 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -94,7 +94,7 @@ -export([head_fun/1, hf/0, lserv/1, measure/0, init_m/1, xx/0, head_exit/0, slow_header/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([try_unblock/1]). @@ -167,7 +167,7 @@ init_per_testcase(Case, Config) -> [{watchdog, Dog}|Config] end. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index 241d68fef4..a4319eb3c1 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index a215ec3608..047bedfa74 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -41,7 +41,7 @@ tick_serv_test/2, tick_serv_test1/1, keep_conn/1, time_ping/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([start_node/2]). @@ -66,7 +66,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(4)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 627fed1fdd..83f9d09a4b 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,7 +23,7 @@ -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2, whitebox/1, +-export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). %% 1) @@ -84,7 +84,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index 19c84ab34c..39007bf085 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -29,7 +29,7 @@ local_archive/1, remote_archive/1, primary_archive/1, virtual_dir_in_archive/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %%----------------------------------------------------------------- %% Test suite for erl_prim_loader. (Most code is run during system start/stop.) @@ -49,7 +49,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 6629eca1ad..626e35dbb2 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ %% -module(error_logger_warn_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -51,7 +51,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 47592ddb14..596fe301b5 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -42,7 +42,7 @@ -export([all/1, init/1, fini/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, read_write_file/1, dirs/1, files/1, names/1]). -export([cur_dir_0/1, cur_dir_1/1, make_del_dir/1, pos/1, pos1/1, pos2/1]). @@ -139,7 +139,7 @@ init_per_testcase(_Func, Config) -> %%error_logger:info_msg("~p:~p *****~n", [?MODULE, _Func]), ?FILE_INIT_PER_TESTCASE(Config). -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> %% error_logger:info_msg("~p:~p END *****~n", [?MODULE, _Func]), ?FILE_FIN_PER_TESTCASE(Config). diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 9aa94a0868..39db6ab81c 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -23,7 +23,7 @@ %%-compile(export_all). --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/1,init_per_testcase/2,end_per_testcase/2]). -export( [basic/1, api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1, @@ -37,7 +37,7 @@ all(suite) -> init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(15)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 94637290a1..b8d1b1722c 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -25,7 +25,7 @@ -include("test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/1, init_per_testcase/2, end_per_testcase/2, t_accept/1, t_connect_timeout/1, t_accept_timeout/1, t_connect/1, t_connect_bad/1, t_recv/1, t_recv_timeout/1, t_recv_eof/1, @@ -39,7 +39,7 @@ all(suite) -> [t_accept, t_connect, t_recv, t_shutdown_write, init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index a2e09877af..f45038b7c4 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ %%-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/1, init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -40,7 +40,7 @@ all(suite) -> init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:minutes(5)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index d73c5fab56..8c2c4b9035 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -25,7 +25,7 @@ -export([all/1, controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, otp_3924/1, otp_3924_sender/4, closed_socket/1, shutdown_active/1, shutdown_passive/1, shutdown_pending/1, default_options/1, http_bad_packet/1, @@ -46,7 +46,7 @@ init_per_testcase(_Func, Config) when is_list(Config) -> Dog = test_server:timetrap(test_server:seconds(240)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 2ff1d7210a..1bd930b8f5 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -30,7 +30,7 @@ -define(CLOSED_PORT, 6666). -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, buffer_size/1, binary_passive_recv/1, bad_address/1, @@ -45,7 +45,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 7a84ad5e75..001debddcf 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -102,7 +102,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ok = gen_server:call(global_name_server, high_level_trace_start,infinity), [{?TESTCASE, Case}, {registered, registered()} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ?line write_high_level_trace(Config), ?line _ = gen_server:call(global_name_server, high_level_trace_stop, infinity), diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index 430cc61267..301f1246c2 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -24,7 +24,7 @@ one_grp/1, one_grp_x/1, two_grp/1, hidden_groups/1, test_exit/1]). -export([init/1, init/2, init2/2, start_proc/1, start_proc_rereg/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %-compile(export_all). @@ -46,7 +46,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog=?t:timetrap(?t:minutes(5)), [{?TESTCASE, Case}, {watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index 0d0296238b..b739f555d0 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -23,7 +23,7 @@ -export([all/1, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, dont_drop/1, kill_pid/1, fini/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([start_heart_stress/1, mangle/1, suicide_by_heart/0]). @@ -33,7 +33,7 @@ init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(test_server:seconds(?DEFAULT_TIMEOUT_SECS)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Nodes = nodes(), lists:foreach(fun(X) -> NNam = list_to_atom(hd(string:tokens(atom_to_list(X),"@"))), diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index 0fa0226ccf..da97accdbe 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index bbd8261197..af538b0b8b 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -27,7 +27,7 @@ reboot/1, stop/1, get_status/1, script_id/1, boot/1]). -export([boot1/1, boot2/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([init/1, fini/1]). @@ -48,7 +48,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index c0db292ba5..e880233588 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index bb1d905de3..76589ab915 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -28,7 +28,7 @@ % Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([app_test/1]). @@ -44,7 +44,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/myApp.erl b/lib/kernel/test/myApp.erl index 2b92046141..26dc74f91b 100644 --- a/lib/kernel/test/myApp.erl +++ b/lib/kernel/test/myApp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 87ee951a0c..09d14208c9 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -31,13 +31,13 @@ -export([all/1, simple/1, complicated/1, heavy/1, info/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(test_server:minutes(10)), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index df28dcf447..08a6b844f6 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -24,7 +24,7 @@ -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([tickets/1, otp_7277/1, otp_8259/1, otp_8653/1, @@ -44,7 +44,7 @@ init_per_testcase(Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{?TESTCASE, Case}, {watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index 798a37d3dc..fadf695c53 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -21,7 +21,7 @@ -export([all/1, %% init/1, fini/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, truncate/1, sync/1, get_set_file/1, compress/1, uuencode/1, large_file_errors/1, large_file_light/1, large_file_heavy/1]). @@ -51,7 +51,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> %% error_logger:info_msg("~p:~p *****~n", [?MODULE, Func]), [{watchdog, Dog} | Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> %% error_logger:info_msg("~p:~p END *****~n", [?MODULE, Func]), Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index b557c7fb1e..3b54216fa9 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,7 @@ %% -module(seq_trace_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/1,init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -43,7 +43,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/kernel/test/topApp.erl b/lib/kernel/test/topApp.erl index acf98e6da0..f44e99f738 100644 --- a/lib/kernel/test/topApp.erl +++ b/lib/kernel/test/topApp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/topApp2.erl b/lib/kernel/test/topApp2.erl index 4587910ff3..b791d4a914 100644 --- a/lib/kernel/test/topApp2.erl +++ b/lib/kernel/test/topApp2.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/topApp3.erl b/lib/kernel/test/topApp3.erl index 1bb6f2f31a..456ef5b2fb 100644 --- a/lib/kernel/test/topApp3.erl +++ b/lib/kernel/test/topApp3.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index ceac593e44..ea1ee77efb 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -43,7 +43,7 @@ external/1, error/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). all(suite) -> [no_file, one, two, four, wrap, wrapping, external, error]. @@ -52,7 +52,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(60)), [{watchdog, Dog} | Config]. -fin_per_testcase(_Func, _Config) -> +end_per_testcase(_Func, _Config) -> Dog=?config(watchdog, _Config), ?t:timetrap_cancel(Dog). diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index f20c9a176b..8ef3d0040f 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -48,7 +48,7 @@ init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 1bb3a570a4..2b5605cb13 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,8 +36,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). init() -> process_flag(trap_exit, true), diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl index d493022ca1..fe9fee86c7 100644 --- a/lib/megaco/test/megaco_actions_test.erl +++ b/lib/megaco/test/megaco_actions_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -72,9 +72,9 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl index 597ec26338..7aeca32540 100644 --- a/lib/megaco/test/megaco_app_test.erl +++ b/lib/megaco/test/megaco_app_test.erl @@ -39,8 +39,8 @@ init_per_testcase(undef_funcs = Case, Config) -> init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_appup_mg.erl b/lib/megaco/test/megaco_appup_mg.erl index f6060e406b..bb8b098f5d 100644 --- a/lib/megaco/test/megaco_appup_mg.erl +++ b/lib/megaco/test/megaco_appup_mg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_appup_mgc.erl b/lib/megaco/test/megaco_appup_mgc.erl index b6e53655f8..49c5f24852 100644 --- a/lib/megaco/test/megaco_appup_mgc.erl +++ b/lib/megaco/test/megaco_appup_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl index 09732c6a4d..2466a7b0cd 100644 --- a/lib/megaco/test/megaco_appup_test.erl +++ b/lib/megaco/test/megaco_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -37,8 +37,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_binary_term_id_test.erl b/lib/megaco/test/megaco_binary_term_id_test.erl index da4e69c617..0c2a8f8af4 100644 --- a/lib/megaco/test/megaco_binary_term_id_test.erl +++ b/lib/megaco/test/megaco_binary_term_id_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,7 @@ %% Test suite exports -export([all/1, encode_first/1, decode_first/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). %%---------------------------------------------------------------------- @@ -74,8 +74,8 @@ decode_first(suite) -> init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl index a25a7924e8..5db4cc2c8a 100644 --- a/lib/megaco/test/megaco_call_flow_test.erl +++ b/lib/megaco/test/megaco_call_flow_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,8 +50,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case diff --git a/lib/megaco/test/megaco_codec_flex_lib.erl b/lib/megaco/test/megaco_codec_flex_lib.erl index de76956711..93bc5d4bbc 100644 --- a/lib/megaco/test/megaco_codec_flex_lib.erl +++ b/lib/megaco/test/megaco_codec_flex_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl index cb4cf09536..7e73d9f85f 100644 --- a/lib/megaco/test/megaco_codec_mini_test.erl +++ b/lib/megaco/test/megaco_codec_mini_test.erl @@ -41,7 +41,7 @@ otp7672_msg01/1, otp7672_msg02/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). %% ---- @@ -81,9 +81,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -118,7 +118,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index f3a68b045b..298ea90b37 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -208,7 +208,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0]). @@ -283,9 +283,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -564,7 +564,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index 5b47300891..526f5b75de 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -217,7 +217,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -299,9 +299,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -588,7 +588,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index db2d1404a7..b5c071322b 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -218,7 +218,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -303,9 +303,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -595,7 +595,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_test.erl b/lib/megaco/test/megaco_codec_test.erl index d247959cc5..6959ccad92 100644 --- a/lib/megaco/test/megaco_codec_test.erl +++ b/lib/megaco/test/megaco_codec_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,8 +36,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). init() -> process_flag(trap_exit, true), diff --git a/lib/megaco/test/megaco_codec_test_lib.erl b/lib/megaco/test/megaco_codec_test_lib.erl index 66e8a52a24..0a903f5617 100644 --- a/lib/megaco/test/megaco_codec_test_lib.erl +++ b/lib/megaco/test/megaco_codec_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index e070dd65e0..5918103417 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -205,7 +205,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -469,9 +469,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -747,7 +747,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index 8b218a5250..ceb7e4d879 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -225,7 +225,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -450,9 +450,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -747,7 +747,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index 16dd0c7f5d..d4d95d6b47 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -219,7 +219,7 @@ flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -export([display_text_messages/0, generate_text_messages/0]). @@ -303,9 +303,9 @@ init_per_testcase(Case, Config) -> end, megaco_test_lib:init_per_testcase(Case, C). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> erase(verbosity), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -595,7 +595,7 @@ tickets() -> Res -> Res end, - fin_per_testcase(Case, C), + end_per_testcase(Case, C), Result end, process_flag(trap_exit, Flag), diff --git a/lib/megaco/test/megaco_config_test.erl b/lib/megaco/test/megaco_config_test.erl index 9ab1a7d90d..180139629a 100644 --- a/lib/megaco/test/megaco_config_test.erl +++ b/lib/megaco/test/megaco_config_test.erl @@ -44,9 +44,9 @@ do_init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). -record(command, {id, desc, cmd, verify}). diff --git a/lib/megaco/test/megaco_digit_map_test.erl b/lib/megaco/test/megaco_digit_map_test.erl index 22e115278f..729b8c7ff6 100644 --- a/lib/megaco/test/megaco_digit_map_test.erl +++ b/lib/megaco/test/megaco_digit_map_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,8 +36,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_examples_test.erl b/lib/megaco/test/megaco_examples_test.erl index ef15cb1bde..3f5b28fb75 100644 --- a/lib/megaco/test/megaco_examples_test.erl +++ b/lib/megaco/test/megaco_examples_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -41,11 +41,11 @@ init_per_testcase(Case, Config) -> megaco:enable_trace(max, io), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> purge_examples(), erase(dbg), megaco:disable_trace(), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). example_modules() -> [megaco_simple_mg, megaco_simple_mgc]. diff --git a/lib/megaco/test/megaco_flex_test.erl b/lib/megaco/test/megaco_flex_test.erl index 3dbcf53e7a..e863a08b9b 100644 --- a/lib/megaco/test/megaco_flex_test.erl +++ b/lib/megaco/test/megaco_flex_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -32,7 +32,7 @@ -export([ t/0, t/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, flex_init/1, flex_fin/1, @@ -55,8 +55,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_load_test.erl b/lib/megaco/test/megaco_load_test.erl index 5a22b7b4ee..de94625945 100644 --- a/lib/megaco/test/megaco_load_test.erl +++ b/lib/megaco/test/megaco_load_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,9 +99,9 @@ do_init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mess_otp8212_test.erl b/lib/megaco/test/megaco_mess_otp8212_test.erl index 109886ebc4..e074e2f0b3 100644 --- a/lib/megaco/test/megaco_mess_otp8212_test.erl +++ b/lib/megaco/test/megaco_mess_otp8212_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl index 368800fa54..b70098fbaf 100644 --- a/lib/megaco/test/megaco_mess_test.erl +++ b/lib/megaco/test/megaco_mess_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -36,7 +36,7 @@ -export([ all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, connect/1, @@ -337,11 +337,11 @@ init_per_testcase(Case, Config) -> C = lists:keydelete(tc_timeout, 1, Config), megaco_test_lib:init_per_testcase(Case, [{tc_timeout, min(1)} |C]). -% fin_per_testcase(pending_ack = Case, Config) -> +% end_per_testcase(pending_ack = Case, Config) -> % erase(dbg), -% megaco_test_lib:fin_per_testcase(Case, Config); -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +% megaco_test_lib:end_per_testcase(Case, Config); +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mess_user_test.erl b/lib/megaco/test/megaco_mess_user_test.erl index 50284be549..ce682c167b 100644 --- a/lib/megaco/test/megaco_mess_user_test.erl +++ b/lib/megaco/test/megaco_mess_user_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl index 2da6aa3bf3..f2e4253c0d 100644 --- a/lib/megaco/test/megaco_mib_test.erl +++ b/lib/megaco/test/megaco_mib_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -63,9 +63,9 @@ init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config) end. -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mreq_test.erl b/lib/megaco/test/megaco_mreq_test.erl index 676acd8a12..7b9de32c1b 100644 --- a/lib/megaco/test/megaco_mreq_test.erl +++ b/lib/megaco/test/megaco_mreq_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -69,9 +69,9 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_pending_limit_test.erl b/lib/megaco/test/megaco_pending_limit_test.erl index 1ca29c195c..7c6c8354e8 100644 --- a/lib/megaco/test/megaco_pending_limit_test.erl +++ b/lib/megaco/test/megaco_pending_limit_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ -module(megaco_pending_limit_test). -export([t/0, t/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([all/1, sent/1, @@ -139,9 +139,9 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_profile.erl b/lib/megaco/test/megaco_profile.erl index 01fa0b5a14..d0b62610e1 100644 --- a/lib/megaco/test/megaco_profile.erl +++ b/lib/megaco/test/megaco_profile.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_sdp_test.erl b/lib/megaco/test/megaco_sdp_test.erl index e9bd550518..f782d58db5 100644 --- a/lib/megaco/test/megaco_sdp_test.erl +++ b/lib/megaco/test/megaco_sdp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,7 +30,7 @@ tickets/1, otp8123/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, t/0, t/1]). @@ -46,8 +46,8 @@ t(Case) -> megaco_test_lib:t({?MODULE, Case}). init_per_testcase(Case, Config) -> megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_segment_test.erl b/lib/megaco/test/megaco_segment_test.erl index ef07ee54b1..27f0acae9e 100644 --- a/lib/megaco/test/megaco_segment_test.erl +++ b/lib/megaco/test/megaco_segment_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,7 +24,7 @@ -module(megaco_segment_test). -export([t/0, t/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([all/1, send/1, @@ -66,9 +66,9 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_tc_controller.erl b/lib/megaco/test/megaco_tc_controller.erl index dedf45e321..458bff55e8 100644 --- a/lib/megaco/test/megaco_tc_controller.erl +++ b/lib/megaco/test/megaco_tc_controller.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_tcp_test.erl b/lib/megaco/test/megaco_tcp_test.erl index 31c88489fe..2348ebb882 100644 --- a/lib/megaco/test/megaco_tcp_test.erl +++ b/lib/megaco/test/megaco_tcp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -54,7 +54,7 @@ connection_supervisor/1, tcp_server/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, t/0, t/1 ]). @@ -111,11 +111,11 @@ init_per_testcase(Case, Config) -> %%---------------------------------------------------------------------- -%% Function: fin_per_testcase/2 +%% Function: end_per_testcase/2 %% Description: %%---------------------------------------------------------------------- -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== diff --git a/lib/megaco/test/megaco_test_deliver.erl b/lib/megaco/test/megaco_test_deliver.erl index 2d0f0c1cbe..ece0a48015 100644 --- a/lib/megaco/test/megaco_test_deliver.erl +++ b/lib/megaco/test/megaco_test_deliver.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_generator.erl b/lib/megaco/test/megaco_test_generator.erl index 8bbc60e6cd..a021d2451b 100644 --- a/lib/megaco/test/megaco_test_generator.erl +++ b/lib/megaco/test/megaco_test_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_generator_lib.erl b/lib/megaco/test/megaco_test_generator_lib.erl index cf0dcaf722..1584605913 100644 --- a/lib/megaco/test/megaco_test_generator_lib.erl +++ b/lib/megaco/test/megaco_test_generator_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_generic_transport.erl b/lib/megaco/test/megaco_test_generic_transport.erl index 10afa45baa..7a3dbc5317 100644 --- a/lib/megaco/test/megaco_test_generic_transport.erl +++ b/lib/megaco/test/megaco_test_generic_transport.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl index 03c04831e8..0d2b4a3f4e 100644 --- a/lib/megaco/test/megaco_test_lib.erl +++ b/lib/megaco/test/megaco_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -333,7 +333,7 @@ eval(Mod, Fun, Config) -> Config2 = Mod:init_per_testcase(Fun, Config), Pid = spawn_link(?MODULE, do_eval, [self(), Mod, Fun, Config2]), R = wait_for_evaluator(Pid, Mod, Fun, Config2, []), - Mod:fin_per_testcase(Fun, Config2), + Mod:end_per_testcase(Fun, Config2), erase(megaco_test_server), global:unregister_name(megaco_test_case_sup), process_flag(trap_exit, Flag), @@ -677,11 +677,11 @@ init_per_testcase(_Case, Config) -> end, set_kill_timer(Config). -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Name = megaco_global_logger, case global:whereis_name(Name) of undefined -> - io:format("~w:fin_per_testcase -> already un-registered~n", + io:format("~w:end_per_testcase -> already un-registered~n", [?MODULE]), ok; Pid when is_pid(Pid) -> diff --git a/lib/megaco/test/megaco_test_megaco_generator.erl b/lib/megaco/test/megaco_test_megaco_generator.erl index 5ff7162223..21b33e4abc 100644 --- a/lib/megaco/test/megaco_test_megaco_generator.erl +++ b/lib/megaco/test/megaco_test_megaco_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_mg.erl b/lib/megaco/test/megaco_test_mg.erl index 22b65a1ac6..ecb3cedc83 100644 --- a/lib/megaco/test/megaco_test_mg.erl +++ b/lib/megaco/test/megaco_test_mg.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_mgc.erl b/lib/megaco/test/megaco_test_mgc.erl index 05c482f1af..13c1cebe56 100644 --- a/lib/megaco/test/megaco_test_mgc.erl +++ b/lib/megaco/test/megaco_test_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl index 5ce2ec302b..2fb0752865 100644 --- a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl index be87dc9a41..6e042080b7 100644 --- a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl index 74a05060d0..c768105194 100644 --- a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_v1_lib.erl b/lib/megaco/test/megaco_test_msg_v1_lib.erl index 638215e8c1..424a66b7c9 100644 --- a/lib/megaco/test/megaco_test_msg_v1_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v1_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_v2_lib.erl b/lib/megaco/test/megaco_test_msg_v2_lib.erl index b680bc869a..b29920006d 100644 --- a/lib/megaco/test/megaco_test_msg_v2_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v2_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_msg_v3_lib.erl b/lib/megaco/test/megaco_test_msg_v3_lib.erl index 7b0d4f7d37..fee61542b7 100644 --- a/lib/megaco/test/megaco_test_msg_v3_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v3_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_test_tcp_generator.erl b/lib/megaco/test/megaco_test_tcp_generator.erl index e4f27f32f5..416d56d742 100644 --- a/lib/megaco/test/megaco_test_tcp_generator.erl +++ b/lib/megaco/test/megaco_test_tcp_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl index 8bcfc5a907..d4dcdf77e6 100644 --- a/lib/megaco/test/megaco_timer_test.erl +++ b/lib/megaco/test/megaco_timer_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ -export([ t/0, t/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, @@ -71,18 +71,18 @@ do_init_per_testcase(Case, Config) -> {ok, _Pid} = megaco_monitor:start_link(), megaco_test_lib:init_per_testcase(Case, [{monitor_running, true}|Config]). -fin_per_testcase(Case, Config) -> - io:format("fin_per_testcase -> entry with" +end_per_testcase(Case, Config) -> + io:format("end_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p" "~n", [Case, Config]), process_flag(trap_exit, false), case lists:keydelete(monitor_running, 1, Config) of Config -> - megaco_test_lib:fin_per_testcase(Case, Config); + megaco_test_lib:end_per_testcase(Case, Config); Config2 -> megaco_monitor:stop(), - megaco_test_lib:fin_per_testcase(Case, Config2) + megaco_test_lib:end_per_testcase(Case, Config2) end. diff --git a/lib/megaco/test/megaco_trans_test.erl b/lib/megaco/test/megaco_trans_test.erl index 44d4b3fff7..c31bcb31af 100644 --- a/lib/megaco/test/megaco_trans_test.erl +++ b/lib/megaco/test/megaco_trans_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -95,9 +95,9 @@ init_per_testcase(Case, Config) -> process_flag(trap_exit, true), megaco_test_lib:init_per_testcase(Case, Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - megaco_test_lib:fin_per_testcase(Case, Config). + megaco_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_udp_test.erl b/lib/megaco/test/megaco_udp_test.erl index 2e2f5465dd..19eab49931 100644 --- a/lib/megaco/test/megaco_udp_test.erl +++ b/lib/megaco/test/megaco_udp_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -48,7 +48,7 @@ errors/1, socket_failure/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, t/0, t/1 ]). @@ -104,11 +104,11 @@ init_per_testcase(Case, Config) -> %%---------------------------------------------------------------------- -%% Function: fin_per_testcase/2 +%% Function: end_per_testcase/2 %% Description: %%---------------------------------------------------------------------- -fin_per_testcase(Case, Config) -> - megaco_test_lib:fin_per_testcase(Case, Config). +end_per_testcase(Case, Config) -> + megaco_test_lib:end_per_testcase(Case, Config). %%====================================================================== diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index b28deaf330..9c5314bca5 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl index 645c203a91..ff34029c9b 100644 --- a/lib/mnesia/test/mnesia_atomicity_test.erl +++ b/lib/mnesia/test/mnesia_atomicity_test.erl @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_config_backup.erl b/lib/mnesia/test/mnesia_config_backup.erl index a33ec6ac5c..0916e255e2 100644 --- a/lib/mnesia/test/mnesia_config_backup.erl +++ b/lib/mnesia/test/mnesia_config_backup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/mnesia/test/mnesia_config_event.erl b/lib/mnesia/test/mnesia_config_event.erl index 6c1dea7ed5..832bf94eb9 100644 --- a/lib/mnesia/test/mnesia_config_event.erl +++ b/lib/mnesia/test/mnesia_config_event.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 7b62c63a62..6e998329a4 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -62,7 +62,7 @@ dynamic_bad/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, c_nodes/0 ]). @@ -95,8 +95,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl index ffe8ab7ac3..e74a6ebd4a 100644 --- a/lib/mnesia/test/mnesia_consistency_test.erl +++ b/lib/mnesia/test/mnesia_consistency_test.erl @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_cost.erl b/lib/mnesia/test/mnesia_cost.erl index 54cb2b3064..3221f46f61 100644 --- a/lib/mnesia/test/mnesia_cost.erl +++ b/lib/mnesia/test/mnesia_cost.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 5f9f2a9733..7456f63fcb 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index b917b0ca40..f94482cf31 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -28,8 +28,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -record(test_rec,{key,val}). diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl index bbbebeb02c..a075974f53 100644 --- a/lib/mnesia/test/mnesia_evil_backup.erl +++ b/lib/mnesia/test/mnesia_evil_backup.erl @@ -35,8 +35,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 4fbf1b4003..28537fc68a 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -30,8 +30,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index d1b1409c9d..96994b9f22 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(init(N, Config), mnesia_test_lib:prepare_test_case([{init_test_case, [mnesia]}, diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl index 4add340254..0008b69ad0 100644 --- a/lib/mnesia/test/mnesia_frag_test.erl +++ b/lib/mnesia/test/mnesia_frag_test.erl @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(match_dist(ExpectedRes, Expr), case ?match(ExpectedRes, Expr) of diff --git a/lib/mnesia/test/mnesia_inconsistent_database_test.erl b/lib/mnesia/test/mnesia_inconsistent_database_test.erl index b19cd8e01b..c4b6257d5b 100644 --- a/lib/mnesia/test/mnesia_inconsistent_database_test.erl +++ b/lib/mnesia/test/mnesia_inconsistent_database_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index 0c868a7449..c9ba2dca23 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index 4fc6e8fe58..2a638190c6 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index fbf804dbec..2bd8420aba 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,8 +27,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(init(N, Config), mnesia_test_lib:prepare_test_case([{init_test_case, [mnesia]}, diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl index aa9339f6b9..0d81a4546f 100644 --- a/lib/mnesia/test/mnesia_nice_coverage_test.erl +++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl @@ -28,8 +28,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl index 1e4f776c7d..4d164cf1e6 100644 --- a/lib/mnesia/test/mnesia_qlc_test.erl +++ b/lib/mnesia/test/mnesia_qlc_test.erl @@ -31,8 +31,8 @@ init_per_testcase(Func, Conf) -> setup(Conf), mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). all(doc) -> ["Test that the qlc mnesia interface works as expected."]; diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index f6ecf2ce2e..7b16d0d7dc 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -28,8 +28,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(receive_messages(Msgs), receive_messages(Msgs, ?FILE, ?LINE)). diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl index 2305ef93b7..7d97b66aab 100644 --- a/lib/mnesia/test/mnesia_registry_test.erl +++ b/lib/mnesia/test/mnesia_registry_test.erl @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(doc) -> diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl index 387238ae6b..d20c94af40 100644 --- a/lib/mnesia/test/mnesia_schema_recovery_test.erl +++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(receive_messages(Msgs), receive_messages(Msgs, ?FILE, ?LINE)). diff --git a/lib/mnesia/test/mnesia_test_lib.erl b/lib/mnesia/test/mnesia_test_lib.erl index 1e98f017f7..182c240084 100644 --- a/lib/mnesia/test/mnesia_test_lib.erl +++ b/lib/mnesia/test/mnesia_test_lib.erl @@ -130,7 +130,7 @@ doc/1, struct/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, kill_tc/2 ]). @@ -144,7 +144,7 @@ init_per_testcase(_Func, Config) -> global:register_name(mnesia_global_logger, group_leader()), Config. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> global:unregister_name(mnesia_global_logger), %% Nodes = select_nodes(all, Config, ?FILE, ?LINE), %% rpc:multicall(Nodes, mnesia, lkill, []), @@ -492,19 +492,19 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log(" Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log("<>ERROR<> Eval process ~w exited, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). activity_evaluator(Coordinator) -> diff --git a/lib/mnesia/test/mnesia_tpcb.erl b/lib/mnesia/test/mnesia_tpcb.erl index 903c53a21c..595412ff24 100644 --- a/lib/mnesia/test/mnesia_tpcb.erl +++ b/lib/mnesia/test/mnesia_tpcb.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index c67382e694..a1dea72926 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,8 +26,8 @@ init_per_testcase(Func, Conf) -> mnesia_test_lib:init_per_testcase(Func, Conf). -fin_per_testcase(Func, Conf) -> - mnesia_test_lib:fin_per_testcase(Func, Conf). +end_per_testcase(Func, Conf) -> + mnesia_test_lib:end_per_testcase(Func, Conf). -define(receive_messages(Msgs), mnesia_recovery_test:receive_messages(Msgs, ?FILE, ?LINE)). diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index 54f4a78e69..883ba02b91 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -21,7 +21,7 @@ %% Test functions -export([all/1,text/1,text_tracing_off/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -30,7 +30,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 6da5e36b29..4192e21568 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -25,7 +25,7 @@ wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([foo/0]). -include("test_server.hrl"). @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> ttb:stop(), ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl index d5d030538f..cfc6f86b54 100644 --- a/lib/orber/test/cdrcoding_10_SUITE.erl +++ b/lib/orber/test/cdrcoding_10_SUITE.erl @@ -69,7 +69,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl index d62fe6eb3a..bd9dff61ba 100644 --- a/lib/orber/test/cdrcoding_11_SUITE.erl +++ b/lib/orber/test/cdrcoding_11_SUITE.erl @@ -69,7 +69,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl index 18e8eaa08a..d859abca52 100644 --- a/lib/orber/test/cdrcoding_12_SUITE.erl +++ b/lib/orber/test/cdrcoding_12_SUITE.erl @@ -70,7 +70,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index fa2d7f2a30..1b20c1206b 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -59,7 +59,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl index dae8fcbefc..0fcb609804 100644 --- a/lib/orber/test/corba_SUITE.erl +++ b/lib/orber/test/corba_SUITE.erl @@ -90,7 +90,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 8103fd81ac..2f1528f703 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -273,7 +273,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, % code_CertificateChain_api/1, % code_AttributeCertChain_api/1, % code_VerifyingCertChain_api/1, @@ -370,7 +370,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> oe_orber_test_server:oe_unregister(), orber:jump_stop(), Path = code:which(?MODULE), diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 1feb0b3b58..516d103dc9 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -75,7 +75,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Dog = ?config(watchdog, Config), diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 1cd1674fc4..0f85d6bd9f 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -103,7 +103,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/iiop_module_do_test_impl.erl b/lib/orber/test/iiop_module_do_test_impl.erl index bf171a3097..54fcd8239a 100644 --- a/lib/orber/test/iiop_module_do_test_impl.erl +++ b/lib/orber/test/iiop_module_do_test_impl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/orber/test/iiop_module_test_impl.erl b/lib/orber/test/iiop_module_test_impl.erl index fe334e1b26..2096c14a23 100644 --- a/lib/orber/test/iiop_module_test_impl.erl +++ b/lib/orber/test/iiop_module_test_impl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/orber/test/iiop_test_impl.erl b/lib/orber/test/iiop_test_impl.erl index fd92109c09..234f7c5f73 100644 --- a/lib/orber/test/iiop_test_impl.erl +++ b/lib/orber/test/iiop_test_impl.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 27e23a9433..4dcca983dc 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -96,7 +96,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> oe_orber_test_server:oe_unregister(), orber:jump_stop(), Path = code:which(?MODULE), diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index 1000c7f113..0ac0e08792 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -59,7 +59,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index 35d01789ee..0867223b36 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -59,7 +59,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index 42db130e54..c2a95faad7 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -60,7 +60,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index d1f0e7cf0e..878d38d446 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -60,7 +60,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index d1931f5393..1c4d648e05 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -51,7 +51,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, basic_PI_api/1, multi_orber_api/1, - init_per_testcase/2, fin_per_testcase/2, multi_pseudo_orber_api/1, + init_per_testcase/2, end_per_testcase/2, multi_pseudo_orber_api/1, light_orber_api/1, light_orber2_api/1, ssl_1_multi_orber_api/1, ssl_2_multi_orber_api/1, ssl_reconfigure_api/1, iiop_timeout_api/1, iiop_timeout_added_api/1, setup_connection_timeout_api/1, @@ -163,7 +163,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> oe_orber_test_server:oe_unregister(), orber:jump_stop(), Path = code:which(?MODULE), diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl index 4406e01d5a..ec4483a5e8 100644 --- a/lib/orber/test/naming_context_SUITE.erl +++ b/lib/orber/test/naming_context_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -43,7 +43,7 @@ -export([name_context/1, check_list/1, name_context_ext/1]). --export([init_all/1, finish_all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([init_all/1, finish_all/1, init_per_testcase/2, end_per_testcase/2]). %%----------------------------------------------------------------- @@ -95,7 +95,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), orber:jump_stop(), diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index f54da02c0e..546cab84e4 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,7 +26,7 @@ % Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([app_test/1, undefined_functions/1, install_load_order/1, @@ -45,7 +45,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl index 2c2a768af2..1ea44ff2e4 100644 --- a/lib/orber/test/orber_acl_SUITE.erl +++ b/lib/orber/test/orber_acl_SUITE.erl @@ -84,7 +84,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl index 3ac0cb7921..24c8d202bb 100644 --- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,7 +50,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, allow_host_api/1, allow_peerhost_api/1, check_address_api/1]). @@ -78,7 +78,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl index 193fc72f7c..809757c988 100644 --- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,7 +50,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, local_interface_api/1]). @@ -79,7 +79,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl index 83f48cba0c..3ad203d8e4 100644 --- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl @@ -50,7 +50,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, allow_host_api/1, allow_peerhost_api/1, check_address_api/1]). @@ -82,7 +82,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> orber:jump_stop(), Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl index e1856b9a47..dcd3adad8f 100644 --- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -50,7 +50,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, local_interface_api/1]). @@ -82,7 +82,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> orber:jump_stop(), Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index 5b295dd1aa..e49b098c68 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -51,7 +51,7 @@ %% External exports %%----------------------------------------------------------------- -export([all/1, cases/0, init_all/1, finish_all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, nat_ip_address/1, nat_ip_address_multiple/1, nat_ip_address_local/1, nat_ip_address_local_local/1, nat_iiop_port/1, nat_iiop_port_local/1, @@ -104,7 +104,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> oe_orber_test_server:oe_unregister(), orber:jump_stop(), Path = code:which(?MODULE), diff --git a/lib/orber/test/orber_test_timeout_server_impl.erl b/lib/orber/test/orber_test_timeout_server_impl.erl index 138eb51d92..67ea897fdd 100644 --- a/lib/orber/test/orber_test_timeout_server_impl.erl +++ b/lib/orber/test/orber_test_timeout_server_impl.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index ffa7468853..fa50100cc2 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -95,7 +95,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> oe_orber_test_server:oe_unregister(), orber:jump_stop(), Path = code:which(?MODULE), diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index 807a663219..53eec26c02 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -163,7 +163,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index ce52271ff8..033c61e3c8 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -21,7 +21,7 @@ %% Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Test cases -export([app_file/1, config/1]). @@ -33,7 +33,7 @@ init_per_testcase(_Case, Config) -> Dog = test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 069f780b5e..5e210cc8eb 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([checks/1, file/1, compile/1, syntax/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index 8153be7e61..f691249e65 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -34,7 +34,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([app_test/1, checks/1, @@ -55,7 +55,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index 964ac68481..dbd058f289 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index a20f4e72c6..454adf66e3 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -580,7 +580,7 @@ init_per_testcase(_Func, Config) -> put(datadir, Datadir), Config. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> %% Nodes = select_nodes(all, Config, ?FILE, ?LINE), %% rpc:multicall(Nodes, mnesia, lkill, []), Config. diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index 656a5faa29..abdb1b8e44 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -58,7 +58,7 @@ init_per_testcase(Case, Config) -> end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> reltool_test_lib:end_per_testcase(Case, Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 0fb15239a2..7fa8df4caf 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -19,7 +19,7 @@ -module(reltool_server_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,7 +42,7 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server +end_per_testcase(Func,Config) -> %% For test_server reltool_test_lib:end_per_testcase(Func,Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl index 5390b0a75e..2d50eda2fb 100644 --- a/lib/reltool/test/reltool_test_lib.erl +++ b/lib/reltool/test/reltool_test_lib.erl @@ -295,7 +295,7 @@ eval_test_case(Mod, Fun, Config) -> test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). wait_for_evaluator(Pid, Mod, Fun, Config) -> @@ -311,12 +311,12 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log(" Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log(" Eval process ~w exited, because\n\t~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index 2a951d0e9e..b0f77f3aa3 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -19,7 +19,7 @@ -module(reltool_wx_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,7 +36,7 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server +end_per_testcase(Func,Config) -> %% For test_server reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification diff --git a/lib/reltool/test/rtt.erl b/lib/reltool/test/rtt.erl index 6755b8400f..437009e26a 100644 --- a/lib/reltool/test/rtt.erl +++ b/lib/reltool/test/rtt.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index ff96af5e86..b64a66891f 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -24,7 +24,7 @@ ip_port_busy/1, wrap_port/1, wrap_port_time/1, with_seq_trace/1, dead_suspend/1, local_trace/1, saved_patterns/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([tracee1/1, tracee2/1]). -export([dummy/0, exported/1]). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index 32483dbe73..83c3464427 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -24,7 +24,7 @@ -include("test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). %% Testcases -export([basic/1]). @@ -42,7 +42,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> {watchdog, ?t:timetrap(?DEFAULT_TIMEOUT)}, {erl_flags_env, save_env()} | Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> ?t:timetrap_cancel(?config(watchdog, Config)), restore_env(?config(erl_flags_env, Config)), ok. diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index 1c5c887b62..27b9185479 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -133,7 +133,7 @@ init_per_testcase(_Case,Config) -> insert_timetraphandle_config(TH,NewConfig2). %% ----------------------------------------------------------------------------- -fin_per_testcase(Case,Config) -> +end_per_testcase(Case,Config) -> ?l test_server:stop_node(get_remotenode_config(inviso1,Config)), ?l test_server:stop_node(get_remotenode_config(inviso2,Config)), @@ -142,14 +142,14 @@ fin_per_testcase(Case,Config) -> true; Pid when is_pid(Pid) -> % But if it exists... exit(Pid,kill), % Remove it! - io:format("Had to kill the control component in fin_per_testcase,~p.~n",[Case]) + io:format("Had to kill the control component in end_per_testcase,~p.~n",[Case]) end, case whereis(inviso_rt) of undefined -> % Should not exist. true; Pid2 when is_pid(Pid2) -> % But if it exists... exit(Pid2,kill), % Remove it! - io:format("Had to kill local runtime component in fin_per_testcase,~p.~n",[Case]) + io:format("Had to kill local runtime component in end_per_testcase,~p.~n",[Case]) end, ?l process_killer([inviso_test_proc, inviso_tab_proc, diff --git a/lib/snmp/test/klas3.erl b/lib/snmp/test/klas3.erl index a5ce2af8c5..ec78d19dbb 100644 --- a/lib/snmp/test/klas3.erl +++ b/lib/snmp/test/klas3.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/sa.erl b/lib/snmp/test/sa.erl index ad3ccce08f..fee50c0e8c 100644 --- a/lib/snmp/test/sa.erl +++ b/lib/snmp/test/sa.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index f560e36663..5cf0af7992 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ -module(snmp_SUITE). -export([all/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). -export([app/1, compiler/1, misc/1, agent/1, manager/1]). @@ -48,7 +48,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_bl_test.erl b/lib/snmp/test/snmp_agent_bl_test.erl index 4608d90201..b17489a755 100644 --- a/lib/snmp/test/snmp_agent_bl_test.erl +++ b/lib/snmp/test/snmp_agent_bl_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -89,7 +89,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl index 5f1ff53a79..c28fa81ae0 100644 --- a/lib/snmp/test/snmp_agent_mibs_test.erl +++ b/lib/snmp/test/snmp_agent_mibs_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -40,7 +40,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, init_all/1, finish_all/1, start_and_stop/1, @@ -100,20 +100,20 @@ init_per_testcase(cache_test, Config) when is_list(Config) -> init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(size_check_dets, Config) when is_list(Config) -> +end_per_testcase(size_check_dets, Config) when is_list(Config) -> Dir = ?config(dets_dir, Config), ?line ok = ?DEL_DIR(Dir), lists:keydelete(dets_dir, 1, Config); -fin_per_testcase(size_check_mnesia, Config) when is_list(Config) -> +end_per_testcase(size_check_mnesia, Config) when is_list(Config) -> mnesia_stop(), Dir = ?config(mnesia_dir, Config), ?line ok = ?DEL_DIR(Dir), lists:keydelete(mnesia_dir, 1, Config); -fin_per_testcase(cache_test, Config) when is_list(Config) -> +end_per_testcase(cache_test, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), Config; -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/snmp_agent_ms_test.erl index 3a3a790e6a..cc4cdae32f 100644 --- a/lib/snmp/test/snmp_agent_ms_test.erl +++ b/lib/snmp/test/snmp_agent_ms_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/snmp_agent_mt_test.erl index 8d5a57f58d..c664dba288 100644 --- a/lib/snmp/test/snmp_agent_mt_test.erl +++ b/lib/snmp/test/snmp_agent_mt_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl index 269c7c96c9..f406ea1e63 100644 --- a/lib/snmp/test/snmp_agent_nfilter_test.erl +++ b/lib/snmp/test/snmp_agent_nfilter_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -34,7 +34,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). %%---------------------------------------------------------------------- @@ -58,7 +58,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index ba438f0568..cb4edf998b 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -123,10 +123,10 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?WD_START(?MINS(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(otp8395, Config) when is_list(Config) -> +end_per_testcase(otp8395, Config) when is_list(Config) -> otp8395({fin, Config}); -fin_per_testcase(_Case, Config) when is_list(Config) -> - ?DBG("fin_per_testcase -> entry with" +end_per_testcase(_Case, Config) when is_list(Config) -> + ?DBG("end_per_testcase -> entry with" "~n Case: ~p" "~n Config: ~p", [_Case, Config]), Dog = ?config(watchdog, Config), @@ -220,7 +220,7 @@ init_per_testcase2(Case, Config) -> {sub_agent_top_dir, SubAgentTopDir}, {manager_top_dir, ManagerTopDir} | Config]. -fin_per_testcase2(_Case, Config) -> +end_per_testcase2(_Case, Config) -> Config. diff --git a/lib/snmp/test/snmp_agent_v1_test.erl b/lib/snmp/test/snmp_agent_v1_test.erl index 52ac6cf58f..737bb25cc3 100644 --- a/lib/snmp/test/snmp_agent_v1_test.erl +++ b/lib/snmp/test/snmp_agent_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -103,7 +103,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/snmp_agent_v2_test.erl index eca66dc30d..549521341e 100644 --- a/lib/snmp/test/snmp_agent_v2_test.erl +++ b/lib/snmp/test/snmp_agent_v2_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/snmp_agent_v3_test.erl index 823c914136..71b355057d 100644 --- a/lib/snmp/test/snmp_agent_v3_test.erl +++ b/lib/snmp/test/snmp_agent_v3_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), Config. diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 773f65be46..a973a2f325 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -24,7 +24,7 @@ -export([ all/1, init_per_suite/1, fin_suite/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, fields/1, modules/1, @@ -112,7 +112,7 @@ init_per_testcase(undef_funcs, Config) -> init_per_testcase(_Case, Config) -> Config. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Config. diff --git a/lib/snmp/test/snmp_appup_mgr.erl b/lib/snmp/test/snmp_appup_mgr.erl index 271d6a2847..6648ce9dbe 100644 --- a/lib/snmp/test/snmp_appup_mgr.erl +++ b/lib/snmp/test/snmp_appup_mgr.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 37522b8e3a..3c708b8977 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -24,7 +24,7 @@ -export([ all/1, init_per_suite/1, fin_suite/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, appup_file/1 @@ -88,7 +88,7 @@ fin_suite(Config) when is_list(Config) -> init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl index ad77b01362..7c1b278ac7 100644 --- a/lib/snmp/test/snmp_compiler_test.erl +++ b/lib/snmp/test/snmp_compiler_test.erl @@ -38,7 +38,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, description/1, oid_conflicts/1, @@ -80,7 +80,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> ?line ok = file:make_dir(CompDir), [{comp_dir, CompDir},{mib_dir, MibDir}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> CompDir = ?config(comp_dir, Config), ?line ok = ?DEL_DIR(CompDir), lists:keydelete(comp_dir, 1, Config). diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl index d2f9631947..90416919d0 100644 --- a/lib/snmp/test/snmp_conf_test.erl +++ b/lib/snmp/test/snmp_conf_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -38,7 +38,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, check_mandatory/1, check_integer1/1, @@ -80,7 +80,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl index 91bdc3e849..dd2f27862e 100644 --- a/lib/snmp/test/snmp_log_test.erl +++ b/lib/snmp/test/snmp_log_test.erl @@ -40,7 +40,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, open_and_close/1, @@ -97,7 +97,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?WD_START(?MINS(5)), [{log_dir, CaseDir}, {watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> %% Leave the dirs created above (enable debugging of the test case(s)) Dog = ?config(watchdog, Config), ?WD_STOP(Dog), diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index d5dc1387f7..f3a4d70ef8 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -43,7 +43,7 @@ -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, start_and_stop/1, @@ -150,8 +150,8 @@ init_per_testcase(Case, Config) when is_list(Config) -> {manager_log_dir, MgrLogDir} | Config]. -fin_per_testcase(Case, Config) when is_list(Config) -> - p("fin_per_testcase -> Case: ~p", [Case]), +end_per_testcase(Case, Config) when is_list(Config) -> + p("end_per_testcase -> Case: ~p", [Case]), %% The cleanup is removed due to some really discusting NFS behaviour... %% CaseTopDir = ?config(manager_dir, Config), %% ?line ok = ?DEL_DIR(CaseTopDir), diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index cef96417dc..83e861589d 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -44,7 +44,7 @@ %%---------------------------------------------------------------------- -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, start_and_stop_tests/1, simple_start_and_stop1/1, @@ -289,18 +289,18 @@ init_per_testcase3(Case, Config) -> Config end. -fin_per_testcase(Case, Config) when is_list(Config) -> +end_per_testcase(Case, Config) when is_list(Config) -> ?DBG("fin [~w] Nodes [1]: ~p", [Case, erlang:nodes()]), Dog = ?config(watchdog, Config), ?WD_STOP(Dog), Conf1 = lists:keydelete(watchdog, 1, Config), - Conf2 = fin_per_testcase2(Case, Conf1), + Conf2 = end_per_testcase2(Case, Conf1), ?DBG("fin [~w] Nodes [2]: ~p", [Case, erlang:nodes()]), %% TopDir = ?config(top_dir, Conf2), %% ?DEL_DIR(TopDir), Conf2. -fin_per_testcase2(Case, Config) -> +end_per_testcase2(Case, Config) -> OldApiCases = [ simple_sync_get1, diff --git a/lib/snmp/test/snmp_manager_user.erl b/lib/snmp/test/snmp_manager_user.erl index 07b56bde39..b0e192344d 100644 --- a/lib/snmp/test/snmp_manager_user.erl +++ b/lib/snmp/test/snmp_manager_user.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_manager_user_old.erl b/lib/snmp/test/snmp_manager_user_old.erl index b53514d699..edffc80dd4 100755 --- a/lib/snmp/test/snmp_manager_user_old.erl +++ b/lib/snmp/test/snmp_manager_user_old.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl index 0f47d70873..b80af16485 100644 --- a/lib/snmp/test/snmp_manager_user_test.erl +++ b/lib/snmp/test/snmp_manager_user_test.erl @@ -37,7 +37,7 @@ -export([ all/1, - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, register_user/1, simple_register_and_unregister1/1, @@ -123,8 +123,8 @@ init_per_testcase(Case, Config) when is_list(Config) -> {manager_log_dir, MgrLogDir} | Config]. -fin_per_testcase(Case, Config) when is_list(Config) -> - p("fin_per_testcase -> Case: ~p", [Case]), +end_per_testcase(Case, Config) when is_list(Config) -> + p("end_per_testcase -> Case: ~p", [Case]), % MgrTopDir = ?config(manager_dir, Config), % ?DEL_DIR(MgrTopDir), Config. diff --git a/lib/snmp/test/snmp_manager_user_test_lib.erl b/lib/snmp/test/snmp_manager_user_test_lib.erl index a49fe93178..bf8fff7c4c 100644 --- a/lib/snmp/test/snmp_manager_user_test_lib.erl +++ b/lib/snmp/test/snmp_manager_user_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl index 8686a47468..763c708bd6 100644 --- a/lib/snmp/test/snmp_note_store_test.erl +++ b/lib/snmp/test/snmp_note_store_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,7 +33,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - init_per_testcase/2, fin_per_testcase/2, + init_per_testcase/2, end_per_testcase/2, all/1, start_and_stop/1, notes/1, @@ -63,7 +63,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. %%====================================================================== diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index 6dc5b779aa..7041552abf 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -38,7 +38,7 @@ tickets/1, otp7575/1, otp8563/1, - init_per_testcase/2, fin_per_testcase/2 + init_per_testcase/2, end_per_testcase/2 ]). @@ -64,7 +64,7 @@ init_per_testcase(_Case, Config) when is_list(Config) -> Config. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl index 9d9c52ef8d..4cc6d36acc 100644 --- a/lib/snmp/test/snmp_test_manager.erl +++ b/lib/snmp/test/snmp_test_manager.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/snmp_test_server.erl b/lib/snmp/test/snmp_test_server.erl index d0a5185452..ffbd2126a3 100644 --- a/lib/snmp/test/snmp_test_server.erl +++ b/lib/snmp/test/snmp_test_server.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,7 +33,7 @@ fatal_skip/3, init_per_testcase/2, - fin_per_testcase/2 + end_per_testcase/2 ]). -include("snmp_test_lib.hrl"). @@ -229,7 +229,7 @@ eval(Mod, Fun, Config) -> Eval = fun() -> do_eval(Self, Mod, Fun, Config2) end, Pid = spawn_link(Eval), R = wait_for_evaluator(Pid, Mod, Fun, Config2, []), - Mod:fin_per_testcase(Fun, Config2), + Mod:end_per_testcase(Fun, Config2), global:unregister_name(?TEST_CASE_SUP), process_flag(trap_exit, Flag), R. @@ -361,7 +361,7 @@ init_per_testcase(_Case, Config) -> global:register_name(?GLOBAL_LOGGER, group_leader()), Config. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> global:unregister_name(?GLOBAL_LOGGER), ok. diff --git a/lib/snmp/test/snmp_test_suite.erl b/lib/snmp/test/snmp_test_suite.erl index a6e203eba3..77aaa508ad 100644 --- a/lib/snmp/test/snmp_test_suite.erl +++ b/lib/snmp/test/snmp_test_suite.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,7 +29,7 @@ behaviour_info(callbacks) -> [ {all, 1}, {init_per_testcase, 2}, - {fin_per_testcase, 2} + {end_per_testcase, 2} ]; behaviour_info(_Other) -> undefined. diff --git a/lib/snmp/test/test1.erl b/lib/snmp/test/test1.erl index b26b03d4ce..23cfaf6aaa 100644 --- a/lib/snmp/test/test1.erl +++ b/lib/snmp/test/test1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/snmp/test/test2.erl b/lib/snmp/test/test2.erl index dc010cfa11..a33208af7b 100644 --- a/lib/snmp/test/test2.erl +++ b/lib/snmp/test/test2.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl index 3c18a905b4..693289990c 100644 --- a/lib/ssl/test/make_certs.erl +++ b/lib/ssl/test/make_certs.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index d1cec26827..b3f02ecd22 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, cinit_return_chkclose/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 63eaa730e9..e693041ded 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, server_accept_timeout/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_dist_SUITE.erl b/lib/ssl/test/old_ssl_dist_SUITE.erl index 97090c1409..912a6d2f9d 100644 --- a/lib/ssl/test/old_ssl_dist_SUITE.erl +++ b/lib/ssl/test/old_ssl_dist_SUITE.erl @@ -39,7 +39,7 @@ -export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, - fin_per_testcase/2]). + end_per_testcase/2]). -export([cnct2tstsrvr/1]). -export([basic/1]). @@ -61,7 +61,7 @@ init_per_testcase(Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:seconds(?DEFAULT_TIMETRAP_SECS)), [{watchdog, Dog},{testcase, Case}|Config]. -fin_per_testcase(_Case, Config) when list(Config) -> +end_per_testcase(_Case, Config) when list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index 2767123a12..2f5f6b82a4 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, seed/1, @@ -40,7 +40,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index 96a7938583..6de58a4da4 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, server_accept_timeout/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index e5b3975d41..4fa4b51392 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, cinit_plain/1, @@ -40,7 +40,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index efdbf45a3d..a03333034a 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_protocol_SUITE). --export([all/1, init_per_testcase/2, fin_per_testcase/2, config/1, +-export([all/1, init_per_testcase/2, end_per_testcase/2, config/1, finish/1, sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, sslv2_tlsv1/1, sslv3_tlsv1/1, sslv2_sslv3_tlsv1/1]). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> WatchDog = test_server:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index 7a8cd1578a..ff45c46317 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, finish/1, cinit_both_verify/1, @@ -39,7 +39,7 @@ init_per_testcase(_Case, Config) -> WatchDog = ssl_test_lib:timetrap(?DEFAULT_TIMEOUT), [{watchdog, WatchDog}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index 71c1d9e181..fccb07fc54 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -28,7 +28,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, config/1, echo_once/1, echo_twice/1, @@ -43,7 +43,7 @@ init_per_testcase(_Case, Config) -> [{watchdog, WatchDog}, {protomod, gen_tcp}, {serialize_accept, true}| Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index e7cfc65be1..62d72a9366 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -28,7 +28,7 @@ %% Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([ new_test/1, @@ -90,7 +90,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index bc867a3770..4a3c9691f4 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -1,6 +1,19 @@ %% %% %CopyrightBegin% %% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% %% %CopyrightEnd% %% -module(beam_lib_SUITE). @@ -22,7 +35,7 @@ -export([all/1, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, building/1, md5/1, encrypted_abstr/1, encrypted_abstr_file/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). all(suite) -> [error, normal, cmp, cmp_literals, strip, otp_6711, building, md5, @@ -32,7 +45,7 @@ init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index e4cdcf6125..f769956da7 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -1,3 +1,21 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% -module(binary_module_SUITE). -export([all/1, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, @@ -17,7 +35,7 @@ -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). % Some of these testcases are really heavy... -define(default_timeout, ?t:minutes(20)). @@ -38,7 +56,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ?line Dog = ?config(watchdog, Config), ?line test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index 2edbc7ab4c..676bade4a8 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index 8b18ef5664..bbaa82b801 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -57,7 +57,7 @@ -export([histogram/1, sum_histogram/1, ave_histogram/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Internal export. -export([client/2]). @@ -83,7 +83,7 @@ init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(15)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog=?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index 6a90870bda..051474c0f7 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ -module(dict_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, create/1,store/1]). -include("test_server.hrl"). @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(5)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/dict_test_lib.erl b/lib/stdlib/test/dict_test_lib.erl index fd15baa5ff..92a75dad89 100644 --- a/lib/stdlib/test/dict_test_lib.erl +++ b/lib/stdlib/test/dict_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index 6ef5b1ddef..24ec67bddb 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index d6d477b388..cdb8567883 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/dummy_h.erl b/lib/stdlib/test/dummy_h.erl index 01eb790a75..7546fe78a0 100644 --- a/lib/stdlib/test/dummy_h.erl +++ b/lib/stdlib/test/dummy_h.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 613bfd000e..bb0f48cafc 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -21,7 +21,7 @@ -export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -31,7 +31,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index e9fb932632..83adea4750 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -45,7 +45,7 @@ config(data_dir, _) -> filename:absname("./epp_SUITE_data"). -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -53,7 +53,7 @@ config(data_dir, _) -> init_per_testcase(_, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_, Config) -> +end_per_testcase(_, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 254ce0095d..ef8ba1708b 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -59,13 +59,13 @@ config(priv_dir,_) -> ".". -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_eval_helper.erl b/lib/stdlib/test/erl_eval_helper.erl index 7fdbabcb17..6863b40108 100644 --- a/lib/stdlib/test/erl_eval_helper.erl +++ b/lib/stdlib/test/erl_eval_helper.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index 1d621c65df..a56ebb984c 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([abstract_module/1, attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, @@ -45,7 +45,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index 8f675c94ec..c8eb0eea79 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ -export([behav/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -34,7 +34,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index c4158abf32..2fc51aea12 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([unused_vars_warn/1, unused_vars_warn_basic/1, @@ -65,7 +65,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index c57541fba9..3f92510891 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([expr/1, func/1, call/1, recs/1, try_catch/1, if_then/1, receive_after/1, bits/1, head_tail/1, package/1, @@ -58,7 +58,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index 32eb97bc92..002645f3c3 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -40,13 +40,13 @@ %% ".". -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(_Case, Config) when is_list(Config) -> ?line Dog=test_server:timetrap(test_server:seconds(1200)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/error_logger_forwarder.erl b/lib/stdlib/test/error_logger_forwarder.erl index 7d99d07860..5703ac769a 100644 --- a/lib/stdlib/test/error_logger_forwarder.erl +++ b/lib/stdlib/test/error_logger_forwarder.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 162ca6006f..56fb6f73ab 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -20,7 +20,7 @@ -export([ all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, basic/1, errors/1, strange_name/1, @@ -57,7 +57,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(1)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 4e789790f6..09a2ddb255 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -72,7 +72,7 @@ -export([write_concurrency/1, heir/1, give_away/1, setopts/1]). -export([bad_table/1, types/1]). --export([init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2, end_per_suite/1]). %% Convenience for manual testing -export([random_test/0]). @@ -108,7 +108,7 @@ init_per_testcase(Case, Config) -> Dog=test_server:timetrap(test_server:minutes(20)), [{watchdog, Dog}, {test_case, Case} | Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), wait_for_test_procs(true), test_server:timetrap_cancel(Dog). diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index 4c8d941f13..cc87348de1 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -19,7 +19,7 @@ -module(ets_tough_SUITE). -export([all/1,ex1/1]). -export([init/1,terminate/2,handle_call/3,handle_info/2]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -compile([export_all]). -include("test_server.hrl"). @@ -34,7 +34,7 @@ init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(test_server:seconds(300)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ets:delete(?GLOBAL_PARAMS). diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index c00ed91fe7..27ff96bd7b 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -44,13 +44,13 @@ binary_check/1, inout/1, misc/1, many/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index 5a279609c6..b3c2537cbd 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -19,7 +19,7 @@ -module(filelib_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, wildcard_one/1,wildcard_two/1,wildcard_errors/1, fold_files/1,otp_5960/1,ensure_dir_eexist/1]). @@ -32,7 +32,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(5)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index 1940ee147e..1cc0f8506f 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -27,7 +27,7 @@ other_process_deletes/1, owner_dies/1, other_process_closes/1,insert_same_key/1]). -export([fixbag/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %%% Internal exports -export([command_loop/0,start_commander/0]). @@ -53,7 +53,7 @@ init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(test_server:seconds(60)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), lists:foreach(fun(X) -> diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 1c9e953003..6ade751874 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -21,7 +21,7 @@ -export([hang_1/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -31,7 +31,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index 99388ba2e3..9058c6687a 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -21,7 +21,7 @@ -include("test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([all/1]). -export([start/1, crash/1, call/1, cast/1, cast_fast/1, @@ -61,7 +61,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 95ee509833..f84d3d711d 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 73efeb004a..da8c9d0c72 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([error_1/1, float_g/1, otp_5403/1, otp_5813/1, otp_6230/1, otp_6282/1, otp_6354/1, otp_6495/1, otp_6517/1, otp_6502/1, @@ -49,7 +49,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index d9672a8c7b..680316cceb 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -21,7 +21,7 @@ -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([setopts_getopts/1,unicode_options/1,unicode_options_gen/1, binary_options/1, bc_with_r12/1, bc_with_r12_gl/1, read_modes_gl/1,bc_with_r12_ogl/1, read_modes_ogl/1, broken_unicode/1,eof_on_pipe/1,unicode_prompt/1]). @@ -73,7 +73,7 @@ init_per_testcase(_Case, Config) -> end, os:putenv("TERM","vt100"), [{watchdog, Dog}, {term, Term} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), Term = ?config(term,Config), os:putenv("TERM",Term), diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index 0089e874c8..580a80d96d 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -31,7 +31,7 @@ % Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([member/1, reverse/1, @@ -90,7 +90,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index 640261f665..92b7dc6483 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 2d90d5b823..5c995203ef 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -38,13 +38,13 @@ -export([float_1_function/1]). -export([action_function/1]). -export([warnings/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(test_server:seconds(360)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/lib/stdlib/test/naughty_child.erl b/lib/stdlib/test/naughty_child.erl index b56130929c..b939436bfc 100644 --- a/lib/stdlib/test/naughty_child.erl +++ b/lib/stdlib/test/naughty_child.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index 2fd7725335..d6677d3c68 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index e21de8770a..ac1c735b2e 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -51,7 +51,7 @@ -include_lib("stdlib/include/ms_transform.hrl"). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([parse_transform/1, badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, @@ -114,7 +114,7 @@ init_per_testcase(Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{?TESTCASE, Case}, {watchdog, Dog} | Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog = ?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index 2cd6b52311..da47fc68bc 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -21,7 +21,7 @@ -export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -31,7 +31,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index 8f1c304705..8c840288dc 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -export([interval_1/1, seed0/1, seed/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include("test_server.hrl"). @@ -31,7 +31,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/random_iolist.erl b/lib/stdlib/test/random_iolist.erl index 4bce347d9a..8f21b5a3b3 100644 --- a/lib/stdlib/test/random_iolist.erl +++ b/lib/stdlib/test/random_iolist.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/random_unicode_list.erl b/lib/stdlib/test/random_unicode_list.erl index 3e83383b08..b8bd719b89 100644 --- a/lib/stdlib/test/random_unicode_list.erl +++ b/lib/stdlib/test/random_unicode_list.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index 6900f1a8f5..5acd98ee48 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -58,14 +58,14 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/1,select_test/1,init_per_testcase/2, fin_per_testcase/2, +-export([all/1,select_test/1,init_per_testcase/2, end_per_testcase/2, return_values/1]). init_per_testcase(_Case, Config) when is_list(Config) -> ?line Dog=test_server:timetrap(test_server:seconds(1200)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index c9f1a03598..3660aca0c7 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ -module(sets_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/1,init_per_testcase/2,end_per_testcase/2, create/1,add_element/1,del_element/1, subtract/1,intersection/1,union/1,is_subset/1, is_set/1,fold/1,filter/1, @@ -36,7 +36,7 @@ init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(5)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/sets_test_lib.erl b/lib/stdlib/test/sets_test_lib.erl index 6b6fb00550..bdfb0d59d2 100644 --- a/lib/stdlib/test/sets_test_lib.erl +++ b/lib/stdlib/test/sets_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index 588342d46a..a5911ec9c5 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -51,7 +51,7 @@ config(priv_dir,_) -> ".". -else. -include("test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). init_per_testcase(_Case, Config) -> @@ -60,7 +60,7 @@ init_per_testcase(_Case, Config) -> ?line code:add_patha(?config(priv_dir,Config)), [{orig_path,OrigPath}, {watchdog, Dog} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ?line Dog = ?config(watchdog, Config), ?line test_server:timetrap_cancel(Dog), ?line OrigPath = ?config(orig_path,Config), diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index d60cfc6895..df85351222 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -81,7 +81,7 @@ union/1, union/2, family_to_digraph/1, family_to_digraph/2, digraph_to_family/1, digraph_to_family/2]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -compile({inline,[{eval,2}]}). @@ -92,7 +92,7 @@ init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index d46a2caf90..dc815dbb59 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,7 +29,7 @@ % Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([app_test/1]). @@ -46,7 +46,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index 452e048dd7..01c3c53863 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -28,7 +28,7 @@ % Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([len/1,equal/1,concat/1,chr_rchr/1,str_rstr/1]). @@ -52,7 +52,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/stdlib/test/supervisor_1.erl b/lib/stdlib/test/supervisor_1.erl index 297550b230..3198be0fed 100644 --- a/lib/stdlib/test/supervisor_1.erl +++ b/lib/stdlib/test/supervisor_1.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index b23bac2d44..aab2b19ccb 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index e44fd56403..81b6613a86 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 6aa2b7b945..69acc357aa 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index 141ac64606..dc01adb5a8 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -22,7 +22,7 @@ -export([all/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, utf8_illegal_sequences_bif/1, utf16_illegal_sequences_bif/1, random_lists/1, @@ -34,7 +34,7 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog=?t:timetrap(?t:minutes(20)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index a574d5e36e..4b332d9ac0 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index b9ccd62d0b..7169412bcd 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index e697cc1571..f366ac75bc 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -63,14 +63,14 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/1, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/1, init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:seconds(30)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> erlang:trace_pattern({'_','_','_'}, false, [local,meta,call_count]), erlang:trace_pattern(on_load, false, [local,meta,call_count]), erlang:trace(all, false, [all]), diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index 430fa86c6c..1bc1c2dcee 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -24,7 +24,7 @@ receive_and_save_trace/2, send_trace/2]). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/1, init_per_testcase/2, end_per_testcase/2]). -export([live_node/1, 'sparc_sunos5.8_32b_emt2.0'/1, @@ -100,7 +100,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> [{watchdog, Dog}, {testcase, Case} | Config]) end. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> ignore_cores:restore(Config), Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), diff --git a/lib/tools/test/ignore_cores.erl b/lib/tools/test/ignore_cores.erl deleted file mode 120000 index 8902a469ef..0000000000 --- a/lib/tools/test/ignore_cores.erl +++ /dev/null @@ -1 +0,0 @@ -../../../erts/test/ignore_cores.erl \ No newline at end of file diff --git a/lib/tools/test/ignore_cores.erl b/lib/tools/test/ignore_cores.erl new file mode 100644 index 0000000000..8b1ac0fe6c --- /dev/null +++ b/lib/tools/test/ignore_cores.erl @@ -0,0 +1,158 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% File : ignore_cores.erl +%%% Author : Rickard Green +%%% Description : +%%% +%%% Created : 11 Feb 2008 by Rickard Green +%%%------------------------------------------------------------------- + +-module(ignore_cores). + +-include_lib("test_server/include/test_server.hrl"). + +-export([init/1, fini/1, setup/3, setup/4, restore/1, dir/1]). + +-record(ignore_cores, {org_cwd, + org_path, + org_pwd_env, + ign_dir = false, + cores_dir = false}). + +%% +%% Takes a testcase config +%% + +init(Config) -> + {ok, OrgCWD} = file:get_cwd(), + [{ignore_cores, + #ignore_cores{org_cwd = OrgCWD, + org_path = code:get_path(), + org_pwd_env = os:getenv("PWD")}} + | lists:keydelete(ignore_cores, 1, Config)]. + +fini(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD} = ?config(ignore_cores, Config), + ok = file:set_cwd(OrgCWD), + true = code:set_path(OrgPath), + case OrgPWD of + false -> ok; + _ -> true = os:putenv("PWD", OrgPWD) + end, + lists:keydelete(ignore_cores, 1, Config). + +setup(Suite, Testcase, Config) -> + setup(Suite, Testcase, Config, false). + +setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite), + is_atom(Testcase), + is_list(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD} = ?config(ignore_cores, Config), + Path = lists:map(fun (".") -> OrgCWD; (Dir) -> Dir end, OrgPath), + true = code:set_path(Path), + PrivDir = ?config(priv_dir, Config), + IgnDir = filename:join([PrivDir, + atom_to_list(Suite) + ++ "_" + ++ atom_to_list(Testcase) + ++ "_wd"]), + ok = file:make_dir(IgnDir), + case SetCwd of + false -> + ok; + _ -> + ok = file:set_cwd(IgnDir), + OrgPWD = case os:getenv("PWD") of + false -> false; + PWD -> + os:putenv("PWD", IgnDir), + PWD + end + end, + ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>), + %% cores are dumped in /cores on MacOS X + CoresDir = case {?t:os_type(), filelib:is_dir("/cores")} of + {{unix,darwin}, true} -> + filelib:fold_files("/cores", + "^core.*$", + false, + fun (C,Cs) -> [C|Cs] end, + []); + _ -> + false + end, + lists:keyreplace(ignore_cores, + 1, + Config, + {ignore_cores, + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD, + ign_dir = IgnDir, + cores_dir = CoresDir}}). + +restore(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD, + ign_dir = IgnDir, + cores_dir = CoresDir} = ?config(ignore_cores, Config), + try + case CoresDir of + false -> + ok; + _ -> + %% Move cores dumped by these testcases in /cores + %% to cwd. + lists:foreach(fun (C) -> + case lists:member(C, CoresDir) of + true -> ok; + _ -> + Dst = filename:join( + [IgnDir, + filename:basename(C)]), + {ok, _} = file:copy(C, Dst), + file:delete(C) + end + end, + filelib:fold_files("/cores", + "^core.*$", + false, + fun (C,Cs) -> [C|Cs] end, + [])) + end + after + catch file:set_cwd(OrgCWD), + catch code:set_path(OrgPath), + case OrgPWD of + false -> ok; + _ -> catch os:putenv("PWD", OrgPWD) + end + end. + + +dir(Config) -> + #ignore_cores{ign_dir = Dir} = ?config(ignore_cores, Config), + Dir. diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index da5930e015..6a0d1965fe 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -18,7 +18,7 @@ %% -module(instrument_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/1,init_per_testcase/2,end_per_testcase/2]). -export(['+Mim true'/1, '+Mis true'/1]). @@ -28,7 +28,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=?t:timetrap(10000), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index 6b952f10ab..642703cc1b 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -26,7 +26,7 @@ %% Test server specific exports -export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([app_test/1]). @@ -39,7 +39,7 @@ all(suite) -> init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index f9d062ef85..e10448862e 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -59,7 +59,7 @@ range/1, relation_to_family/1, set/1, to_external/1, union/2]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Checks some info counters of a server and some relations that should hold. -export([check_count/1, check_state/1]). @@ -91,7 +91,7 @@ init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> Dog=?config(watchdog, _Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index cba7800f14..2d435344cd 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -45,9 +45,6 @@ init_per_testcase(Case, Config0) -> end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func, Config). -fin_per_testcase(Case, Config) -> - wx_test_lib:end_per_testcase(Case, Config). - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(suite) -> diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index 16fcac66d2..68d00480e6 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(wx_basic_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -41,8 +41,6 @@ init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 9d9e001d3d..c737ed3e74 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -25,7 +25,7 @@ -module(wx_class_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,8 +42,6 @@ init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index 5204acb978..883f89195a 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -23,7 +23,7 @@ %%%------------------------------------------------------------------- -module(wx_event_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -40,8 +40,6 @@ init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 51c7064e7c..37d4d89294 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -23,7 +23,7 @@ %%%------------------------------------------------------------------- -module(wx_opengl_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -48,8 +48,6 @@ init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> diff --git a/lib/wx/test/wx_test_lib.erl b/lib/wx/test/wx_test_lib.erl index 9368aa4bdc..550369794a 100644 --- a/lib/wx/test/wx_test_lib.erl +++ b/lib/wx/test/wx_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -200,7 +200,7 @@ eval_test_case(Mod, Fun, Config) -> test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). wait_for_evaluator(Pid, Mod, Fun, Config) -> @@ -216,12 +216,12 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log(" Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log(" Eval process ~w exited, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index bf0a467eac..f6def9d20d 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -41,8 +41,6 @@ init_per_testcase(Func,Config) -> wx_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> -- cgit v1.2.3 From d9ba1a5d1a1c79098593332d490d8ab8cba0cc80 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 6 Oct 2010 11:38:43 +0200 Subject: Remove extra end_per_testcase --- lib/reltool/test/reltool_app_SUITE.erl | 3 --- lib/reltool/test/reltool_server_SUITE.erl | 4 +--- lib/reltool/test/reltool_wx_SUITE.erl | 4 +--- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index abdb1b8e44..93e770a795 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -58,9 +58,6 @@ init_per_testcase(Case, Config) -> end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -end_per_testcase(Case, Config) -> - reltool_test_lib:end_per_testcase(Case, Config). - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all(suite) -> diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 7fa8df4caf..56f7031a77 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -19,7 +19,7 @@ -module(reltool_server_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,8 +42,6 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -end_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index b0f77f3aa3..03a392a497 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -19,7 +19,7 @@ -module(reltool_wx_SUITE). -export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,8 +36,6 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -end_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification all(suite) -> -- cgit v1.2.3 From aed82e4ccb6d22ec3ec99aa7f4497881fcbec5e3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 6 Oct 2010 12:19:46 +0200 Subject: Update app_init to init_per_suite to conform with common_test standards. --- lib/asn1/test/asn1_app_test.erl | 14 +++++++------- lib/asn1/test/asn1_appup_test.erl | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl index 23a7e691e7..8002f5b78f 100644 --- a/lib/asn1/test/asn1_app_test.erl +++ b/lib/asn1/test/asn1_app_test.erl @@ -34,13 +34,13 @@ all(suite) -> exportall, app_depend ], - {req, [], {conf, app_init, Cases, app_fin}}. + {req, [], {conf, init_per_suite, Cases, end_per_suite}}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -app_init(suite) -> []; -app_init(doc) -> []; -app_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> case is_app(asn1) of {ok, AppFile} -> io:format("AppFile: ~n~p~n", [AppFile]), @@ -60,9 +60,9 @@ is_app(App) -> end. -app_fin(suite) -> []; -app_fin(doc) -> []; -app_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl index 4a60c814e8..43fd425b6e 100644 --- a/lib/asn1/test/asn1_appup_test.erl +++ b/lib/asn1/test/asn1_appup_test.erl @@ -31,13 +31,13 @@ all(suite) -> [ appup ], - {req, [], {conf, appup_init, Cases, appup_fin}}. + {req, [], {conf, init_per_suite, Cases, end_per_suite}}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -appup_init(suite) -> []; -appup_init(doc) -> []; -appup_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> AppFile = file_name(asn1, ".app"), AppupFile = file_name(asn1, ".appup"), [{app_file, AppFile}, {appup_file, AppupFile}|Config]. @@ -48,9 +48,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -appup_fin(suite) -> []; -appup_fin(doc) -> []; -appup_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. -- cgit v1.2.3 From 95f687c351e8d01cb41700649e89799192edc0dc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:29:53 +0200 Subject: Update wx tests to conform with common_test standard --- lib/wx/test/wx.spec | 3 +-- lib/wx/test/wx_app_SUITE.erl | 20 ++++++++++++-------- lib/wx/test/wx_basic_SUITE.erl | 23 ++++++++++++++--------- lib/wx/test/wx_class_SUITE.erl | 28 ++++++++++++++-------------- lib/wx/test/wx_event_SUITE.erl | 25 ++++++++++++++----------- lib/wx/test/wx_opengl_SUITE.erl | 19 +++++++++++++------ lib/wx/test/wx_test_lib.erl | 2 +- lib/wx/test/wx_xtra_SUITE.erl | 22 ++++++++++++++-------- 8 files changed, 83 insertions(+), 59 deletions(-) diff --git a/lib/wx/test/wx.spec b/lib/wx/test/wx.spec index a9201e5737..7181a01ab7 100644 --- a/lib/wx/test/wx.spec +++ b/lib/wx/test/wx.spec @@ -1,2 +1 @@ -{topcase, {dir, "../wx_test"}}. - +{suites,"wx_test",all}. diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index 2d435344cd..c34069af6b 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -47,14 +47,18 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - fields, - modules, - exportall, - app_depend, - undef_funcs - ]. +all() -> +[fields, modules, exportall, app_depend, undef_funcs]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index 68d00480e6..ed40566749 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_basic_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -43,14 +43,19 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - create_window, - several_apps, - wx_api, - wx_misc, - data_types - ]. +all() -> +[create_window, several_apps, wx_api, wx_misc, + data_types]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index c737ed3e74..3c35925ba3 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(wx_class_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -44,19 +44,19 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - calendarCtrl, - treeCtrl, - notebook, - staticBoxSizer, - clipboard, - helpFrame, - htmlWindow, - listCtrlSort, - radioBox, - systemSettings - ]. +all() -> +[calendarCtrl, treeCtrl, notebook, staticBoxSizer, + clipboard, helpFrame, htmlWindow, listCtrlSort, + radioBox, systemSettings]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %% The test cases diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index 883f89195a..a8260f22de 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_event_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,16 +42,19 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - connect, - disconnect, - connect_msg_20, - connect_cb_20, - mouse_on_grid, - spin_event, - connect_in_callback - ]. +all() -> +[connect, disconnect, connect_msg_20, connect_cb_20, + mouse_on_grid, spin_event, connect_in_callback]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 37d4d89294..59252381cb 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_opengl_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -50,11 +50,18 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - canvas, - glu_tesselation - ]. +all() -> +[canvas, glu_tesselation]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/wx/test/wx_test_lib.erl b/lib/wx/test/wx_test_lib.erl index 550369794a..8509d6be6f 100644 --- a/lib/wx/test/wx_test_lib.erl +++ b/lib/wx/test/wx_test_lib.erl @@ -35,7 +35,7 @@ init_per_suite(Config) -> exit("Can not test on MacOSX"); {unix, _} -> io:format("DISPLAY ~s~n", [os:getenv("DISPLAY")]), - case proplists:get_value(xserver, Config, none) of + case ct:get_config(xserver, none) of none -> ignore; Server -> os:putenv("DISPLAY", Server) diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index f6def9d20d..7f6d18fd41 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -43,13 +43,19 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - destroy_app, - multiple_add_in_sizer, - app_dies, - menu_item_debug - ]. +all() -> +[destroy_app, multiple_add_in_sizer, app_dies, + menu_item_debug]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases -- cgit v1.2.3 From 4a1a40f8ce37e1790c0b519ba2e339b8dc96d770 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:30:46 +0200 Subject: Update tools tests to conform with common_test standard --- lib/tools/test/cover_SUITE.erl | 37 +++++++++++++++++++---------- lib/tools/test/cprof_SUITE.erl | 28 +++++++++++++--------- lib/tools/test/emem_SUITE.erl | 47 +++++++++++++++++++++---------------- lib/tools/test/eprof_SUITE.erl | 17 +++++++++++--- lib/tools/test/fprof_SUITE.erl | 33 ++++++++++++++++---------- lib/tools/test/instrument_SUITE.erl | 17 +++++++++++--- lib/tools/test/lcnt_SUITE.erl | 19 +++++++++++---- lib/tools/test/make_SUITE.erl | 20 ++++++++++++---- lib/tools/test/tools.spec | 2 +- lib/tools/test/tools_SUITE.erl | 20 +++++++++++----- lib/tools/test/xref_SUITE.erl | 45 +++++++++++++++++++++-------------- 11 files changed, 188 insertions(+), 97 deletions(-) diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 7169412bcd..aeda99c5fd 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -18,13 +18,13 @@ %% -module(cover_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, compile/1, analyse/1, misc/1, stop/1, distribution/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, otp_8188/1, otp_8270/1, otp_8273/1, otp_8340/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%---------------------------------------------------------------------- %% The following directory structure is assumed: @@ -37,17 +37,28 @@ %% y %%---------------------------------------------------------------------- -all(suite) -> - case whereis(cover_server) of - undefined -> - [start, compile, analyse, misc, stop, distribution, - export_import, - otp_5031, eif, otp_5305, otp_5418, otp_6115, otp_7095, - otp_8188, otp_8270, otp_8273, otp_8340]; - _pid -> - {skip,"It looks like the test server is running cover. " - "Can't run cover test."} - end. +all() -> +case whereis(cover_server) of + undefined -> + [start, compile, analyse, misc, stop, distribution, + export_import, otp_5031, eif, otp_5305, otp_5418, + otp_6115, otp_7095, otp_8188, otp_8270, otp_8273, + otp_8340]; + _pid -> + {skip, + "It looks like the test server is running " + "cover. Can't run cover test."} +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + start(suite) -> []; start(Config) when is_list(Config) -> diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index f366ac75bc..2f118deebe 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -41,7 +41,7 @@ -define(config(A,B),config(A,B)). -export([config/2]). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. -ifdef(debug). @@ -63,7 +63,7 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/1, init_per_testcase/2, end_per_testcase/2, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> @@ -78,15 +78,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test the cprof profiling tool."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> [basic, on_load, modules] -%, on_and_off, info, -% pause_and_restart, combo] - end. +all() -> +case test_server:is_native(cprof_SUITE) of + true -> [not_run]; + false -> [basic, on_load, modules] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index 1bc1c2dcee..fdedcef650 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -24,7 +24,7 @@ receive_and_save_trace/2, send_trace/2]). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([live_node/1, 'sparc_sunos5.8_32b_emt2.0'/1, @@ -41,7 +41,7 @@ -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(DEFAULT_TIMEOUT, ?t:minutes(5)). @@ -65,26 +65,33 @@ %% %% -all(doc) -> []; -all(suite) -> +all() -> case is_debug_compiled() of - true -> {skipped, "Not run when debug compiled"}; + true -> {skip, "Not run when debug compiled"}; false -> test_cases() end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -test_cases() -> - [live_node, - 'sparc_sunos5.8_32b_emt2.0', - 'pc_win2000_32b_emt2.0', - 'pc.smp_linux2.2.19pre17_32b_emt2.0', - 'powerpc_darwin7.7.0_32b_emt2.0', - 'alpha_osf1v5.1_64b_emt2.0', - 'sparc_sunos5.8_64b_emt2.0', - 'sparc_sunos5.8_32b_emt1.0', - 'pc_win2000_32b_emt1.0', - 'powerpc_darwin7.7.0_32b_emt1.0', - 'alpha_osf1v5.1_64b_emt1.0', - 'sparc_sunos5.8_64b_emt1.0']. +test_cases() -> +[live_node, 'sparc_sunos5.8_32b_emt2.0', + 'pc_win2000_32b_emt2.0', + 'pc.smp_linux2.2.19pre17_32b_emt2.0', + 'powerpc_darwin7.7.0_32b_emt2.0', + 'alpha_osf1v5.1_64b_emt2.0', + 'sparc_sunos5.8_64b_emt2.0', + 'sparc_sunos5.8_32b_emt1.0', 'pc_win2000_32b_emt1.0', + 'powerpc_darwin7.7.0_32b_emt1.0', + 'alpha_osf1v5.1_64b_emt1.0', + 'sparc_sunos5.8_64b_emt1.0']. init_per_testcase(Case, Config) when is_list(Config) -> case maybe_skip(Config) of @@ -700,8 +707,8 @@ start_node(Name, Args) -> % stop_node(Node) -> % ?t:stop_node(Node). -is_debug_compiled() -> - is_debug_compiled(erlang:system_info(system_version)). +is_debug_compiled() -> +is_debug_compiled(erlang:system_info(system_version)). is_debug_compiled([$d,$e,$b,$u,$g | _]) -> true; diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index 67607c6cf2..fa5fdf30e4 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -18,11 +18,22 @@ %% -module(eprof_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,tiny/1,eed/1,basic/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). + +all() -> +[basic, tiny, eed]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [basic,tiny,eed]. basic(suite) -> []; basic(Config) when is_list(Config) -> diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 1cd9ac7824..5ecb150e09 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -18,10 +18,10 @@ %% -module(fprof_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server framework exports --export([all/1, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). %% Test suites -export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1, @@ -54,17 +54,24 @@ -all(doc) -> - ["Test the 'fprof' profiling tool."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> - [not_run]; - false -> - [stack_seq, tail_seq, create_file_slow, spawn_simple, - imm_tail_seq, imm_create_file_slow, imm_compile, - cpu_create_file_slow] - end. +all() -> +case test_server:is_native(fprof_SUITE) of + true -> [not_run]; + false -> + [stack_seq, tail_seq, create_file_slow, spawn_simple, + imm_tail_seq, imm_create_file_slow, imm_compile, + cpu_create_file_slow] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped, "Native code"}. diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index 6a0d1965fe..f607dab727 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -18,11 +18,11 @@ %% -module(instrument_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export(['+Mim true'/1, '+Mis true'/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_Case, Config) -> ?line Dog=?t:timetrap(10000), @@ -33,7 +33,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> ['+Mim true', '+Mis true']. +all() -> +['+Mim true', '+Mis true']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + '+Mim true'(doc) -> ["Check that memory data can be read and processed"]; '+Mim true'(suite) -> []; diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index e6866f721d..eeae182d8e 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -18,10 +18,10 @@ %% -module(lcnt_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -51,9 +51,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - % Test cases - [load_v1, conflicts, locations, swap_keys]. +all() -> +[load_v1, conflicts, locations, swap_keys]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%---------------------------------------------------------------------- %% Tests diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index 72dccdb465..d0692c9d6a 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -18,12 +18,12 @@ %% -module(make_SUITE). --export([all/1, make_all/1, make_files/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, make_all/1, make_files/1]). -export([otp_6057_init/1, otp_6057_a/1, otp_6057_b/1, otp_6057_c/1, otp_6057_end/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). @@ -35,9 +35,19 @@ %% that the file :"test5.erl" shall be compiled with the 'S' option, %% i.e. produce "test5.S" instead of "test5." -all(suite) -> [make_all, make_files, - {conf, otp_6057_init, - [otp_6057_a,otp_6057_b,otp_6057_c], otp_6057_end}]. +all() -> +[make_all, make_files, otp_6057_a, otp_6057_b, + otp_6057_c]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + test_files() -> ["test1", "test2", "test3", "test4"]. diff --git a/lib/tools/test/tools.spec b/lib/tools/test/tools.spec index 93d5930472..05a5b8fca6 100644 --- a/lib/tools/test/tools.spec +++ b/lib/tools/test/tools.spec @@ -1 +1 @@ -{topcase, {dir, "../tools_test"}}. +{suites,"tools_test",all}. diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index 642703cc1b..39d22b67cd 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -18,23 +18,31 @@ %% -module(tools_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). -define(application, tools). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([app_test/1]). -all(doc) -> - []; -all(suite) -> - [app_test]. +all() -> +[app_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index e10448862e..7ce77b94c5 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -29,28 +29,28 @@ -define(privdir, "xref_SUITE_priv"). -define(copydir, "xref_SUITE_priv/datacopy"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(datadir, ?config(data_dir, Conf)). -define(privdir, ?config(priv_dir, Conf)). -define(copydir, ?config(copy_dir, Conf)). -endif. --export([all/1, init/1, fini/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1]). --export([xref/1, +-export([ addrem/1, convert/1, intergraph/1, lines/1, loops/1, no_data/1, modules/1]). --export([files/1, +-export([ add/1, default/1, info/1, lib/1, read/1, read2/1, remove/1, replace/1, update/1, deprecated/1, trycatch/1, abstract_modules/1, fun_mfa/1, qlc/1]). --export([analyses/1, +-export([ analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]). --export([misc/1, +-export([ format_error/1, otp_7423/1, otp_7831/1]). -import(lists, [append/2, flatten/1, keysearch/3, member/2, sort/1, usort/1]). @@ -68,8 +68,28 @@ -include_lib("tools/src/xref.hrl"). -all(suite) -> - {conf, init, [xref, files, analyses, misc], fini}. +all() -> +[{group, xref}, {group, files}, {group, analyses}, + {group, misc}]. + +groups() -> + [{xref, [], + [addrem, convert, intergraph, lines, loops, no_data, + modules]}, + {files, [], + [add, default, info, lib, read, read2, remove, replace, + update, deprecated, trycatch, abstract_modules, fun_mfa, + qlc]}, + {analyses, [], + [analyze, basic, md, q, variables, unused_locals]}, + {misc, [], [format_error, otp_7423, otp_7831]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Conf) when is_list(Conf) -> DataDir = ?datadir, @@ -96,8 +116,6 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -xref(suite) -> - [addrem, convert, intergraph, lines, loops, no_data, modules]. %% Seems a bit short... addrem(suite) -> []; @@ -680,9 +698,6 @@ modules(Conf) when is_list(Conf) -> ?line ok = xref_base:delete(S), ok. -files(suite) -> - [add, default, info, lib, read, read2, remove, replace, update, - deprecated, trycatch, abstract_modules, fun_mfa, qlc]. add(suite) -> []; add(doc) -> ["Add modules, applications, releases, directories"]; @@ -1788,8 +1803,6 @@ qlc(Conf) when is_list(Conf) -> ok. -analyses(suite) -> - [analyze, basic, md, q, variables, unused_locals]. analyze(suite) -> []; analyze(doc) -> ["Simple analyses"]; @@ -2312,8 +2325,6 @@ unused_locals(Conf) when is_list(Conf) -> ?line ok = file:delete(Beam2), ok. -misc(suite) -> - [format_error, otp_7423, otp_7831]. format_error(suite) -> []; format_error(doc) -> ["Format error messages"]; -- cgit v1.2.3 From 62297e8644c485453262f2bba1b60baf6be77f2c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 1 Nov 2010 18:13:10 +0100 Subject: Common test spec fix --- lib/common_test/test/common_test.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common_test/test/common_test.spec b/lib/common_test/test/common_test.spec index 7619a75b31..e1b4fa8d39 100644 --- a/lib/common_test/test/common_test.spec +++ b/lib/common_test/test/common_test.spec @@ -1 +1 @@ -{topcase, {dir, "../common_test"}}. +{suites,"common_test_test",all}. \ No newline at end of file -- cgit v1.2.3 From 9a1c2c32a199e05fb717403880d040e4d55798b3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:32:51 +0200 Subject: Update syntax_tools tests to conform with common_test standard --- lib/syntax_tools/test/syntax_tools_SUITE.erl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index 16f794683b..30fb63d57b 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -17,16 +17,26 @@ %% -module(syntax_tools_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %% Test cases -export([smoke_test/1]). -all(suite) -> - [smoke_test]. +all() -> +[smoke_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Read and parse all source in the OTP release. smoke_test(Config) when is_list(Config) -> -- cgit v1.2.3 From 65ff8409203e7154f4fbe03ed9d76ca7c1362eaf Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:33:30 +0200 Subject: Update stdlib tests to conform with common_test standard --- lib/stdlib/test/array_SUITE.erl | 42 ++++---- lib/stdlib/test/base64_SUITE.erl | 24 +++-- lib/stdlib/test/beam_lib_SUITE.erl | 20 +++- lib/stdlib/test/binary_module_SUITE.erl | 22 ++++- lib/stdlib/test/c_SUITE.erl | 19 +++- lib/stdlib/test/calendar_SUITE.erl | 25 +++-- lib/stdlib/test/dets_SUITE.erl | 53 ++++++----- lib/stdlib/test/dict_SUITE.erl | 18 +++- lib/stdlib/test/digraph_SUITE.erl | 25 +++-- lib/stdlib/test/digraph_utils_SUITE.erl | 19 +++- lib/stdlib/test/edlin_expand_SUITE.erl | 20 ++-- lib/stdlib/test/epp_SUITE.erl | 38 ++++---- lib/stdlib/test/erl_eval_SUITE.erl | 13 ++- lib/stdlib/test/erl_expand_records_SUITE.erl | 25 +++-- lib/stdlib/test/erl_internal_SUITE.erl | 17 +++- lib/stdlib/test/erl_lint_SUITE.erl | 46 +++++---- lib/stdlib/test/erl_pp_SUITE.erl | 40 +++++--- lib/stdlib/test/erl_scan_SUITE.erl | 26 ++--- lib/stdlib/test/escript_SUITE.erl | 31 +++--- lib/stdlib/test/ets_SUITE.erl | 137 ++++++++++++++------------- lib/stdlib/test/ets_tough_SUITE.erl | 17 +++- lib/stdlib/test/file_sorter_SUITE.erl | 34 ++++--- lib/stdlib/test/filelib_SUITE.erl | 20 +++- lib/stdlib/test/filename_SUITE.erl | 17 +++- lib/stdlib/test/fixtable_SUITE.erl | 22 +++-- lib/stdlib/test/format_SUITE.erl | 20 ++-- lib/stdlib/test/gen_event_SUITE.erl | 27 ++++-- lib/stdlib/test/gen_fsm_SUITE.erl | 34 ++++--- lib/stdlib/test/gen_server_SUITE.erl | 33 ++++--- lib/stdlib/test/id_transform_SUITE.erl | 17 +++- lib/stdlib/test/io_SUITE.erl | 26 +++-- lib/stdlib/test/io_proto_SUITE.erl | 25 +++-- lib/stdlib/test/lists_SUITE.erl | 115 ++++++++++------------ lib/stdlib/test/log_mf_h_SUITE.erl | 17 +++- lib/stdlib/test/ms_transform_SUITE.erl | 25 +++-- lib/stdlib/test/proc_lib_SUITE.erl | 23 +++-- lib/stdlib/test/qlc_SUITE.erl | 69 ++++++++------ lib/stdlib/test/queue_SUITE.erl | 20 ++-- lib/stdlib/test/random_SUITE.erl | 20 ++-- lib/stdlib/test/re_SUITE.erl | 21 +++- lib/stdlib/test/select_SUITE.erl | 20 ++-- lib/stdlib/test/sets_SUITE.erl | 22 +++-- lib/stdlib/test/shell_SUITE.erl | 59 +++++++----- lib/stdlib/test/slave_SUITE.erl | 18 +++- lib/stdlib/test/sofs_SUITE.erl | 60 +++++++----- lib/stdlib/test/stdlib.spec | 5 +- lib/stdlib/test/stdlib_SUITE.erl | 20 ++-- lib/stdlib/test/string_SUITE.erl | 27 ++++-- lib/stdlib/test/supervisor_SUITE.erl | 103 ++++++++++---------- lib/stdlib/test/supervisor_bridge_SUITE.erl | 17 +++- lib/stdlib/test/sys_SUITE.erl | 17 +++- lib/stdlib/test/tar_SUITE.erl | 25 +++-- lib/stdlib/test/timer_SUITE.erl | 17 +++- lib/stdlib/test/timer_simple_SUITE.erl | 40 ++++---- lib/stdlib/test/unicode_SUITE.erl | 20 +++- lib/stdlib/test/win32reg_SUITE.erl | 18 +++- lib/stdlib/test/y2k_SUITE.erl | 33 ++++--- lib/stdlib/test/zip_SUITE.erl | 26 +++-- 58 files changed, 1124 insertions(+), 685 deletions(-) diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index 62d72a9366..0cb5eb33b0 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -19,7 +19,7 @@ -module(array_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Default timetrap timeout (set in init_per_testcase). %% This should be set relatively high (10-15 times the expected @@ -27,7 +27,7 @@ -define(default_timeout, ?t:seconds(60)). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([ @@ -64,27 +64,23 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [new_test, - fix_test, - relax_test, - resize_test, - set_get_test, - to_list_test, - sparse_to_list_test, - from_list_test, - to_orddict_test, - sparse_to_orddict_test, - from_orddict_test, - map_test, - sparse_map_test, - foldl_test, - sparse_foldl_test, - foldr_test, - sparse_foldr_test - ]. +all() -> +[new_test, fix_test, relax_test, resize_test, + set_get_test, to_list_test, sparse_to_list_test, + from_list_test, to_orddict_test, sparse_to_orddict_test, + from_orddict_test, map_test, sparse_map_test, + foldl_test, sparse_foldl_test, foldr_test, + sparse_foldr_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index d8bb2dfb60..c41cf2970a 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -19,11 +19,11 @@ -module(base64_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). %% Test server specific exports --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([base64_encode/1, base64_decode/1, base64_otp_5635/1, @@ -43,13 +43,19 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -all(doc) -> - ["Test library functions for base64 encode and decode " - "(taken from inets/test/http_format_SUITE)"]; -all(suite) -> - [base64_encode, base64_decode, base64_otp_5635, - base64_otp_6279, big, illegal, mime_decode, - mime_decode_to_string, roundtrip]. +all() -> +[base64_encode, base64_decode, base64_otp_5635, + base64_otp_6279, big, illegal, mime_decode, mime_decode_to_string, roundtrip]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%------------------------------------------------------------------------- diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index 4a3c9691f4..cf4de516a6 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -27,19 +27,29 @@ -define(t,test_server). -define(privdir, "beam_lib_SUITE_priv"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/1, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, building/1, md5/1, encrypted_abstr/1, encrypted_abstr_file/1]). -export([init_per_testcase/2, end_per_testcase/2]). -all(suite) -> - [error, normal, cmp, cmp_literals, strip, otp_6711, building, md5, - encrypted_abstr, encrypted_abstr_file]. +all() -> +[error, normal, cmp, cmp_literals, strip, otp_6711, + building, md5, encrypted_abstr, encrypted_abstr_file]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index f769956da7..ec4894a2fa 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -18,7 +18,7 @@ %% -module(binary_module_SUITE). --export([all/1, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]). @@ -34,7 +34,7 @@ -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). % Some of these testcases are really heavy... @@ -62,9 +62,21 @@ end_per_testcase(_Case, Config) -> ok. -endif. -all(suite) -> [interesting,random_ref_fla_comp,random_ref_sr_comp, - random_ref_comp,parts,bin_to_list, list_to_bin, copy, - referenced,guard,encode_decode,badargs,longest_common_trap]. +all() -> +[interesting, random_ref_fla_comp, random_ref_sr_comp, + random_ref_comp, parts, bin_to_list, list_to_bin, copy, + referenced, guard, encode_decode, badargs, + longest_common_trap]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))). diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index 676bade4a8..4649bcb856 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -17,17 +17,26 @@ %% %CopyrightEnd% %% -module(c_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1, memory/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(c, [c/2, nc/2]). -all(doc) -> ["Test cases for the 'c' module."]; -all(suite) -> - [c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. +all() -> +[c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%% Write output to a directory other than current directory: diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 10fb72c1b1..12eae47474 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -18,9 +18,9 @@ %% -module(calendar_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, gregorian_days/1, gregorian_seconds/1, day_of_the_week/1, @@ -32,15 +32,20 @@ -define(START_YEAR, 1947). -define(END_YEAR, 2012). -all(suite) -> [gregorian_days, - gregorian_seconds, - day_of_the_week, - day_of_the_week_calibrate, - leap_years, - last_day_of_the_month, - local_time_to_universal_time_dst]; +all() -> +[gregorian_days, gregorian_seconds, day_of_the_week, + day_of_the_week_calibrate, leap_years, + last_day_of_the_month, local_time_to_universal_time_dst]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(doc) -> "This is the test suite for calendar.erl". gregorian_days(doc) -> "Tests that date_to_gregorian_days and gregorian_days_to_date " diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index bbaa82b801..e66afcdb9b 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -28,13 +28,13 @@ -define(privdir(_), "./dets_SUITE_priv"). -define(datadir(_), "./dets_SUITE_data"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/1, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, open_v8/1, open_v9/1, sets_v8/1, sets_v9/1, bags_v8/1, bags_v9/1, duplicate_bags_v8/1, duplicate_bags_v9/1, access_v8/1, access_v9/1, dirty_mark/1, dirty_mark2/1, @@ -88,31 +88,38 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> +all() -> case os:type() of - vxworks -> - [not_run]; + vxworks -> [not_run]; _ -> - {req,[stdlib], - [basic_v8, basic_v9, open_v8, open_v9, sets_v8, sets_v9, - bags_v8, bags_v9, duplicate_bags_v8, duplicate_bags_v9, - newly_started, open_file_v8, open_file_v9, - init_table_v8, init_table_v9, repair_v8, repair_v9, - access_v8, access_v9, oldbugs_v8, oldbugs_v9, - unsafe_assumptions, truncated_segment_array_v8, - truncated_segment_array_v9, dirty_mark, dirty_mark2, - bag_next_v8, bag_next_v9, hash_v8b_v8c, phash, fold_v8, - fold_v9, fixtable_v8, fixtable_v9, match_v8, match_v9, - select_v8, select_v9, update_counter, badarg, - cache_sets_v8, cache_sets_v9, cache_bags_v8, - cache_bags_v9, cache_duplicate_bags_v8, - cache_duplicate_bags_v9, otp_4208, otp_4989, many_clients, - otp_4906, otp_5402, simultaneous_open, insert_new, - repair_continuation, otp_5487, otp_6206, otp_6359, otp_4738, - otp_7146, otp_8070, otp_8856, otp_8898, otp_8899, otp_8903, - otp_8923]} + [basic_v8, basic_v9, open_v8, open_v9, sets_v8, sets_v9, + bags_v8, bags_v9, duplicate_bags_v8, duplicate_bags_v9, + newly_started, open_file_v8, open_file_v9, + init_table_v8, init_table_v9, repair_v8, repair_v9, + access_v8, access_v9, oldbugs_v8, oldbugs_v9, + unsafe_assumptions, truncated_segment_array_v8, + truncated_segment_array_v9, dirty_mark, dirty_mark2, + bag_next_v8, bag_next_v9, hash_v8b_v8c, phash, fold_v8, + fold_v9, fixtable_v8, fixtable_v9, match_v8, match_v9, + select_v8, select_v9, update_counter, badarg, + cache_sets_v8, cache_sets_v9, cache_bags_v8, + cache_bags_v9, cache_duplicate_bags_v8, + cache_duplicate_bags_v9, otp_4208, otp_4989, + many_clients, otp_4906, otp_5402, simultaneous_open, + insert_new, repair_continuation, otp_5487, otp_6206, + otp_6359, otp_4738, otp_7146, otp_8070, otp_8856, otp_8898, + otp_8899, otp_8903, otp_8923] end. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(suite) -> []; not_run(Conf) when is_list(Conf) -> {comment, "Not runnable VxWorks/NFS"}. diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index 051474c0f7..d58b50f9a1 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -22,15 +22,25 @@ -module(dict_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,store/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(lists, [foldl/3,reverse/1]). -all(suite) -> - [create,store]. +all() -> +[create, store]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(5)), diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index 24ec67bddb..efebea5496 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -23,19 +23,32 @@ -ifdef(STANDALONE). -define(line, put(line, ?LINE), ). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([opts/1, degree/1, path/1, cycle/1, misc/1, vertices/1, - edges/1, data/1, tickets/1, otp_3522/1, otp_3630/1, otp_8066/1]). +-export([opts/1, degree/1, path/1, cycle/1, vertices/1, + edges/1, data/1, otp_3522/1, otp_3630/1, otp_8066/1]). -export([spawn_graph/2]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> {req, [stdlib], [opts, degree, path, cycle, misc, tickets]}. +all() -> +[opts, degree, path, cycle, {group, misc}, + {group, tickets}]. + +groups() -> + [{misc, [], [vertices, edges, data]}, + {tickets, [], [otp_3522, otp_3630, otp_8066]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -147,7 +160,6 @@ cycle(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -misc(suite) -> [vertices, edges, data]. vertices(doc) -> []; vertices(suite) -> []; @@ -210,7 +222,6 @@ data(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -tickets(suite) -> [otp_3522, otp_3630, otp_8066]. otp_3522(doc) -> []; otp_3522(suite) -> []; diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index cdb8567883..4434b0db04 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -22,10 +22,10 @@ -ifdef(debug). -define(line, put(line, ?LINE), ). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([simple/1, loop/1, isolated/1, topsort/1, subgraph/1, condensation/1, tree/1]). @@ -33,8 +33,19 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> {req, [stdlib], [simple, loop, isolated, topsort, - subgraph, condensation, tree]}. +all() -> +[simple, loop, isolated, topsort, subgraph, + condensation, tree]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index bb0f48cafc..38ea43999f 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -17,13 +17,13 @@ %% %CopyrightEnd% %% -module(edlin_expand_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -36,10 +36,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for edlin_expand."]; -all(suite) -> - [normal, quoted_fun, quoted_module, quoted_both]. +all() -> +[normal, quoted_fun, quoted_module, quoted_both]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + normal(doc) -> [""]; diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index 83adea4750..bd39af68f0 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -17,11 +17,11 @@ %% %CopyrightEnd% -module(epp_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([rec_1/1, predef_mac/1, - upcase_mac/1, upcase_mac_1/1, upcase_mac_2/1, - variable/1, variable_1/1, otp_4870/1, otp_4871/1, otp_5362/1, + upcase_mac_1/1, upcase_mac_2/1, + variable_1/1, otp_4870/1, otp_4871/1, otp_5362/1, pmod/1, not_circular/1, skip_header/1, otp_6277/1, otp_7702/1, otp_8130/1, overload_mac/1, otp_8388/1, otp_8470/1, otp_8503/1, otp_8562/1, otp_8665/1, otp_8911/1]). @@ -44,7 +44,7 @@ config(priv_dir, _) -> config(data_dir, _) -> filename:absname("./epp_SUITE_data"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). @@ -59,12 +59,22 @@ end_per_testcase(_, Config) -> ok. -endif. -all(doc) -> - ["Test cases for epp."]; -all(suite) -> - [rec_1, upcase_mac, predef_mac, variable, otp_4870, otp_4871, otp_5362, - pmod, not_circular, skip_header, otp_6277, otp_7702, otp_8130, - overload_mac, otp_8388, otp_8470, otp_8503, otp_8562, otp_8665, otp_8911]. +all() -> + [rec_1, {group, upcase_mac}, predef_mac, + {group, variable}, otp_4870, otp_4871, otp_5362, pmod, + not_circular, skip_header, otp_6277, otp_7702, otp_8130, + overload_mac, otp_8388, otp_8470, otp_8503, otp_8562, + otp_8665, otp_8911]. + +groups() -> + [{upcase_mac, [], [upcase_mac_1, upcase_mac_2]}, + {variable, [], [variable_1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. rec_1(doc) -> ["Recursive macros hang or crash epp (OTP-1398)."]; @@ -127,10 +137,6 @@ check_errors([{error, Info} | Rest]) -> check_errors([_ | Rest]) -> check_errors(Rest). -upcase_mac(doc) -> - ["Check that uppercase macro names are implicitly quoted (OTP-2608)"]; -upcase_mac(suite) -> - [upcase_mac_1, upcase_mac_2]. upcase_mac_1(doc) -> []; @@ -176,10 +182,6 @@ predef_mac(Config) when is_list(Config) -> end, ok. -variable(doc) -> - ["Check variable as first file component of the include directives."]; -variable(suite) -> - [variable_1]. variable_1(doc) -> []; diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index ef8ba1708b..756cefcf14 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -58,7 +58,7 @@ config(priv_dir,_) -> ".". -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -80,6 +80,15 @@ all(suite) -> otp_6787, otp_6977, otp_7550, otp_8133, funs, try_catch, eval_expr_5, zero_width]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + guard_1(doc) -> ["(OTP-2405)"]; guard_1(suite) -> diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index a56ebb984c..6eb038c0be 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -27,15 +27,15 @@ -define(privdir, "erl_expand_records_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([abstract_module/1, attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, - tickets/1, otp_5915/1, otp_7931/1, otp_5990/1, + otp_5915/1, otp_7931/1, otp_5990/1, otp_7078/1, otp_7101/1]). % Default timetrap timeout (set in init_per_testcase). @@ -50,9 +50,20 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [abstract_module, attributes, expr, guard, init, pattern, - strict, update, tickets]. +all() -> +[abstract_module, attributes, expr, guard, init, + pattern, strict, update, {group, tickets}]. + +groups() -> + [{tickets, [], + [otp_5915, otp_7931, otp_5990, otp_7078, otp_7101]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + abstract_module(doc) -> "Compile an abstract module."; @@ -399,8 +410,6 @@ update(Config) when is_list(Config) -> ?line run(Config, Ts), ok. -tickets(suite) -> - [otp_5915, otp_7931, otp_5990, otp_7078, otp_7101]. otp_5915(doc) -> "Strict record tests in guards."; diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index c8eb0eea79..18a28c24dc 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -18,15 +18,26 @@ %% -module(erl_internal_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([behav/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[behav]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [behav]. -define(default_timeout, ?t:minutes(2)). diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 2fc51aea12..e7603ad8c1 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -27,14 +27,14 @@ -define(privdir, "erl_lint_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Conf)). -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([unused_vars_warn/1, +-export([ unused_vars_warn_basic/1, unused_vars_warn_lc/1, unused_vars_warn_rec/1, @@ -54,8 +54,7 @@ otp_7550/1, otp_8051/1, format_warn/1, - on_load/1, on_load_successful/1, on_load_failing/1, - too_many_arguments/1 + on_load_successful/1, on_load_failing/1, too_many_arguments/1 ]). % Default timetrap timeout (set in init_per_testcase). @@ -70,19 +69,30 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [unused_vars_warn, export_vars_warn, - shadow_vars, unused_import, unused_function, - unsafe_vars, unsafe_vars2, unsafe_vars_try, - guard, otp_4886, otp_4988, otp_5091, otp_5276, otp_5338, - otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, otp_5878, otp_5917, otp_6585, - otp_6885, export_all, bif_clash, - behaviour_basic, behaviour_multiple, otp_7550, otp_8051, format_warn, - on_load,too_many_arguments]. +all() -> +[{group, unused_vars_warn}, export_vars_warn, + shadow_vars, unused_import, unused_function, + unsafe_vars, unsafe_vars2, unsafe_vars_try, guard, + otp_4886, otp_4988, otp_5091, otp_5276, otp_5338, + otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, + otp_5878, otp_5917, otp_6585, otp_6885, export_all, + bif_clash, behaviour_basic, behaviour_multiple, + otp_7550, otp_8051, format_warn, {group, on_load}, too_many_arguments]. + +groups() -> + [{unused_vars_warn, [], + [unused_vars_warn_basic, unused_vars_warn_lc, + unused_vars_warn_rec, unused_vars_warn_fun, + unused_vars_OTP_4858]}, + {on_load, [], [on_load_successful, on_load_failing]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -unused_vars_warn(suite) -> - [unused_vars_warn_basic, unused_vars_warn_lc, unused_vars_warn_rec, - unused_vars_warn_fun, unused_vars_OTP_4858]. unused_vars_warn_basic(doc) -> "Warnings for unused variables in some simple cases."; @@ -2832,8 +2842,6 @@ format_level(Level, Count, Config) -> %% Test the -on_load(Name/0) directive. -on_load(suite) -> - [on_load_successful, on_load_failing]. on_load_successful(Config) when is_list(Config) -> Ts = [{on_load_1, diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index 3f92510891..41e4443f89 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -30,21 +30,21 @@ -define(privdir, "erl_pp_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([expr/1, func/1, call/1, recs/1, try_catch/1, if_then/1, +-export([ func/1, call/1, recs/1, try_catch/1, if_then/1, receive_after/1, bits/1, head_tail/1, package/1, cond1/1, block/1, case1/1, ops/1, messages/1, old_mnemosyne_syntax/1, - attributes/1, import_export/1, misc_attrs/1, + import_export/1, misc_attrs/1, hook/1, neg_indent/1, - tickets/1, + otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1, otp_8473/1, otp_8522/1, otp_8567/1, otp_8664/1]). @@ -63,12 +63,27 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [expr, attributes, hook, neg_indent, tickets]. +all() -> +[{group, expr}, {group, attributes}, hook, neg_indent, + {group, tickets}]. + +groups() -> + [{expr, [], + [func, call, recs, try_catch, if_then, receive_after, + bits, head_tail, package, cond1, block, case1, ops, + messages, old_mnemosyne_syntax]}, + {attributes, [], [misc_attrs, import_export]}, + {tickets, [], + [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, + otp_8473, otp_8522, otp_8567, otp_8664]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -expr(suite) -> - [func, call, recs, try_catch, if_then, receive_after, bits, head_tail, - package, cond1, block, case1, ops, messages, old_mnemosyne_syntax]. func(suite) -> []; @@ -564,8 +579,6 @@ old_mnemosyne_syntax(Config) when is_list(Config) -> ok. -attributes(suite) -> - [misc_attrs, import_export]. import_export(suite) -> []; @@ -763,9 +776,6 @@ neg_indent(Config) when is_list(Config) -> ok. -tickets(suite) -> - [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, otp_8473, otp_8522, - otp_8567, otp_8664]. otp_6321(doc) -> "OTP_6321. Bug fix of exprs()."; diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index 002645f3c3..5a98890ba7 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -17,9 +17,9 @@ %% %CopyrightEnd% -module(erl_scan_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([error/1, error_1/1, error_2/1, iso88591/1, otp_7810/1]). +-export([ error_1/1, error_2/1, iso88591/1, otp_7810/1]). -import(lists, [nth/2,flatten/1]). -import(io_lib, [print/1]). @@ -39,7 +39,7 @@ %% config(data_dir, _) -> %% ".". -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(_Case, Config) when is_list(Config) -> @@ -55,15 +55,19 @@ end_per_testcase(_Case, Config) -> % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). -all(doc) -> - ["Test cases for the 'erl_scan' module."]; -all(suite) -> - [error,iso88591,otp_7810]. +all() -> +[{group, error}, iso88591, otp_7810]. + +groups() -> + [{error, [], [error_1, error_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -error(doc) -> - ["Error cases"]; -error(suite) -> - [error_1, error_2]. error_1(doc) -> ["(OTP-2347)"]; diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 56fb6f73ab..d9535ae3ae 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -18,7 +18,7 @@ -module(escript_SUITE). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, basic/1, @@ -35,23 +35,22 @@ verify_sections/3 ]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> - [ - basic, - errors, - strange_name, - emulator_flags, - module_script, - beam_script, - archive_script, - epp, - create_and_extract, - foldl, - overflow - ]. +all() -> + [basic, errors, strange_name, emulator_flags, + module_script, beam_script, archive_script, epp, + create_and_extract, foldl, overflow]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(1)), diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 09a2ddb255..0e605a1407 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -18,24 +18,24 @@ %% -module(ets_SUITE). --export([all/1]). --export([new/1,default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1, privacy/1,privacy_owner/2]). --export([insert/1,empty/1,badinsert/1]). --export([lookup/1,time_lookup/1,badlookup/1,lookup_order/1]). --export([delete/1,delete_elem/1,delete_tab/1,delete_large_tab/1, +-export([empty/1,badinsert/1]). +-export([time_lookup/1,badlookup/1,lookup_order/1]). +-export([delete_elem/1,delete_tab/1,delete_large_tab/1, delete_large_named_table/1, evil_delete/1,baddelete/1,match_delete/1,table_leak/1]). -export([match_delete3/1]). -export([firstnext/1,firstnext_concurrent/1]). -export([slot/1]). --export([match/1, match1/1, match2/1, match_object/1, match_object2/1]). --export([misc/1, dups/1, misc1/1, safe_fixtable/1, info/1, tab2list/1]). --export([files/1, tab2file/1, tab2file2/1, tabfile_ext1/1, +-export([ match1/1, match2/1, match_object/1, match_object2/1]). +-export([ dups/1, misc1/1, safe_fixtable/1, info/1, tab2list/1]). +-export([ tab2file2/1, tabfile_ext1/1, tabfile_ext2/1, tabfile_ext3/1, tabfile_ext4/1]). --export([heavy/1, heavy_lookup/1, heavy_lookup_element/1, heavy_concurrent/1]). --export([lookup_element/1, lookup_element_mult/1]). --export([fold/1]). +-export([ heavy_lookup/1, heavy_lookup_element/1, heavy_concurrent/1]). +-export([ lookup_element_mult/1]). +-export([]). -export([foldl_ordered/1, foldr_ordered/1, foldl/1, foldr/1, fold_empty/1]). -export([t_delete_object/1, t_init_table/1, t_whitebox/1, t_delete_all_objects/1, t_insert_list/1, t_test_ms/1, @@ -59,7 +59,7 @@ -export([otp_7665/1]). -export([meta_wb/1]). -export([grow_shrink/1, grow_pseudo_deleted/1, shrink_pseudo_deleted/1]). --export([meta_smp/1, +-export([ meta_lookup_unnamed_read/1, meta_lookup_unnamed_write/1, meta_lookup_named_read/1, meta_lookup_named_write/1, meta_newdel_unnamed/1, meta_newdel_named/1]). @@ -97,7 +97,7 @@ -export([t_select_reverse/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(Case, Config) -> Seed = {S1,S2,S3} = random:seed0(), %now(), @@ -120,32 +120,63 @@ end_per_suite(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - new,insert,lookup,delete,firstnext,firstnext_concurrent,slot,match, - t_match_spec_run, - lookup_element, misc,files, heavy, - ordered, ordered_match, interface_equality, - fixtable_next, fixtable_insert, rename, rename_unnamed, evil_rename, - update_element, update_counter, evil_update_counter, partly_bound, - match_heavy, fold, member, - t_delete_object, t_init_table, t_whitebox, - t_delete_all_objects, t_insert_list, t_test_ms, - t_select_delete, t_ets_dets, memory, t_select_reverse, - t_bucket_disappears, - select_fail,t_insert_new, t_repair_continuation, otp_5340, otp_6338, - otp_6842_select_1000, otp_7665, otp_8732, - meta_wb, - grow_shrink, grow_pseudo_deleted, shrink_pseudo_deleted, - meta_smp, - smp_insert, smp_fixed_delete, smp_unfix_fix, smp_select_delete, otp_8166, - exit_large_table_owner, - exit_many_large_table_owner, - exit_many_tables_owner, - exit_many_many_tables_owner, - write_concurrency, heir, give_away, setopts, - bad_table, types - ]. +all() -> +[{group, new}, {group, insert}, {group, lookup}, + {group, delete}, firstnext, firstnext_concurrent, slot, + {group, match}, t_match_spec_run, + {group, lookup_element}, {group, misc}, {group, files}, + {group, heavy}, ordered, ordered_match, + interface_equality, fixtable_next, fixtable_insert, + rename, rename_unnamed, evil_rename, update_element, + update_counter, evil_update_counter, partly_bound, + match_heavy, {group, fold}, member, t_delete_object, + t_init_table, t_whitebox, t_delete_all_objects, + t_insert_list, t_test_ms, t_select_delete, t_ets_dets, + memory, t_select_reverse, t_bucket_disappears, + select_fail, t_insert_new, t_repair_continuation, + otp_5340, otp_6338, otp_6842_select_1000, otp_7665, + otp_8732, meta_wb, grow_shrink, grow_pseudo_deleted, + shrink_pseudo_deleted, {group, meta_smp}, smp_insert, + smp_fixed_delete, smp_unfix_fix, smp_select_delete, + otp_8166, exit_large_table_owner, + exit_many_large_table_owner, exit_many_tables_owner, + exit_many_many_tables_owner, write_concurrency, heir, + give_away, setopts, bad_table, types]. + +groups() -> + [{new, [], + [default, setbag, badnew, verybadnew, named, keypos2, + privacy]}, + {insert, [], [empty, badinsert]}, + {lookup, [], [time_lookup, badlookup, lookup_order]}, + {lookup_element, [], [lookup_element_mult]}, + {delete, [], + [delete_elem, delete_tab, delete_large_tab, + delete_large_named_table, evil_delete, table_leak, + baddelete, match_delete, match_delete3]}, + {match, [], + [match1, match2, match_object, match_object2]}, + {misc, [], + [misc1, safe_fixtable, info, dups, tab2list]}, + {files, [], + [tab2file, tab2file2, tab2file3, tabfile_ext1, + tabfile_ext2, tabfile_ext3, tabfile_ext4]}, + {heavy, [], + [heavy_lookup, heavy_lookup_element, heavy_concurrent]}, + {fold, [], + [foldl_ordered, foldr_ordered, foldl, foldr, + fold_empty]}, + {meta_smp, [], + [meta_lookup_unnamed_read, meta_lookup_unnamed_write, + meta_lookup_named_read, meta_lookup_named_write, + meta_newdel_unnamed, meta_newdel_named]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -332,7 +363,6 @@ t_repair_continuation_do(Opts) -> ?line true = ets:is_compiled_ms(ets:match_spec_compile(MS)), ?line verify_etsmem(EtsMem). -new(suite) -> [default,setbag,badnew,verybadnew,named,keypos2,privacy]. default(doc) -> ["Check correct default vaules of a new ets table"]; @@ -2720,8 +2750,6 @@ rotate_tuple(Tuple, N) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -insert(doc) -> ["Test proper and improper inserts into a table."]; -insert(suite) -> [empty,badinsert]. empty(doc) -> ["Check lookup in an empty table and lookup of a non-existing key"]; @@ -2761,8 +2789,6 @@ badinsert_do(Opts) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -lookup(doc) -> ["Some tests for lookups (timing, bad lookups, etc.)."]; -lookup(suite) -> [time_lookup,badlookup,lookup_order]. time_lookup(doc) -> ["Lookup timing."]; time_lookup(suite) -> []; @@ -2889,8 +2915,6 @@ fill_tab(Tab,Val) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -lookup_element(doc) -> ["Some tests for lookup_element."]; -lookup_element(suite) -> [lookup_element_mult]. lookup_element_mult(doc) -> ["Multiple return elements (OTP-2386)"]; lookup_element_mult(suite) -> []; @@ -2932,11 +2956,6 @@ lem_crash_3(T) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -delete(doc) -> - ["Check delete functionality (proper/improper deletes)"]; -delete(suite) -> - [delete_elem,delete_tab,delete_large_tab,delete_large_named_table,evil_delete, - table_leak,baddelete,match_delete,match_delete3]. delete_elem(doc) -> ["Check delete of an element inserted in a `filled' table."]; @@ -3471,7 +3490,6 @@ slot_loop(Tab,SlotNo,EltsSoFar) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -match(suite) -> [match1, match2, match_object, match_object2]. match1(suite) -> []; match1(Config) when is_list(Config) -> @@ -3606,7 +3624,6 @@ match_object2_do(Opts) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -misc(suite) -> [misc1, safe_fixtable, info, dups, tab2list]. tab2list(doc) -> ["Tests tab2list (OTP-3319)"]; tab2list(suite) -> []; @@ -3739,9 +3756,6 @@ dups_do(Opts) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -files(suite) -> [tab2file, tab2file2, tabfile_ext1, tabfile_ext2, - tabfile_ext3, tabfile_ext4]. - tab2file(doc) -> ["Check the ets:tab2file function on an empty " "ets table."]; tab2file(suite) -> []; @@ -3991,7 +4005,6 @@ make_sub_binary(List, Num) when is_list(List) -> {_,B} = split_binary(Bin, N+1), B. -heavy(suite) -> [heavy_lookup, heavy_lookup_element, heavy_concurrent]. %% Lookup stuff like crazy... heavy_lookup(doc) -> ["Performs multiple lookups for every key ", @@ -4092,9 +4105,6 @@ do_heavy_concurrent_proc(Tab, N, Offs) -> _ = ets:lookup(Tab, N), do_heavy_concurrent_proc(Tab, N-1, Offs). -fold(suite) -> [foldl_ordered, foldr_ordered, - foldl, foldr, - fold_empty]. fold_empty(doc) -> []; @@ -4856,13 +4866,6 @@ shrink_pseudo_deleted_do(Type) -> process_flag(scheduler,0). -meta_smp(suite) -> - [meta_lookup_unnamed_read, - meta_lookup_unnamed_write, - meta_lookup_named_read, - meta_lookup_named_write, - meta_newdel_unnamed, - meta_newdel_named]. meta_lookup_unnamed_read(suite) -> []; meta_lookup_unnamed_read(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index cc87348de1..ef14403b0c 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -17,13 +17,24 @@ %% %CopyrightEnd% %% -module(ets_tough_SUITE). --export([all/1,ex1/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,ex1/1]). -export([init/1,terminate/2,handle_call/3,handle_info/2]). -export([init_per_testcase/2, end_per_testcase/2]). -compile([export_all]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[ex1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [ex1]. -define(DEBUG(X),debug_disabled). diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index 27ff96bd7b..050dac989b 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -27,12 +27,12 @@ -define(t,test_server). -define(privdir(_), "./file_sorter_SUITE_priv"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/1, basic/1, badarg/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1, badarg/1, term_sort/1, term_keysort/1, binary_term_sort/1, binary_term_keysort/1, binary_sort/1, @@ -55,19 +55,23 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - {req,[stdlib,kernel], - [basic, badarg, - term_sort, term_keysort, - binary_term_sort, binary_term_keysort, - binary_sort, - term_merge, term_keymerge, - binary_term_merge, binary_term_keymerge, - binary_merge, - term_check, binary_term_keycheck, - binary_term_check, binary_term_keycheck, - binary_check, - inout, misc, many]}. +all() -> +[basic, badarg, term_sort, term_keysort, + binary_term_sort, binary_term_keysort, binary_sort, + term_merge, term_keymerge, binary_term_merge, + binary_term_keymerge, binary_merge, term_check, + binary_term_keycheck, binary_term_check, + binary_term_keycheck, binary_check, inout, misc, many]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + basic(doc) -> ["Basic test case."]; diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index b3c2537cbd..4df5bc8106 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -19,13 +19,13 @@ -module(filelib_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, wildcard_one/1,wildcard_two/1,wildcard_errors/1, fold_files/1,otp_5960/1,ensure_dir_eexist/1]). -import(lists, [foreach/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). init_per_testcase(_Case, Config) -> @@ -37,9 +37,19 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [wildcard_one,wildcard_two,wildcard_errors,fold_files,otp_5960, - ensure_dir_eexist]. +all() -> +[wildcard_one, wildcard_two, wildcard_errors, + fold_files, otp_5960, ensure_dir_eexist]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + wildcard_one(Config) when is_list(Config) -> ?line {ok,OldCwd} = file:get_cwd(), diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl index dbce93600b..e30fe2649c 100644 --- a/lib/stdlib/test/filename_SUITE.erl +++ b/lib/stdlib/test/filename_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(filename_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([absname/1, absname_2/1, basename_1/1, basename_2/1, dirname/1, extension/1, join/1, t_nativename/1]). @@ -26,9 +26,10 @@ basename_bin_1/1, basename_bin_2/1, dirname_bin/1, extension_bin/1, join_bin/1]). -export([pathtype_bin/1,rootname_bin/1,split_bin/1]). --include("test_server.hrl"). -all(suite) -> +-include_lib("test_server/include/test_server.hrl"). + +all() -> [absname, absname_2, basename_1, basename_2, dirname, extension, join, pathtype, rootname, split, t_nativename, find_src, @@ -36,6 +37,16 @@ all(suite) -> extension_bin, join_bin, pathtype_bin, rootname_bin, split_bin]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% absname(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index 1cc0f8506f..8259917c78 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -21,7 +21,7 @@ %%%---------------------------------------------------------------------- -module(fixtable_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%% Test cases -export([multiple_fixes/1, multiple_processes/1, other_process_deletes/1, owner_dies/1, @@ -31,12 +31,22 @@ %%% Internal exports -export([command_loop/0,start_commander/0]). -all(suite) -> {req, [stdlib], - [multiple_fixes, multiple_processes, - other_process_deletes, owner_dies, - other_process_closes,insert_same_key,fixbag]}. +all() -> +[multiple_fixes, multiple_processes, + other_process_deletes, owner_dies, other_process_closes, + insert_same_key, fixbag]. --include("test_server.hrl"). +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +-include_lib("test_server/include/test_server.hrl"). %%% I wrote this thinking I would use more than one temporary at a time, but %%% I wasn't... Well, maybe in the future... diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 6ade751874..5304eb2350 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -17,13 +17,13 @@ %% %CopyrightEnd% %% -module(format_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([hang_1/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -36,10 +36,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for io:format/[2,3]."]; -all(suite) -> - [hang_1]. +all() -> +[hang_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + hang_1(doc) -> ["Bad args can hang (OTP-2400)"]; diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index 4f7de451e3..99caa72f6c 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -18,16 +18,30 @@ %% -module(gen_event_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). --export([start/1, test_all/1, add_handler/1, add_sup_handler/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([start/1, add_handler/1, add_sup_handler/1, delete_handler/1, swap_handler/1, swap_sup_handler/1, notify/1, sync_notify/1, call/1, info/1, hibernate/1, call_format_status/1, error_format_status/1]). -all(suite) -> {req, [stdlib], [start, test_all, hibernate, - call_format_status, error_format_status]}. +all() -> +[start, {group, test_all}, hibernate, + call_format_status, error_format_status]. + +groups() -> + [{test_all, [], + [add_handler, add_sup_handler, delete_handler, + swap_handler, swap_sup_handler, notify, sync_notify, + call, info]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% -------------------------------------- %% Start an event manager. @@ -171,9 +185,6 @@ hibernate(Config) when is_list(Config) -> ok. -test_all(suite) -> [add_handler, add_sup_handler, delete_handler, - swap_handler, swap_sup_handler, notify, - sync_notify, call, info]. add_handler(doc) -> []; add_handler(suite) -> []; diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index dd120f8c05..d487418adb 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -18,19 +18,19 @@ %% -module(gen_fsm_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test cases --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([start/1, start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1, +-export([ start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1, start7/1, start8/1, start9/1, start10/1, start11/1]). --export([abnormal/1, abnormal1/1, abnormal2/1]). +-export([ abnormal1/1, abnormal2/1]). -export([shutdown/1]). --export([sys/1, sys1/1, call_format_status/1, error_format_status/1]). +-export([ sys1/1, call_format_status/1, error_format_status/1]). -export([hibernate/1,hiber_idle/3,hiber_wakeup/3,hiber_idle/2,hiber_wakeup/2]). @@ -53,13 +53,27 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [start, abnormal, shutdown, sys, hibernate, enter_loop]. +all() -> +[{group, start}, {group, abnormal}, shutdown, + {group, sys}, hibernate, enter_loop]. + +groups() -> + [{start, [], + [start1, start2, start3, start4, start5, start6, start7, + start8, start9, start10, start11]}, + {abnormal, [], [abnormal1, abnormal2]}, + {sys, [], + [sys1, call_format_status, error_format_status]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -start(suite) -> [start1, start2, start3, start4, start5, start6, start7, - start8, start9, start10, start11]. %% anonymous start1(Config) when is_list(Config) -> @@ -239,7 +253,6 @@ start11(Config) when is_list(Config) -> test_server:messages_get(), ok. -abnormal(suite) -> [abnormal1, abnormal2]. %% Check that time outs in calls work abnormal1(suite) -> []; @@ -305,7 +318,6 @@ shutdown(Config) when is_list(Config) -> ok. -sys(suite) -> [sys1, call_format_status, error_format_status]. sys1(Config) when is_list(Config) -> ?line {ok, Pid} = diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index 9058c6687a..73407ce839 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -18,12 +18,12 @@ %% -module(gen_server_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, crash/1, call/1, cast/1, cast_fast/1, info/1, abcast/1, multicall/1, multicall_down/1, call_remote1/1, call_remote2/1, call_remote3/1, @@ -45,16 +45,25 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, format_status/2]). -all(suite) -> - [start, crash, call, cast, cast_fast, info, - abcast, multicall, multicall_down, call_remote1, - call_remote2, call_remote3, call_remote_n1, - call_remote_n2, call_remote_n3, spec_init, - spec_init_local_registered_parent, - spec_init_global_registered_parent, - otp_5854, hibernate, otp_7669, - call_format_status, error_format_status, - call_with_huge_message_queue]. +all() -> +[start, crash, call, cast, cast_fast, info, abcast, + multicall, multicall_down, call_remote1, call_remote2, + call_remote3, call_remote_n1, call_remote_n2, + call_remote_n3, spec_init, + spec_init_local_registered_parent, + spec_init_global_registered_parent, otp_5854, hibernate, + otp_7669, call_format_status, error_format_status, + call_with_huge_message_queue]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(default_timeout, ?t:minutes(1)). diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index f84d3d711d..7c49dcdd1b 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("kernel/include/file.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, id_transform/1]). -export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1, @@ -29,9 +29,20 @@ % Serves as test... -hej(hopp). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[id_transform]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [id_transform]. id_transform(doc) -> "Test erl_id_trans."; id_transform(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index da8c9d0c72..91d1143545 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -18,7 +18,7 @@ %% -module(io_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -37,7 +37,7 @@ -define(t, test_server). -define(privdir(_), "./io_SUITE_priv"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. @@ -54,12 +54,22 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for io."]; -all(suite) -> - [error_1,float_g,otp_5403,otp_5813,otp_6230,otp_6282,otp_6354,otp_6495, - otp_6517,otp_6502,manpage,otp_6708,otp_7084,otp_7421, - io_lib_collect_line_3_wb,cr_whitespace_in_string,io_fread_newlines]. +all() -> +[error_1, float_g, otp_5403, otp_5813, otp_6230, + otp_6282, otp_6354, otp_6495, otp_6517, otp_6502, + manpage, otp_6708, otp_7084, otp_7421, + io_lib_collect_line_3_wb, cr_whitespace_in_string, + io_fread_newlines]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + error_1(doc) -> ["Error cases for output"]; diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 680316cceb..1c9057a86e 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -19,7 +19,7 @@ -module(io_proto_SUITE). -compile(r12). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -42,7 +42,7 @@ -define(t, test_server). -define(privdir(_), "./io_SUITE_priv"). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. @@ -80,12 +80,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for the io_protocol."]; -all(suite) -> - [setopts_getopts, unicode_options, unicode_options_gen, binary_options, bc_with_r12, - bc_with_r12_gl,bc_with_r12_ogl, read_modes_gl, read_modes_ogl, - broken_unicode,eof_on_pipe,unicode_prompt]. +all() -> +[setopts_getopts, unicode_options, unicode_options_gen, + binary_options, bc_with_r12, bc_with_r12_gl, + bc_with_r12_ogl, read_modes_gl, read_modes_ogl, + broken_unicode, eof_on_pipe, unicode_prompt]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -record(state, { diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index 580a80d96d..aa690c4231 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -21,7 +21,7 @@ %%%----------------------------------------------------------------- -module(lists_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). @@ -30,36 +30,36 @@ -define(default_timeout, ?t:minutes(4)). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. -export([member/1, reverse/1, keymember/1, keysearch_keyfind/1, keystore/1, keytake/1, - append/1, append_1/1, append_2/1, - seq/1, seq_loop/1, seq_2/1, seq_3/1, seq_2_e/1, seq_3_e/1, - sublist/1, flatten/1, + append_1/1, append_2/1, + seq_loop/1, seq_2/1, seq_3/1, seq_2_e/1, seq_3_e/1, + sublist_2/1, sublist_3/1, sublist_2_e/1, sublist_3_e/1, flatten_1/1, flatten_2/1, flatten_1_e/1, flatten_2_e/1, dropwhile/1, sort/1, sort_1/1, sort_stable/1, merge/1, rmerge/1, sort_rand/1, - usort/1, usort_1/1, usort_stable/1, umerge/1, rumerge/1,usort_rand/1, + usort_1/1, usort_stable/1, umerge/1, rumerge/1,usort_rand/1, keymerge/1, rkeymerge/1, - keysort/1, keysort_1/1, keysort_i/1, keysort_stable/1, + keysort_1/1, keysort_i/1, keysort_stable/1, keysort_rand/1, keysort_error/1, ukeymerge/1, rukeymerge/1, - ukeysort/1, ukeysort_1/1, ukeysort_i/1, ukeysort_stable/1, + ukeysort_1/1, ukeysort_i/1, ukeysort_stable/1, ukeysort_rand/1, ukeysort_error/1, funmerge/1, rfunmerge/1, - funsort/1, funsort_1/1, funsort_stable/1, funsort_rand/1, + funsort_1/1, funsort_stable/1, funsort_rand/1, funsort_error/1, ufunmerge/1, rufunmerge/1, - ufunsort/1, ufunsort_1/1, ufunsort_stable/1, ufunsort_rand/1, + ufunsort_1/1, ufunsort_stable/1, ufunsort_rand/1, ufunsort_error/1, zip_unzip/1, zip_unzip3/1, zipwith/1, zipwith3/1, filter_partition/1, - tickets/1, otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1, + otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1, suffix/1, subtract/1]). %% Sort randomized lists until stopped. @@ -76,15 +76,44 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [append, reverse, member, keymember, keysearch_keyfind, keystore, keytake, - dropwhile, - sort, usort, keysort, ukeysort, - funsort, ufunsort, sublist, flatten, seq, - zip_unzip, zip_unzip3, zipwith, zipwith3, - filter_partition, tickets, suffix, subtract]. +all() -> +[{group, append}, reverse, member, keymember, + keysearch_keyfind, keystore, keytake, dropwhile, sort, + {group, usort}, {group, keysort}, {group, ukeysort}, + {group, funsort}, {group, ufunsort}, {group, sublist}, + {group, flatten}, {group, seq}, zip_unzip, zip_unzip3, + zipwith, zipwith3, filter_partition, {group, tickets}, + suffix, subtract]. + +groups() -> + [{append, [], [append_1, append_2]}, + {usort, [], + [umerge, rumerge, usort_1, usort_rand, usort_stable]}, + {keysort, [], + [keymerge, rkeymerge, keysort_1, keysort_rand, + keysort_i, keysort_stable, keysort_error]}, + {ukeysort, [], + [ukeymerge, rukeymerge, ukeysort_1, ukeysort_rand, + ukeysort_i, ukeysort_stable, ukeysort_error]}, + {funsort, [], + [funmerge, rfunmerge, funsort_1, funsort_stable, + funsort_error, funsort_rand]}, + {ufunsort, [], + [ufunmerge, rufunmerge, ufunsort_1, ufunsort_stable, + ufunsort_error, ufunsort_rand]}, + {seq, [], [seq_loop, seq_2, seq_3, seq_2_e, seq_3_e]}, + {sublist, [], + [sublist_2, sublist_3, sublist_2_e, sublist_3_e]}, + {flatten, [], + [flatten_1, flatten_2, flatten_1_e, flatten_2_e]}, + {tickets, [], [otp_5939, otp_6023, otp_6606, otp_7230]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), @@ -98,10 +127,6 @@ end_per_testcase(_Case, Config) -> % % Test cases starts here. % -append(doc) -> - ["Tests lists:append/1 & lists:append/2"]; -append(suite) -> - [append_1, append_2]. append_1(doc) -> []; append_1(suite) -> []; @@ -536,10 +561,6 @@ expl_pid([{I,F} | T], L) when is_function(F) -> expl_pid([], L) -> L. -usort(doc) -> - ["Tests unique merge functions and lists:usort/1"]; -usort(suite) -> - [umerge, rumerge, usort_1, usort_rand, usort_stable]. usort_1(suite) -> []; usort_1(doc) -> [""]; @@ -750,11 +771,6 @@ ucheck_stability(L) -> U = lists:usort(L), check_stab(L, U, S, "usort/1", "ukeysort/2"). -keysort(doc) -> - ["Tests lists:keysort/2"]; -keysort(suite) -> - [keymerge, rkeymerge, - keysort_1, keysort_rand, keysort_i, keysort_stable, keysort_error]. keymerge(doc) -> ["Key merge two lists."]; keymerge(suite) -> []; @@ -946,11 +962,6 @@ keycompare(I, J, A, B) when element(I, A) == element(I, B), element(J, A) =< element(J, B) -> ok. -ukeysort(doc) -> - ["Tests lists:ukeysort/2"]; -ukeysort(suite) -> - [ukeymerge, rukeymerge, - ukeysort_1, ukeysort_rand, ukeysort_i, ukeysort_stable, ukeysort_error]. ukeymerge(suite) -> []; ukeymerge(doc) -> ["Merge two lists while removing duplicates."]; @@ -1240,11 +1251,6 @@ ukeycompare(I, J, A, B) when A =/= B, ok. -funsort(doc) -> - ["Tests lists:sort/2"]; -funsort(suite) -> - [funmerge, rfunmerge, - funsort_1, funsort_stable, funsort_error, funsort_rand]. funmerge(doc) -> ["Merge two lists using a fun."]; funmerge(suite) -> []; @@ -1377,11 +1383,6 @@ funsort_check(I, Input, Expected) -> ?line Expected = funsort(I, Input), check_sorted(I, Input, Expected). -ufunsort(doc) -> - ["Tests lists:usort/2"]; -ufunsort(suite) -> - [ufunmerge, rufunmerge, - ufunsort_1, ufunsort_stable, ufunsort_error, ufunsort_rand]. ufunmerge(suite) -> []; ufunmerge(doc) -> ["Merge two lists while removing duplicates using a fun."]; @@ -2076,12 +2077,6 @@ rkeymerge2_2(_I, T1, _E1, [], M, H1) -> %%%------------------------------------------------------------ -seq(doc) -> - ["Tests lists:seq/3"]; -seq(suite) -> - [ - seq_loop, - seq_2, seq_3, seq_2_e, seq_3_e]. seq_loop(doc) -> ["Test for infinite loop (OTP-2404)."]; @@ -2229,10 +2224,6 @@ property(From, To, Step) -> %%%------------------------------------------------------------ -sublist(doc) -> - ["Tests lists:sublist/[2,3]"]; -sublist(suite) -> - [sublist_2, sublist_3, sublist_2_e, sublist_3_e]. -define(sublist_error2(X,Y), ?line {'EXIT', _} = (catch lists:sublist(X,Y))). -define(sublist_error3(X,Y,Z), ?line {'EXIT', _} = (catch lists:sublist(X,Y,Z))). @@ -2326,10 +2317,6 @@ sublist_3_e(Config) when is_list(Config) -> %%%------------------------------------------------------------ -flatten(doc) -> - ["Tests lists:flatten/[1,2]"]; -flatten(suite) -> - [flatten_1, flatten_2, flatten_1_e, flatten_2_e]. -define(flatten_error1(X), ?line {'EXIT', _} = (catch lists:flatten(X))). -define(flatten_error2(X,Y), ?line {'EXIT', _} = (catch lists:flatten(X,Y))). @@ -2489,10 +2476,6 @@ filpart(F, All, Exp) -> Other = lists:filter(fun(E) -> not F(E) end, All), {Exp,Other} = lists:partition(F, All). -tickets(doc) -> - ["Ticktes."]; -tickets(suite) -> - [otp_5939, otp_6023, otp_6606, otp_7230]. otp_5939(doc) -> ["OTP-5939. Guard tests added."]; otp_5939(suite) -> []; diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index 92b7dc6483..e39b4b9297 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -18,12 +18,23 @@ %% -module(log_mf_h_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/1, test/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, test/1]). + +all() -> +[test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [test]. %%----------------------------------------------------------------- diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 5c995203ef..0e490d75ad 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -19,9 +19,9 @@ -module(ms_transform_SUITE). -author('pan@erix.ericsson.se'). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic_ets/1]). -export([basic_dbg/1]). -export([from_shell/1]). @@ -48,11 +48,22 @@ end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). -all(suite) -> [from_shell,basic_ets,basic_dbg,records,record_index,multipass, - bitsyntax, record_defaults, andalso_orelse, - float_1_function, action_function, - warnings, - top_match, old_guards, autoimported, semicolon]. +all() -> +[from_shell, basic_ets, basic_dbg, records, + record_index, multipass, bitsyntax, record_defaults, + andalso_orelse, float_1_function, action_function, + warnings, top_match, old_guards, autoimported, + semicolon]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% This may be subject to change -define(WARN_NUMBER_SHADOW,50). diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index d6677d3c68..9b8a78dfbb 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -23,10 +23,10 @@ %% %%-define(STANDALONE,1). --export([all/1, crash/1, sync_start/1, sync_start_nolink/1, sync_start_link/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, spawn_opt/1, sp1/0, sp2/0, sp3/1, sp4/2, sp5/1, hibernate/1]). --export([tickets/1, otp_6345/1]). +-export([ otp_6345/1]). -export([hib_loop/1, awaken/1]). @@ -40,12 +40,24 @@ -ifdef(STANDALONE). -define(line, noop, ). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. -all(suite) -> [crash, sync_start, spawn_opt, hibernate, tickets]. +all() -> +[crash, {group, sync_start}, spawn_opt, hibernate, + {group, tickets}]. + +groups() -> + [{tickets, [], [otp_6345]}, + {sync_start, [], [sync_start_nolink, sync_start_link]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> [otp_6345]. %%----------------------------------------------------------------- %% We don't have to test that spwn and spawn_link actually spawns @@ -127,7 +139,6 @@ crash(Config) when is_list(Config) -> ok end. -sync_start(suite) -> [sync_start_nolink, sync_start_link]. sync_start_nolink(Config) when is_list(Config) -> _Pid = spawn_link(?MODULE, sp5, [self()]), diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index ac1c735b2e..d34ceba4e6 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -43,7 +43,7 @@ -define(testcase, current_testcase). % don't know -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). -define(testcase, ?config(?TESTCASE, Config)). @@ -51,35 +51,35 @@ -include_lib("stdlib/include/ms_transform.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([parse_transform/1, +-export([ badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, filter_var/1, single/1, exported_var/1, generator_vars/1, nomatch/1, errors/1, pattern/1, - evaluation/1, + eval/1, cursor/1, fold/1, eval_unique/1, eval_cache/1, append/1, evaluator/1, string_to_handle/1, table/1, process_dies/1, sort/1, keysort/1, filesort/1, cache/1, cache_list/1, filter/1, info/1, nested_info/1, lookup1/1, lookup2/1, lookup_rec/1, indices/1, pre_fun/1, skip_filters/1, - table_impls/1, + ets/1, dets/1, - join/1, + join_option/1, join_filter/1, join_lookup/1, join_merge/1, join_sort/1, join_complex/1, - tickets/1, + otp_5644/1, otp_5195/1, otp_6038_bug/1, otp_6359/1, otp_6562/1, otp_6590/1, otp_6673/1, otp_6964/1, otp_7114/1, otp_7238/1, otp_7232/1, otp_7552/1, otp_6674/1, otp_7714/1, manpage/1, - compat/1, + backward/1, forward/1]). %% Internal exports. @@ -119,12 +119,39 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [parse_transform, evaluation, table_impls, join, tickets, manpage, compat]. +all() -> +[{group, parse_transform}, {group, evaluation}, + {group, table_impls}, {group, join}, {group, tickets}, + manpage, {group, compat}]. + +groups() -> + [{parse_transform, [], + [badarg, nested_qlc, unused_var, lc, fun_clauses, + filter_var, single, exported_var, generator_vars, + nomatch, errors, pattern]}, + {evaluation, [], + [eval, cursor, fold, eval_unique, eval_cache, append, + evaluator, string_to_handle, table, process_dies, sort, + keysort, filesort, cache, cache_list, filter, info, + nested_info, lookup1, lookup2, lookup_rec, indices, + pre_fun, skip_filters]}, + {table_impls, [], [ets, dets]}, + {join, [], + [join_option, join_filter, join_lookup, join_merge, + join_sort, join_complex]}, + {tickets, [], + [otp_5644, otp_5195, otp_6038_bug, otp_6359, otp_6562, + otp_6590, otp_6673, otp_6964, otp_7114, otp_7232, + otp_7238, otp_7552, otp_6674, otp_7714]}, + {compat, [], [backward, forward]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -parse_transform(suite) -> - [badarg, nested_qlc, unused_var, lc, fun_clauses, filter_var, - single, exported_var, generator_vars, nomatch, errors, pattern]. badarg(doc) -> "Badarg."; @@ -461,11 +488,6 @@ pattern(Config) when is_list(Config) -> -record(k, {t,v}).\n">>, Ts), ok. -evaluation(suite) -> - [eval, cursor, fold, eval_unique, eval_cache, append, evaluator, - string_to_handle, table, process_dies, sort, keysort, filesort, cache, - cache_list, filter, info, nested_info, lookup1, lookup2, lookup_rec, - indices, pre_fun, skip_filters]. eval(doc) -> "eval/2"; @@ -4297,8 +4319,6 @@ skip_filters(Config) when is_list(Config) -> ok. -table_impls(suite) -> - [ets, dets]. ets(doc) -> "ets:table/1,2."; @@ -4445,9 +4465,6 @@ dets(Config) when is_list(Config) -> _ = file:delete(Fname), ok. -join(suite) -> - [join_option, join_filter, join_lookup, join_merge, - join_sort, join_complex]. join_option(doc) -> "The 'join' option (any, lookup, merge, nested_loop). Also cache/unique."; @@ -5729,10 +5746,6 @@ join_complex(Config) when is_list(Config) -> ok. -tickets(suite) -> - [otp_5644, otp_5195, otp_6038_bug, otp_6359, otp_6562, otp_6590, - otp_6673, otp_6964, otp_7114, otp_7232, otp_7238, otp_7552, otp_6674, - otp_7714]. otp_5644(doc) -> "OTP-5644. Handle the new language element M:F/A."; @@ -7378,8 +7391,6 @@ gb_iter(I0, N, EFun) -> end. ">>. -compat(suite) -> - [backward, forward]. backward(doc) -> "OTP-6674. Join info and extra constants."; diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index da47fc68bc..ed777df0a9 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -17,13 +17,13 @@ %% %CopyrightEnd% %% -module(queue_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -36,10 +36,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for queue."]; -all(suite) -> - [do, to_list, io_test, op_test, error, oops]. +all() -> +[do, to_list, io_test, op_test, error, oops]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + do(doc) -> [""]; diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index 8c840288dc..ed56f8a8ac 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -17,13 +17,13 @@ %% %CopyrightEnd% -module(random_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([interval_1/1, seed0/1, seed/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -36,10 +36,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test cases for random."]; -all(suite) -> - [interval_1, seed0, seed]. +all() -> +[interval_1, seed0, seed]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + seed0(doc) -> ["Test that seed is set implicitly, and always the same."]; diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index 46a84d4e24..9a174f2186 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -18,12 +18,27 @@ %% -module(re_SUITE). --export([all/1, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> [pcre,compile_options,run_options,combined_options,replace_autogen,global_capture,replace_input_types,replace_return,split_autogen,split_options,split_specials,error_handling,pcre_cve_2008_2371,pcre_compile_workspace_overflow,re_infinite_loop]. +all() -> +[pcre, compile_options, run_options, combined_options, + replace_autogen, global_capture, replace_input_types, + replace_return, split_autogen, split_options, + split_specials, error_handling, pcre_cve_2008_2371, + pcre_compile_workspace_overflow, re_infinite_loop]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + pcre(doc) -> ["Run all applicable tests from the PCRE testsuites."]; diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index 5acd98ee48..112e07bcfd 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -37,7 +37,7 @@ -export([config/2]). -define(fmt(A,B),io:format(A,B)). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(fmt(A,B),test_server:format(A,B)). -endif. @@ -58,7 +58,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/1,select_test/1,init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, return_values/1]). init_per_testcase(_Case, Config) when is_list(Config) -> @@ -70,10 +70,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test ets:select"]; -all(suite) -> - [return_values, select_test]. +all() -> +[return_values, select_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + select_test(suite) -> []; diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index 3660aca0c7..54937afb33 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -22,13 +22,13 @@ -module(sets_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,add_element/1,del_element/1, subtract/1,intersection/1,union/1,is_subset/1, is_set/1,fold/1,filter/1, take_smallest/1,take_largest/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(lists, [foldl/3,reverse/1]). @@ -41,10 +41,20 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [create,add_element,del_element,subtract, - intersection,union,is_subset,is_set,fold,filter, - take_smallest,take_largest]. +all() -> +[create, add_element, del_element, subtract, + intersection, union, is_subset, is_set, fold, filter, + take_smallest, take_largest]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + create(Config) when is_list(Config) -> test_all(fun create_1/1). diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index a5911ec9c5..c06bcb18ce 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -17,20 +17,20 @@ %% %CopyrightEnd% %% -module(shell_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([forget/1, records/1, known_bugs/1, otp_5226/1, otp_5327/1, otp_5435/1, otp_5195/1, otp_5915/1, otp_5916/1, - bits/1, bs_match_misc_SUITE/1, bs_match_int_SUITE/1, + bs_match_misc_SUITE/1, bs_match_int_SUITE/1, bs_match_tail_SUITE/1, bs_match_bin_SUITE/1, bs_construct_SUITE/1, - refman/1, refman_bit_syntax/1, - progex/1, progex_bit_syntax/1, progex_records/1, + refman_bit_syntax/1, + progex_bit_syntax/1, progex_records/1, progex_lc/1, progex_funs/1, - tickets/1, otp_5990/1, otp_6166/1, otp_6554/1, otp_6785/1, + otp_5990/1, otp_6166/1, otp_6554/1, otp_6785/1, otp_7184/1, otp_7232/1, otp_8393/1]). --export([restricted/1, start_restricted_from_shell/1, +-export([ start_restricted_from_shell/1, start_restricted_on_command_line/1,restricted_local/1]). %% Internal export. @@ -50,7 +50,7 @@ config(priv_dir,_) -> ".". -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). @@ -71,18 +71,36 @@ end_per_testcase(_Case, Config) -> ok. -endif. -all(doc) -> - ["Test cases for the 'shell' module."]; -all(suite) -> - [forget, records, known_bugs, otp_5226, otp_5327, otp_5435, otp_5195, - otp_5915, otp_5916, bits, refman, progex, tickets, restricted]. +all() -> +[forget, records, known_bugs, otp_5226, otp_5327, + otp_5435, otp_5195, otp_5915, otp_5916, {group, bits}, + {group, refman}, {group, progex}, {group, tickets}, + {group, restricted}]. + +groups() -> + [{restricted, [], + [start_restricted_from_shell, + start_restricted_on_command_line, restricted_local]}, + {bits, [], + [bs_match_misc_SUITE, bs_match_tail_SUITE, + bs_match_bin_SUITE, bs_construct_SUITE]}, + {refman, [], [refman_bit_syntax]}, + {progex, [], + [progex_bit_syntax, progex_records, progex_lc, + progex_funs]}, + {tickets, [], + [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, + otp_7232, otp_8393]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -record(state, {bin, reply, leader}). -restricted(doc) -> - ["Test restricted_shell"]; -restricted(suite) -> - [start_restricted_from_shell,start_restricted_on_command_line,restricted_local]. start_restricted_from_shell(doc) -> ["Test that a restricted shell can be started from the normal shell"]; @@ -797,9 +815,6 @@ otp_5916(Config) when is_list(Config) -> [ok] = scan(C), ok. -bits(suite) -> - [bs_match_misc_SUITE, % bs_match_int_SUITE/, - bs_match_tail_SUITE, bs_match_bin_SUITE, bs_construct_SUITE]. bs_match_misc_SUITE(doc) -> ["OTP-5327. Adopted from parts of emulator/test/bs_match_misc_SUITE.erl."]; @@ -1520,8 +1535,6 @@ evaluate(Str, Vars) -> Result end. -refman(suite) -> - [refman_bit_syntax]. refman_bit_syntax(doc) -> ["Bit syntax examples from the Reference Manual. OTP-5237."]; @@ -1564,8 +1577,6 @@ refman_bit_syntax(Config) when is_list(Config) -> ?line <<2,4,6>> = << << (X*2) >> || <> <= << 1,2,3 >> >>, ok. -progex(suite) -> - [progex_bit_syntax, progex_records, progex_lc, progex_funs]. -define(IP_VERSION, 4). -define(IP_MIN_HDR_LEN, 5). @@ -2256,8 +2267,6 @@ progex_funs(Config) when is_list(Config) -> ?line [ok] = scan(Test2_shell), ok. -tickets(suite) -> - [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, otp_7232, otp_8393]. otp_5990(doc) -> "OTP-5990. {erlang,is_record}."; diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl index 5c1282fe9b..94ba327f51 100644 --- a/lib/stdlib/test/slave_SUITE.erl +++ b/lib/stdlib/test/slave_SUITE.erl @@ -18,17 +18,27 @@ %% -module(slave_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, t_start/1, t_start_link/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, start_link_nodedown/1, errors/1]). %% Internal exports. -export([fun_init/1, test_errors/1]). -export([timeout_test/1, auth_test/1, rsh_test/1, start_a_slave/3]). -all(suite) -> - [t_start_link, start_link_nodedown, t_start, errors]. +all() -> +[t_start_link, start_link_nodedown, t_start, errors]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + t_start_link(suite) -> []; t_start_link(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index df85351222..fcf006da2b 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -26,13 +26,13 @@ -define(config(X,Y), foo). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -endif. --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([sofs/1, from_term_1/1, set_1/1, from_sets_1/1, relation_1/1, +-export([ from_term_1/1, set_1/1, from_sets_1/1, relation_1/1, a_function_1/1, family_1/1, projection/1, relation_to_family_1/1, domain_1/1, range_1/1, image/1, inverse_image/1, inverse_1/1, converse_1/1, no_elements_1/1, @@ -47,7 +47,7 @@ multiple_relative_product/1, digraph/1, constant_function/1, misc/1]). --export([sofs_family/1, family_specification/1, +-export([ family_specification/1, family_domain_1/1, family_range_1/1, family_to_relation_1/1, union_of_family_1/1, intersection_of_family_1/1, @@ -85,8 +85,38 @@ -compile({inline,[{eval,2}]}). -all(suite) -> - [sofs, sofs_family]. +all() -> +[{group, sofs}, {group, sofs_family}]. + +groups() -> + [{sofs, [], + [from_term_1, set_1, from_sets_1, relation_1, + a_function_1, family_1, relation_to_family_1, domain_1, + range_1, image, inverse_image, inverse_1, converse_1, + no_elements_1, substitution, restriction, drestriction, + projection, strict_relation_1, extension, + weak_relation_1, to_sets_1, specification, union_1, + intersection_1, difference, symdiff, + symmetric_partition, is_sofs_set_1, is_set_1, is_equal, + is_subset, is_a_function_1, is_disjoint, join, + canonical, composite_1, relative_product_1, + relative_product_2, product_1, partition_1, partition_3, + multiple_relative_product, digraph, constant_function, + misc]}, + {sofs_family, [], + [family_specification, family_domain_1, family_range_1, + family_to_relation_1, union_of_family_1, + intersection_of_family_1, family_projection, + family_difference, family_intersection_1, + family_intersection_2, family_union_1, family_union_2, + partition_family]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog=?t:timetrap(?t:minutes(2)), @@ -100,18 +130,6 @@ end_per_testcase(_Case, Config) -> %% [{2,b},{1,a,b}] == lists:sort([{2,b},{1,a,b}]) %% [{1,a,b},{2,b}] == lists:keysort(1,[{2,b},{1,a,b}]) -sofs(suite) -> - [from_term_1, set_1, from_sets_1, relation_1, a_function_1, - family_1, relation_to_family_1, domain_1, range_1, image, - inverse_image, inverse_1, converse_1, no_elements_1, - substitution, restriction, drestriction, projection, - strict_relation_1, extension, weak_relation_1, to_sets_1, - specification, union_1, intersection_1, difference, symdiff, - symmetric_partition, is_sofs_set_1, is_set_1, is_equal, - is_subset, is_a_function_1, is_disjoint, join, canonical, - composite_1, relative_product_1, relative_product_2, product_1, - partition_1, partition_3, multiple_relative_product, digraph, - constant_function, misc]. from_term_1(suite) -> []; from_term_1(doc) -> [""]; @@ -1934,12 +1952,6 @@ relational_restriction(R) -> Fun = fun(S) -> no_elements(S) > 1 end, family_to_relation(family_specification(Fun, relation_to_family(R))). -sofs_family(suite) -> - [family_specification, family_domain_1, family_range_1, - family_to_relation_1, union_of_family_1, intersection_of_family_1, - family_projection, family_difference, - family_intersection_1, family_intersection_2, - family_union_1, family_union_2, partition_family]. family_specification(suite) -> []; family_specification(doc) -> [""]; diff --git a/lib/stdlib/test/stdlib.spec b/lib/stdlib/test/stdlib.spec index bbfb43bd15..e67ac71c2f 100644 --- a/lib/stdlib/test/stdlib.spec +++ b/lib/stdlib/test/stdlib.spec @@ -1,4 +1 @@ -{topcase, {dir, "../stdlib_test"}}. -%{skip,{dets_SUITE,open_file_1,"Crashes Windows tests"}}. -%{skip,{dets_SUITE,fold,"Crashes Windows tests"}}. -%{skip,{dets_SUITE,match,"Crashes Windows tests"}}. +{suites,"stdlib_test",all}. diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index dc815dbb59..16832a142b 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -20,7 +20,7 @@ %%% Purpose:Stdlib application test suite. %%%----------------------------------------------------------------- -module(stdlib_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). @@ -28,7 +28,7 @@ -define(application, stdlib). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -38,10 +38,18 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [?cases]. +all() -> +[[app_test]]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index 01c3c53863..165eaf5f31 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -20,14 +20,14 @@ %%% Purpose: string test suite. %%%----------------------------------------------------------------- -module(string_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -40,14 +40,21 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [len,equal,concat,chr_rchr,str_rstr, - span_cspan,substr,tokens,chars, - copies,words,strip,sub_word,left_right, - sub_string,centre, join, - to_integer,to_float,to_upper_to_lower]. +all() -> +[len, equal, concat, chr_rchr, str_rstr, span_cspan, + substr, tokens, chars, copies, words, strip, sub_word, + left_right, sub_string, centre, join, to_integer, + to_float, to_upper_to_lower]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 039ea298c4..321e21814a 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -20,33 +20,33 @@ -module(supervisor_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Testserver specific export --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %% Indirect spawn export -export([init/1]). %% API tests --export([sup_start/1, sup_start_normal/1, sup_start_ignore_init/1, +-export([ sup_start_normal/1, sup_start_ignore_init/1, sup_start_ignore_child/1, sup_start_error_return/1, - sup_start_fail/1, sup_stop/1, sup_stop_infinity/1, + sup_start_fail/1, sup_stop_infinity/1, sup_stop_timeout/1, sup_stop_brutal_kill/1, child_adm/1, child_adm_simple/1, child_specs/1, extra_return/1]). %% Tests concept permanent, transient and temporary --export([normal_termination/1, permanent_normal/1, transient_normal/1, - temporary_normal/1, abnormal_termination/1, +-export([ permanent_normal/1, transient_normal/1, + temporary_normal/1, permanent_abnormal/1, transient_abnormal/1, temporary_abnormal/1]). %% Restart strategy tests --export([restart_one_for_one/1, one_for_one/1, - one_for_one_escalation/1, restart_one_for_all/1, one_for_all/1, - one_for_all_escalation/1, restart_simple_one_for_one/1, +-export([ one_for_one/1, + one_for_one_escalation/1, one_for_all/1, + one_for_all_escalation/1, simple_one_for_one/1, simple_one_for_one_escalation/1, - restart_rest_for_one/1, rest_for_one/1, rest_for_one_escalation/1, + rest_for_one/1, rest_for_one_escalation/1, simple_one_for_one_extra/1]). %% Misc tests @@ -54,14 +54,46 @@ %------------------------------------------------------------------------- -all(suite) -> - {req,[stdlib], - [sup_start, sup_stop, child_adm, - child_adm_simple, extra_return, child_specs, - restart_one_for_one, restart_one_for_all, - restart_simple_one_for_one, restart_rest_for_one, - normal_termination, abnormal_termination, child_unlink, tree, - count_children_memory]}. +all() -> +[{group, sup_start}, {group, sup_stop}, child_adm, + child_adm_simple, extra_return, child_specs, + {group, restart_one_for_one}, + {group, restart_one_for_all}, + {group, restart_simple_one_for_one}, + {group, restart_rest_for_one}, + {group, normal_termination}, + {group, abnormal_termination}, child_unlink, tree, + count_children_memory]. + +groups() -> + [{sup_start, [], + [sup_start_normal, sup_start_ignore_init, + sup_start_ignore_child, sup_start_error_return, + sup_start_fail]}, + {sup_stop, [], + [sup_stop_infinity, sup_stop_timeout, + sup_stop_brutal_kill]}, + {normal_termination, [], + [permanent_normal, transient_normal, temporary_normal]}, + {abnormal_termination, [], + [permanent_abnormal, transient_abnormal, + temporary_abnormal]}, + {restart_one_for_one, [], + [one_for_one, one_for_one_escalation]}, + {restart_one_for_all, [], + [one_for_all, one_for_all_escalation]}, + {restart_simple_one_for_one, [], + [simple_one_for_one, simple_one_for_one_extra, + simple_one_for_one_escalation]}, + {restart_rest_for_one, [], + [rest_for_one, rest_for_one_escalation]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + start(InitResult) -> @@ -88,11 +120,6 @@ get_child_counts(Supervisor) -> % %------------------------------------------------------------------------- -sup_start(doc) -> - ["Test start of a supervisor."]; -sup_start(suite) -> - [sup_start_normal, sup_start_ignore_init, sup_start_ignore_child, - sup_start_error_return, sup_start_fail]. %------------------------------------------------------------------------- sup_start_normal(doc) -> @@ -192,10 +219,6 @@ sup_start_fail(Config) when is_list(Config) -> end, ok. %------------------------------------------------------------------------- -sup_stop(doc) -> - ["Tests that the supervisor shoutdowns its children if it is " - "shutdown itself."]; -sup_stop(suite) -> [sup_stop_infinity, sup_stop_timeout, sup_stop_brutal_kill]. %------------------------------------------------------------------------- @@ -550,10 +573,6 @@ child_specs(Config) when is_list(Config) -> ?line ok = supervisor:check_childspecs([C4]), ok. %------------------------------------------------------------------------- -normal_termination(doc) -> - ["Testes the supervisors behaviour if a child dies with reason normal"]; -normal_termination(suite) -> - [permanent_normal, transient_normal, temporary_normal]. %------------------------------------------------------------------------- permanent_normal(doc) -> @@ -616,10 +635,6 @@ temporary_normal(Config) when is_list(Config) -> ok. %------------------------------------------------------------------------- -abnormal_termination(doc) -> - ["Testes the supervisors behaviour if a child dies with reason abnormal"]; -abnormal_termination(suite) -> - [permanent_abnormal, transient_abnormal, temporary_abnormal]. %------------------------------------------------------------------------- permanent_abnormal(doc) -> @@ -688,10 +703,6 @@ temporary_abnormal(Config) when is_list(Config) -> ok. %------------------------------------------------------------------------- -restart_one_for_one(doc) -> - ["Test that the one_for_one strategy works."]; - -restart_one_for_one(suite) -> [one_for_one, one_for_one_escalation]. %------------------------------------------------------------------------- one_for_one(doc) -> @@ -772,11 +783,6 @@ one_for_one_escalation(Config) when is_list(Config) -> end, ok. %------------------------------------------------------------------------- -restart_one_for_all(doc) -> - ["Test that the one_for_all strategy works."]; - -restart_one_for_all(suite) -> - [one_for_all, one_for_all_escalation]. %------------------------------------------------------------------------- one_for_all(doc) -> @@ -866,12 +872,6 @@ one_for_all_escalation(Config) when is_list(Config) -> ok. %------------------------------------------------------------------------- -restart_simple_one_for_one(doc) -> - ["Test that the simple_one_for_one strategy works."]; - -restart_simple_one_for_one(suite) -> - [simple_one_for_one, simple_one_for_one_extra, - simple_one_for_one_escalation]. %------------------------------------------------------------------------- simple_one_for_one(doc) -> @@ -990,9 +990,6 @@ simple_one_for_one_escalation(Config) when is_list(Config) -> end, ok. %------------------------------------------------------------------------- -restart_rest_for_one(doc) -> - ["Test that the rest_for_one strategy works."]; -restart_rest_for_one(suite) -> [rest_for_one, rest_for_one_escalation]. %------------------------------------------------------------------------- rest_for_one(doc) -> diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index aab2b19ccb..a7aec23a3d 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -17,16 +17,27 @@ %% %CopyrightEnd% %% -module(supervisor_bridge_SUITE). --export([all/1,starting/1,mini_terminate/1,mini_die/1,badstart/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). -export([client/1,init/1,internal_loop_init/1,terminate/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(bridge_name,supervisor_bridge_SUITE_server). -define(work_bridge_name,work_supervisor_bridge_SUITE_server). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> [starting,mini_terminate,mini_die,badstart]. +all() -> +[starting, mini_terminate, mini_die, badstart]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index 81b6613a86..5d6d0a416c 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -17,9 +17,9 @@ %% %CopyrightEnd% %% -module(sys_SUITE). --export([all/1,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). -export([handle_call/3,terminate/2,init/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(server,sys_SUITE_server). @@ -29,7 +29,18 @@ %% system messages at all. -all(suite) -> [log,log_to_file,stats,trace,suspend,install]. +all() -> +[log, log_to_file, stats, trace, suspend, install]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index 7646f4c249..b9f4f2cad8 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -18,21 +18,30 @@ %% -module(tar_SUITE). --export([all/1, borderline/1, atomic/1, long_names/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, create_long_names/1, bad_tar/1, errors/1, extract_from_binary/1, extract_from_binary_compressed/1, extract_from_open_file/1, symlinks/1, open_add_close/1, cooked_compressed/1, memory/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> [borderline, atomic, long_names, create_long_names, - bad_tar, errors, - extract_from_binary, extract_from_binary_compressed, - extract_from_open_file, - symlinks, open_add_close, cooked_compressed, - memory]. +all() -> +[borderline, atomic, long_names, create_long_names, + bad_tar, errors, extract_from_binary, + extract_from_binary_compressed, extract_from_open_file, + symlinks, open_add_close, cooked_compressed, memory]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + borderline(doc) -> ["Test creating, listing and extracting one file from an archive", diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl index 5f38c91c64..87b1495a58 100644 --- a/lib/stdlib/test/timer_SUITE.erl +++ b/lib/stdlib/test/timer_SUITE.erl @@ -18,12 +18,12 @@ %% -module(timer_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([do_big_test/1]). -export([big_test/1, collect/3, i_t/3, a_t/2]). -export([do_nrev/1, internal_watchdog/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test suite for timer module. This is a really nasty test it runs a %% lot of timeouts and then checks in the end if any of them was @@ -51,7 +51,18 @@ %% amount of load. The test suite should also include tests that test the %% interface of the timer module. -all(suite) -> [do_big_test]. +all() -> +[do_big_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% ------------------------------------------------------- %% diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 69acc357aa..8e209eab35 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -21,7 +21,7 @@ -module(timer_simple_SUITE). %% external --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, apply_after/1, send_after1/1, @@ -49,31 +49,27 @@ timer/4, timer/5]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(MAXREF, (1 bsl 18)). -define(REFMARG, 30). -all(doc) -> "Test of the timer module."; -all(suite) -> - [apply_after, - send_after1, - send_after2, - send_after3, - exit_after1, - exit_after2, - kill_after1, - kill_after2, - apply_interval, - send_interval1, - send_interval2, - send_interval3, - send_interval4, - cancel1, - cancel2, - tc, - unique_refs, - timer_perf]. +all() -> +[apply_after, send_after1, send_after2, send_after3, + exit_after1, exit_after2, kill_after1, kill_after2, + apply_interval, send_interval1, send_interval2, + send_interval3, send_interval4, cancel1, cancel2, tc, + unique_refs, timer_perf]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_, Config) when is_list(Config) -> timer:start(), diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index dc01adb5a8..b5436696e9 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -18,9 +18,9 @@ %% -module(unicode_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, utf8_illegal_sequences_bif/1, @@ -38,8 +38,20 @@ end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [utf8_illegal_sequences_bif,utf16_illegal_sequences_bif,random_lists,roundtrips,latin1,exceptions]. +all() -> +[utf8_illegal_sequences_bif, + utf16_illegal_sequences_bif, random_lists, roundtrips, + latin1, exceptions]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + exceptions(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl index c8cc82f61e..35c21861c1 100644 --- a/lib/stdlib/test/win32reg_SUITE.erl +++ b/lib/stdlib/test/win32reg_SUITE.erl @@ -18,13 +18,23 @@ %% -module(win32reg_SUITE). --export([all/1,long/1,evil_write/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,long/1,evil_write/1]). -export([ostype/1,fini/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[long, evil_write]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [{conf,ostype,[long,evil_write],fini}]. ostype(Config) when is_list(Config) -> case os:type() of diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index 4b332d9ac0..670c131afb 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -21,30 +21,29 @@ -module(y2k_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, date_1999_01_01/1, date_1999_02_28/1, date_1999_09_09/1, date_2000_01_01/1, date_2000_02_29/1, date_2001_01_01/1, date_2001_02_29/1, date_2004_02_29/1 ]). -all(doc) -> - "This is the test suite for year 2000. Eight dates according " - "to Ericsson Corporate Millennium Test Specification " - "(LME/DT-98:1097 are tested."; - -all(suite) -> - [date_1999_01_01, - date_1999_02_28, - date_1999_09_09, - date_2000_01_01, - date_2000_02_29, - date_2001_01_01, - date_2001_02_29, - date_2004_02_29 - ]. +all() -> +[date_1999_01_01, date_1999_02_28, date_1999_09_09, + date_2000_01_01, date_2000_02_29, date_2001_01_01, + date_2001_02_29, date_2004_02_29]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + date_1999_01_01(doc) -> "#1 : 1999-01-01: test roll-over from 1998-12-31 to 1999-01-01."; diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl index 48b14396c1..06228317ce 100644 --- a/lib/stdlib/test/zip_SUITE.erl +++ b/lib/stdlib/test/zip_SUITE.erl @@ -18,7 +18,7 @@ %% -module(zip_SUITE). --export([all/1, borderline/1, atomic/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, bad_zip/1, unzip_from_binary/1, unzip_to_binary/1, zip_to_binary/1, unzip_options/1, zip_options/1, list_dir_options/1, aliases/1, @@ -26,18 +26,26 @@ compress_control/1, foldl/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/file.hrl"). -include_lib("stdlib/include/zip.hrl"). -all(suite) -> [borderline, atomic, bad_zip, - unzip_from_binary, unzip_to_binary, - zip_to_binary, - unzip_options, zip_options, list_dir_options, aliases, - openzip_api, zip_api, unzip_jar, - compress_control, - foldl]. +all() -> +[borderline, atomic, bad_zip, unzip_from_binary, + unzip_to_binary, zip_to_binary, unzip_options, + zip_options, list_dir_options, aliases, openzip_api, + zip_api, unzip_jar, compress_control, foldl]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + borderline(doc) -> ["Test creating, listing and extracting one file from an archive " -- cgit v1.2.3 From e895e8ae96264ed7b5a0cb5f30f5a0af3d076831 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:33:57 +0200 Subject: Update ssl tests to conform with common_test standard --- lib/ssl/test/old_ssl_active_SUITE.erl | 36 +++++----- lib/ssl/test/old_ssl_active_once_SUITE.erl | 38 +++++------ lib/ssl/test/old_ssl_dist_SUITE.erl | 20 ++++-- lib/ssl/test/old_ssl_misc_SUITE.erl | 24 ++++--- lib/ssl/test/old_ssl_passive_SUITE.erl | 36 +++++----- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 25 ++++--- lib/ssl/test/old_ssl_protocol_SUITE.erl | 25 ++++--- lib/ssl/test/old_ssl_verify_SUITE.erl | 24 ++++--- lib/ssl/test/old_transport_accept_SUITE.erl | 20 ++++-- lib/ssl/test/ssl.spec | 2 +- lib/ssl/test/ssl_basic_SUITE.erl | 77 ++++++++++++--------- lib/ssl/test/ssl_packet_SUITE.erl | 100 ++++++++++++++-------------- lib/ssl/test/ssl_payload_SUITE.erl | 42 ++++++------ lib/ssl/test/ssl_session_cache_SUITE.erl | 20 ++++-- lib/ssl/test/ssl_to_openssl_SUITE.erl | 68 ++++++++++--------- 15 files changed, 307 insertions(+), 250 deletions(-) diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index b3f02ecd22..5eb05ec743 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -40,7 +40,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). -define(MANYCONNS, ssl_test_MACHINE:many_conns()). @@ -53,22 +53,22 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of ssl.erl interface in active mode."; -all(suite) -> - {conf, - config, - [cinit_return_chkclose, - sinit_return_chkclose, - cinit_big_return_chkclose, - sinit_big_return_chkclose, - cinit_big_echo_chkclose, - cinit_huge_echo_chkclose, - sinit_big_echo_chkclose, - cinit_few_echo_chkclose, - cinit_many_echo_chkclose, - cinit_cnocert], - finish}. +all() -> +[cinit_return_chkclose, sinit_return_chkclose, + cinit_big_return_chkclose, sinit_big_return_chkclose, + cinit_big_echo_chkclose, cinit_huge_echo_chkclose, + sinit_big_echo_chkclose, cinit_few_echo_chkclose, + cinit_many_echo_chkclose, cinit_cnocert]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains, and record the number of available " diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index e693041ded..09e11503bf 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_once_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -40,7 +40,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). -define(MANYCONNS, ssl_test_MACHINE:many_conns()). @@ -53,23 +53,23 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of ssl.erl interface in passive mode."; -all(suite) -> - {conf, - config, - [server_accept_timeout, - cinit_return_chkclose, - sinit_return_chkclose, - cinit_big_return_chkclose, - sinit_big_return_chkclose, - cinit_big_echo_chkclose, - cinit_huge_echo_chkclose, - sinit_big_echo_chkclose, - cinit_few_echo_chkclose, - cinit_many_echo_chkclose, - cinit_cnocert], - finish}. +all() -> +[server_accept_timeout, cinit_return_chkclose, + sinit_return_chkclose, cinit_big_return_chkclose, + sinit_big_return_chkclose, cinit_big_echo_chkclose, + cinit_huge_echo_chkclose, sinit_big_echo_chkclose, + cinit_few_echo_chkclose, cinit_many_echo_chkclose, + cinit_cnocert]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_ssl_dist_SUITE.erl b/lib/ssl/test/old_ssl_dist_SUITE.erl index 912a6d2f9d..c0f2b45c91 100644 --- a/lib/ssl/test/old_ssl_dist_SUITE.erl +++ b/lib/ssl/test/old_ssl_dist_SUITE.erl @@ -29,13 +29,13 @@ %%%------------------------------------------------------------------- -module(old_ssl_dist_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(DEFAULT_TIMETRAP_SECS, 240). -define(AWAIT_SLL_NODE_UP_TIMEOUT, 30000). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, @@ -46,10 +46,18 @@ -record(node_handle, {connection_handler, socket, name, nodename}). -all(doc) -> - []; -all(suite) -> - [basic]. +all() -> +[basic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) -> add_ssl_opts_config(Config). diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index 2f5f6b82a4..e57960e0d3 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_misc_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -31,7 +31,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). -define(MANYCONNS, 5). @@ -44,14 +44,18 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of misc in ssl.erl interface."; -all(suite) -> - {conf, - config, - [seed, app], - finish - }. +all() -> +[seed, app]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index 6de58a4da4..dcaa2ea8d4 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_passive_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -40,7 +40,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). -define(MANYCONNS, ssl_test_MACHINE:many_conns()). @@ -53,22 +53,22 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of ssl.erl interface in passive mode."; -all(suite) -> - {conf, - config, - [server_accept_timeout, - cinit_return_chkclose, - sinit_return_chkclose, - cinit_big_return_chkclose, - sinit_big_return_chkclose, - cinit_big_echo_chkclose, - sinit_big_echo_chkclose, - cinit_few_echo_chkclose, - cinit_many_echo_chkclose, - cinit_cnocert], - finish}. +all() -> +[server_accept_timeout, cinit_return_chkclose, + sinit_return_chkclose, cinit_big_return_chkclose, + sinit_big_return_chkclose, cinit_big_echo_chkclose, + sinit_big_echo_chkclose, cinit_few_echo_chkclose, + cinit_many_echo_chkclose, cinit_cnocert]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index 4fa4b51392..cfff5d74b6 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_peer_cert_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -32,7 +32,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). @@ -44,15 +44,18 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of ssl verification and peer certificate retrieval."; -all(suite) -> - {conf, - config, - [cinit_plain, - cinit_both_verify, - cinit_cnocert], - finish}. +all() -> +[cinit_plain, cinit_both_verify, cinit_cnocert]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index a03333034a..2908de1450 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -20,13 +20,13 @@ %% -module(old_ssl_protocol_SUITE). --export([all/1, init_per_testcase/2, end_per_testcase/2, config/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, finish/1, sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, sslv2_tlsv1/1, sslv3_tlsv1/1, sslv2_sslv3_tlsv1/1]). -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). @@ -38,14 +38,19 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of configuration protocol_version."; -all(suite) -> - {conf, - config, - [sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, sslv3_tlsv1, - sslv2_sslv3_tlsv1], - finish}. +all() -> +[sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, + sslv3_tlsv1, sslv2_sslv3_tlsv1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index ff45c46317..e11d41b181 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_verify_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -31,7 +31,7 @@ -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, test_server_only/6]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ssl_test_MACHINE.hrl"). @@ -43,14 +43,18 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of ssl.erl interface in active mode."; -all(suite) -> - {conf, - config, - [cinit_both_verify, - cinit_cnocert], - finish}. +all() -> +[cinit_both_verify, cinit_cnocert]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index fccb07fc54..39c31922f7 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -19,14 +19,14 @@ %% -module(old_transport_accept_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). %% Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). -define(application, ssh). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -47,10 +47,18 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test transport_accept and ssl_accept"; -all(suite) -> - [config, echo_once, echo_twice, close_before_ssl_accept]. +all() -> +[config, echo_once, echo_twice, close_before_ssl_accept]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + config(doc) -> "Want to se what Config contains."; diff --git a/lib/ssl/test/ssl.spec b/lib/ssl/test/ssl.spec index 6ef4fb73db..65adb51d36 100644 --- a/lib/ssl/test/ssl.spec +++ b/lib/ssl/test/ssl.spec @@ -1 +1 @@ -{topcase, {dir, "../ssl_test"}}. +{suites,"ssl_test",all}. diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 6a1b83d344..56b623d551 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("public_key/include/public_key.hrl"). @@ -173,51 +173,64 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test the basic ssl functionality"]; - -all(suite) -> +all() -> [app, alerts, connection_info, protocol_versions, - empty_protocol_versions, controlling_process, controller_dies, - client_closes_socket, peercert, connect_dist, peername, sockname, - socket_options, misc_ssl_options, versions, cipher_suites, - upgrade, upgrade_with_timeout, tcp_connect, ipv6, ekeyfile, - ecertfile, ecacertfile, eoptions, shutdown, shutdown_write, - shutdown_both, shutdown_error, + empty_protocol_versions, controlling_process, + controller_dies, client_closes_socket, peercert, + connect_dist, peername, sockname, socket_options, + misc_ssl_options, versions, cipher_suites, upgrade, + upgrade_with_timeout, tcp_connect, ipv6, ekeyfile, + ecertfile, ecacertfile, eoptions, shutdown, + shutdown_write, shutdown_both, shutdown_error, ciphers_rsa_signed_certs, ciphers_rsa_signed_certs_ssl3, ciphers_rsa_signed_certs_openssl_names, ciphers_rsa_signed_certs_openssl_names_ssl3, - ciphers_dsa_signed_certs, - ciphers_dsa_signed_certs_ssl3, + ciphers_dsa_signed_certs, ciphers_dsa_signed_certs_ssl3, ciphers_dsa_signed_certs_openssl_names, ciphers_dsa_signed_certs_openssl_names_ssl3, anonymous_cipher_suites, default_reject_anonymous, send_close, - close_transport_accept, dh_params, server_verify_peer_passive, - server_verify_peer_active, server_verify_peer_active_once, + close_transport_accept, dh_params, + server_verify_peer_passive, server_verify_peer_active, + server_verify_peer_active_once, server_verify_none_passive, server_verify_none_active, - server_verify_none_active_once, server_verify_no_cacerts, - server_require_peer_cert_ok, server_require_peer_cert_fail, + server_verify_none_active_once, + server_verify_no_cacerts, server_require_peer_cert_ok, + server_require_peer_cert_fail, server_verify_client_once_passive, server_verify_client_once_active, - server_verify_client_once_active_once, client_verify_none_passive, - client_verify_none_active, client_verify_none_active_once, - reuse_session, reuse_session_expired, - server_does_not_want_to_reuse_session, client_renegotiate, - server_renegotiate, client_renegotiate_reused_session, - server_renegotiate_reused_session, client_no_wrap_sequence_number, - server_no_wrap_sequence_number, - extended_key_usage_verify_peer, extended_key_usage_verify_none, - no_authority_key_identifier, - invalid_signature_client, invalid_signature_server, cert_expired, - client_with_cert_cipher_suites_handshake, unknown_server_ca_fail, - der_input, unknown_server_ca_accept_verify_none, unknown_server_ca_accept_verify_peer, + server_verify_client_once_active_once, + client_verify_none_passive, client_verify_none_active, + client_verify_none_active_once, + reuse_session, + reuse_session_expired, + server_does_not_want_to_reuse_session, + client_renegotiate, server_renegotiate, + client_renegotiate_reused_session, + server_renegotiate_reused_session, + client_no_wrap_sequence_number, + server_no_wrap_sequence_number, extended_key_usage_verify_peer, + extended_key_usage_verify_none, + no_authority_key_identifier, invalid_signature_client, + invalid_signature_server, cert_expired, + client_with_cert_cipher_suites_handshake, + unknown_server_ca_fail, der_input, + unknown_server_ca_accept_verify_none, + unknown_server_ca_accept_verify_peer, unknown_server_ca_accept_backwardscompatibilty, - %different_ca_peer_sign, + %%different_ca_peer_sign, no_reuses_session_server_restart_new_cert, - no_reuses_session_server_restart_new_cert_file, reuseaddr - ]. + no_reuses_session_server_restart_new_cert_file, reuseaddr]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %% Test cases starts here. %%-------------------------------------------------------------------- diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index b1e585e39e..3b583b8e4d 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -23,7 +23,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(BYTE(X), X:8/unsigned-big-integer). -define(UINT16(X), X:16/unsigned-big-integer). @@ -118,56 +118,54 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test that erlang:decode_packet/3 seems to be handled correctly." - "We only use the most basic packet types in our tests as testing of" - "the packet types are for inet to verify" - ]; - -all(suite) -> - [packet_raw_passive_many_small, - packet_0_passive_many_small, packet_1_passive_many_small, - packet_2_passive_many_small, packet_4_passive_many_small, - packet_raw_passive_some_big, packet_0_passive_some_big, - packet_1_passive_some_big, - packet_2_passive_some_big, packet_4_passive_some_big, - packet_raw_active_once_many_small, - packet_0_active_once_many_small, packet_1_active_once_many_small, - packet_2_active_once_many_small, packet_4_active_once_many_small, - packet_raw_active_once_some_big, - packet_0_active_once_some_big, packet_1_active_once_some_big, - packet_2_active_once_some_big, packet_4_active_once_some_big, - packet_raw_active_many_small, packet_0_active_many_small, - packet_1_active_many_small, - packet_2_active_many_small, packet_4_active_many_small, - packet_raw_active_some_big, packet_0_active_some_big, - packet_1_active_some_big, packet_2_active_some_big, - packet_4_active_some_big, - packet_send_to_large, - packet_wait_passive, packet_wait_active, - packet_baddata_passive, packet_baddata_active, - packet_size_passive, packet_size_active, - packet_cdr_decode, - packet_cdr_decode_list, - packet_http_decode, - packet_http_decode_list, - packet_http_bin_decode_multi, - packet_http_error_passive, - packet_line_decode, - packet_line_decode_list, - packet_asn1_decode, - packet_asn1_decode_list, - packet_tpkt_decode, - packet_tpkt_decode_list, - %packet_fcgi_decode, - packet_sunrm_decode, - packet_sunrm_decode_list, - header_decode_one_byte, - header_decode_two_bytes, - header_decode_two_bytes_one_sent, - header_decode_two_bytes_two_sent - - ]. +all() -> +[packet_raw_passive_many_small, + packet_0_passive_many_small, + packet_1_passive_many_small, + packet_2_passive_many_small, + packet_4_passive_many_small, + packet_raw_passive_some_big, packet_0_passive_some_big, + packet_1_passive_some_big, packet_2_passive_some_big, + packet_4_passive_some_big, + packet_raw_active_once_many_small, + packet_0_active_once_many_small, + packet_1_active_once_many_small, + packet_2_active_once_many_small, + packet_4_active_once_many_small, + packet_raw_active_once_some_big, + packet_0_active_once_some_big, + packet_1_active_once_some_big, + packet_2_active_once_some_big, + packet_4_active_once_some_big, + packet_raw_active_many_small, + packet_0_active_many_small, packet_1_active_many_small, + packet_2_active_many_small, packet_4_active_many_small, + packet_raw_active_some_big, packet_0_active_some_big, + packet_1_active_some_big, packet_2_active_some_big, + packet_4_active_some_big, packet_send_to_large, + packet_wait_passive, packet_wait_active, + packet_baddata_passive, packet_baddata_active, + packet_size_passive, packet_size_active, + packet_cdr_decode, packet_cdr_decode_list, + packet_http_decode, packet_http_decode_list, + packet_http_bin_decode_multi, packet_http_error_passive, + packet_line_decode, packet_line_decode_list, + packet_asn1_decode, packet_asn1_decode_list, + packet_tpkt_decode, packet_tpkt_decode_list, + packet_sunrm_decode, packet_sunrm_decode_list, + header_decode_one_byte, header_decode_two_bytes, + header_decode_two_bytes_one_sent, + header_decode_two_bytes_two_sent]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index b19d1f286f..1c63006ac3 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -22,7 +22,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(TIMEOUT, 600000). @@ -99,24 +99,28 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test payload over ssl in all socket modes, active, active_once," - "and passive mode."]; - -all(suite) -> - [server_echos_passive_small, server_echos_active_once_small, - server_echos_active_small, - client_echos_passive_small, client_echos_active_once_small, - client_echos_active_small, - server_echos_passive_big, server_echos_active_once_big, - server_echos_active_big, - client_echos_passive_big, client_echos_active_once_big, - client_echos_active_big, - server_echos_passive_huge, server_echos_active_once_huge, - server_echos_active_huge, - client_echos_passive_huge, client_echos_active_once_huge, - client_echos_active_huge - ]. +all() -> +[server_echos_passive_small, + server_echos_active_once_small, + server_echos_active_small, client_echos_passive_small, + client_echos_active_once_small, + client_echos_active_small, server_echos_passive_big, + server_echos_active_once_big, server_echos_active_big, + client_echos_passive_big, client_echos_active_once_big, + client_echos_active_big, server_echos_passive_huge, + server_echos_active_once_huge, server_echos_active_huge, + client_echos_passive_huge, + client_echos_active_once_huge, client_echos_active_huge]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index 5aac9bb4e3..8b95329bef 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(SLEEP, 500). -define(TIMEOUT, 60000). @@ -145,13 +145,19 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test session cach API"]; +all() -> + [session_cache_process_list, + session_cache_process_mnesia]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [ - session_cache_process_list, session_cache_process_mnesia - ]. session_cache_process_list(doc) -> ["Test reuse of sessions (short handshake)"]; diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index 0cbaafd99c..cddf234c2b 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(TIMEOUT, 120000). -define(LONG_TIMEOUT, 600000). @@ -143,37 +143,41 @@ end_per_testcase(_, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test erlangs ssl against openssl"]; - -all(suite) -> - [erlang_client_openssl_server, - erlang_server_openssl_client, - tls1_erlang_client_openssl_server_dsa_cert, - tls1_erlang_server_openssl_client_dsa_cert, - ssl3_erlang_client_openssl_server_dsa_cert, - ssl3_erlang_server_openssl_client_dsa_cert, - erlang_server_openssl_client_reuse_session, - erlang_client_openssl_server_renegotiate, - erlang_client_openssl_server_no_wrap_sequence_number, - erlang_server_openssl_client_no_wrap_sequence_number, - erlang_client_openssl_server_no_server_ca_cert, - ssl3_erlang_client_openssl_server, - ssl3_erlang_server_openssl_client, - ssl3_erlang_client_openssl_server_client_cert, - ssl3_erlang_server_openssl_client_client_cert, - ssl3_erlang_server_erlang_client_client_cert, - tls1_erlang_client_openssl_server, - tls1_erlang_server_openssl_client, - tls1_erlang_client_openssl_server_client_cert, - tls1_erlang_server_openssl_client_client_cert, - tls1_erlang_server_erlang_client_client_cert, - ciphers_rsa_signed_certs, - ciphers_dsa_signed_certs, - erlang_client_bad_openssl_server, - expired_session, - ssl2_erlang_server_openssl_client - ]. +all() -> +[erlang_client_openssl_server, + erlang_server_openssl_client, + tls1_erlang_client_openssl_server_dsa_cert, + tls1_erlang_server_openssl_client_dsa_cert, + ssl3_erlang_client_openssl_server_dsa_cert, + ssl3_erlang_server_openssl_client_dsa_cert, + erlang_server_openssl_client_reuse_session, + erlang_client_openssl_server_renegotiate, + erlang_client_openssl_server_no_wrap_sequence_number, + erlang_server_openssl_client_no_wrap_sequence_number, + erlang_client_openssl_server_no_server_ca_cert, + ssl3_erlang_client_openssl_server, + ssl3_erlang_server_openssl_client, + ssl3_erlang_client_openssl_server_client_cert, + ssl3_erlang_server_openssl_client_client_cert, + ssl3_erlang_server_erlang_client_client_cert, + tls1_erlang_client_openssl_server, + tls1_erlang_server_openssl_client, + tls1_erlang_client_openssl_server_client_cert, + tls1_erlang_server_openssl_client_client_cert, + tls1_erlang_server_erlang_client_client_cert, + ciphers_rsa_signed_certs, ciphers_dsa_signed_certs, + erlang_client_bad_openssl_server, expired_session, + ssl2_erlang_server_openssl_client]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- -- cgit v1.2.3 From f46420139c89668f24f9b86e80f0f93fbbb9827b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:34:20 +0200 Subject: Update snmp tests to conform with common_test standard --- lib/snmp/test/snmp.spec | 2 +- lib/snmp/test/snmp_SUITE.erl | 144 +++---- lib/snmp/test/snmp_agent_mibs_test.erl | 47 +-- lib/snmp/test/snmp_agent_ms_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_mt_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_nfilter_test.erl | 8 +- lib/snmp/test/snmp_agent_test.erl | 642 ++++++++++++----------------- lib/snmp/test/snmp_agent_v2_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_agent_v3_test.erl | 474 +++++++++++---------- lib/snmp/test/snmp_app_test.erl | 54 +-- lib/snmp/test/snmp_appup_test.erl | 30 +- lib/snmp/test/snmp_compiler_test.erl | 35 +- lib/snmp/test/snmp_conf_test.erl | 40 +- lib/snmp/test/snmp_log_test.erl | 65 ++- lib/snmp/test/snmp_manager_config_test.erl | 155 +++---- lib/snmp/test/snmp_manager_test.erl | 202 ++++----- lib/snmp/test/snmp_manager_user_test.erl | 79 ++-- lib/snmp/test/snmp_note_store_test.erl | 24 +- lib/snmp/test/snmp_pdus_test.erl | 29 +- 19 files changed, 1585 insertions(+), 1867 deletions(-) diff --git a/lib/snmp/test/snmp.spec b/lib/snmp/test/snmp.spec index 0af52c139e..07492337fb 100644 --- a/lib/snmp/test/snmp.spec +++ b/lib/snmp/test/snmp.spec @@ -1 +1 @@ -{topcase, {dir, "../snmp_test"}}. +{suites,"snmp_test",all}. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 5cf0af7992..4261a1c155 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,27 +19,26 @@ -module(snmp_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). --export([app/1, compiler/1, misc/1, agent/1, manager/1]). +-export([]). -export([ - app_test/1, - appup_test/1, - compiler_test/1, - conf_test/1, - pdus_test/1, - log_test/1, - note_store_test/1, - mibs_test/1, - nfilter_test/1, - agent_test/1, - manager_config_test/1, - manager_user_test/1, - manager_test/1 - ]). + + + + + + + + + + + + +]). %% %% ----- @@ -55,103 +54,74 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(doc) -> - ["Test suites for the snmp application.", - "There are eight different sub test-suites."]; - -all(suite) -> - [ - app, - compiler, - misc, - agent, - manager - - ]. - -app(suite) -> - [ - app_test, - appup_test - ]. - -compiler(suite) -> - [ - compiler_test - ]. - -misc(suite) -> - [ - conf_test, - pdus_test, - log_test, - note_store_test - ]. - -agent(suite) -> - [ - mibs_test, - nfilter_test, - agent_test - ]. +all() -> +[{group, app}, {group, compiler}, {group, misc}, + {group, agent}, {group, manager}]. -manager(suite) -> - [ - manager_config_test, - manager_user_test, - manager_test - ]. +groups() -> + [{app, [], [{group, app_test}, {group, appup_test}]}, + {compiler, [], [{group, compiler_test}]}, + {misc, [], + [{group, conf_test}, {group, pdus_test}, + {group, log_test}, {group, note_store_test}]}, + {agent, [], + [{group, mibs_test}, {group, nfilter_test}, + {group, agent_test}]}, + {manager, [], + [{group, manager_config_test}, + {group, manager_user_test}, {group, manager_test}]}, + {app_test, [], [{snmp_app_test, all}]}, + {appup_test, [], [{snmp_appup_test, all}]}, + {compiler_test, [], [{snmp_compiler_test, all}]}, + {conf_test, [], [{snmp_conf_test, all}]}, + {pdus_test, [], [{snmp_pdus_test, all}]}, + {log_test, [], [{snmp_log_test, all}]}, + {note_store_test, [], [{snmp_note_store_test, all}]}, + {mibs_test, [], [{snmp_agent_mibs_test, all}]}, + {nfilter_test, [], [{snmp_agent_nfilter_test, all}]}, + {agent_test, [], [{snmp_agent_test, all}]}, + {manager_config_test, [], + [{snmp_manager_config_test, all}]}, + {manager_user_test, [], + [{snmp_manager_user_test, all}]}, + {manager_test, [], [{snmp_manager_test, all}]}]. +init_per_group(_GroupName, Config) -> + Config. -app_test(suite) -> - [{snmp_app_test, all}]. +end_per_group(_GroupName, Config) -> + Config. -appup_test(suite) -> - [{snmp_appup_test, all}]. -compiler_test(suite) -> - [{snmp_compiler_test, all}]. -conf_test(suite) -> - [{snmp_conf_test, all}]. -pdus_test(suite) -> - [{snmp_pdus_test, all}]. -log_test(suite) -> - [{snmp_log_test, all}]. + -note_store_test(suite) -> - [{snmp_note_store_test, all}]. + + -mibs_test(suite) -> - [{snmp_agent_mibs_test, all}]. + + -nfilter_test(suite) -> - [{snmp_agent_nfilter_test, all}]. -agent_test(suite) -> - [{snmp_agent_test, all}]. -manager_config_test(suite) -> - [{snmp_manager_config_test, all}]. -manager_user_test(suite) -> - [{snmp_manager_user_test, all}]. + + -manager_test(suite) -> - [{snmp_manager_test, all}]. + diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl index c28fa81ae0..3e48130fac 100644 --- a/lib/snmp/test/snmp_agent_mibs_test.erl +++ b/lib/snmp/test/snmp_agent_mibs_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). -include_lib("snmp/include/SNMP-COMMUNITY-MIB.hrl"). @@ -39,12 +39,12 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - init_all/1, finish_all/1, + init_per_suite/1, end_per_suite/1, start_and_stop/1, - size_check/1, + size_check_ets/1, size_check_dets/1, size_check_mnesia/1, @@ -58,8 +58,6 @@ %%---------------------------------------------------------------------- %% Internal exports %%---------------------------------------------------------------------- --export([ - ]). %%---------------------------------------------------------------------- %% Macros @@ -121,20 +119,25 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - {conf, init_all, cases(), finish_all}. +all() -> +cases(). + +groups() -> + [{size_check, [], + [size_check_ets, size_check_dets, size_check_mnesia]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [ - start_and_stop, - load_unload, - size_check, - me_lookup, - which_mib, - cache_test - ]. +cases() -> +[start_and_stop, load_unload, {group, size_check}, + me_lookup, which_mib, cache_test]. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> %% Data dir points wrong DataDir0 = ?config(data_dir, Config), DataDir1 = filename:split(filename:absname(DataDir0)), @@ -142,7 +145,7 @@ init_all(Config) when is_list(Config) -> DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]), [{snmp_data_dir, DataDir ++ "/"}|Config]. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> lists:keydelete(snmp_data_dir, 1, Config). @@ -217,12 +220,6 @@ load_unload(Config) when is_list(Config) -> %% --------------------------------------------------------------------- -size_check(suite) -> - [ - size_check_ets, - size_check_dets, - size_check_mnesia - ]. size_check_ets(suite) -> []; diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/snmp_agent_ms_test.erl index cc4cdae32f..1f34f1c8d1 100644 --- a/lib/snmp/test/snmp_agent_ms_test.erl +++ b/lib/snmp/test/snmp_agent_ms_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/snmp_agent_mt_test.erl index c664dba288..4f125c0017 100644 --- a/lib/snmp/test/snmp_agent_mt_test.erl +++ b/lib/snmp/test/snmp_agent_mt_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl index f406ea1e63..f08060cee3 100644 --- a/lib/snmp/test/snmp_agent_nfilter_test.erl +++ b/lib/snmp/test/snmp_agent_nfilter_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -33,7 +33,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0, init_per_testcase/2, end_per_testcase/2 ]). @@ -64,8 +64,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(_) -> - ?SKIP(not_yet_implemented). +all() -> + {skip,not_yet_implemented}. %%====================================================================== diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index cb4edf998b..692d29fda0 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -85,11 +85,164 @@ end). -all(suite) -> - Reqs = [mnesia, distribution, {local_slave_nodes, 2}, {time, 360}], - Conf1 = [{conf, init_all, cases(), finish_all}], - Conf2 = [tickets2], - {req, Reqs, Conf1 ++ Conf2}. +all() -> + Reqs = [mnesia, distribution, {local_slave_nodes, 2}, + {time, 360}], + Conf1 = [{group, all_tcs}], + Conf2 = [{group, tickets2}], + Conf1 ++ Conf2. + +groups() -> + [{all_tcs, [], cases()}, + {mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {misc, [], misc_cases()}, {test_v1, [], v1_cases()}, + {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets1, [], [{group, otp_4394}, {group, otp_7157}]}, + {tickets2, [], [otp8395]}, + {otp_4394, [], [otp_4394_test]}, + {otp_7157, [], + begin Reqs = [], Conf = [otp_7157_test], Conf end}]. + +init_per_group(all_tcs, Config) -> + init_all(Config); +init_per_group(otp_7157, Config) -> + init_otp_7157(Config); +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(misc, Config) -> + init_misc(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(all_tcs, Config) -> + finish_all(Config); +end_per_group(otp_7157, Config) -> + finish_otp_7157(Config); +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(misc, Config) -> + finish_misc(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(otp8395 = Case, Config) when is_list(Config) -> @@ -175,7 +328,7 @@ init_per_suite(Config) -> Config2. %% end_per_suite(Config) -> -end_suite(Config) -> +end_per_suite(Config) -> Config. fix_data_dir(Config) -> @@ -224,31 +377,18 @@ end_per_testcase2(_Case, Config) -> Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_multi_threaded, - mib_storage, - tickets1 - ]; - _Else -> - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_v3, - test_multi_threaded, - mib_storage, - tickets1 - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets1}]; + _Else -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets1}] +end. %%%----------------------------------------------------------------- @@ -355,144 +495,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when is_list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -975,8 +1027,6 @@ mib_of(Oid, ExpectedMibName) -> end. -misc(suite) -> - {req, [], {conf, init_misc, misc_cases(), finish_misc}}. init_misc(Config) -> init_v1(Config). @@ -984,11 +1034,8 @@ init_misc(Config) -> finish_misc(Config) -> finish_v1(Config). -misc_cases() -> - [ - app_info, - info_test - ]. +misc_cases() -> +[app_info, info_test]. app_info(suite) -> []; app_info(Config) when is_list(Config) -> @@ -1021,34 +1068,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [ - simple, - db_notify_client, - v1_processing, - big, - big2, - loop_mib, - api, - subagent, - mnesia, - multiple_reqs, - sa_register, - v1_trap, - sa_error, - next_across_sa, - undo, - reported_bugs, - standard_mibs, - sparse_table, - cnt_64, - opaque, - - change_target_addr_config - ]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when is_list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1065,34 +1092,14 @@ finish_v1(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. - -v2_cases() -> - [ - simple_2, - v2_processing, - big_2, - big2_2, - loop_mib_2, - api_2, - subagent_2, - mnesia_2, - multiple_reqs_2, - sa_register_2, - v2_trap, - v2_inform, - sa_error_2, - next_across_sa_2, - undo_2, - reported_bugs_2, - standard_mibs_2, - v2_types, - implied, - sparse_table_2, - cnt_64_2, - opaque_2, - v2_caps - ]. + +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1109,11 +1116,9 @@ finish_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> - {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1130,35 +1135,15 @@ finish_v1_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. - -v3_cases() -> - [ - simple_3, - v3_processing, - big_3, - big2_3, - api_3, - subagent_3, - mnesia_3, - loop_mib_3, - multiple_reqs_3, - sa_register_3, - v3_trap, - v3_inform, - sa_error_3, - next_across_sa_3, - undo_3, - reported_bugs_3, - standard_mibs_3, - v3_security, - v2_types_3, - implied_3, - sparse_table_3, - cnt_64_3, - opaque_3, - v2_caps_3 - ]. + +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when is_list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1196,11 +1181,9 @@ finish_v3(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> - {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1690,21 +1673,19 @@ mnesia_2(X) -> ?P(mnesia_2), mnesia(X). mnesia_3(X) -> ?P(mnesia_3), mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1929,8 +1910,6 @@ v3_trap(Config) when is_list(Config) -> ?P(v3_trap), trap2(Config). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2190,13 +2169,6 @@ v3_processing(Config) when is_list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> - [ - v3_crypto_basic, - v3_md5_auth, - v3_sha_auth, - v3_des_priv - ]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -4044,36 +4016,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [ - snmp_standard_mib, - snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, - snmp_notification_mib, - snmp_view_based_acm_mib - ]. - -standard_mibs_2(suite) -> - [ - snmpv2_mib_2, - snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, - snmp_notification_mib_2, - snmp_view_based_acm_mib_2 - ]. - -standard_mibs_3(suite) -> - [ - snmpv2_mib_3, - snmp_framework_mib_3, - snmp_mpd_mib_3, - snmp_target_mib_3, - snmp_notification_mib_3, - snmp_view_based_acm_mib_3, - snmp_user_based_sm_mib_3 - ]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -5117,70 +5061,14 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [ - otp_1128, - otp_1129, - otp_1131, - otp_1162, - otp_1222, - otp_1298, - otp_1331, - otp_1338, - otp_1342, - otp_2776, - otp_2979, - otp_3187, - otp_3725 - ]. - -reported_bugs_2(suite) -> - [ - otp_1128_2, - otp_1129_2, - otp_1131_2, - otp_1162_2, - otp_1222_2, - otp_1298_2, - otp_1331_2, - otp_1338_2, - otp_1342_2, - otp_2776_2, - otp_2979_2, - otp_3187_2 - ]. - -reported_bugs_3(suite) -> - [ - otp_1128_3, - otp_1129_3, - otp_1131_3, - otp_1162_3, - otp_1222_3, - otp_1298_3, - otp_1331_3, - otp_1338_3, - otp_1342_3, - otp_2776_3, - otp_2979_3, - otp_3187_3, - otp_3542 - ]. + + %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets1(suite) -> - [ - otp_4394, - otp_7157 - ]. -tickets2(suite) -> - [ - otp8395 - ]. @@ -5661,10 +5549,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when is_list(Config) -> ?DBG("init_otp_4394 -> entry with" @@ -5758,10 +5642,6 @@ otp_4394_test1() -> %%----------------------------------------------------------------- -otp_7157(suite) -> - Reqs = [], - Conf = [{conf, init_otp_7157, [otp_7157_test], finish_otp_7157}], - {req, Reqs, Conf}. init_otp_7157(Config) when is_list(Config) -> %% diff --git a/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/snmp_agent_v2_test.erl index 549521341e..dc94c18ad9 100644 --- a/lib/snmp/test/snmp_agent_v2_test.erl +++ b/lib/snmp/test/snmp_agent_v2_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/snmp_agent_v3_test.erl index 71b355057d..266be72878 100644 --- a/lib/snmp/test/snmp_agent_v3_test.erl +++ b/lib/snmp/test/snmp_agent_v3_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% , and a second version _2. There may be several %% versions as well, _N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index a973a2f325..64dd638f83 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -23,7 +23,8 @@ -module(snmp_app_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, fields/1, @@ -32,7 +33,7 @@ app_depend/1, undef_funcs/1, - start_and_stop/1, + start_and_stop_empty/1, start_and_stop_with_agent/1, start_and_stop_with_manager/1, @@ -44,23 +45,32 @@ -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs, - start_and_stop - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [fields, modules, exportall, app_depend, + undef_funcs, {group, start_and_stop}], + Cases. + +groups() -> + [{start_and_stop, [], + [start_and_stop_empty, start_and_stop_with_agent, + start_and_stop_with_manager, + start_and_stop_with_agent_and_manager, + start_epmty_and_then_agent_and_manager_and_stop, + start_with_agent_and_then_manager_and_stop, + start_with_manager_and_then_agent_and_stop]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) when is_list(Config) -> ?DISPLAY_SUITE_INFO(), @@ -97,9 +107,9 @@ is_app(App) -> {error, {invalid_format, Error}} end. -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. @@ -319,16 +329,6 @@ undef_funcs_make_name(App, PostFix) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -start_and_stop(suite) -> - [ - start_and_stop_empty, - start_and_stop_with_agent, - start_and_stop_with_manager, - start_and_stop_with_agent_and_manager, - start_epmty_and_then_agent_and_manager_and_stop, - start_with_agent_and_then_manager_and_stop, - start_with_manager_and_then_agent_and_stop - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 3c708b8977..b93f960814 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -23,25 +23,33 @@ -module(snmp_appup_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, appup_file/1 ]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup_file - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [appup_file], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -76,9 +84,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl index 7c1b278ac7..98ffaf8bae 100644 --- a/lib/snmp/test/snmp_compiler_test.erl +++ b/lib/snmp/test/snmp_compiler_test.erl @@ -28,7 +28,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, description/1, @@ -45,7 +45,7 @@ imports/1, module_identity/1, - tickets/1, + otp_6150/1, otp_8574/1, otp_8595/1 @@ -90,21 +90,20 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - description, - oid_conflicts, - imports, - module_identity, - tickets - ]. - -tickets(suite) -> - [ - otp_6150, - otp_8574, - otp_8595 - ]. +all() -> +[description, oid_conflicts, imports, module_identity, + {group, tickets}]. + +groups() -> + [{tickets, [], [otp_6150, otp_8574, otp_8595]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%====================================================================== diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl index 90416919d0..c4341d8d7e 100644 --- a/lib/snmp/test/snmp_conf_test.erl +++ b/lib/snmp/test/snmp_conf_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/STANDARD-MIB.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, check_mandatory/1, @@ -86,26 +86,22 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - check_mandatory, - check_integer1, - check_integer2, - check_string1, - check_string2, - check_atom, - check_ip, - check_taddress, - check_packet_size, - check_oid, - check_sec_model1, - check_sec_model2, - check_sec_level, - check_timer, - - read, - read_files - ]. +all() -> +[check_mandatory, check_integer1, check_integer2, + check_string1, check_string2, check_atom, check_ip, + check_taddress, check_packet_size, check_oid, + check_sec_model1, check_sec_model2, check_sec_level, + check_timer, read, read_files]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl index dd2f27862e..b692017407 100644 --- a/lib/snmp/test/snmp_log_test.erl +++ b/lib/snmp/test/snmp_log_test.erl @@ -29,7 +29,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -42,17 +42,17 @@ -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, open_and_close/1, - open_write_and_close/1, + open_write_and_close1/1, open_write_and_close2/1, open_write_and_close3/1, open_write_and_close4/1, - log_to_io/1, + log_to_io1/1, log_to_io2/1, - log_to_txt/1, + log_to_txt1/1, log_to_txt2/1, log_to_txt3/1 @@ -108,37 +108,30 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== %% ?SKIP(not_yet_implemented). -all(suite) -> - [ - open_and_close, - open_write_and_close, - log_to_io, - log_to_txt - ]. - - -open_write_and_close(suite) -> - [ - open_write_and_close1, - open_write_and_close2, - open_write_and_close3, - open_write_and_close4 - ]. - - -log_to_io(suite) -> - [ - log_to_io1, - log_to_io2 - ]. - - -log_to_txt(suite) -> - [ - log_to_txt1, - log_to_txt2, - log_to_txt3 - ]. +all() -> +[open_and_close, {group, open_write_and_close}, + {group, log_to_io}, {group, log_to_txt}]. + +groups() -> + [{open_write_and_close, [], + [open_write_and_close1, open_write_and_close2, + open_write_and_close3, open_write_and_close4]}, + {log_to_io, [], [log_to_io1, log_to_io2]}, + {log_to_txt, [], + [log_to_txt1, log_to_txt2, log_to_txt3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index f3a4d70ef8..a72dd0cc22 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -31,7 +31,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/src/manager/snmpm_usm.hrl"). @@ -42,10 +42,10 @@ %% -compile(export_all). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop/1, + simple_start_and_stop/1, start_without_mandatory_opts1/1, @@ -58,36 +58,36 @@ start_with_invalid_agents_conf_file1/1, start_with_invalid_usm_conf_file1/1, - normal_op/1, + - system/1, + simple_system_op/1, - users/1, + register_user_using_file/1, register_user_using_function/1, register_user_failed_using_function1/1, - agents/1, + register_agent_using_file/1, register_agent_using_function/1, register_agent_failed_using_function1/1, - usm_users/1, + register_usm_user_using_file/1, register_usm_user_using_function/1, register_usm_user_failed_using_function1/1, update_usm_user_info/1, - counter/1, + create_and_increment/1, - stats_counter/1, + stats_create_and_increment/1, - tickets/1, + otp_7219/1, - otp_8395/1, + otp_8395_1/1, otp_8395_2/1, otp_8395_3/1, @@ -163,33 +163,55 @@ end_per_testcase(Case, Config) when is_list(Config) -> %%====================================================================== % all(doc) -> % "The top snmp manager config test case"; -all(suite) -> - [ - start_and_stop, - normal_op, - tickets - ]. +all() -> +[{group, start_and_stop}, {group, normal_op}, + {group, tickets}]. + +groups() -> + [{start_and_stop, [], + [simple_start_and_stop, start_without_mandatory_opts1, + start_without_mandatory_opts2, + start_with_all_valid_opts, start_with_unknown_opts, + start_with_incorrect_opts, + start_with_invalid_manager_conf_file1, + start_with_invalid_users_conf_file1, + start_with_invalid_agents_conf_file1, + start_with_invalid_usm_conf_file1]}, + {normal_op, [], + [{group, system}, {group, agents}, {group, users}, + {group, usm_users}, {group, counter}, + {group, stats_counter}]}, + {system, [], [simple_system_op]}, + {users, [], + [register_user_using_file, register_user_using_function, + register_user_failed_using_function1]}, + {agents, [], + [register_agent_using_file, + register_agent_using_function, + register_agent_failed_using_function1]}, + {usm_users, [], + [register_usm_user_using_file, + register_usm_user_using_function, + register_usm_user_failed_using_function1, + update_usm_user_info]}, + {counter, [], [create_and_increment]}, + {stats_counter, [], [stats_create_and_increment]}, + {tickets, [], [otp_7219, {group, otp_8395}]}, + {otp_8395, [], + [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== %% Test functions %%====================================================================== -start_and_stop(doc) -> - "A collection of start and stop tests"; -start_and_stop(suite) -> - [ - simple_start_and_stop, - start_without_mandatory_opts1, - start_without_mandatory_opts2, - start_with_all_valid_opts, - start_with_unknown_opts, - start_with_incorrect_opts, - start_with_invalid_manager_conf_file1, - start_with_invalid_users_conf_file1, - start_with_invalid_agents_conf_file1, - start_with_invalid_usm_conf_file1 - ]. %% @@ -1641,29 +1663,12 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> %% --- %% -normal_op(doc) -> - "A collection of tests for normal operation"; -normal_op(suite) -> - [ - system, - agents, - users, - usm_users, - counter, - stats_counter - ]. %% %% --- %% -system(doc) -> - "Various system related operations with the snmp manager config"; -system(suite) -> - [ - simple_system_op - ]. simple_system_op(suite) -> []; simple_system_op(doc) -> @@ -1702,14 +1707,6 @@ simple_system_op(Conf) when is_list(Conf) -> %% --- %% -users(doc) -> - "Various users related operations with the snmp manager config"; -users(suite) -> - [ - register_user_using_file, - register_user_using_function, - register_user_failed_using_function1 - ]. %% @@ -1764,14 +1761,6 @@ register_user_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -agents(doc) -> - "Various agents related operations with the snmp manager config"; -agents(suite) -> - [ - register_agent_using_file, - register_agent_using_function, - register_agent_failed_using_function1 - ]. %% @@ -1950,15 +1939,6 @@ register_agent_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -usm_users(doc) -> - "Various USM users related operations with the snmp manager config"; -usm_users(suite) -> - [ - register_usm_user_using_file, - register_usm_user_using_function, - register_usm_user_failed_using_function1, - update_usm_user_info - ]. %% @@ -2208,12 +2188,6 @@ update_usm_user_info(Conf) when is_list(Conf) -> %% --- %% -counter(doc) -> - "Various counter related operations with the snmp manager config"; -counter(suite) -> - [ - create_and_increment - ]. %% @@ -2258,13 +2232,6 @@ create_and_increment(Conf) when is_list(Conf) -> %% --- %% -stats_counter(doc) -> - "Various statistic counter related operations with the " - "snmp manager config"; -stats_counter(suite) -> - [ - stats_create_and_increment - ]. %% @@ -2323,11 +2290,6 @@ loop(N, _, F) when (N > 0) andalso is_function(F) -> %% Ticket test-cases %%====================================================================== -tickets(suite) -> - [ - otp_7219, - otp_8395 - ]. otp_7219(suite) -> @@ -2379,13 +2341,6 @@ otp_7219(Config) when is_list(Config) -> -otp_8395(suite) -> - [ - otp_8395_1, - otp_8395_2, - otp_8395_3, - otp_8395_4 - ]. otp_8395_1(suite) -> []; otp_8395_1(doc) -> diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index 83e861589d..50836db731 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -31,7 +31,7 @@ %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include("snmp_test_data/Test2.hrl"). @@ -43,10 +43,10 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop_tests/1, + simple_start_and_stop1/1, simple_start_and_stop2/1, simple_start_and_monitor_crash1/1, @@ -54,49 +54,49 @@ notify_started01/1, notify_started02/1, - user_tests/1, + register_user1/1, - agent_tests/1, + register_agent1/1, register_agent2/1, - misc_tests/1, + info/1, - request_tests/1, + - get_tests/1, + simple_sync_get1/1, simple_sync_get2/1, simple_async_get1/1, simple_async_get2/1, - get_next_tests/1, + simple_sync_get_next1/1, simple_sync_get_next2/1, simple_async_get_next1/1, simple_async_get_next2/1, - set_tests/1, + simple_sync_set1/1, simple_sync_set2/1, simple_async_set1/1, simple_async_set2/1, - bulk_tests/1, + simple_sync_get_bulk1/1, simple_sync_get_bulk2/1, simple_async_get_bulk1/1, simple_async_get_bulk2/1, - misc_request_tests/1, + misc_async1/1, misc_async2/1, discovery/1, - event_tests/1, + trap1/1, trap2/1, @@ -109,10 +109,10 @@ report/1, - tickets/1, - otp8015/1, + + otp8015_1/1, - otp8395/1, + otp8395_1/1 ]). @@ -359,118 +359,64 @@ end_per_testcase2(Case, Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop_tests, - misc_tests, - user_tests, - agent_tests, - request_tests, - event_tests, - discovery, - tickets - ]. - -start_and_stop_tests(suite) -> - [ - simple_start_and_stop1, - simple_start_and_stop2, - simple_start_and_monitor_crash1, - simple_start_and_monitor_crash2, - notify_started01, - notify_started02 - ]. - -misc_tests(suite) -> - [ - info - ]. - -user_tests(suite) -> - [ - register_user1 - ]. - -agent_tests(suite) -> - [ - register_agent1, - register_agent2 - ]. - -request_tests(suite) -> - [ - get_tests, - get_next_tests, - set_tests, - bulk_tests, - misc_request_tests - ]. - -get_tests(suite) -> - [ - simple_sync_get1, - simple_sync_get2, - simple_async_get1, - simple_async_get2 - ]. - -get_next_tests(suite) -> - [ - simple_sync_get_next1, - simple_sync_get_next2, - simple_async_get_next1, - simple_async_get_next2 - ]. - -set_tests(suite) -> - [ - simple_sync_set1, - simple_sync_set2, - simple_async_set1, - simple_async_set2 - ]. - -bulk_tests(suite) -> - [ - simple_sync_get_bulk1, - simple_sync_get_bulk2, - simple_async_get_bulk1, - simple_async_get_bulk2 - ]. - -misc_request_tests(suite) -> - [ - misc_async1, - misc_async2 - ]. - -event_tests(suite) -> - [ - trap1, - trap2, - inform1, - inform2, - inform3, - inform4, - inform_swarm, - report - ]. - -tickets(suite) -> - [ - otp8015, - otp8395 - ]. - -otp8015(suite) -> - [ - otp8015_1 - ]. - -otp8395(suite) -> - [ - otp8395_1 - ]. +all() -> +[{group, start_and_stop_tests}, {group, misc_tests}, + {group, user_tests}, {group, agent_tests}, + {group, request_tests}, {group, event_tests}, discovery, + {group, tickets}]. + +groups() -> + [{start_and_stop_tests, [], + [simple_start_and_stop1, simple_start_and_stop2, + simple_start_and_monitor_crash1, + simple_start_and_monitor_crash2, notify_started01, + notify_started02]}, + {misc_tests, [], [info]}, + {user_tests, [], [register_user1]}, + {agent_tests, [], [register_agent1, register_agent2]}, + {request_tests, [], + [{group, get_tests}, {group, get_next_tests}, + {group, set_tests}, {group, bulk_tests}, + {group, misc_request_tests}]}, + {get_tests, [], + [simple_sync_get1, simple_sync_get2, simple_async_get1, + simple_async_get2]}, + {get_next_tests, [], + [simple_sync_get_next1, simple_sync_get_next2, + simple_async_get_next1, simple_async_get_next2]}, + {set_tests, [], + [simple_sync_set1, simple_sync_set2, simple_async_set1, + simple_async_set2]}, + {bulk_tests, [], + [simple_sync_get_bulk1, simple_sync_get_bulk2, + simple_async_get_bulk1, simple_async_get_bulk2]}, + {misc_request_tests, [], [misc_async1, misc_async2]}, + {event_tests, [], + [trap1, trap2, inform1, inform2, inform3, inform4, + inform_swarm, report]}, + {tickets, [], [{group, otp8015}, {group, otp8395}]}, + {otp8015, [], [otp8015_1]}, {otp8395, [], [otp8395_1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl index b80af16485..fefa1ad713 100644 --- a/lib/snmp/test/snmp_manager_user_test.erl +++ b/lib/snmp/test/snmp_manager_user_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -36,10 +36,10 @@ %% -compile(export_all). -export([ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - register_user/1, + simple_register_and_unregister1/1, simple_register_and_unregister2/1, simple_register_and_unregister3/1, @@ -62,7 +62,7 @@ register_monitor_request_and_crash3/1, register_monitor_request_and_crash4/1, - tickets/1, + otp7902/1 ]). @@ -134,42 +134,41 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - register_user, - tickets - ]. - -register_user(suite) -> - [ - simple_register_and_unregister1, - simple_register_and_unregister2, - simple_register_and_unregister3, - register_and_crash1, - register_and_crash2, - register_and_crash3, - register_request_and_crash1, - register_request_and_crash2, - register_request_and_crash3, - simple_register_monitor_and_unregister1, - simple_register_monitor_and_unregister2, - simple_register_monitor_and_unregister3, - register_monitor_and_crash1, - register_monitor_and_crash2, - register_monitor_and_crash3, - register_monitor_and_crash4, - register_monitor_and_crash5, - register_monitor_request_and_crash1, - register_monitor_request_and_crash2, - register_monitor_request_and_crash3, - register_monitor_request_and_crash4 - ]. - - -tickets(suite) -> - [ - otp7902 - ]. +all() -> +[{group, register_user}, {group, tickets}]. + +groups() -> + [{register_user, [], + [simple_register_and_unregister1, + simple_register_and_unregister2, + simple_register_and_unregister3, register_and_crash1, + register_and_crash2, register_and_crash3, + register_request_and_crash1, + register_request_and_crash2, + register_request_and_crash3, + simple_register_monitor_and_unregister1, + simple_register_monitor_and_unregister2, + simple_register_monitor_and_unregister3, + register_monitor_and_crash1, + register_monitor_and_crash2, + register_monitor_and_crash3, + register_monitor_and_crash4, + register_monitor_and_crash5, + register_monitor_request_and_crash1, + register_monitor_request_and_crash2, + register_monitor_request_and_crash3, + register_monitor_request_and_crash4]}, + {tickets, [], [otp7902]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl index 763c708bd6..24ba88f986 100644 --- a/lib/snmp/test/snmp_note_store_test.erl +++ b/lib/snmp/test/snmp_note_store_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). @@ -34,7 +34,7 @@ %%---------------------------------------------------------------------- -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, start_and_stop/1, notes/1, info/1, @@ -69,14 +69,18 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop, - notes, - info, - garbage_in - - ]. +all() -> +[start_and_stop, notes, info, garbage_in]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index 7041552abf..ef510ad62e 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -34,8 +34,8 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, - tickets/1, + all/0,groups/0,init_per_group/2,end_per_group/2, + otp7575/1, otp8563/1, init_per_testcase/2, end_per_testcase/2 @@ -71,16 +71,19 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - tickets - ]. - -tickets(suite) -> - [ - otp7575, - otp8563 - ]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], [otp7575, otp8563]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + -- cgit v1.2.3 From a995b3b416f214b6d6e06d9e3cf0fed3c7096210 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:35:07 +0200 Subject: Update runtime_tools tests to conform with common_test standard --- lib/runtime_tools/test/dbg_SUITE.erl | 23 ++++++-- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 18 ++++-- lib/runtime_tools/test/inviso_SUITE.erl | 67 +++++++++------------- lib/runtime_tools/test/runtime_tools.spec | 2 +- lib/runtime_tools/test/runtime_tools_SUITE.erl | 18 ++++-- 5 files changed, 74 insertions(+), 54 deletions(-) diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index b64a66891f..f8821712b4 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -19,7 +19,7 @@ -module(dbg_SUITE). %% Test functions --export([all/1, big/1, tiny/1, simple/1, message/1, distributed/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1, ip_port_busy/1, wrap_port/1, wrap_port_time/1, with_seq_trace/1, dead_suspend/1, local_trace/1, @@ -28,7 +28,7 @@ -export([tracee1/1, tracee2/1]). -export([dummy/0, exported/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). init_per_testcase(_Case, Config) -> @@ -39,10 +39,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> [big, tiny, simple, message, distributed, - ip_port, file_port, file_port2, file_port_schedfix, - ip_port_busy, wrap_port, wrap_port_time, - with_seq_trace, dead_suspend, local_trace, saved_patterns]. +all() -> +[big, tiny, simple, message, distributed, ip_port, + file_port, file_port2, file_port_schedfix, ip_port_busy, + wrap_port, wrap_port_time, with_seq_trace, dead_suspend, + local_trace, saved_patterns]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + big(suite) -> []; big(doc) -> ["Rudimentary interface test"]; diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index 83c3464427..13177ddcec 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -21,10 +21,10 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Testcases -export([basic/1]). @@ -34,8 +34,18 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -all(doc) -> []; -all(suite) -> [basic]. +all() -> +[basic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_list(Config) -> [{testcase, Case}, diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index 27b9185479..c5291a7904 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -29,49 +29,38 @@ -module(inviso_SUITE). -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("kernel/include/file.hrl"). -define(l,?line). -all(suite) -> - [ - basic_dist_trace_1, - basic_dist_trace_2, - basic_dist_trace_3, - basic_dist_trace_ti_1, - basic_dist_trace_ti_2, - basic_dist_trace_ti_3, - suspend_dist_trace_ti_1, - suspend_dist_trace_ti_2, - meta_cleanfunc_dist_1, - basic_handlerfun_dist_1, - delete_log_dist_1, - autostart_dist_1, - autostart_dist_2, - autostart_dist_3, - running_alone_dist_1, - running_alone_dist_2, - running_alone_dist_3, - running_alone_dist_4, - running_alone_dist_5, - overload_dist_1, - overload_dist_2, - overload_dist_3, - overload_dist_4, - overload_dist_5, - subscribe_dist_1, - lfm_trace_dist_1, - lfm_trace_ti_dist_2, - handle_logfile_sort_wrapset, - fetch_log_dist_trace_1, - fetch_log_dist_trace_2, - fetch_log_dist_trace_3, - fetch_log_dist_error_1, - fetch_log_dist_error_2, - expand_regexp_dist_1, - only_loaded_dist_1 - ]. +all() -> +[basic_dist_trace_1, basic_dist_trace_2, + basic_dist_trace_3, basic_dist_trace_ti_1, + basic_dist_trace_ti_2, basic_dist_trace_ti_3, + suspend_dist_trace_ti_1, suspend_dist_trace_ti_2, + meta_cleanfunc_dist_1, basic_handlerfun_dist_1, + delete_log_dist_1, autostart_dist_1, autostart_dist_2, + autostart_dist_3, running_alone_dist_1, + running_alone_dist_2, running_alone_dist_3, + running_alone_dist_4, running_alone_dist_5, + overload_dist_1, overload_dist_2, overload_dist_3, + overload_dist_4, overload_dist_5, subscribe_dist_1, + lfm_trace_dist_1, lfm_trace_ti_dist_2, + handle_logfile_sort_wrapset, fetch_log_dist_trace_1, + fetch_log_dist_trace_2, fetch_log_dist_trace_3, + fetch_log_dist_error_1, fetch_log_dist_error_2, + expand_regexp_dist_1, only_loaded_dist_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) -> diff --git a/lib/runtime_tools/test/runtime_tools.spec b/lib/runtime_tools/test/runtime_tools.spec index a60a533ce2..008c84de5e 100644 --- a/lib/runtime_tools/test/runtime_tools.spec +++ b/lib/runtime_tools/test/runtime_tools.spec @@ -1 +1 @@ -{topcase, {dir, "../runtime_tools_test"}}. +{suites,"runtime_tools_test",all}. diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 84e255e126..61afd37ef0 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(runtime_tools_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -38,8 +38,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [app_file]. +all() -> +[app_file]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + app_file(suite) -> []; -- cgit v1.2.3 From cf123118a26db0029a727e878b91af432c91e0a7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:35:35 +0200 Subject: Update reltool tests to conform with common_test standard --- lib/reltool/test/reltool.spec | 3 +-- lib/reltool/test/reltool_app_SUITE.erl | 20 ++++++++++++-------- lib/reltool/test/reltool_server_SUITE.erl | 27 +++++++++++++++------------ lib/reltool/test/reltool_test_lib.erl | 2 +- lib/reltool/test/reltool_wx_SUITE.erl | 18 +++++++++++++----- 5 files changed, 42 insertions(+), 28 deletions(-) diff --git a/lib/reltool/test/reltool.spec b/lib/reltool/test/reltool.spec index 252232e09d..d613ebd97d 100644 --- a/lib/reltool/test/reltool.spec +++ b/lib/reltool/test/reltool.spec @@ -1,2 +1 @@ -{topcase, {dir, "../reltool_test"}}. - +{suites,"reltool_test",all}. diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index 93e770a795..3afb4f9b2f 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -60,14 +60,18 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - fields, - modules, - export_all, - app_depend, - undef_funcs - ]. +all() -> +[fields, modules, export_all, app_depend, undef_funcs]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 56f7031a77..a42c07cd3d 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -18,7 +18,7 @@ -module(reltool_server_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -46,17 +46,20 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification -all(suite) -> - [ - start_server, - set_config, - create_release, - create_script, - create_target, - create_embedded, - create_standalone, - create_old_target - ]. +all() -> +[start_server, set_config, create_release, + create_script, create_target, create_embedded, + create_standalone, create_old_target]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl index 2d50eda2fb..b8bcbcd009 100644 --- a/lib/reltool/test/reltool_test_lib.erl +++ b/lib/reltool/test/reltool_test_lib.erl @@ -97,7 +97,7 @@ wx_init_per_suite(Config) -> exit({skipped, "Can not test on MacOSX"}); {unix, _} -> io:format("DISPLAY ~s~n", [os:getenv("DISPLAY")]), - case proplists:get_value(xserver, Config, none) of + case ct:get_config(xserver, none) of none -> ignore; Server -> os:putenv("DISPLAY", Server) end; diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index 03a392a497..cfce774d22 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -18,7 +18,7 @@ -module(reltool_wx_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -38,10 +38,18 @@ end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - start_all_windows - ]. +all() -> +[start_all_windows]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases -- cgit v1.2.3 From 206c1fd527b5155e55041c02a3bce397a46668ec Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:36:20 +0200 Subject: Update public_key tests to conform with common_test standard --- lib/public_key/test/pkits_SUITE.erl | 35 +++++++++++++++----------------- lib/public_key/test/public_key.spec | 3 +-- lib/public_key/test/public_key_SUITE.erl | 27 ++++++++++++------------ 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index 454adf66e3..a113caee2b 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -43,25 +43,22 @@ -define(NIST6, "2.16.840.1.101.3.2.1.48.6"). %% -all(doc) -> - ["PKITS tests for RFC3280 compliance"]; -all(suite) -> - [signature_verification, - validity_periods, - verifying_name_chaining, - %% basic_certificate_revocation_tests, - verifying_paths_with_self_issued_certificates, - verifying_basic_constraints, - key_usage, -%% certificate_policies, -%% require_explicit_policy, -%% policy_mappings, -%% inhibit_policy_mapping, -%% inhibit_any_policy, - name_constraints, -%% distribution_points, -%% delta_crls, - private_certificate_extensions]. +all() -> +[signature_verification, validity_periods, + verifying_name_chaining, + verifying_paths_with_self_issued_certificates, + verifying_basic_constraints, key_usage, + name_constraints, private_certificate_extensions]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + signature_verification(doc) -> [""]; signature_verification(suite) -> []; diff --git a/lib/public_key/test/public_key.spec b/lib/public_key/test/public_key.spec index dee9ad44ed..d4a63b5dd4 100644 --- a/lib/public_key/test/public_key.spec +++ b/lib/public_key/test/public_key.spec @@ -1,2 +1 @@ -{topcase, {dir, "../public_key_test"}}. - +{suites,"public_key_test",all}. diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 185618e58e..469bd5eaaf 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -23,7 +23,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("test_server/include/test_server_line.hrl"). -include("public_key.hrl"). @@ -99,18 +99,19 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test the public_key rsa functionality"]; - -all(suite) -> - [app, - pk_decode_encode, - encrypt_decrypt, - sign_verify, - pkix, - pkix_path_validation, - deprecated - ]. +all() -> +[app, pk_decode_encode, encrypt_decrypt, sign_verify, + pkix, pkix_path_validation, deprecated]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- -- cgit v1.2.3 From 91298c06d77197433c68b3cc1d05eb966e1370e0 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:36:54 +0200 Subject: Update percept tests to conform with common_test standard --- lib/percept/test/egd_SUITE.erl | 28 ++++++++++++++++------------ lib/percept/test/percept.spec | 3 +-- lib/percept/test/percept_SUITE.erl | 22 ++++++++++++++-------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl index fde02b47d5..a3b7c54708 100644 --- a/lib/percept/test/egd_SUITE.erl +++ b/lib/percept/test/egd_SUITE.erl @@ -18,10 +18,10 @@ %% -module(egd_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -54,16 +54,20 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - % Test cases - [ - image_create_and_destroy, - image_shape, - image_primitives, - image_colors, - image_font, - image_png_compliant - ]. +all() -> +[image_create_and_destroy, image_shape, + image_primitives, image_colors, image_font, + image_png_compliant]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%---------------------------------------------------------------------- %% Tests diff --git a/lib/percept/test/percept.spec b/lib/percept/test/percept.spec index 75aacc1fd6..10b3037283 100644 --- a/lib/percept/test/percept.spec +++ b/lib/percept/test/percept.spec @@ -1,2 +1 @@ -{topcase, {dir, "../percept_test"}}. - +{suites,"percept_test",all}. diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index dbd058f289..7d637f267f 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -18,10 +18,10 @@ %% -module(percept_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -51,12 +51,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - % Test cases - [ webserver, - profile, - analyze, - analyze_dist]. +all() -> +[webserver, profile, analyze, analyze_dist]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%---------------------------------------------------------------------- %% Tests -- cgit v1.2.3 From 6261f06d39e990b45f08b79edebe7b18a6eb9f01 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:37:22 +0200 Subject: Update megaco tests to conform with common_test standard --- lib/megaco/test/megaco.spec | 7 +- lib/megaco/test/megaco_SUITE.erl | 156 ++++----- lib/megaco/test/megaco_actions_test.erl | 30 +- lib/megaco/test/megaco_app_test.erl | 24 +- lib/megaco/test/megaco_appup_test.erl | 19 +- lib/megaco/test/megaco_binary_term_id_test.erl | 35 +- lib/megaco/test/megaco_call_flow_test.erl | 36 +-- lib/megaco/test/megaco_codec_mini_test.erl | 25 +- lib/megaco/test/megaco_codec_prev3a_test.erl | 397 +++++++++-------------- lib/megaco/test/megaco_codec_prev3b_test.erl | 411 +++++++++--------------- lib/megaco/test/megaco_codec_prev3c_test.erl | 410 +++++++++--------------- lib/megaco/test/megaco_codec_test.erl | 33 +- lib/megaco/test/megaco_codec_v1_test.erl | 395 +++++++++-------------- lib/megaco/test/megaco_codec_v2_test.erl | 423 +++++++++---------------- lib/megaco/test/megaco_codec_v3_test.erl | 410 +++++++++--------------- lib/megaco/test/megaco_config_test.erl | 37 ++- lib/megaco/test/megaco_digit_map_test.erl | 62 ++-- lib/megaco/test/megaco_examples_test.erl | 19 +- lib/megaco/test/megaco_flex_test.erl | 23 +- lib/megaco/test/megaco_load_test.erl | 30 +- lib/megaco/test/megaco_mess_test.erl | 124 +++----- lib/megaco/test/megaco_mib_test.erl | 21 +- lib/megaco/test/megaco_mreq_test.erl | 21 +- lib/megaco/test/megaco_pending_limit_test.erl | 61 ++-- lib/megaco/test/megaco_sdp_test.erl | 25 +- lib/megaco/test/megaco_segment_test.erl | 52 ++- lib/megaco/test/megaco_tcp_test.erl | 50 ++- lib/megaco/test/megaco_timer_test.erl | 56 ++-- lib/megaco/test/megaco_trans_test.erl | 108 +++---- lib/megaco/test/megaco_udp_test.erl | 43 ++- 30 files changed, 1424 insertions(+), 2119 deletions(-) diff --git a/lib/megaco/test/megaco.spec b/lib/megaco/test/megaco.spec index 7493bd5df8..6f8ee92c3c 100644 --- a/lib/megaco/test/megaco.spec +++ b/lib/megaco/test/megaco.spec @@ -1,5 +1,2 @@ -{topcase, {dir, "../megaco_test"}}. -{require_nodenames, 1}. -%{skip, {megaco_digit_map_test, all, "Not yet implemented"}}. -{skip, {megaco_measure_test, all, "Not yet implemented"}}. -%{skip, {M, F, "Not yet implemented"}}. +{suites,"megaco_test",all}. +{skip_cases,"megaco_test",megaco_measure_test,[all],"Not yet implemented"}. diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 2b5605cb13..03748e27ca 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -46,97 +46,67 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - app_test, - appup_test, - config, - flex, - udp, - tcp, - examples, - %% call_flow, - digit_map, - mess, - measure, - binary_term_id, - codec, - sdp, - mib, - trans, - actions, - load, - pending_limit, - segmented, - timer - ]. - -tickets(suite) -> - [ - mess, - codec - ]. - -app_test(suite) -> - [{megaco_app_test, all}]. - -appup_test(suite) -> - [{megaco_appup_test, all}]. - -config(suite) -> - [{megaco_config_test, all}]. - -call_flow(suite) -> - [{megaco_call_flow_test, all}]. - -digit_map(suite) -> - [{megaco_digit_map_test, all}]. - -mess(suite) -> - [{megaco_mess_test, all}]. - -udp(suite) -> - [{megaco_udp_test, all}]. - -tcp(suite) -> - [{megaco_tcp_test, all}]. - -examples(suite) -> - [{megaco_examples_test, all}]. - -measure(suite) -> - [{megaco_measure_test, all}]. - -binary_term_id(suite) -> - [{megaco_binary_term_id_test, all}]. - -codec(suite) -> - [{megaco_codec_test, all}]. - -sdp(suite) -> - [{megaco_sdp_test, all}]. - -mib(suite) -> - [{megaco_mib_test, all}]. - -trans(suite) -> - [{megaco_trans_test, all}]. - -actions(suite) -> - [{megaco_actions_test, all}]. - -load(suite) -> - [{megaco_load_test, all}]. - -pending_limit(suite) -> - [{megaco_pending_limit_test, all}]. - -segmented(suite) -> - [{megaco_segment_test, all}]. - -timer(suite) -> - [{megaco_timer_test, all}]. - -flex(suite) -> - [{megaco_flex_test, all}]. +all() -> +[{group, app_test}, {group, appup_test}, + {group, config}, {group, flex}, {group, udp}, + {group, tcp}, {group, examples}, {group, digit_map}, + {group, mess}, {group, measure}, + {group, binary_term_id}, {group, codec}, {group, sdp}, + {group, mib}, {group, trans}, {group, actions}, + {group, load}, {group, pending_limit}, + {group, segmented}, {group, timer}]. + +groups() -> + [{tickets, [], [{group, mess}, {group, codec}]}, + {app_test, [], [{megaco_app_test, all}]}, + {appup_test, [], [{megaco_appup_test, all}]}, + {config, [], [{megaco_config_test, all}]}, + {call_flow, [], [{megaco_call_flow_test, all}]}, + {digit_map, [], [{megaco_digit_map_test, all}]}, + {mess, [], [{megaco_mess_test, all}]}, + {udp, [], [{megaco_udp_test, all}]}, + {tcp, [], [{megaco_tcp_test, all}]}, + {examples, [], [{megaco_examples_test, all}]}, + {measure, [], [{megaco_measure_test, all}]}, + {binary_term_id, [], + [{megaco_binary_term_id_test, all}]}, + {codec, [], [{megaco_codec_test, all}]}, + {sdp, [], [{megaco_sdp_test, all}]}, + {mib, [], [{megaco_mib_test, all}]}, + {trans, [], [{megaco_trans_test, all}]}, + {actions, [], [{megaco_actions_test, all}]}, + {load, [], [{megaco_load_test, all}]}, + {pending_limit, [], [{megaco_pending_limit_test, all}]}, + {segmented, [], [{megaco_segment_test, all}]}, + {timer, [], [{megaco_timer_test, all}]}, + {flex, [], [{megaco_flex_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl index fe9fee86c7..8e89491893 100644 --- a/lib/megaco/test/megaco_actions_test.erl +++ b/lib/megaco/test/megaco_actions_test.erl @@ -78,21 +78,21 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - pretty_text, - flex_pretty_text, - compact_text, - flex_compact_text, - erl_dist, - erl_dist_mc, - ber_bin, - ber_bin_drv, - ber_bin_native, - ber_bin_drv_native - ], - Cases. +all() -> +Cases = [pretty_text, flex_pretty_text, compact_text, + flex_compact_text, erl_dist, erl_dist_mc, ber_bin, + ber_bin_drv, ber_bin_native, ber_bin_drv_native], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl index 7aeca32540..7d5994c9b7 100644 --- a/lib/megaco/test/megaco_app_test.erl +++ b/lib/megaco/test/megaco_app_test.erl @@ -44,16 +44,20 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs - ], - {req, [], {conf, app_init, Cases, app_fin}}. +all() -> +Cases = [fields, modules, exportall, app_depend, + undef_funcs], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl index 2466a7b0cd..552d6049b9 100644 --- a/lib/megaco/test/megaco_appup_test.erl +++ b/lib/megaco/test/megaco_appup_test.erl @@ -43,12 +43,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup - ], - {req, [], {conf, appup_init, Cases, appup_fin}}. +all() -> +Cases = [appup], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_binary_term_id_test.erl b/lib/megaco/test/megaco_binary_term_id_test.erl index 0c2a8f8af4..bb9fca951b 100644 --- a/lib/megaco/test/megaco_binary_term_id_test.erl +++ b/lib/megaco/test/megaco_binary_term_id_test.erl @@ -37,7 +37,7 @@ -export([t/0]). %% Test suite exports --export([all/1, encode_first/1, decode_first/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). @@ -57,17 +57,21 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - encode_first, - decode_first - ]. +all() -> +[{group, encode_first}, {group, decode_first}]. + +groups() -> + [{encode_first, [], encode_first_cases()}, + {decode_first, [], decode_first_cases()}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -encode_first(suite) -> - encode_first_cases(). -decode_first(suite) -> - decode_first_cases(). %% Test server callbacks @@ -89,11 +93,12 @@ t() -> cases() -> encode_first_cases() ++ decode_first_cases(). -encode_first_cases() -> [te01,te02,te03,te04,te05, - te06,te07,te08,te09,te10, - te11,te12,te13,te14,te15, - te16,te17,te18,te19]. -decode_first_cases() -> [td01,td02,td03,td04,td05,td06]. +encode_first_cases() -> +[te01, te02, te03, te04, te05, te06, te07, te08, te09, + te10, te11, te12, te13, te14, te15, te16, te17, te18, + te19]. +decode_first_cases() -> +[td01, td02, td03, td04, td05, td06]. do(Case) -> case doc(Case) of diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl index 5db4cc2c8a..6d4f000670 100644 --- a/lib/megaco/test/megaco_call_flow_test.erl +++ b/lib/megaco/test/megaco_call_flow_test.erl @@ -56,31 +56,23 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary - ]. +all() -> +[{group, text}, {group, binary}]. + +groups() -> + [{text, [], [pretty, compact]}, + {flex, [], [pretty_flex, compact_flex]}, + {binary, [], [bin, ber, ber_bin, per]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -text(suite) -> - [ - pretty, - compact - ]. -flex(suite) -> - [ - pretty_flex, - compact_flex - ]. -binary(suite) -> - [ - bin, - ber, - ber_bin, - per - ]. pretty(suite) -> []; diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl index 7e73d9f85f..f018d3d0d0 100644 --- a/lib/megaco/test/megaco_codec_mini_test.erl +++ b/lib/megaco/test/megaco_codec_mini_test.erl @@ -34,10 +34,10 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, tickets/0, - tickets/1, + otp7672_msg01/1, otp7672_msg02/1, @@ -89,16 +89,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - tickets - ]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], [otp7672_msg01, otp7672_msg02]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [ - otp7672_msg01, - otp7672_msg02 - ]. %% ---- diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index 298ea90b37..baaafc729d 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -36,22 +36,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -65,31 +65,31 @@ flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,7 +133,7 @@ compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_tickets/1, + flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, flex_compact_otp7431_msg03/1, @@ -142,7 +142,7 @@ flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -186,7 +186,7 @@ pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -291,260 +291,161 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -erl_dist(suite) -> - [ - erl_dist_m - ]. -pretty(suite) -> - [ - pretty_test_msgs - ]. -compact(suite) -> - [ - compact_test_msgs - ]. -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index 526f5b75de..563794133a 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -36,22 +36,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -65,31 +65,31 @@ flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -134,7 +134,7 @@ compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_tickets/1, + flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, flex_compact_otp7431_msg03/1, @@ -143,7 +143,7 @@ flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -191,7 +191,7 @@ pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -307,268 +307,165 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5836_msg01, compact_otp5993_msg01, + compact_otp5993_msg02, compact_otp5993_msg03, + compact_otp6017_msg01, compact_otp6017_msg02, + compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -erl_dist(suite) -> - [ - erl_dist_m - ]. -pretty(suite) -> - [ - pretty_test_msgs - ]. -compact(suite) -> - [ - compact_test_msgs - ]. -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index b5c071322b..a2f8e453ac 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -37,22 +37,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -66,31 +66,31 @@ flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -134,7 +134,7 @@ compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_tickets/1, + flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -144,7 +144,7 @@ flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -192,7 +192,7 @@ pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -311,271 +311,167 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. -bin(suite) -> - [ - bin_test_msgs - ]. -ber(suite) -> - [ - ber_test_msgs - ]. -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. -per(suite) -> - [ - per_test_msgs - ]. - %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp4299_msg1, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_test.erl b/lib/megaco/test/megaco_codec_test.erl index 6959ccad92..803b927de7 100644 --- a/lib/megaco/test/megaco_codec_test.erl +++ b/lib/megaco/test/megaco_codec_test.erl @@ -47,17 +47,24 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - codec - ]. - -codec(suite) -> - [{megaco_codec_mini_test, all}, - {megaco_codec_v1_test, all}, - {megaco_codec_v2_test, all}, - {megaco_codec_prev3a_test, all}, - {megaco_codec_prev3b_test, all}, - {megaco_codec_prev3c_test, all}, - {megaco_codec_v3_test, all}]. +all() -> +[{group, codec}]. + +groups() -> + [{codec, [], + [{megaco_codec_mini_test, all}, + {megaco_codec_v1_test, all}, + {megaco_codec_v2_test, all}, + {megaco_codec_prev3a_test, all}, + {megaco_codec_prev3b_test, all}, + {megaco_codec_prev3c_test, all}, + {megaco_codec_v3_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 5918103417..74c70b72ee 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -38,22 +38,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -64,31 +64,31 @@ flex_compact_dm_timers5/1, flex_compact_dm_timers6/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -132,7 +132,7 @@ compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_tickets/1, + flex_compact_otp7431_msg01a/1, flex_compact_otp7431_msg01b/1, flex_compact_otp7431_msg02/1, @@ -142,7 +142,7 @@ flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -184,7 +184,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -477,257 +477,160 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. - -erl_dist(suite) -> - [ - erl_dist_m - ]. - -pretty(suite) -> - [ - pretty_test_msgs - ]. - - -compact(suite) -> - [ - compact_test_msgs - ]. - - -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. - -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. - - -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6 - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5600_msg1, pretty_otp5600_msg2, + pretty_otp5601_msg1, pretty_otp5793_msg01, + pretty_otp5882_msg01, pretty_otp6490_msg01, + pretty_otp6490_msg02, pretty_otp6490_msg03, + pretty_otp6490_msg04, pretty_otp6490_msg05, + pretty_otp6490_msg06, pretty_otp7671_msg01, + pretty_otp7671_msg02, pretty_otp7671_msg03, + pretty_otp7671_msg04, pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6]. -bin(suite) -> - [ - bin_test_msgs - ]. -ber(suite) -> - [ - ber_test_msgs - ]. -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - pretty_tickets, - flex_compact_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7431_msg01a, - flex_compact_otp7431_msg01b, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp7431_msg01a, + flex_compact_otp7431_msg01b, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index ceb7e4d879..f49522769d 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -37,22 +37,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -66,31 +66,31 @@ flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -144,7 +144,7 @@ compact_otp7576_msg01/1, compact_otp7671_msg01/1, - flex_compact_tickets/1, + flex_compact_otp7138_msg01/1, flex_compact_otp7138_msg02/1, flex_compact_otp7431_msg01/1, @@ -161,7 +161,7 @@ flex_compact_otp7573_msg01/1, flex_compact_otp7576_msg01/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -204,7 +204,7 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -458,276 +458,169 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5290_msg01, + compact_otp5290_msg02, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03, + compact_otp7138_msg01, compact_otp7138_msg02, + compact_otp7457_msg01, compact_otp7457_msg02, + compact_otp7457_msg03, compact_otp7534_msg01, + compact_otp7576_msg01, compact_otp7671_msg01]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5600_msg1, pretty_otp5600_msg2, + pretty_otp5601_msg1, pretty_otp5793_msg01, + pretty_otp5882_msg01, pretty_otp6490_msg01, + pretty_otp6490_msg02, pretty_otp6490_msg03, + pretty_otp6490_msg04, pretty_otp6490_msg05, + pretty_otp6490_msg06, pretty_otp7249_msg01, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -erl_dist(suite) -> - [ - erl_dist_m - ]. -pretty(suite) -> - [ - pretty_test_msgs - ]. -compact(suite) -> - [ - compact_test_msgs - ]. -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - pretty_tickets, - flex_compact_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4299_msg2, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5290_msg01, - compact_otp5290_msg02, - compact_otp5793_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03, - compact_otp7138_msg01, - compact_otp7138_msg02, - compact_otp7457_msg01, - compact_otp7457_msg02, - compact_otp7457_msg03, - compact_otp7534_msg01, - compact_otp7576_msg01, - compact_otp7671_msg01 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp7138_msg01, - flex_compact_otp7138_msg02, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07, - flex_compact_otp7138_msg02, - flex_compact_otp7457_msg01, - flex_compact_otp7457_msg02, - flex_compact_otp7457_msg03, - flex_compact_otp7534_msg01, - flex_compact_otp7573_msg01, - flex_compact_otp7576_msg01 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp7138_msg01, flex_compact_otp7138_msg02, + flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07, flex_compact_otp7138_msg02, + flex_compact_otp7457_msg01, flex_compact_otp7457_msg02, + flex_compact_otp7457_msg03, flex_compact_otp7534_msg01, + flex_compact_otp7573_msg01, flex_compact_otp7576_msg01]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7249_msg01, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index d4d95d6b47..383de670e7 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -37,22 +37,22 @@ -export([t/0, t/1]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - text/1, + - pretty/1, + pretty_test_msgs/1, - compact/1, + compact_test_msgs/1, - flex_pretty/1, + flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact/1, + flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, @@ -66,31 +66,31 @@ flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - binary/1, - bin/1, + + bin_test_msgs/1, - ber/1, + ber_test_msgs/1, - ber_bin/1, + ber_bin_test_msgs/1, - per/1, + per_test_msgs/1, - per_bin/1, + per_bin_test_msgs/1, - erl_dist/1, - erl_dist_m/1, + + erl_dist_m_test_msgs/1, tickets/0, - tickets/1, + - compact_tickets/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -134,7 +134,7 @@ compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_tickets/1, + flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -145,7 +145,7 @@ flex_compact_otp7431_msg07/1, - pretty_tickets/1, + pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, pretty_otp4632_msg3/1, @@ -193,7 +193,7 @@ pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_tickets/1, + flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -311,271 +311,167 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - text, - binary, - erl_dist, - tickets - ]. - -text(suite) -> - [ - pretty, - flex_pretty, - compact, - flex_compact - ]. - -binary(suite) -> - [ - bin, - ber, - ber_bin, - per, - per_bin - ]. +all() -> +[{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. + +groups() -> + [{text, [], + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + +init_per_group(flex_pretty_tickets, Config) -> + flex_pretty_init(Config); +init_per_group(flex_compact_tickets, Config) -> + flex_compact_init(Config); +init_per_group(flex_compact, Config) -> + flex_compact_init(Config); +init_per_group(flex_pretty, Config) -> + flex_pretty_init(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(flex_pretty_tickets, Config) -> + flex_pretty_finish(Config); +end_per_group(flex_compact_tickets, Config) -> + flex_compact_finish(Config); +end_per_group(flex_compact, Config) -> + flex_compact_finish(Config); +end_per_group(flex_pretty, Config) -> + flex_pretty_finish(Config); +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + +flex_pretty_cases() -> +[flex_pretty_test_msgs]. + + +flex_compact_cases() -> +[flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. -erl_dist(suite) -> - [ - erl_dist_m - ]. -pretty(suite) -> - [ - pretty_test_msgs - ]. -compact(suite) -> - [ - compact_test_msgs - ]. -flex_pretty(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_cases(), flex_pretty_finish}}. -flex_pretty_cases() -> - [ - flex_pretty_test_msgs - ]. -flex_compact(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_cases(), flex_compact_finish}}. - -flex_compact_cases() -> - [ - flex_compact_test_msgs, - flex_compact_dm_timers1, - flex_compact_dm_timers2, - flex_compact_dm_timers3, - flex_compact_dm_timers4, - flex_compact_dm_timers5, - flex_compact_dm_timers6, - flex_compact_dm_timers7, - flex_compact_dm_timers8 - ]. - - -bin(suite) -> - [ - bin_test_msgs - ]. - - -ber(suite) -> - [ - ber_test_msgs - ]. - - -ber_bin(suite) -> - [ - ber_bin_test_msgs - ]. - - -per(suite) -> - [ - per_test_msgs - ]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% -per_bin(suite) -> - [ - per_bin_test_msgs - ]. -erl_dist_m(suite) -> - [ - erl_dist_m_test_msgs - ]. -tickets(suite) -> - [ - compact_tickets, - flex_compact_tickets, - pretty_tickets, - flex_pretty_tickets - ]. -compact_tickets(suite) -> - [ - compact_otp4011_msg1, - compact_otp4011_msg2, - compact_otp4011_msg3, - compact_otp4013_msg1, - compact_otp4085_msg1, - compact_otp4085_msg2, - compact_otp4280_msg1, - compact_otp4299_msg1, - compact_otp4359_msg1, - compact_otp4920_msg0, - compact_otp4920_msg1, - compact_otp4920_msg2, - compact_otp4920_msg3, - compact_otp4920_msg4, - compact_otp4920_msg5, - compact_otp4920_msg6, - compact_otp4920_msg7, - compact_otp4920_msg8, - compact_otp4920_msg9, - compact_otp4920_msg10, - compact_otp4920_msg11, - compact_otp4920_msg12, - compact_otp4920_msg20, - compact_otp4920_msg21, - compact_otp4920_msg22, - compact_otp4920_msg23, - compact_otp4920_msg24, - compact_otp4920_msg25, - compact_otp5186_msg01, - compact_otp5186_msg02, - compact_otp5186_msg03, - compact_otp5186_msg04, - compact_otp5186_msg05, - compact_otp5186_msg06, - compact_otp5793_msg01, - compact_otp5836_msg01, - compact_otp5993_msg01, - compact_otp5993_msg02, - compact_otp5993_msg03, - compact_otp6017_msg01, - compact_otp6017_msg02, - compact_otp6017_msg03 - ]. -flex_compact_tickets(suite) -> - {req, [], - {conf, flex_compact_init, flex_compact_tickets_cases(), - flex_compact_finish}}. -flex_compact_tickets_cases() -> - [ - flex_compact_otp4299_msg1, - flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07 - ]. +flex_compact_tickets_cases() -> +[flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. -pretty_tickets(suite) -> - [ - pretty_otp4632_msg1, - pretty_otp4632_msg2, - pretty_otp4632_msg3, - pretty_otp4632_msg4, - pretty_otp4710_msg1, - pretty_otp4710_msg2, - pretty_otp4945_msg1, - pretty_otp4945_msg2, - pretty_otp4945_msg3, - pretty_otp4945_msg4, - pretty_otp4945_msg5, - pretty_otp4945_msg6, - pretty_otp4949_msg1, - pretty_otp4949_msg2, - pretty_otp4949_msg3, - pretty_otp5042_msg1, - pretty_otp5068_msg1, - pretty_otp5085_msg1, - pretty_otp5085_msg2, - pretty_otp5085_msg3, - pretty_otp5085_msg4, - pretty_otp5085_msg5, - pretty_otp5085_msg6, - pretty_otp5085_msg7, - pretty_otp5085_msg8, - pretty_otp5600_msg1, - pretty_otp5600_msg2, - pretty_otp5601_msg1, - pretty_otp5793_msg01, - pretty_otp5803_msg01, - pretty_otp5803_msg02, - pretty_otp5805_msg01, - pretty_otp5836_msg01, - pretty_otp5882_msg01, - pretty_otp6490_msg01, - pretty_otp6490_msg02, - pretty_otp6490_msg03, - pretty_otp6490_msg04, - pretty_otp6490_msg05, - pretty_otp6490_msg06, - pretty_otp7671_msg01, - pretty_otp7671_msg02, - pretty_otp7671_msg03, - pretty_otp7671_msg04, - pretty_otp7671_msg05, - pretty_otp8114_msg01 - ]. -flex_pretty_tickets(suite) -> - {req, [], - {conf, flex_pretty_init, flex_pretty_tickets_cases(), - flex_pretty_finish}}. -flex_pretty_tickets_cases() -> - [ - flex_pretty_otp5042_msg1, - flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, - flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, - flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, - flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, - flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, - flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, - flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, - flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07 - ]. +flex_pretty_tickets_cases() -> +[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_config_test.erl b/lib/megaco/test/megaco_config_test.erl index 180139629a..34ab0f0ba4 100644 --- a/lib/megaco/test/megaco_config_test.erl +++ b/lib/megaco/test/megaco_config_test.erl @@ -58,25 +58,24 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(suite) -> - [ - config, - transaction_id_counter, - tickets - ]. - -transaction_id_counter(suite) -> - [ - transaction_id_counter_mg, - transaction_id_counter_mgc - ]. - -tickets(suite) -> - [ - otp_7216, - otp_8167, - otp_8183 - ]. +all() -> +[config, {group, transaction_id_counter}, + {group, tickets}]. + +groups() -> + [{transaction_id_counter, [], + [transaction_id_counter_mg, + transaction_id_counter_mgc]}, + {tickets, [], [otp_7216, otp_8167, otp_8183]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_digit_map_test.erl b/lib/megaco/test/megaco_digit_map_test.erl index 729b8c7ff6..fa5ab37936 100644 --- a/lib/megaco/test/megaco_digit_map_test.erl +++ b/lib/megaco/test/megaco_digit_map_test.erl @@ -42,48 +42,34 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - tickets - ], - Cases. +all() -> +Cases = [{group, tickets}], + Cases. + +groups() -> + [{tickets, [], + [{group, otp_5750}, {group, otp_5799}, + {group, otp_5826}, {group, otp_7449}]}, + {otp_5750, [], [otp_5750_01, otp_5750_02]}, + {otp_5799, [], [otp_5799_01]}, + {otp_5826, [], [otp_5826_01, otp_5826_02, otp_5826_03]}, + {otp_7449, [], [otp_7449_1, otp_7449_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -tickets(suite) -> - [ - otp_5750, - otp_5799, - otp_5826, - otp_7449 - ]. - - -otp_5750(suite) -> - [ - otp_5750_01, - otp_5750_02 - ]. - -otp_5799(suite) -> - [ - otp_5799_01 - ]. - -otp_5826(suite) -> - [ - otp_5826_01, - otp_5826_02, - otp_5826_03 - ]. - -otp_7449(suite) -> - [ - otp_7449_1, - otp_7449_2 - ]. + + + + + diff --git a/lib/megaco/test/megaco_examples_test.erl b/lib/megaco/test/megaco_examples_test.erl index 3f5b28fb75..f44a4f1c43 100644 --- a/lib/megaco/test/megaco_examples_test.erl +++ b/lib/megaco/test/megaco_examples_test.erl @@ -70,13 +70,18 @@ purge_examples() -> %% Top test case %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run all examples mentioned in the documentation", - "Are really all examples covered?"]; -all(suite) -> - [ - simple - ]. +all() -> +[simple]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + simple(suite) -> []; diff --git a/lib/megaco/test/megaco_flex_test.erl b/lib/megaco/test/megaco_flex_test.erl index e863a08b9b..dfa1d8f34d 100644 --- a/lib/megaco/test/megaco_flex_test.erl +++ b/lib/megaco/test/megaco_flex_test.erl @@ -34,7 +34,7 @@ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, flex_init/1, flex_fin/1, plain/1, @@ -61,14 +61,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - plain, - port_exit, - garbage_in - ], - {req, [], {conf, flex_init, Cases, flex_fin}}. +all() -> +Cases = [plain, port_exit, garbage_in], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + flex_init(suite) -> []; diff --git a/lib/megaco/test/megaco_load_test.erl b/lib/megaco/test/megaco_load_test.erl index de94625945..115a4107e9 100644 --- a/lib/megaco/test/megaco_load_test.erl +++ b/lib/megaco/test/megaco_load_test.erl @@ -106,19 +106,23 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - single_user_light_load, - single_user_medium_load, - single_user_heavy_load, - single_user_extreme_load, - multi_user_light_load, - multi_user_medium_load, - multi_user_heavy_load, - multi_user_extreme_load - ], - Cases. +all() -> +Cases = [single_user_light_load, + single_user_medium_load, single_user_heavy_load, + single_user_extreme_load, multi_user_light_load, + multi_user_medium_load, multi_user_heavy_load, + multi_user_extreme_load], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl index b70098fbaf..9eb2d0ed3b 100644 --- a/lib/megaco/test/megaco_mess_test.erl +++ b/lib/megaco/test/megaco_mess_test.erl @@ -34,13 +34,13 @@ %% -compile(export_all). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, connect/1, - request_and_reply/1, + request_and_reply_plain/1, request_and_no_reply/1, request_and_reply_pending_ack_no_pending/1, @@ -52,13 +52,13 @@ request_and_reply_and_late_ack/1, trans_req_and_reply_and_req/1, - pending_ack/1, + pending_ack_plain/1, request_and_pending_and_late_reply/1, dist/1, - tickets/1, + otp_4359/1, otp_4836/1, otp_5805/1, @@ -67,18 +67,18 @@ otp_6253/1, otp_6275/1, otp_6276/1, - otp_6442/1, + otp_6442_resend_request1/1, otp_6442_resend_request2/1, otp_6442_resend_reply1/1, otp_6442_resend_reply2/1, - otp_6865/1, + otp_6865_request_and_reply_plain_extra1/1, otp_6865_request_and_reply_plain_extra2/1, otp_7189/1, otp_7259/1, otp_7713/1, - otp_8183/1, + otp_8183_request1/1, otp_8212/1 ]). @@ -346,74 +346,48 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - connect, - request_and_reply, - pending_ack, - dist, - - %% Tickets last - tickets - ]. - -request_and_reply(suite) -> - [ - request_and_reply_plain, - request_and_no_reply, - request_and_reply_pending_ack_no_pending, - request_and_reply_pending_ack_one_pending, - single_trans_req_and_reply, - single_trans_req_and_reply_sendopts, - request_and_reply_and_ack, - request_and_reply_and_no_ack, - request_and_reply_and_late_ack, - trans_req_and_reply_and_req - ]. - -pending_ack(suite) -> - [ - pending_ack_plain, - request_and_pending_and_late_reply - ]. - -tickets(suite) -> - [ - otp_4359, - otp_4836, - otp_5805, - otp_5881, - otp_5887, - otp_6253, - otp_6275, - otp_6276, - otp_6442, - otp_6865, - otp_7189, - otp_7259, - otp_7713, - otp_8183, - otp_8212 - ]. - -otp_6442(suite) -> - [ - otp_6442_resend_request1, - otp_6442_resend_request2, - otp_6442_resend_reply1, - otp_6442_resend_reply2 - ]. - -otp_6865(suite) -> - [ - otp_6865_request_and_reply_plain_extra1, - otp_6865_request_and_reply_plain_extra2 - ]. - -otp_8183(suite) -> - [ - otp_8183_request1 - ]. +all() -> +[connect, {group, request_and_reply}, + {group, pending_ack}, dist, {group, tickets}]. + +groups() -> + [{request_and_reply, [], + [request_and_reply_plain, request_and_no_reply, + request_and_reply_pending_ack_no_pending, + request_and_reply_pending_ack_one_pending, + single_trans_req_and_reply, + single_trans_req_and_reply_sendopts, + request_and_reply_and_ack, request_and_reply_and_no_ack, + request_and_reply_and_late_ack, + trans_req_and_reply_and_req]}, + {pending_ack, [], + [pending_ack_plain, + request_and_pending_and_late_reply]}, + {tickets, [], + [otp_4359, otp_4836, otp_5805, otp_5881, otp_5887, + otp_6253, otp_6275, otp_6276, {group, otp_6442}, + {group, otp_6865}, otp_7189, otp_7259, otp_7713, + {group, otp_8183}, otp_8212]}, + {otp_6442, [], + [otp_6442_resend_request1, otp_6442_resend_request2, + otp_6442_resend_reply1, otp_6442_resend_reply2]}, + {otp_6865, [], + [otp_6865_request_and_reply_plain_extra1, + otp_6865_request_and_reply_plain_extra2]}, + {otp_8183, [], [otp_8183_request1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl index f2e4253c0d..721887200c 100644 --- a/lib/megaco/test/megaco_mib_test.erl +++ b/lib/megaco/test/megaco_mib_test.erl @@ -70,14 +70,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - plain, - connect, - traffic - ], - Cases. +all() -> +Cases = [plain, connect, traffic], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mreq_test.erl b/lib/megaco/test/megaco_mreq_test.erl index 7b9de32c1b..06ba3ba82d 100644 --- a/lib/megaco/test/megaco_mreq_test.erl +++ b/lib/megaco/test/megaco_mreq_test.erl @@ -75,14 +75,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - req_and_rep, - req_and_pending, - req_and_cancel - ], - Cases. +all() -> +Cases = [req_and_rep, req_and_pending, req_and_cancel], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_pending_limit_test.erl b/lib/megaco/test/megaco_pending_limit_test.erl index 7c6c8354e8..fed572cb28 100644 --- a/lib/megaco/test/megaco_pending_limit_test.erl +++ b/lib/megaco/test/megaco_pending_limit_test.erl @@ -27,9 +27,9 @@ -export([t/0, t/1]). -export([init_per_testcase/2, end_per_testcase/2]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - sent/1, + sent_timer_late_reply/1, sent_timer_exceeded/1, sent_timer_exceeded_long/1, @@ -37,11 +37,11 @@ sent_resend_exceeded/1, sent_resend_exceeded_long/1, - recv/1, + recv_limit_exceeded1/1, recv_limit_exceeded2/1, - tickets/1, + otp_4956/1, otp_5310/1, otp_5619/1 @@ -145,38 +145,27 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - sent, - recv, - - %% Tickets last - tickets - ]. - -sent(suite) -> - [ - sent_timer_late_reply, - sent_timer_exceeded, - sent_timer_exceeded_long, - sent_resend_late_reply, - sent_resend_exceeded, - sent_resend_exceeded_long - - ]. - -recv(suite) -> - [ - recv_limit_exceeded1, - recv_limit_exceeded2 - ]. - -tickets(suite) -> - [ - otp_4956, - otp_5310, - otp_5619 - ]. +all() -> +[{group, sent}, {group, recv}, {group, tickets}]. + +groups() -> + [{sent, [], + [sent_timer_late_reply, sent_timer_exceeded, + sent_timer_exceeded_long, sent_resend_late_reply, + sent_resend_exceeded, sent_resend_exceeded_long]}, + {recv, [], + [recv_limit_exceeded1, recv_limit_exceeded2]}, + {tickets, [], [otp_4956, otp_5310, otp_5619]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_sdp_test.erl b/lib/megaco/test/megaco_sdp_test.erl index f782d58db5..026a71f34b 100644 --- a/lib/megaco/test/megaco_sdp_test.erl +++ b/lib/megaco/test/megaco_sdp_test.erl @@ -24,10 +24,10 @@ -module(megaco_sdp_test). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, decode_encode/1, - tickets/1, + otp8123/1, init_per_testcase/2, end_per_testcase/2, @@ -55,16 +55,19 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - decode_encode, - tickets - ]. +all() -> +[decode_encode, {group, tickets}]. + +groups() -> + [{tickets, [], [otp8123]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [ - otp8123 - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_segment_test.erl b/lib/megaco/test/megaco_segment_test.erl index 27f0acae9e..0761b5437a 100644 --- a/lib/megaco/test/megaco_segment_test.erl +++ b/lib/megaco/test/megaco_segment_test.erl @@ -25,9 +25,9 @@ -export([t/0, t/1]). -export([init_per_testcase/2, end_per_testcase/2]). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - send/1, + send_segmented_msg_plain1/1, send_segmented_msg_plain2/1, send_segmented_msg_plain3/1, @@ -36,7 +36,7 @@ send_segmented_msg_missing_seg_reply1/1, send_segmented_msg_missing_seg_reply2/1, - recv/1, + recv_segmented_msg_plain/1, recv_segmented_msg_ooo_seg/1, recv_segmented_msg_missing_seg1/1, @@ -73,33 +73,29 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - send, - recv - - %% Tickets last - %% tickets - ]. +all() -> +[{group, send}, {group, recv}]. + +groups() -> + [{send, [], + [send_segmented_msg_plain1, send_segmented_msg_plain2, + send_segmented_msg_plain3, send_segmented_msg_plain4, + send_segmented_msg_ooo1, + send_segmented_msg_missing_seg_reply1, + send_segmented_msg_missing_seg_reply2]}, + {recv, [], + [recv_segmented_msg_plain, recv_segmented_msg_ooo_seg, + recv_segmented_msg_missing_seg1, + recv_segmented_msg_missing_seg2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -send(suite) -> - [ - send_segmented_msg_plain1, - send_segmented_msg_plain2, - send_segmented_msg_plain3, - send_segmented_msg_plain4, - send_segmented_msg_ooo1, - send_segmented_msg_missing_seg_reply1, - send_segmented_msg_missing_seg_reply2 - ]. -recv(suite) -> - [ - recv_segmented_msg_plain, - recv_segmented_msg_ooo_seg, - recv_segmented_msg_missing_seg1, - recv_segmented_msg_missing_seg2 - ]. tickets(suite) -> [ diff --git a/lib/megaco/test/megaco_tcp_test.erl b/lib/megaco/test/megaco_tcp_test.erl index 2348ebb882..1130d7a651 100644 --- a/lib/megaco/test/megaco_tcp_test.erl +++ b/lib/megaco/test/megaco_tcp_test.erl @@ -36,18 +36,18 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, - start/1, + start_normal/1, start_invalid_opt/1, start_and_stop/1, - sending/1, + sendreceive/1, block_unblock/1, - errors/1, + socket_failure/1, accept_process/1, accept_supervisor/1, @@ -121,34 +121,26 @@ end_per_testcase(Case, Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start, - sending, - errors - ]. +all() -> +[{group, start}, {group, sending}, {group, errors}]. + +groups() -> + [{start, [], + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], + [socket_failure, accept_process, accept_supervisor, + connection_supervisor, tcp_server]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -start(suite) -> - [ - start_normal, - start_invalid_opt, - start_and_stop - ]. -sending(suite) -> - [ - sendreceive, - block_unblock - ]. -errors(suite) -> - [ - socket_failure, - accept_process, - accept_supervisor, - connection_supervisor, - tcp_server - ]. %% ------------------ start ------------------------ diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl index d4dcdf77e6..96d2005835 100644 --- a/lib/megaco/test/megaco_timer_test.erl +++ b/lib/megaco/test/megaco_timer_test.erl @@ -27,13 +27,13 @@ t/0, t/1, init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, - simple/1, + simple_init/1, simple_usage/1, - integer_timer/1, + integer_timer_start_and_expire/1, integer_timer_start_and_stop/1%% , @@ -88,32 +88,30 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - simple, - integer_timer%% , -%% incr_timer - ], - Cases. - - -simple(suite) -> - Cases = - [ - simple_init, - simple_usage - ], - Cases. - - -integer_timer(suite) -> - Cases = - [ - integer_timer_start_and_expire, - integer_timer_start_and_stop - ], - Cases. +all() -> +Cases = [{group, simple}, {group, integer_timer}], + Cases. + +groups() -> + [{simple, [], + begin Cases = [simple_init, simple_usage], Cases end}, + {integer_timer, [], + begin + Cases = [integer_timer_start_and_expire, + integer_timer_start_and_stop], + Cases + end}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + %% incr_timer(suite) -> diff --git a/lib/megaco/test/megaco_trans_test.erl b/lib/megaco/test/megaco_trans_test.erl index c31bcb31af..8166ba8aae 100644 --- a/lib/megaco/test/megaco_trans_test.erl +++ b/lib/megaco/test/megaco_trans_test.erl @@ -102,70 +102,50 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - [ - ack, - trans_req, - trans_req_and_ack, - pending, - reply, - - tickets - ]. - -ack(suite) -> - [ - single_ack, - multi_ack_timeout, - multi_ack_maxcount - ]. - -trans_req(suite) -> - [ - single_trans_req, - multi_trans_req_timeout, - multi_trans_req_maxcount1, - multi_trans_req_maxcount2, - multi_trans_req_maxsize1, - multi_trans_req_maxsize2 - ]. - -trans_req_and_ack(suite) -> - [ - single_trans_req_and_ack, - multi_trans_req_and_ack_timeout, - multi_trans_req_and_ack_ackmaxcount, - multi_trans_req_and_ack_reqmaxcount, - multi_trans_req_and_ack_maxsize1, - multi_trans_req_and_ack_maxsize2 - ]. - -pending(suite) -> - [ - single_trans_req_and_pending, - multi_trans_req_and_pending, - multi_trans_req_and_ack_and_pending, - multi_ack_and_pending - ]. - -reply(suite) -> - [ - multi_trans_req_and_reply, - multi_trans_req_and_ack_and_reply, - multi_ack_and_reply - ]. - -tickets(suite) -> - [ - otp_7192 - ]. - -otp_7192(suite) -> - [ - otp_7192_1, - otp_7192_2, - otp_7192_3 - ]. +all() -> +[{group, ack}, {group, trans_req}, + {group, trans_req_and_ack}, {group, pending}, + {group, reply}, {group, tickets}]. + +groups() -> + [{ack, [], + [single_ack, multi_ack_timeout, multi_ack_maxcount]}, + {trans_req, [], + [single_trans_req, multi_trans_req_timeout, + multi_trans_req_maxcount1, multi_trans_req_maxcount2, + multi_trans_req_maxsize1, multi_trans_req_maxsize2]}, + {trans_req_and_ack, [], + [single_trans_req_and_ack, + multi_trans_req_and_ack_timeout, + multi_trans_req_and_ack_ackmaxcount, + multi_trans_req_and_ack_reqmaxcount, + multi_trans_req_and_ack_maxsize1, + multi_trans_req_and_ack_maxsize2]}, + {pending, [], + [single_trans_req_and_pending, + multi_trans_req_and_pending, + multi_trans_req_and_ack_and_pending, + multi_ack_and_pending]}, + {reply, [], + [multi_trans_req_and_reply, + multi_trans_req_and_ack_and_reply, + multi_ack_and_reply]}, + {tickets, [], [{group, otp_7192}]}, + {otp_7192, [], [otp_7192_1, otp_7192_2, otp_7192_3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + diff --git a/lib/megaco/test/megaco_udp_test.erl b/lib/megaco/test/megaco_udp_test.erl index 19eab49931..729882424f 100644 --- a/lib/megaco/test/megaco_udp_test.erl +++ b/lib/megaco/test/megaco_udp_test.erl @@ -34,18 +34,18 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, - start/1, + start_normal/1, start_invalid_opt/1, start_and_stop/1, - sending/1, + sendreceive/1, block_unblock/1, - errors/1, + socket_failure/1, init_per_testcase/2, end_per_testcase/2, @@ -115,31 +115,24 @@ end_per_testcase(Case, Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - start, - sending, - errors - ]. +all() -> +[{group, start}, {group, sending}, {group, errors}]. + +groups() -> + [{start, [], + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], [socket_failure]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -start(suite) -> - [ - start_normal, - start_invalid_opt, - start_and_stop - ]. -sending(suite) -> - [ - sendreceive, - block_unblock - ]. -errors(suite) -> - [ - socket_failure - ]. %% ================================================= -- cgit v1.2.3 From 486455c2ecae11713fc8750a127caf2c853bedee Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:37:41 +0200 Subject: Update mnesia tests to conform with common_test standard --- lib/mnesia/test/mnesia.spec | 99 ++++++-- lib/mnesia/test/mnesia_SUITE.erl | 215 ++++++---------- lib/mnesia/test/mnesia_atomicity_test.erl | 129 +++------- lib/mnesia/test/mnesia_config_test.erl | 110 +++----- lib/mnesia/test/mnesia_consistency_test.erl | 322 ++++++++---------------- lib/mnesia/test/mnesia_dirty_access_test.erl | 163 +++++------- lib/mnesia/test/mnesia_durability_test.erl | 101 +++----- lib/mnesia/test/mnesia_evil_backup.erl | 50 ++-- lib/mnesia/test/mnesia_evil_coverage_test.erl | 144 ++++------- lib/mnesia/test/mnesia_examples_test.erl | 38 ++- lib/mnesia/test/mnesia_frag_test.erl | 56 ++--- lib/mnesia/test/mnesia_install_test.erl | 44 ++-- lib/mnesia/test/mnesia_isolation_test.erl | 146 +++-------- lib/mnesia/test/mnesia_measure_test.erl | 143 ++++------- lib/mnesia/test/mnesia_nice_coverage_test.erl | 18 +- lib/mnesia/test/mnesia_qlc_test.erl | 50 ++-- lib/mnesia/test/mnesia_recovery_test.erl | 243 +++++++----------- lib/mnesia/test/mnesia_registry_test.erl | 19 +- lib/mnesia/test/mnesia_schema_recovery_test.erl | 165 ++++++------ lib/mnesia/test/mnesia_trans_access_test.erl | 91 +++---- 20 files changed, 890 insertions(+), 1456 deletions(-) diff --git a/lib/mnesia/test/mnesia.spec b/lib/mnesia/test/mnesia.spec index 596f8b917d..d24873eed0 100644 --- a/lib/mnesia/test/mnesia.spec +++ b/lib/mnesia/test/mnesia.spec @@ -1,23 +1,76 @@ -{topcase, {dir, "../mnesia_test"}}. -{require_nodenames, 2}. -{skip, {mnesia_measure_test, ram_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, disc_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, disc_only_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, cost, "Takes to long time"}}. -{skip, {mnesia_measure_test, dbn_meters, "Takes to long time"}}. -{skip, {mnesia_measure_test, tpcb, "Takes to long time"}}. -{skip, {mnesia_measure_test, prediction, "Not yet implemented"}}. -{skip, {mnesia_measure_test, consumption, "Not yet implemented"}}. -{skip, {mnesia_measure_test, scalability, "Not yet implemented"}}. -{skip, {mnesia_measure_test, tpcb, "Takes too much time and memory"}}. -{skip, {mnesia_measure_test, measure_all_api_functions, "Not yet implemented"}}. -{skip, {mnesia_measure_test, mnemosyne_vs_mnesia_kernel, "Not yet implemented"}}. -{skip, {mnesia_examples_test, company, "Not yet implemented"}}. -{skip, {mnesia_config_test, ignore_fallback_at_startup, "Not yet implemented"}}. -{skip, {mnesia_evil_backup, local_backup_checkpoint, "Not yet implemented"}}. -{skip, {mnesia_config_test, max_wait_for_decision, "Not yet implemented"}}. -{skip, {mnesia_recovery_test, after_full_disc_partition, "Not yet implemented"}}. -{skip, {mnesia_recovery_test, system_upgrade, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_change_table_copy_type, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_transform_table, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_rename_of_node, "Not yet implemented"}}. +{suites,"mnesia_test",all}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [disc_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [disc_only_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test,[cost],"Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [dbn_meters], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_tpcb,disc_tpcb,disc_only_tpcb], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [reader_disturbed_by_node_down,writer_disturbed_by_node_down, + reader_disturbed_by_node_up,writer_disturbed_by_node_up, + reader_disturbed_by_schema_ops,writer_disturbed_by_schema_ops, + reader_disturbed_by_checkpoint,writer_disturbed_by_checkpoint, + reader_disturbed_by_dump_log,writer_disturbed_by_dump_log, + reader_disturbed_by_backup,writer_disturbed_by_backup, + reader_disturbed_by_restore,writer_disturbed_by_restore, + reader_competing_with_reader,reader_competing_with_writer, + writer_competing_with_reader,writer_competing_with_writer], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [measure_resource_consumption,determine_resource_leakage], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [determine_system_limits,performance_at_min_config, + performance_at_max_config,performance_at_full_load, + resource_consumption_at_min_config, + resource_consumption_at_max_config, + resource_consumption_at_full_load], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_tpcb,disc_tpcb,disc_only_tpcb], + "Takes too much time and memory"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [measure_all_api_functions], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [mnemosyne_vs_mnesia_kernel], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_examples_test, + [company], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_config_test, + [ignore_fallback_at_startup], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_evil_backup, + [local_backup_checkpoint], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_config_test, + [max_wait_for_decision], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_recovery_test, + [after_full_disc_partition], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_recovery_test, + [system_upgrade], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_change_table_copy_type], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_transform_table_ram, + consistency_after_transform_table_disc, + consistency_after_transform_table_disc_only], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_rename_of_node], + "Not yet implemented"}. diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 9c5314bca5..2b9f885c80 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -30,130 +30,107 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify that Mnesia really is a distributed real-time DBMS", - "This is the test suite of the Mnesia DBMS. The test suite", - "covers many aspects of usage and is indended to be developed", - "incrementally. The test suite is divided into a hierarchy of test", - "suites where the leafs actually implements the test cases.", - "The intention of each test case and sub test suite can be", - "read in comments where they are implemented or in worst cases", - "from their long mnemonic names. ", - "", - "The most simple test case of them all is called 'silly'", - "and is useful to run now and then, e.g. when some new fatal", - "bug has been introduced. It may be run even if Mnesia is in", - "such a bad shape that the test machinery cannot be used.", - "NB! Invoke the function directly with mnesia_SUITE:silly()", - "and do not involve the normal test machinery."]; -all(suite) -> - [ - light, - medium, - heavy, - clean_up_suite - ]. +all() -> +[{group, light}, {group, medium}, {group, heavy}, + clean_up_suite]. + +groups() -> + [{light, [], + [{group, install}, {group, nice}, {group, evil}, + {mnesia_frag_test, [{group, light}]}, {group, qlc}, + {group, registry}, {group, config}, {group, examples}]}, + {install, [], [{mnesia_install_test, all}]}, + {nice, [], [{mnesia_nice_coverage_test, all}]}, + {evil, [], [{mnesia_evil_coverage_test, all}]}, + {qlc, [], [{mnesia_qlc_test, all}]}, + {registry, [], [{mnesia_registry_test, all}]}, + {config, [], [{mnesia_config_test, all}]}, + {examples, [], [{mnesia_examples_test, all}]}, + {medium, [], + [{group, install}, {group, atomicity}, + {group, isolation}, {group, durability}, + {group, recovery}, {group, consistency}, + {mnesia_frag_test, [{group, medium}]}]}, + {atomicity, [], [{mnesia_atomicity_test, all}]}, + {isolation, [], [{mnesia_isolation_test, all}]}, + {durability, [], [{mnesia_durability_test, all}]}, + {recovery, [], [{mnesia_recovery_test, all}]}, + {consistency, [], [{mnesia_consistency_test, all}]}, + {heavy, [], [{group, measure}]}, + {measure, [], [{mnesia_measure_test, all}]}, + {prediction, [], + [{mnesia_measure_test, [{group, prediction}]}]}, + {fairness, [], + [{mnesia_measure_test, [{group, fairness}]}]}, + {benchmarks, [], + [{mnesia_measure_test, [{group, benchmarks}]}]}, + {consumption, [], + [{mnesia_measure_test, [{group, consumption}]}]}, + {scalability, [], + [{mnesia_measure_test, [{group, scalability}]}]}, + {otp_r4b, [], + [{mnesia_config_test, access_module}, + {mnesia_config_test, dump_log_load_regulation}, + {mnesia_config_test, embedded_mnemosyne}, + {mnesia_config_test, ignore_fallback_at_startup}, + {mnesia_config_test, max_wait_for_decision}, + {mnesia_consistency_test, consistency_after_restore}, + {mnesia_evil_backup, restore}, + {mnesia_evil_coverage_test, offline_set_master_nodes}, + {mnesia_evil_coverage_test, record_name}, + {mnesia_evil_coverage_test, user_properties}, + {mnesia_registry_test, all}, {group, otp_2363}]}, + {otp_2363, [], + [{mnesia_dirty_access_test, + dirty_index_match_object_disc_only}, + {mnesia_dirty_access_test, dirty_index_read_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_bag_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_set_disc_only}, + {mnesia_evil_coverage_test, + create_live_table_index_disc_only}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +init_per_suite(Config) -> + Config. + +end_per_suite(Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% silly() -> mnesia_install_test:silly(). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -light(doc) -> - ["The 'light' test suite runs a selected set of test suites and is", - "intended to be the smallest test suite that is meaningful", - "to run. It starts with an installation test (which in essence is the", - "'silly' test case) and then it covers all functions in the API in", - "various depths. All configuration parameters and examples are also", - "covered."]; -light(suite) -> - [ - install, - nice, - evil, - {mnesia_frag_test, light}, - qlc, - registry, - config, - examples - ]. - -install(suite) -> - [{mnesia_install_test, all}]. - -nice(suite) -> - [{mnesia_nice_coverage_test, all}]. - -evil(suite) -> - [{mnesia_evil_coverage_test, all}]. - -qlc(suite) -> - [{mnesia_qlc_test, all}]. - -registry(suite) -> - [{mnesia_registry_test, all}]. - -config(suite) -> - [{mnesia_config_test, all}]. - -examples(suite) -> - [{mnesia_examples_test, all}]. + + + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -medium(doc) -> - ["The 'medium' test suite verfies the ACID (atomicity, consistency", - "isolation and durability) properties and various recovery scenarios", - "These tests may take quite while to run."]; -medium(suite) -> - [ - install, - atomicity, - isolation, - durability, - recovery, - consistency, - {mnesia_frag_test, medium} - ]. - -atomicity(suite) -> - [{mnesia_atomicity_test, all}]. + -isolation(suite) -> - [{mnesia_isolation_test, all}]. -durability(suite) -> - [{mnesia_durability_test, all}]. -recovery(suite) -> - [{mnesia_recovery_test, all}]. -consistency(suite) -> - [{mnesia_consistency_test, all}]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -heavy(doc) -> - ["The 'heavy' test suite runs some resource consuming tests and", - "benchmarks"]; -heavy(suite) -> - [measure]. -measure(suite) -> - [{mnesia_measure_test, all}]. -prediction(suite) -> - [{mnesia_measure_test, prediction}]. -fairness(suite) -> - [{mnesia_measure_test, fairness}]. -benchmarks(suite) -> - [{mnesia_measure_test, benchmarks}]. -consumption(suite) -> - [{mnesia_measure_test, consumption}]. -scalability(suite) -> - [{mnesia_measure_test, scalability}]. clean_up_suite(doc) -> ["Not a test case only kills mnesia and nodes, that where" @@ -169,35 +146,7 @@ clean_up_suite(Config) when is_list(Config)-> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -otp_r4b(doc) -> - ["This test suite is an extract of the grand Mnesia suite", - "it contains OTP R4B specific test cases"]; -otp_r4b(suite) -> - [ - {mnesia_config_test, access_module}, - {mnesia_config_test, dump_log_load_regulation}, - {mnesia_config_test, embedded_mnemosyne}, - {mnesia_config_test, ignore_fallback_at_startup}, - {mnesia_config_test, max_wait_for_decision}, - {mnesia_consistency_test, consistency_after_restore}, - {mnesia_evil_backup, restore}, - {mnesia_evil_coverage_test, offline_set_master_nodes}, - {mnesia_evil_coverage_test, record_name}, - {mnesia_evil_coverage_test, user_properties}, - {mnesia_registry_test, all}, - otp_2363 - ]. - -otp_2363(doc) -> - ["Index on disc only tables"]; -otp_2363(suite) -> - [ - {mnesia_dirty_access_test, dirty_index_match_object_disc_only}, - {mnesia_dirty_access_test,dirty_index_read_disc_only}, - {mnesia_dirty_access_test,dirty_index_update_bag_disc_only}, - {mnesia_dirty_access_test,dirty_index_update_set_disc_only}, - {mnesia_evil_coverage_test, create_live_table_index_disc_only} - ]. + diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl index ff34029c9b..3fe38645d6 100644 --- a/lib/mnesia/test/mnesia_atomicity_test.erl +++ b/lib/mnesia/test/mnesia_atomicity_test.erl @@ -31,20 +31,42 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify atomicity of transactions", - "Verify that transactions are atomic, i.e. either all operations", - "in a transaction will be performed or none of them. It must be", - "assured that no partitially completed operations leaves any", - "effects in the database."]; -all(suite) -> - [ - explicit_abort_in_middle_of_trans, - runtime_error_in_middle_of_trans, - kill_self_in_middle_of_trans, - throw_in_middle_of_trans, - mnesia_down_in_middle_of_trans - ]. +all() -> +[explicit_abort_in_middle_of_trans, + runtime_error_in_middle_of_trans, + kill_self_in_middle_of_trans, throw_in_middle_of_trans, + {group, mnesia_down_in_middle_of_trans}]. + +groups() -> + [{mnesia_down_in_middle_of_trans, [], + [mnesia_down_during_infinite_trans, + {group, lock_waiter}, {group, restart_check}]}, + {lock_waiter, [], + [lock_waiter_sw_r, lock_waiter_sw_rt, lock_waiter_sw_wt, + lock_waiter_wr_r, lock_waiter_srw_r, lock_waiter_sw_sw, + lock_waiter_sw_w, lock_waiter_sw_wr, lock_waiter_sw_srw, + lock_waiter_wr_wt, lock_waiter_srw_wt, + lock_waiter_wr_sw, lock_waiter_srw_sw, lock_waiter_wr_w, + lock_waiter_srw_w, lock_waiter_r_sw, lock_waiter_r_w, + lock_waiter_r_wt, lock_waiter_rt_sw, lock_waiter_rt_w, + lock_waiter_rt_wt, lock_waiter_wr_wr, + lock_waiter_srw_srw, lock_waiter_wt_r, lock_waiter_wt_w, + lock_waiter_wt_rt, lock_waiter_wt_wt, lock_waiter_wt_wr, + lock_waiter_wt_srw, lock_waiter_wt_sw, lock_waiter_w_wr, + lock_waiter_w_srw, lock_waiter_w_sw, lock_waiter_w_r, + lock_waiter_w_w, lock_waiter_w_rt, lock_waiter_w_wt]}, + {restart_check, [], + [restart_r_one, restart_w_one, restart_rt_one, + restart_wt_one, restart_wr_one, restart_sw_one, + restart_r_two, restart_w_two, restart_rt_two, + restart_wt_two, restart_wr_two, restart_sw_two]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% explicit_abort_in_middle_of_trans(suite) -> []; @@ -259,12 +281,6 @@ throw_in_middle_of_trans(Config) when is_list(Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_in_middle_of_trans(suite) -> - [ - mnesia_down_during_infinite_trans, - lock_waiter, - restart_check - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mnesia_down_during_infinite_trans(suite) -> []; @@ -304,56 +320,6 @@ mnesia_down_during_infinite_trans(Config) when is_list(Config) -> ?verify_mnesia([Node2], [Node1]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -lock_waiter(doc) -> - ["The purpose of this test case is to test the following situation:", - "process B locks an object, process A accesses that object as", - "well, but A has to wait for the lock to be released. Then", - "mnesia of B goes down. Question: will A get the lock ?", - "important: the transaction of A is the oldest one !!! (= a little tricky)", - "", - "several different access operations shall be tested", - "rt = read_lock_table, wt = write_lock_table, r = read,", - "sw = s_write, w = write, wr = wread"]; -lock_waiter(suite) -> - [ - lock_waiter_sw_r, - lock_waiter_sw_rt, - lock_waiter_sw_wt, - lock_waiter_wr_r, - lock_waiter_srw_r, - lock_waiter_sw_sw, - lock_waiter_sw_w, - lock_waiter_sw_wr, - lock_waiter_sw_srw, - lock_waiter_wr_wt, - lock_waiter_srw_wt, - lock_waiter_wr_sw, - lock_waiter_srw_sw, - lock_waiter_wr_w, - lock_waiter_srw_w, - lock_waiter_r_sw, - lock_waiter_r_w, - lock_waiter_r_wt, - lock_waiter_rt_sw, - lock_waiter_rt_w, - lock_waiter_rt_wt, - lock_waiter_wr_wr, - lock_waiter_srw_srw, - lock_waiter_wt_r, - lock_waiter_wt_w, - lock_waiter_wt_rt, - lock_waiter_wt_wt, - lock_waiter_wt_wr, - lock_waiter_wt_srw, - lock_waiter_wt_sw, - lock_waiter_w_wr, - lock_waiter_w_srw, - lock_waiter_w_sw, - lock_waiter_w_r, - lock_waiter_w_w, - lock_waiter_w_rt, - lock_waiter_w_wt - ]. lock_waiter_sw_r(suite) -> []; lock_waiter_sw_r(Config) when is_list(Config) -> @@ -649,29 +615,6 @@ wait(Mseconds) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -restart_check (doc) -> - [ - "test case:'A' performs a transaction on a table which", - "is only replicated on node B. During that transaction", - "mnesia on node B is killed. The transaction of A should", - "be stopped, since there is no further replica", - "rt = read_lock_table, wt = write_lock_table, r = read,", - "sw = s_write, w = write, wr = wread,"]; -restart_check(suite) -> - [ - restart_r_one, - restart_w_one, - restart_rt_one, - restart_wt_one, - restart_wr_one, - restart_sw_one, - restart_r_two, - restart_w_two, - restart_rt_two, - restart_wt_two, - restart_wr_two, - restart_sw_two - ]. restart_r_one(suite) -> []; restart_r_one(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 6e998329a4..ac74a69334 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -27,14 +27,14 @@ -record(test_table2,{i, b}). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, access_module/1, auto_repair/1, backup_module/1, debug/1, dir/1, dump_log_load_regulation/1, - dump_log_thresholds/1, + dump_log_update_in_place/1, embedded_mnemosyne/1, event_module/1, @@ -44,7 +44,7 @@ send_compressed/1, app_test/1, - schema_config/1, + schema_merge/1, unknown_config/1, @@ -56,7 +56,7 @@ start_first_one_disc_less_then_two_more_disc_less/1, schema_location_and_extra_db_nodes_combinations/1, table_load_to_disc_less_nodes/1, - dynamic_connect/1, + dynamic_basic/1, dynamic_ext/1, dynamic_bad/1, @@ -101,40 +101,34 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - [ - "Test all configuration parameters", - "Perform an exhaustive test of all the various parameters that", - "may be used to configure the Mnesia application.", - "", - "Hint: Check out the unofficial function mnesia:start/1.", - " But be careful to cleanup all configuration parameters", - " afterwards since the rest of the test suite may rely on", - " these default configurations. Perhaps it is best to run", - " these tests in a separate node which is dropped afterwards.", - "Are really all configuration parameters covered?"]; - -all(suite) -> - [ - access_module, - auto_repair, - backup_module, - debug, - dir, - dump_log_load_regulation, - dump_log_thresholds, - dump_log_update_in_place, - embedded_mnemosyne, - event_module, - ignore_fallback_at_startup, - inconsistent_database, - max_wait_for_decision, - send_compressed, - - app_test, - schema_config, - unknown_config - ]. +all() -> +[access_module, auto_repair, backup_module, debug, dir, + dump_log_load_regulation, {group, dump_log_thresholds}, + dump_log_update_in_place, embedded_mnemosyne, + event_module, ignore_fallback_at_startup, + inconsistent_database, max_wait_for_decision, + send_compressed, app_test, {group, schema_config}, + unknown_config]. + +groups() -> + [{dump_log_thresholds, [], + [dump_log_time_threshold, dump_log_write_threshold]}, + {schema_config, [], + [start_one_disc_full_then_one_disc_less, + start_first_one_disc_less_then_one_disc_full, + start_first_one_disc_less_then_two_more_disc_less, + schema_location_and_extra_db_nodes_combinations, + table_load_to_disc_less_nodes, schema_merge, + {group, dynamic_connect}]}, + {dynamic_connect, [], + [dynamic_basic, dynamic_ext, dynamic_bad]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -445,21 +439,6 @@ dump_log_update_in_place(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dump_log_thresholds(doc) -> - ["Elaborate with various values of the dump log thresholds and how", - "they affects each others. Both the dump_log_time_threshold and the", - "dump_log_write_threshold must be covered. Do also check that both", - "kinds of overload events are generated as expected.", - "", - "Logs are checked by first doing whatever has to be done to trigger ", - "a dump, and then stopping Mnesia and then look in the ", - "data files and see that the correct amount of transactions ", - "have been done."]; -dump_log_thresholds(suite) -> - [ - dump_log_time_threshold, - dump_log_write_threshold - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dump_log_write_threshold(doc)-> @@ -783,22 +762,6 @@ event_module(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -schema_config(doc) -> - ["Try many configurations with various schema_location's with and", - "without explicit extra_db_nodes. Do also provoke various schema merge", - "situations. Most of the other test suites focusses on tests where the", - "schema is residing on disc. Now it is time to perform an exhaustive", - "elaboration with various disc less configurations."]; -schema_config(suite) -> - [ - start_one_disc_full_then_one_disc_less, - start_first_one_disc_less_then_one_disc_full, - start_first_one_disc_less_then_two_more_disc_less, - schema_location_and_extra_db_nodes_combinations, - table_load_to_disc_less_nodes, - schema_merge, - dynamic_connect - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start_one_disc_full_then_one_disc_less(doc)-> ["Start a disk node and then a disk less one. Distribute some", @@ -1160,15 +1123,6 @@ sort(NS) when is_list(NS) -> lists:sort(NS). -dynamic_connect(doc) -> - ["Test the new functionality where we start mnesia first and then " - "connect to the other mnesia nodes"]; -dynamic_connect(suite) -> - [ - dynamic_basic, - dynamic_ext, - dynamic_bad - ]. dynamic_basic(suite) -> []; diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl index e74a6ebd4a..ccd5f416f9 100644 --- a/lib/mnesia/test/mnesia_consistency_test.erl +++ b/lib/mnesia/test/mnesia_consistency_test.erl @@ -31,29 +31,117 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify transaction consistency", - "Consistency is the property of the application that requires any", - "execution of the transaction to take the database from one", - "consistent state to another. Verify that the database is", - "consistent at any point in time.", - "Verify for various configurations.", - " Verify for both set and bag"]; -all(suite) -> - [ - consistency_after_restart, - consistency_after_dump_tables, - consistency_after_add_replica, - consistency_after_del_replica, - consistency_after_move_replica, - consistency_after_transform_table, - consistency_after_change_table_copy_type, - consistency_after_fallback, - consistency_after_restore, - consistency_after_rename_of_node, - checkpoint_retainer_consistency, - backup_consistency - ]. +all() -> +[{group, consistency_after_restart}, + {group, consistency_after_dump_tables}, + {group, consistency_after_add_replica}, + {group, consistency_after_del_replica}, + {group, consistency_after_move_replica}, + {group, consistency_after_transform_table}, + consistency_after_change_table_copy_type, + {group, consistency_after_fallback}, + {group, consistency_after_restore}, + consistency_after_rename_of_node, + {group, checkpoint_retainer_consistency}, + {group, backup_consistency}]. + +groups() -> + [{consistency_after_restart, [], + [consistency_after_restart_1_ram, + consistency_after_restart_1_disc, + consistency_after_restart_1_disc_only, + consistency_after_restart_2_ram, + consistency_after_restart_2_disc, + consistency_after_restart_2_disc_only]}, + {consistency_after_dump_tables, [], + [consistency_after_dump_tables_1_ram, + consistency_after_dump_tables_2_ram]}, + {consistency_after_add_replica, [], + [consistency_after_add_replica_2_ram, + consistency_after_add_replica_2_disc, + consistency_after_add_replica_2_disc_only, + consistency_after_add_replica_3_ram, + consistency_after_add_replica_3_disc, + consistency_after_add_replica_3_disc_only]}, + {consistency_after_del_replica, [], + [consistency_after_del_replica_2_ram, + consistency_after_del_replica_2_disc, + consistency_after_del_replica_2_disc_only, + consistency_after_del_replica_3_ram, + consistency_after_del_replica_3_disc, + consistency_after_del_replica_3_disc_only]}, + {consistency_after_move_replica, [], + [consistency_after_move_replica_2_ram, + consistency_after_move_replica_2_disc, + consistency_after_move_replica_2_disc_only, + consistency_after_move_replica_3_ram, + consistency_after_move_replica_3_disc, + consistency_after_move_replica_3_disc_only]}, + {consistency_after_transform_table, [], + [consistency_after_transform_table_ram, + consistency_after_transform_table_disc, + consistency_after_transform_table_disc_only]}, + {consistency_after_fallback, [], + [consistency_after_fallback_2_ram, + consistency_after_fallback_2_disc, + consistency_after_fallback_2_disc_only, + consistency_after_fallback_3_ram, + consistency_after_fallback_3_disc, + consistency_after_fallback_3_disc_only]}, + {consistency_after_restore, [], + [consistency_after_restore_clear_ram, + consistency_after_restore_clear_disc, + consistency_after_restore_clear_disc_only, + consistency_after_restore_recreate_ram, + consistency_after_restore_recreate_disc, + consistency_after_restore_recreate_disc_only]}, + {checkpoint_retainer_consistency, [], + [{group, updates_during_checkpoint_activation}, + {group, updates_during_checkpoint_iteration}, + {group, load_table_with_activated_checkpoint}, + {group, + add_table_copy_to_table_with_activated_checkpoint}]}, + {updates_during_checkpoint_activation, [], + [updates_during_checkpoint_activation_2_ram, + updates_during_checkpoint_activation_2_disc, + updates_during_checkpoint_activation_2_disc_only, + updates_during_checkpoint_activation_3_ram, + updates_during_checkpoint_activation_3_disc, + updates_during_checkpoint_activation_3_disc_only]}, + {updates_during_checkpoint_iteration, [], + [updates_during_checkpoint_iteration_2_ram, + updates_during_checkpoint_iteration_2_disc, + updates_during_checkpoint_iteration_2_disc_only]}, + {load_table_with_activated_checkpoint, [], + [load_table_with_activated_checkpoint_ram, + load_table_with_activated_checkpoint_disc, + load_table_with_activated_checkpoint_disc_only]}, + {add_table_copy_to_table_with_activated_checkpoint, [], + [add_table_copy_to_table_with_activated_checkpoint_ram, + add_table_copy_to_table_with_activated_checkpoint_disc, + add_table_copy_to_table_with_activated_checkpoint_disc_only]}, + {backup_consistency, [], + [{group, interupted_install_fallback}, + {group, interupted_uninstall_fallback}, + {group, mnesia_down_during_backup_causes_switch}, + {group, mnesia_down_during_backup_causes_abort}, + {group, schema_transactions_during_backup}]}, + {interupted_install_fallback, [], + [inst_fallback_process_dies, fatal_when_inconsistency]}, + {interupted_uninstall_fallback, [], [after_delete]}, + {mnesia_down_during_backup_causes_switch, [], + [cause_switch_before, cause_switch_after]}, + {mnesia_down_during_backup_causes_abort, [], + [cause_abort_before, cause_abort_after]}, + {schema_transactions_during_backup, [], + [change_schema_before, change_schema_after]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -185,15 +273,6 @@ receive_messages(ListOfMsgs) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_restart(suite) -> - [ - consistency_after_restart_1_ram, - consistency_after_restart_1_disc, - consistency_after_restart_1_disc_only, - consistency_after_restart_2_ram, - consistency_after_restart_2_disc, - consistency_after_restart_2_disc_only - ]. consistency_after_restart_1_ram(suite) -> []; consistency_after_restart_1_ram(Config) when is_list(Config) -> @@ -237,11 +316,6 @@ consistency_after_restart(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_dump_tables(suite) -> - [ - consistency_after_dump_tables_1_ram, - consistency_after_dump_tables_2_ram - ]. consistency_after_dump_tables_1_ram(suite) -> []; consistency_after_dump_tables_1_ram(Config) when is_list(Config) -> @@ -274,15 +348,6 @@ consistency_after_dump_tables(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_add_replica(suite) -> - [ - consistency_after_add_replica_2_ram, - consistency_after_add_replica_2_disc, - consistency_after_add_replica_2_disc_only, - consistency_after_add_replica_3_ram, - consistency_after_add_replica_3_disc, - consistency_after_add_replica_3_disc_only - ]. consistency_after_add_replica_2_ram(suite) -> []; consistency_after_add_replica_2_ram(Config) when is_list(Config) -> @@ -326,15 +391,6 @@ consistency_after_add_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes0, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_del_replica(suite) -> - [ - consistency_after_del_replica_2_ram, - consistency_after_del_replica_2_disc, - consistency_after_del_replica_2_disc_only, - consistency_after_del_replica_3_ram, - consistency_after_del_replica_3_disc, - consistency_after_del_replica_3_disc_only - ]. consistency_after_del_replica_2_ram(suite) -> []; consistency_after_del_replica_2_ram(Config) when is_list(Config) -> @@ -377,15 +433,6 @@ consistency_after_del_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_move_replica(suite) -> - [ - consistency_after_move_replica_2_ram, - consistency_after_move_replica_2_disc, - consistency_after_move_replica_2_disc_only, - consistency_after_move_replica_3_ram, - consistency_after_move_replica_3_disc, - consistency_after_move_replica_3_disc_only - ]. consistency_after_move_replica_2_ram(suite) -> []; consistency_after_move_replica_2_ram(Config) when is_list(Config) -> @@ -430,16 +477,6 @@ consistency_after_move_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_transform_table(doc) -> - ["Check that the database is consistent after transform_table.", - " While applications are updating the involved tables. "]; - -consistency_after_transform_table(suite) -> - [ - consistency_after_transform_table_ram, - consistency_after_transform_table_disc, - consistency_after_transform_table_disc_only - ]. consistency_after_transform_table_ram(suite) -> []; @@ -498,20 +535,6 @@ consistency_after_change_table_copy_type(doc) -> " While applications are updating the involved tables. "]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_fallback(doc) -> - ["Check that installed fallbacks are consistent. Check this by starting ", - "some nodes, run tpcb on them, take a backup at any time, install it ", - "as a fallback, kill all nodes, start mnesia again and check for ", - "any inconsistencies"]; -consistency_after_fallback(suite) -> - [ - consistency_after_fallback_2_ram, - consistency_after_fallback_2_disc, - consistency_after_fallback_2_disc_only, - consistency_after_fallback_3_ram, - consistency_after_fallback_3_disc - , consistency_after_fallback_3_disc_only - ]. consistency_after_fallback_2_ram(suite) -> []; consistency_after_fallback_2_ram(Config) when is_list(Config) -> @@ -583,18 +606,6 @@ consistency_after_fallback(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_restore(doc) -> - ["Verify consistency after restore operations."]; - -consistency_after_restore(suite) -> - [ - consistency_after_restore_clear_ram, - consistency_after_restore_clear_disc, - consistency_after_restore_clear_disc_only, - consistency_after_restore_recreate_ram, - consistency_after_restore_recreate_disc, - consistency_after_restore_recreate_disc_only - ]. consistency_after_restore_clear_ram(suite) -> []; consistency_after_restore_clear_ram(Config) when is_list(Config) -> @@ -716,32 +727,8 @@ consistency_after_rename_of_node(doc) -> ["Skipped because it is an unimportant case."]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -checkpoint_retainer_consistency(doc) -> - ["Verify that the contents of a checkpoint retainer has the expected", - "contents in various situations."]; -checkpoint_retainer_consistency(suite) -> - [ - updates_during_checkpoint_activation, - updates_during_checkpoint_iteration, - load_table_with_activated_checkpoint, - add_table_copy_to_table_with_activated_checkpoint - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -updates_during_checkpoint_activation(doc) -> - ["Perform updates while the checkpoint getting activated", - "and verify that all checkpoint retainers associated with", - "different replicas of the same table really has the same", - "contents."]; -updates_during_checkpoint_activation(suite) -> - [ - updates_during_checkpoint_activation_2_ram, - updates_during_checkpoint_activation_2_disc, - updates_during_checkpoint_activation_2_disc_only, - updates_during_checkpoint_activation_3_ram, - updates_during_checkpoint_activation_3_disc - , updates_during_checkpoint_activation_3_disc_only - ]. updates_during_checkpoint_activation_2_ram(suite) -> []; updates_during_checkpoint_activation_2_ram(Config) when is_list(Config) -> @@ -808,17 +795,6 @@ updates_during_checkpoint_activation(ReplicaType,NodeConfig,Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -updates_during_checkpoint_iteration(doc) -> - ["Perform updates while someone is iterating over a checkpoint", - "and verify that the iterator really finds the expected data", - "regardless of ongoing upates."]; - -updates_during_checkpoint_iteration(suite) -> - [ - updates_during_checkpoint_iteration_2_ram, - updates_during_checkpoint_iteration_2_disc - , updates_during_checkpoint_iteration_2_disc_only - ]. updates_during_checkpoint_iteration_2_ram(suite) -> []; updates_during_checkpoint_iteration_2_ram(Config) when is_list(Config) -> @@ -890,17 +866,6 @@ loop_accounts(N_br, N_acc) when N_acc >= 1 -> loop_accounts(_,_) -> done. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_table_with_activated_checkpoint(doc) -> - ["Load a table with a checkpoint attached to it and verify that the", - "newly loaded replica also gets a checkpoint retainer attached to it", - "and that it is consistent with the original retainer."]; - -load_table_with_activated_checkpoint(suite) -> - [ - load_table_with_activated_checkpoint_ram, - load_table_with_activated_checkpoint_disc, - load_table_with_activated_checkpoint_disc_only - ]. load_table_with_activated_checkpoint_ram(suite) -> []; load_table_with_activated_checkpoint_ram(Config) when is_list(Config) -> @@ -986,18 +951,6 @@ view(Source, Mod) -> lists:sort(TabList). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -add_table_copy_to_table_with_activated_checkpoint(doc) -> - ["Add a replica to a table with a checkpoint attached to it", - "and verify that the new replica also gets a checkpoint", - "retainer attached to it and that it is consistent with the", - "original retainer."]; - -add_table_copy_to_table_with_activated_checkpoint(suite) -> - [ - add_table_copy_to_table_with_activated_checkpoint_ram, - add_table_copy_to_table_with_activated_checkpoint_disc, - add_table_copy_to_table_with_activated_checkpoint_disc_only - ]. add_table_copy_to_table_with_activated_checkpoint_ram(suite) -> []; add_table_copy_to_table_with_activated_checkpoint_ram(Config) when is_list(Config) -> @@ -1070,25 +1023,8 @@ add_table_copy_to_table_with_activated_checkpoint(Type,Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -backup_consistency(suite) -> - [ - interupted_install_fallback, - interupted_uninstall_fallback, - mnesia_down_during_backup_causes_switch, - mnesia_down_during_backup_causes_abort, - schema_transactions_during_backup - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -interupted_install_fallback(doc) -> - ["Verify that a interrupted install_fallback really", - "is performed on all nodes or none"]; - -interupted_install_fallback(suite) -> - [ - inst_fallback_process_dies, - fatal_when_inconsistency - ]. inst_fallback_process_dies(suite) -> []; @@ -1232,13 +1168,6 @@ is_running(Node, Shouldbe) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -interupted_uninstall_fallback(doc) -> - ["Verify that a interrupted uninstall_fallback really", - "is performed on all nodes or none"]; -interupted_uninstall_fallback(suite) -> - [ - after_delete - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1371,17 +1300,6 @@ do_uninstall(Config,DebugPoint) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_during_backup_causes_switch(doc) -> - ["Verify that an ongoing backup is not disturbed", - "even if the node hosting the replica that currently", - "is being backup'ed is stopped. The backup utility", - "is expected to switch over to another replica and", - "fulfill the backup."]; -mnesia_down_during_backup_causes_switch(suite) -> - [ - cause_switch_before, - cause_switch_after - ]. %%%%%%%%%%%%%%% @@ -1401,16 +1319,6 @@ cause_switch_after(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_during_backup_causes_abort(doc) -> - ["Verify that an ongoing backup is aborted nicely", - "without leaving any backup file if the last replica", - "of a table becomes unavailable due to a node down", - "or some crash."]; -mnesia_down_during_backup_causes_abort(suite) -> - [ - cause_abort_before, - cause_abort_after - ]. %%%%%%%%%%%%%%%%%% @@ -1432,14 +1340,6 @@ cause_abort_after(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -schema_transactions_during_backup(doc) -> - ["Verify that an schema transactions does not", - "affect an ongoing backup."]; -schema_transactions_during_backup(suite) -> - [ - change_schema_before, - change_schema_after - ]. %%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 7456f63fcb..16eef3a111 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -30,33 +30,68 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil dirty access, regardless of transaction scope.", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - dirty_write, - dirty_read, - dirty_update_counter, - dirty_delete, - dirty_delete_object, - dirty_match_object, - dirty_index, - dirty_iter, - admin_tests - ]. +all() -> +[{group, dirty_write}, {group, dirty_read}, + {group, dirty_update_counter}, {group, dirty_delete}, + {group, dirty_delete_object}, + {group, dirty_match_object}, {group, dirty_index}, + {group, dirty_iter}, {group, admin_tests}]. + +groups() -> + [{dirty_write, [], + [dirty_write_ram, dirty_write_disc, + dirty_write_disc_only]}, + {dirty_read, [], + [dirty_read_ram, dirty_read_disc, + dirty_read_disc_only]}, + {dirty_update_counter, [], + [dirty_update_counter_ram, dirty_update_counter_disc, + dirty_update_counter_disc_only]}, + {dirty_delete, [], + [dirty_delete_ram, dirty_delete_disc, + dirty_delete_disc_only]}, + {dirty_delete_object, [], + [dirty_delete_object_ram, dirty_delete_object_disc, + dirty_delete_object_disc_only]}, + {dirty_match_object, [], + [dirty_match_object_ram, dirty_match_object_disc, + dirty_match_object_disc_only]}, + {dirty_index, [], + [{group, dirty_index_match_object}, + {group, dirty_index_read}, + {group, dirty_index_update}]}, + {dirty_index_match_object, [], + [dirty_index_match_object_ram, + dirty_index_match_object_disc, + dirty_index_match_object_disc_only]}, + {dirty_index_read, [], + [dirty_index_read_ram, dirty_index_read_disc, + dirty_index_read_disc_only]}, + {dirty_index_update, [], + [dirty_index_update_set_ram, + dirty_index_update_set_disc, + dirty_index_update_set_disc_only, + dirty_index_update_bag_ram, dirty_index_update_bag_disc, + dirty_index_update_bag_disc_only]}, + {dirty_iter, [], + [dirty_iter_ram, dirty_iter_disc, + dirty_iter_disc_only]}, + {admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Write records dirty -dirty_write(suite) -> - [ - dirty_write_ram, - dirty_write_disc, - dirty_write_disc_only - ]. dirty_write_ram(suite) -> []; dirty_write_ram(Config) when is_list(Config) -> @@ -88,12 +123,6 @@ dirty_write(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read records dirty -dirty_read(suite) -> - [ - dirty_read_ram, - dirty_read_disc, - dirty_read_disc_only - ]. dirty_read_ram(suite) -> []; dirty_read_ram(Config) when is_list(Config) -> @@ -137,12 +166,6 @@ dirty_read(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Update counter record dirty -dirty_update_counter(suite) -> - [ - dirty_update_counter_ram, - dirty_update_counter_disc, - dirty_update_counter_disc_only - ]. dirty_update_counter_ram(suite) -> []; dirty_update_counter_ram(Config) when is_list(Config) -> @@ -180,12 +203,6 @@ dirty_update_counter(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Delete record dirty -dirty_delete(suite) -> - [ - dirty_delete_ram, - dirty_delete_disc, - dirty_delete_disc_only - ]. dirty_delete_ram(suite) -> []; dirty_delete_ram(Config) when is_list(Config) -> @@ -223,12 +240,6 @@ dirty_delete(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Delete matching record dirty -dirty_delete_object(suite) -> - [ - dirty_delete_object_ram, - dirty_delete_object_disc, - dirty_delete_object_disc_only - ]. dirty_delete_object_ram(suite) -> []; dirty_delete_object_ram(Config) when is_list(Config) -> @@ -272,12 +283,6 @@ dirty_delete_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read matching records dirty -dirty_match_object(suite) -> - [ - dirty_match_object_ram, - dirty_match_object_disc, - dirty_match_object_disc_only - ]. dirty_match_object_ram(suite) -> []; dirty_match_object_ram(Config) when is_list(Config) -> @@ -311,22 +316,10 @@ dirty_match_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirty_index(suite) -> - [ - dirty_index_match_object, - dirty_index_read, - dirty_index_update - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Dirty read matching records by using an index -dirty_index_match_object(suite) -> - [ - dirty_index_match_object_ram, - dirty_index_match_object_disc, - dirty_index_match_object_disc_only - ]. dirty_index_match_object_ram(suite) -> []; dirty_index_match_object_ram(Config) when is_list(Config) -> @@ -364,12 +357,6 @@ dirty_index_match_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read records by using an index -dirty_index_read(suite) -> - [ - dirty_index_read_ram, - dirty_index_read_disc, - dirty_index_read_disc_only - ]. dirty_index_read_ram(suite) -> []; dirty_index_read_ram(Config) when is_list(Config) -> @@ -413,19 +400,6 @@ dirty_index_read(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirty_index_update(suite) -> - [ - dirty_index_update_set_ram, - dirty_index_update_set_disc, - dirty_index_update_set_disc_only, - dirty_index_update_bag_ram, - dirty_index_update_bag_disc, - dirty_index_update_bag_disc_only - ]; -dirty_index_update(doc) -> - ["See Ticket OTP-2083, verifies that a table with a index is " - "update in the correct way i.e. the index finds the correct " - "records after a update"]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dirty_index_update_set_ram(suite) -> []; @@ -631,12 +605,6 @@ dirty_index_update_bag(Config, Storage) -> %% Dirty iteration %% dirty_slot, dirty_first, dirty_next -dirty_iter(suite) -> - [ - dirty_iter_ram, - dirty_iter_disc, - dirty_iter_disc_only - ]. dirty_iter_ram(suite) -> []; dirty_iter_ram(Config) when is_list(Config) -> @@ -700,21 +668,6 @@ all_nexts(Tab, PrevKey) -> [PrevKey] ++ all_nexts(Tab, Key). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -admin_tests(doc) -> - ["Verifies that dirty operations work during schema operations"]; - -admin_tests(suite) -> - [del_table_copy_1, - del_table_copy_2, - del_table_copy_3, - add_table_copy_1, - add_table_copy_2, - add_table_copy_3, - add_table_copy_4, - move_table_copy_1, - move_table_copy_2, - move_table_copy_3, - move_table_copy_4]. update_trans(Tab, Key, Acc) -> Update = diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index f94482cf31..d5b0b978e9 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -35,40 +35,47 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify durability", - "Verify that the effects of committed transactions are durable.", - "The content of the tables tables must be restored at startup."]; -all(suite) -> - [ - load_tables, - durability_of_dump_tables, - durability_of_disc_copies, - durability_of_disc_only_copies - ]. +all() -> +[{group, load_tables}, + {group, durability_of_dump_tables}, + durability_of_disc_copies, + durability_of_disc_only_copies]. + +groups() -> + [{load_tables, [], + [load_latest_data, load_local_contents_directly, + load_directly_when_all_are_ram_copiesA, + load_directly_when_all_are_ram_copiesB, + {group, late_load_when_all_are_ram_copies_on_ram_nodes}, + load_when_last_replica_becomes_available, + load_when_we_have_down_from_all_other_replica_nodes, + late_load_transforms_into_disc_load, + late_load_leads_to_hanging, + force_load_when_nobody_intents_to_load, + force_load_when_someone_has_decided_to_load, + force_load_when_someone_else_already_has_loaded, + force_load_when_we_has_loaded, + force_load_on_a_non_local_table, + force_load_when_the_table_does_not_exist, + {group, load_tables_with_master_tables}]}, + {late_load_when_all_are_ram_copies_on_ram_nodes, [], + [late_load_when_all_are_ram_copies_on_ram_nodes1, + late_load_when_all_are_ram_copies_on_ram_nodes2]}, + {load_tables_with_master_tables, [], + [master_nodes, starting_master_nodes, + master_on_non_local_tables, + remote_force_load_with_local_master_node]}, + {durability_of_dump_tables, [], + [dump_ram_copies, dump_disc_copies, dump_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_tables(doc) -> - ["Try to provoke all kinds of table load scenarios."]; -load_tables(suite) -> - [ - load_latest_data, - load_local_contents_directly, - load_directly_when_all_are_ram_copiesA, - load_directly_when_all_are_ram_copiesB, - late_load_when_all_are_ram_copies_on_ram_nodes, - load_when_last_replica_becomes_available, - load_when_we_have_down_from_all_other_replica_nodes, - late_load_transforms_into_disc_load, - late_load_leads_to_hanging, - force_load_when_nobody_intents_to_load, - force_load_when_someone_has_decided_to_load, - force_load_when_someone_else_already_has_loaded, - force_load_when_we_has_loaded, - force_load_on_a_non_local_table, - force_load_when_the_table_does_not_exist, - load_tables_with_master_tables - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% load_latest_data(doc) -> @@ -284,13 +291,6 @@ load_directly_when_all_are_ram_copiesB(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -late_load_when_all_are_ram_copies_on_ram_nodes(doc) -> - ["Load of ram_copies tables when all replicas resides on disc less nodes"]; -late_load_when_all_are_ram_copies_on_ram_nodes(suite) -> - [ - late_load_when_all_are_ram_copies_on_ram_nodes1, - late_load_when_all_are_ram_copies_on_ram_nodes2 - ]. late_load_when_all_are_ram_copies_on_ram_nodes1(suite) -> []; late_load_when_all_are_ram_copies_on_ram_nodes1(Config) when is_list(Config) -> @@ -916,22 +916,6 @@ force_load_when_the_table_does_not_exist(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_tables_with_master_tables(doc) -> - ["Verifies the semantics of different master nodes settings", - "The semantics should be:", - "1. Mnesia downs, Normally decides from where mnesia should load tables", - "2. Master tables (overrides mnesia downs) ", - "3. Force load (overrides Master tables) ", - "--- 1st from active master nodes", - "--- 2nd from active nodes", - "--- 3rd get local copy (if ram create new one)" - ]; - -load_tables_with_master_tables(suite) -> - [master_nodes, - starting_master_nodes, - master_on_non_local_tables, - remote_force_load_with_local_master_node]. -define(SDwrite(Tup), fun() -> mnesia:write(Tup) end). @@ -1156,13 +1140,6 @@ remote_force_load_with_local_master_node(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -durability_of_dump_tables(doc) -> - [ "Verify that all tables contain the correct data when Mnesia", - "is restarted and tables are loaded from disc to recover", - " their previous contents. " ]; -durability_of_dump_tables(suite) -> [dump_ram_copies, - dump_disc_copies, - dump_disc_only]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl index a075974f53..fadeca9660 100644 --- a/lib/mnesia/test/mnesia_evil_backup.erl +++ b/lib/mnesia/test/mnesia_evil_backup.erl @@ -40,26 +40,25 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Checking all the functionality regarding ", - "to the backup and different ", - "kinds of restore and fallback interface"]; - -all(suite) -> - [ - backup, - bad_backup, - global_backup_checkpoint, - restore_tables, - traverse_backup, - selective_backup_checkpoint, - incremental_backup_checkpoint, -%% local_backup_checkpoint, - install_fallback, - uninstall_fallback, - local_fallback, - sops_with_checkpoint - ]. +all() -> +[backup, bad_backup, global_backup_checkpoint, + {group, restore_tables}, traverse_backup, + selective_backup_checkpoint, + incremental_backup_checkpoint, install_fallback, + uninstall_fallback, local_fallback, + sops_with_checkpoint]. + +groups() -> + [{restore_tables, [], + [restore_errors, restore_clear, restore_keep, + restore_recreate, restore_clear_ram]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + backup(doc) -> ["Checking the interface to the function backup", "We don't check that the backups can be used here", @@ -132,17 +131,6 @@ global_backup_checkpoint(Config) when is_list(Config) -> ?match(ok, file:delete(File2)), ?verify_mnesia(Nodes, []). -restore_tables(doc) -> - ["Tests the interface of restore"]; - -restore_tables(suite) -> - [ - restore_errors, - restore_clear, - restore_keep, - restore_recreate, - restore_clear_ram - ]. restore_errors(suite) -> []; restore_errors(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 28537fc68a..52322dc2a3 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -34,41 +34,50 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil usage of the API.", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - system_info, - table_info, - error_description, - db_node_lifecycle, - evil_delete_db_node, - start_and_stop, - checkpoint, - table_lifecycle, - add_copy_conflict, - add_copy_when_going_down, - replica_management, - schema_availability, - local_content, - table_access_modifications, - replica_location, - table_sync, - user_properties, - unsupp_user_props, - record_name, - snmp_access, - subscriptions, - iteration, - debug_support, - sorted_ets, - {mnesia_dirty_access_test, all}, - {mnesia_trans_access_test, all}, - {mnesia_evil_backup, all} - ]. +all() -> +[system_info, table_info, error_description, + db_node_lifecycle, evil_delete_db_node, start_and_stop, + checkpoint, table_lifecycle, add_copy_conflict, + add_copy_when_going_down, replica_management, + schema_availability, local_content, + {group, table_access_modifications}, replica_location, + {group, table_sync}, user_properties, unsupp_user_props, + {group, record_name}, {group, snmp_access}, + {group, subscriptions}, {group, iteration}, + {group, debug_support}, sorted_ets, + {mnesia_dirty_access_test, all}, + {mnesia_trans_access_test, all}, + {mnesia_evil_backup, all}]. + +groups() -> + [{table_access_modifications, [], + [change_table_access_mode, change_table_load_order, + set_master_nodes, offline_set_master_nodes]}, + {table_sync, [], + [dump_tables, dump_log, wait_for_tables, + force_load_table]}, + {snmp_access, [], + [snmp_open_table, snmp_close_table, snmp_get_next_index, + snmp_get_row, snmp_get_mnesia_key, snmp_update_counter, + snmp_order]}, + {subscriptions, [], + [subscribe_standard, subscribe_extended]}, + {iteration, [], [foldl]}, + {debug_support, [], + [info, schema_0, schema_1, view_0, view_1, view_2, + lkill, kill]}, + {record_name, [], [{group, record_name_dirty_access}]}, + {record_name_dirty_access, [], + [record_name_dirty_access_ram, + record_name_dirty_access_disc, + record_name_dirty_access_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -910,13 +919,6 @@ local_content(Config) when is_list(Config) -> ?verify_mnesia(Nodes, []). -table_access_modifications(suite) -> - [ - change_table_access_mode, - change_table_load_order, - set_master_nodes, - offline_set_master_nodes - ]. change_table_access_mode(suite) -> []; change_table_access_mode(Config) when is_list(Config) -> @@ -1103,13 +1105,6 @@ offline_set_master_nodes(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Syncronize table with log or disc %% -table_sync(suite) -> - [ - dump_tables, - dump_log, - wait_for_tables, - force_load_table - ]. %% Dump ram tables on disc dump_tables(suite) -> []; @@ -1359,19 +1354,6 @@ unsupp_user_props(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -snmp_access(doc) -> - ["Make Mnesia table accessible via SNMP"]; - -snmp_access(suite) -> - [ - snmp_open_table, - snmp_close_table, - snmp_get_next_index, - snmp_get_row, - snmp_get_mnesia_key, - snmp_update_counter, - snmp_order - ]. snmp_open_table(suite) -> []; snmp_open_table(Config) when is_list(Config) -> @@ -1779,11 +1761,6 @@ get_keys(Tab, Key) -> -record(tab, {i, e1, e2}). % Simple test table -subscriptions(doc) -> - ["Test the event subscription mechanism"]; -subscriptions(suite) -> - [subscribe_standard, - subscribe_extended]. subscribe_extended(doc) -> ["Test the extended set of events, test with and without checkpoints. "]; @@ -2009,10 +1986,6 @@ recv_event() -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -iteration(doc) -> - ["Verify that the iteration functions works as expected"]; -iteration(suite) -> - [foldl]. foldl(suite) -> @@ -2074,19 +2047,6 @@ sort_res(Else) -> Else. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -debug_support(doc) -> - ["Check that the debug support has not decayed."]; -debug_support(suite) -> - [ - info, - schema_0, - schema_1, - view_0, - view_1, - view_2, - lkill, - kill - ]. info(suite) -> []; info(Config) when is_list(Config) -> @@ -2173,21 +2133,7 @@ kill(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -record_name(doc) -> - ["Verify that record names may be differ from the name of ", - "the hosting table. Check at least access, restore, " - "registry, subscriptions and traveres_backup"]; -record_name(suite) -> - [ - record_name_dirty_access - ]. - -record_name_dirty_access(suite) -> - [ - record_name_dirty_access_ram, - record_name_dirty_access_disc, - record_name_dirty_access_disc_only - ]. + record_name_dirty_access_ram(suite) -> []; diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index 96994b9f22..451f7e8e10 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -61,16 +61,21 @@ opt_load(Mod) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run all examples mentioned in the documentation", - "Are really all examples covered?"]; -all(suite) -> - [ - bup, - company, - meter, - tpcb - ]. +all() -> +[bup, company, meter, {group, tpcb}]. + +groups() -> + [{tpcb, [], + [replica_test, sticky_replica_test, dist_test, + conflict_test, frag_test, frag2_test, remote_test, + remote_frag2_test]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bup(doc) -> ["Run the backup examples in bup.erl"]; @@ -85,19 +90,6 @@ company(doc) -> ["Run the company examples in company.erl and company_o.erl"]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -tpcb(doc) -> - ["Run the sample configurations of the stress tests in mnesia_tpcb.erl"]; -tpcb(suite) -> - [ - replica_test, - sticky_replica_test, - dist_test, - conflict_test, - frag_test, - frag2_test, - remote_test, - remote_frag2_test - ]. replica_test(suite) -> []; replica_test(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl index 0008b69ad0..fa9dd17c76 100644 --- a/lib/mnesia/test/mnesia_frag_test.erl +++ b/lib/mnesia/test/mnesia_frag_test.erl @@ -37,34 +37,29 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify the functionality of fragmented tables"]; -all(suite) -> - [ - light, - medium - ]. - -light(suite) -> - [ - nice, - evil - ]. - -medium(suite) -> - [ - consistency - ]. +all() -> +[{group, light}, {group, medium}]. + +groups() -> + [{light, [], [{group, nice}, {group, evil}]}, + {medium, [], [consistency]}, + {nice, [], + [nice_single, nice_multi, nice_access, iter_access]}, + {evil, [], + [evil_create, evil_delete, evil_change, evil_combine, + evil_loop, evil_delete_db_node]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nice(suite) -> - [ - nice_single, - nice_multi, - nice_access, - iter_access - ]. nice_single(suite) -> []; nice_single(Config) when is_list(Config) -> @@ -503,17 +498,6 @@ consistency(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -evil(doc) -> - ["Evil coverage of fragmentation API."]; -evil(suite) -> - [ - evil_create, - evil_delete, - evil_change, - evil_combine, - evil_loop, - evil_delete_db_node - ]. evil_create(suite) -> []; evil_create(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index c9ba2dca23..9c4095262f 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -31,25 +31,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run some small but demanding test cases in order to verify", - "that the basic functionality in Mnesia still works.", - "", - "Try some very simple things to begin with and increase the", - "difficulty stepwise. This test suite should be run before", - "all the others if you expect to find bugs.", - "", - "The function mnesia_install_test:silly() does not use the whole", - "infra structure of the test suite. Invoke it on a single node to", - "begin with. If that works, proceed with pong = net_adm:ping(SomeOtherNode)", - "and rerun silly() in order to perform some distributed tests."]; -all(suite) -> - [ - silly_durability, - silly_move, - silly_upgrade - %,stress - ]. +all() -> +[silly_durability, silly_move, silly_upgrade]. + +groups() -> + [{stress, [], stress_cases()}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Stepwise of more and more advanced features @@ -286,16 +279,9 @@ transform_some_records(Tab1, _Tab2, Old) -> lists:sort(lists:zf(Filter, Old)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -stress(doc) -> - ["Stress the system a little"]; -stress(suite) -> - stress_cases(). - -stress_cases() -> - [ - conflict, - dist - ]. + +stress_cases() -> +[conflict, dist]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dist(doc) -> diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index 2a638190c6..b3c96aed03 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -31,42 +31,49 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify the isolation property.", - "Operations of concurrent transactions must yield results which", - "are indistinguishable from the results which would be obtained by", - "forcing each transaction to be serially executed to completion in", - "some order. This means that repeated reads of the same records", - "within any committed transaction must have returned identical", - "data when run concurrently with any mix of arbitary transactions.", - "Updates in one transaction must not be visible in any other", - "transaction before the transaction has been committed."]; -all(suite) -> - [ - locking, - visibility - ]. +all() -> +[{group, locking}, {group, visibility}]. + +groups() -> + [{locking, [], + [no_conflict, simple_queue_conflict, + advanced_queue_conflict, simple_deadlock_conflict, + advanced_deadlock_conflict, lock_burst, + {group, sticky_locks}, {group, unbound_locking}, + {group, admin_conflict}, nasty]}, + {sticky_locks, [], [basic_sticky_functionality]}, + {unbound_locking, [], [unbound1, unbound2]}, + {admin_conflict, [], + [create_table, delete_table, move_table_copy, + add_table_index, del_table_index, transform_table, + snmp_open_table, snmp_close_table, + change_table_copy_type, change_table_access, + add_table_copy, del_table_copy, dump_tables, + {group, extra_admin_tests}]}, + {extra_admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}, + {visibility, [], + [dirty_updates_visible_direct, + dirty_reads_regardless_of_trans, + trans_update_invisibible_outside_trans, + trans_update_visible_inside_trans, write_shadows, + delete_shadows, write_delete_shadows_bag, + write_delete_shadows_bag2, {group, iteration}, + shadow_search, snmp_shadows]}, + {removed_resources, [], [rr_kill_copy]}, + {iteration, [], [foldl, first_next]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -locking(doc) -> - ["Verify locking semantics for various configurations", - " NoLock = lock_funs(no_lock, any_granularity)", - " SharedLock = lock_funs(shared_lock, any_granularity)", - " ExclusiveLock = lock_funs(exclusive_lock, any_granularity)", - " AnyLock = lock_funs(any_lock, any_granularity)"]; -locking(suite) -> - [no_conflict, - simple_queue_conflict, - advanced_queue_conflict, - simple_deadlock_conflict, - advanced_deadlock_conflict, - lock_burst, - sticky_locks, - unbound_locking, - admin_conflict, -%% removed_resources, - nasty - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -431,14 +438,6 @@ burst_incr(Tab, Father) -> Father ! burst_incr_done. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -sticky_locks(doc) -> - ["Simple Tests of sticky locks"]; - -sticky_locks(suite) -> - [ - basic_sticky_functionality - %% Needs to be expandand a little bit further - ]. basic_sticky_functionality(suite) -> []; basic_sticky_functionality(Config) when is_list(Config) -> @@ -519,12 +518,6 @@ get_held() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -unbound_locking(suite) -> - [unbound1, unbound2]; - -unbound_locking(doc) -> - ["Check that mnesia handles unbound key variables, GPRS bug." - "Ticket id: OTP-3342"]. unbound1(suite) -> []; unbound1(Config) when is_list(Config) -> @@ -637,25 +630,6 @@ receiver() -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -admin_conflict(doc) -> - ["Provoke lock conflicts with schema transactions and checkpoints."]; -admin_conflict(suite) -> - [ - create_table, - delete_table, - move_table_copy, - add_table_index, - del_table_index, - transform_table, - snmp_open_table, - snmp_close_table, - change_table_copy_type, - change_table_access, - add_table_copy, - del_table_copy, - dump_tables, - extra_admin_tests - ]. create_table(suite) -> []; create_table(Config) when is_list(Config) -> @@ -1088,18 +1062,6 @@ insert(Tab, N) when N > 0 -> ok = mnesia:sync_dirty(fun() -> mnesia:write({Tab, N, N, 0}) end), insert(Tab, N-1). -extra_admin_tests(suite) -> - [del_table_copy_1, - del_table_copy_2, - del_table_copy_3, - add_table_copy_1, - add_table_copy_2, - add_table_copy_3, - add_table_copy_4, - move_table_copy_1, - move_table_copy_2, - move_table_copy_3, - move_table_copy_4]. update_own(Tab, Key, Acc) -> Update = @@ -1347,23 +1309,6 @@ move_table(CallFrom, FromNode, ToNode, [Node1, Node2, Node3], Def) -> ?verify_mnesia([Node1, Node2, Node3], []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -visibility(doc) -> - ["Verify the visibility semantics for various configurations"]; -visibility(suite) -> - [ - dirty_updates_visible_direct, - dirty_reads_regardless_of_trans, - trans_update_invisibible_outside_trans, - trans_update_visible_inside_trans, - write_shadows, - delete_shadows, -%% delete_shadows2, - write_delete_shadows_bag, - write_delete_shadows_bag2, - iteration, - shadow_search, - snmp_shadows - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dirty_updates_visible_direct(doc) -> @@ -1969,10 +1914,6 @@ shadow_search(Config) when is_list(Config) -> ?verify_mnesia([Node1], []). -removed_resources(suite) -> - [rr_kill_copy]; -removed_resources(doc) -> - ["Verify that the locking behave when resources are removed"]. rr_kill_copy(suite) -> []; rr_kill_copy(Config) when is_list(Config) -> @@ -2138,11 +2079,6 @@ get_exit(Pid) -> ?error("Timeout EXIT ~p~n", [Pid]) end. -iteration(doc) -> - ["Verify that the updates before/during iteration are visable " - "and that the order is preserved for ordered_set tables"]; -iteration(suite) -> - [foldl,first_next]. foldl(doc) -> [""]; diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index 2bd8420aba..e9be99411c 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -37,101 +37,62 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Measure various aspects of Mnesia", - "Verify that Mnesia has predictable response times,", - "that the transaction system has fair algoritms,", - "resource consumption, scalabilitym system limits etc.", - "Perform some benchmarks."]; -all(suite) -> - [ - prediction, - consumption, - scalability, - benchmarks - ]. +all() -> +[{group, prediction}, {group, consumption}, + {group, scalability}, {group, benchmarks}]. + +groups() -> + [{prediction, [], + [reader_disturbed_by_node_down, + writer_disturbed_by_node_down, + reader_disturbed_by_node_up, + writer_disturbed_by_node_up, + reader_disturbed_by_schema_ops, + writer_disturbed_by_schema_ops, + reader_disturbed_by_checkpoint, + writer_disturbed_by_checkpoint, + reader_disturbed_by_dump_log, + writer_disturbed_by_dump_log, + reader_disturbed_by_backup, writer_disturbed_by_backup, + reader_disturbed_by_restore, + writer_disturbed_by_restore, {group, fairness}]}, + {fairness, [], + [reader_competing_with_reader, + reader_competing_with_writer, + writer_competing_with_reader, + writer_competing_with_writer]}, + {consumption, [], + [measure_resource_consumption, + determine_resource_leakage]}, + {scalability, [], + [determine_system_limits, performance_at_min_config, + performance_at_max_config, performance_at_full_load, + resource_consumption_at_min_config, + resource_consumption_at_max_config, + resource_consumption_at_full_load]}, + {benchmarks, [], + [{group, meter}, cost, dbn_meters, + measure_all_api_functions, {group, tpcb}, + mnemosyne_vs_mnesia_kernel]}, + {tpcb, [], [ram_tpcb, disc_tpcb, disc_only_tpcb]}, + {meter, [], [ram_meter, disc_meter, disc_only_meter]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -prediction(doc) -> - ["The system must have predictable response times.", - "The maintenance of the system should not impact on the", - "availability. Make sure that the response times does not vary too", - "much from the undisturbed normal usage.", - "Verify that deadlocks never occurs."]; -prediction(suite) -> - [ - reader_disturbed_by_node_down, - writer_disturbed_by_node_down, - reader_disturbed_by_node_up, - writer_disturbed_by_node_up, - reader_disturbed_by_schema_ops, - writer_disturbed_by_schema_ops, - reader_disturbed_by_checkpoint, - writer_disturbed_by_checkpoint, - reader_disturbed_by_dump_log, - writer_disturbed_by_dump_log, - reader_disturbed_by_backup, - writer_disturbed_by_backup, - reader_disturbed_by_restore, - writer_disturbed_by_restore, - fairness - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -fairness(doc) -> - ["Verify that the transaction system behaves fair, even under intense", - "stress. Combine different access patterns (transaction profiles)", - "in order to verify that concurrent applications gets a fair share", - "of the database resource. Verify that starvation never may occur."]; -fairness(suite) -> - [ - reader_competing_with_reader, - reader_competing_with_writer, - writer_competing_with_reader, - writer_competing_with_writer - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consumption(doc) -> - ["Measure the resource consumption and publish the outcome. Make", - "sure that resources are released after failures."]; -consumption(suite) -> - [ - measure_resource_consumption, - determine_resource_leakage - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -scalability(doc) -> - ["Try out where the system limits are. We must at least meet the", - "documented system limits.", - "Redo the performance meters for various configurations and load,", - "especially near system limits."]; -scalability(suite) -> - [ - determine_system_limits, - performance_at_min_config, - performance_at_max_config, - performance_at_full_load, - resource_consumption_at_min_config, - resource_consumption_at_max_config, - resource_consumption_at_full_load - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -benchmarks(doc) -> - ["Measure typical database operations and publish them. Try to", - "verify that new releases of Mnesia always outperforms old", - "releases, or at least that the meters does not get worse."]; -benchmarks(suite) -> - [ - meter, - cost, - dbn_meters, - measure_all_api_functions, - tpcb, - mnemosyne_vs_mnesia_kernel - ]. dbn_meters(suite) -> []; dbn_meters(Config) when is_list(Config) -> @@ -139,12 +100,6 @@ dbn_meters(Config) when is_list(Config) -> ?match(ok, mnesia_dbn_meters:start()), ok. -tpcb(suite) -> - [ - ram_tpcb, - disc_tpcb, - disc_only_tpcb - ]. tpcb(ReplicaType, Config) -> HarakiriDelay = {tc_timeout, timer:minutes(20)}, @@ -171,12 +126,6 @@ disc_only_tpcb(suite) -> []; disc_only_tpcb(Config) when is_list(Config) -> tpcb(disc_only_copies, Config). -meter(suite) -> - [ - ram_meter, - disc_meter, - disc_only_meter - ]. ram_meter(suite) -> []; ram_meter(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl index 0d81a4546f..7835c44d6a 100644 --- a/lib/mnesia/test/mnesia_nice_coverage_test.erl +++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl @@ -32,12 +32,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Test nice usage of the entire API", - "Invoke all functions in the API, at least once.", - "Try to verify that all functions exists and that they perform", - "reasonable things when used in the most simple way."]; -all(suite) -> [nice]. +all() -> +[nice]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + nice(doc) -> [""]; nice(suite) -> []; diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl index 4d164cf1e6..288bd3c2db 100644 --- a/lib/mnesia/test/mnesia_qlc_test.erl +++ b/lib/mnesia/test/mnesia_qlc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -include("mnesia_test_lib.hrl"). -include_lib("stdlib/include/qlc.hrl"). @@ -34,17 +34,31 @@ init_per_testcase(Func, Conf) -> end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). -all(doc) -> - ["Test that the qlc mnesia interface works as expected."]; -all(suite) -> - case code:which(qlc) of - non_existing -> []; - _ -> - all_qlc() - end. +all() -> +case code:which(qlc) of + non_existing -> []; + _ -> all_qlc() +end. + +groups() -> + [{dirty, [], + [dirty_nice_ram_copies, dirty_nice_disc_copies, + dirty_nice_disc_only_copies]}, + {trans, [], + [trans_nice_ram_copies, trans_nice_disc_copies, + trans_nice_disc_only_copies, {group, atomic}]}, + {atomic, [], [atomic_eval]}]. + +init_per_group(_GroupName, Config) -> + Config. -all_qlc() -> - [dirty, trans, frag, info, mnesia_down]. +end_per_group(_GroupName, Config) -> + Config. + + +all_qlc() -> +[{group, dirty}, {group, trans}, frag, info, + mnesia_down]. init_testcases(Type,Config) -> Nodes = [N1,N2] = ?acquire_nodes(2, Config), @@ -59,10 +73,6 @@ init_testcases(Type,Config) -> Nodes. %% Test cases -dirty(suite) -> - [dirty_nice_ram_copies, - dirty_nice_disc_copies, - dirty_nice_disc_only_copies]. dirty_nice_ram_copies(Setup) -> dirty_nice(Setup,ram_copies). dirty_nice_disc_copies(Setup) -> dirty_nice(Setup,disc_copies). @@ -109,12 +119,6 @@ dirty_nice(Config, Type) when is_list(Config) -> end, ?verify_mnesia(Ns, []). -trans(suite) -> - [trans_nice_ram_copies, - trans_nice_disc_copies, - trans_nice_disc_only_copies, - atomic - ]. trans_nice_ram_copies(Setup) -> trans_nice(Setup,ram_copies). trans_nice_disc_copies(Setup) -> trans_nice(Setup,disc_copies). @@ -182,9 +186,7 @@ recs() -> "-record(b, {k,v}). " "-record(k, {t,v}). " >>. - -atomic(suite) -> [atomic_eval]; -atomic(doc) -> []. + atomic_eval(suite) -> []; atomic_eval(doc) -> []; diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index 7b16d0d7dc..4cb6c38186 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -42,34 +42,95 @@ end_per_testcase(Func, Conf) -> -endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify recoverability", - "Verify that the effects of committed transactions are preserved", - "after recovery from system failures. It must be possible to", - "restore the tables to a consistent state on a node, from (any kind", - "of) replica on other nodes as well as from local disk on the failed", - "node. The system must also recover from instantaneous", - "interruption causing disk files to not be completely synchronized."]; - -all(suite) -> - [ - mnesia_down, - explicit_stop, - coord_dies, - schema_trans, - async_dirty, - sync_dirty, - sym_trans, - asym_trans, - after_full_disc_partition, - after_corrupt_files, - disc_less, - garb_decision, - system_upgrade - ]. - -schema_trans(suite) -> - [{mnesia_schema_recovery_test, all}]. +all() -> +[{group, mnesia_down}, {group, explicit_stop}, + coord_dies, {group, schema_trans}, {group, async_dirty}, + {group, sync_dirty}, {group, sym_trans}, + {group, asym_trans}, after_full_disc_partition, + {group, after_corrupt_files}, disc_less, garb_decision, + system_upgrade]. + +groups() -> + [{schema_trans, [], + [{mnesia_schema_recovery_test, all}]}, + {mnesia_down, [], + [{group, mnesia_down_during_startup}, + {group, master_node_tests}, {group, read_during_down}, + {group, with_checkpoint}, delete_during_start]}, + {master_node_tests, [], + [no_master_2, no_master_3, one_master_2, one_master_3, + two_master_2, two_master_3, all_master_2, + all_master_3]}, + {read_during_down, [], + [dirty_read_during_down, trans_read_during_down]}, + {mnesia_down_during_startup, [], + [mnesia_down_during_startup_disk_ram, + mnesia_down_during_startup_init_ram, + mnesia_down_during_startup_init_disc, + mnesia_down_during_startup_init_disc_only, + mnesia_down_during_startup_tm_ram, + mnesia_down_during_startup_tm_disc, + mnesia_down_during_startup_tm_disc_only]}, + {with_checkpoint, [], + [with_checkpoint_same, with_checkpoint_other]}, + {explicit_stop, [], [explicit_stop_during_snmp]}, + {sym_trans, [], + [sym_trans_before_commit_kill_coord_node, + sym_trans_before_commit_kill_coord_pid, + sym_trans_before_commit_kill_part_after_ask, + sym_trans_before_commit_kill_part_before_ask, + sym_trans_after_commit_kill_coord_node, + sym_trans_after_commit_kill_coord_pid, + sym_trans_after_commit_kill_part_after_ask, + sym_trans_after_commit_kill_part_do_commit_pre, + sym_trans_after_commit_kill_part_do_commit_post]}, + {sync_dirty, [], + [sync_dirty_pre_kill_part, + sync_dirty_pre_kill_coord_node, + sync_dirty_pre_kill_coord_pid, + sync_dirty_post_kill_part, + sync_dirty_post_kill_coord_node, + sync_dirty_post_kill_coord_pid]}, + {async_dirty, [], + [async_dirty_pre_kill_part, + async_dirty_pre_kill_coord_node, + async_dirty_pre_kill_coord_pid, + async_dirty_post_kill_part, + async_dirty_post_kill_coord_node, + async_dirty_post_kill_coord_pid]}, + {asym_trans, [], + [asym_trans_kill_part_ask, + asym_trans_kill_part_commit_vote, + asym_trans_kill_part_pre_commit, + asym_trans_kill_part_log_commit, + asym_trans_kill_part_do_commit, + asym_trans_kill_coord_got_votes, + asym_trans_kill_coord_pid_got_votes, + asym_trans_kill_coord_log_commit_rec, + asym_trans_kill_coord_pid_log_commit_rec, + asym_trans_kill_coord_log_commit_dec, + asym_trans_kill_coord_pid_log_commit_dec, + asym_trans_kill_coord_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_rec_acc_pre_commit_done_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]}, + {after_corrupt_files, [], + [after_corrupt_files_decision_log_head, + after_corrupt_files_decision_log_tail, + after_corrupt_files_latest_log_head, + after_corrupt_files_latest_log_tail, + after_corrupt_files_table_dat_head, + after_corrupt_files_table_dat_tail, + after_corrupt_files_schema_dat_head, + after_corrupt_files_schema_dat_tail]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + tpcb_config(ReplicaType, _NodeConfig, Nodes) -> [{n_branches, 5}, @@ -83,30 +144,7 @@ tpcb_config(ReplicaType, _NodeConfig, Nodes) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down(doc) -> - [" Various tests about recovery when mnesia goes down on one or several nodes."]; -mnesia_down(suite) -> - [ - mnesia_down_during_startup, - master_node_tests, - read_during_down, - with_checkpoint, - delete_during_start - ]. - -master_node_tests(doc) -> - ["Verify that mnesia loads the correct data after it has been down, regarding master node settings."]; -master_node_tests(suite) -> - [ - no_master_2, - no_master_3, - one_master_2, - one_master_3, - two_master_2, - two_master_3, - all_master_2, - all_master_3 - ]. + no_master_2(suite) -> []; no_master_2(Config) when is_list(Config) -> mnesia_down_2(no, Config). @@ -251,13 +289,6 @@ mnesia_down_3(Masters, Config) -> ?verify_mnesia(Nodes, []). -read_during_down(doc) -> - ["Verify that read operation can continue to read when mnesia goes down"]; -read_during_down(suite) -> - [ - dirty_read_during_down, - trans_read_during_down - ]. dirty_read_during_down(suite) -> []; @@ -325,20 +356,6 @@ loop_and_kill_mnesia(N, Node, Tabs) -> timer:sleep(100), loop_and_kill_mnesia(N-1, KN, Tabs). -mnesia_down_during_startup(doc) -> - ["Verify that mnesia can come back up again in a consistent state", - "after it has gone down during startup (with different store and", - "when it goes down in different situations"]; -mnesia_down_during_startup(suite) -> - [ - mnesia_down_during_startup_disk_ram, - mnesia_down_during_startup_init_ram, - mnesia_down_during_startup_init_disc, - mnesia_down_during_startup_init_disc_only, - mnesia_down_during_startup_tm_ram, - mnesia_down_during_startup_tm_disc, - mnesia_down_during_startup_tm_disc_only - ]. mnesia_down_during_startup_disk_ram(suite) -> []; mnesia_down_during_startup_disk_ram(Config) when is_list(Config)-> @@ -433,10 +450,6 @@ mnesia_down_during_startup2(Config, ReplicaType, Debug_Point, _Father) -> ?verify_mnesia(Nodes, []). -with_checkpoint(doc) -> - ["Restart mnesia with checkpoint"]; -with_checkpoint(suite) -> - [with_checkpoint_same, with_checkpoint_other]. with_checkpoint_same(suite) -> []; with_checkpoint_same(Config) when is_list(Config) -> @@ -581,10 +594,6 @@ verify_where2read([]) -> ok. %%------------------------------------------------------------------------------------------- -explicit_stop(doc) -> - ["Stop Mnesia in different situations"]; -explicit_stop(suite) -> - [explicit_stop_during_snmp]. %% This is a bad implementation, but at least gives a indication if something is wrong explicit_stop_during_snmp(suite) -> []; explicit_stop_during_snmp(Config) when is_list(Config) -> @@ -700,21 +709,7 @@ coord_dies(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -sym_trans(doc) -> - ["Recovery of symmetrical transactions in a couple of different", - "situations; when coordinator or participant or node dies"]; - -sym_trans(suite) -> - [sym_trans_before_commit_kill_coord_node, %% coordinator node dies - sym_trans_before_commit_kill_coord_pid, %% coordinator process dies - sym_trans_before_commit_kill_part_after_ask, %% participating node dies - sym_trans_before_commit_kill_part_before_ask, - sym_trans_after_commit_kill_coord_node, - sym_trans_after_commit_kill_coord_pid, - sym_trans_after_commit_kill_part_after_ask, - sym_trans_after_commit_kill_part_do_commit_pre, - sym_trans_after_commit_kill_part_do_commit_post]. + %kill_after_debug_point(Config, TestCase, {Debug_node, Debug_Point}, TransFun, Tab) @@ -828,17 +823,6 @@ do_sym_trans([Tab], _Fahter) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -sync_dirty(doc) -> - ["Verify recovery of synchronously operations in a couple of different", - "situations"]; -sync_dirty(suite) -> - [sync_dirty_pre_kill_part, - sync_dirty_pre_kill_coord_node, - sync_dirty_pre_kill_coord_pid, - sync_dirty_post_kill_part, - sync_dirty_post_kill_coord_node, - sync_dirty_post_kill_coord_pid - ]. sync_dirty_pre_kill_part(suite) -> []; sync_dirty_pre_kill_part(Config) when is_list(Config) -> @@ -916,16 +900,6 @@ do_sync_dirty([Tab], _Father) -> ?dl("SYNC_DIRTY done: ~p ", [Res]), ok. -async_dirty(doc) -> - ["Verify recovery of asynchronously dirty operations in a couple of different", - "situations"]; -async_dirty(suite) -> - [async_dirty_pre_kill_part, - async_dirty_pre_kill_coord_node, - async_dirty_pre_kill_coord_pid, - async_dirty_post_kill_part, - async_dirty_post_kill_coord_node, - async_dirty_post_kill_coord_pid]. async_dirty_pre_kill_part(suite) -> []; async_dirty_pre_kill_part(Config) when is_list(Config) -> @@ -1005,29 +979,6 @@ do_async_dirty([Tab], _Fahter) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -asym_trans(doc) -> - ["Recovery of asymmetrical transactions in a couple of different", - "situations, currently the error cases are not covered, i.e. ", - "not tested are the situations when we kill mnesia or a process", - "during a recovery"]; -asym_trans(suite) -> - [ - asym_trans_kill_part_ask, - asym_trans_kill_part_commit_vote, - asym_trans_kill_part_pre_commit, - asym_trans_kill_part_log_commit, - asym_trans_kill_part_do_commit, - asym_trans_kill_coord_got_votes, - asym_trans_kill_coord_pid_got_votes, - asym_trans_kill_coord_log_commit_rec, - asym_trans_kill_coord_pid_log_commit_rec, - asym_trans_kill_coord_log_commit_dec, - asym_trans_kill_coord_pid_log_commit_dec, - asym_trans_kill_coord_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_rec_acc_pre_commit_done_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit - ]. asym_trans_kill_part_ask(suite) -> []; asym_trans_kill_part_ask(Config) when is_list(Config) -> @@ -1435,18 +1386,6 @@ after_full_disc_partition(doc) -> %% interrupted_fallback_start %% is implemented in consistency interupted_install_fallback! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -after_corrupt_files(doc) -> - ["Verify that mnesia (and dets) can handle corrupt files"]; -after_corrupt_files(suite) -> % cope with unsynced disks - [after_corrupt_files_decision_log_head, - after_corrupt_files_decision_log_tail, - after_corrupt_files_latest_log_head, - after_corrupt_files_latest_log_tail, - after_corrupt_files_table_dat_head, - after_corrupt_files_table_dat_tail, - after_corrupt_files_schema_dat_head, - after_corrupt_files_schema_dat_tail - ]. after_corrupt_files_decision_log_head(suite) -> []; after_corrupt_files_decision_log_head(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl index 7d97b66aab..daf6897861 100644 --- a/lib/mnesia/test/mnesia_registry_test.erl +++ b/lib/mnesia/test/mnesia_registry_test.erl @@ -30,13 +30,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Test the mnesia_registry module"]; -all(suite) -> - [ - good_dump, - bad_dump - ]. +all() -> +[good_dump, bad_dump]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% good_dump(doc) -> diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl index d20c94af40..0fd9ffb9a4 100644 --- a/lib/mnesia/test/mnesia_schema_recovery_test.erl +++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl @@ -41,92 +41,85 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify recoverabiliy of schema transactions.", - " Verify that a schema transaction", - " can be completed when it has been logged correctly and Mnesia", - " crashed before the log has been dumped. Then the transaction ", - " should be handled during the log dump at startup" - ]; -all(suite) -> - [interrupted_before_log_dump, - interrupted_after_log_dump]. - -interrupted_before_log_dump(suite) -> - [interrupted_before_create_ram, - interrupted_before_create_disc, - interrupted_before_create_disc_only, - interrupted_before_create_nostore, - interrupted_before_delete_ram, - interrupted_before_delete_disc, - interrupted_before_delete_disc_only, - interrupted_before_add_ram, - interrupted_before_add_disc, - interrupted_before_add_disc_only, - interrupted_before_add_kill_copier, - interrupted_before_move_ram, - interrupted_before_move_disc, - interrupted_before_move_disc_only, - interrupted_before_move_kill_copier, - interrupted_before_delcopy_ram, - interrupted_before_delcopy_disc, - interrupted_before_delcopy_disc_only, - interrupted_before_delcopy_kill_copier, - interrupted_before_addindex_ram, - interrupted_before_addindex_disc, - interrupted_before_addindex_disc_only, - interrupted_before_delindex_ram, - interrupted_before_delindex_disc, - interrupted_before_delindex_disc_only, - interrupted_before_change_type_ram2disc, - interrupted_before_change_type_ram2disc_only, - interrupted_before_change_type_disc2ram, - interrupted_before_change_type_disc2disc_only, - interrupted_before_change_type_disc_only2ram, - interrupted_before_change_type_disc_only2disc, - interrupted_before_change_type_other_node, - interrupted_before_change_schema_type %% Change schema table copy type!! - ]. - -interrupted_after_log_dump(suite) -> - [interrupted_after_create_ram, - interrupted_after_create_disc, - interrupted_after_create_disc_only, - interrupted_after_create_nostore, - interrupted_after_delete_ram, - interrupted_after_delete_disc, - interrupted_after_delete_disc_only, - interrupted_after_add_ram, - interrupted_after_add_disc, - interrupted_after_add_disc_only, - interrupted_after_add_kill_copier, - interrupted_after_move_ram, - interrupted_after_move_disc, - interrupted_after_move_disc_only, - interrupted_after_move_kill_copier, - interrupted_after_delcopy_ram, - interrupted_after_delcopy_disc, - interrupted_after_delcopy_disc_only, - interrupted_after_delcopy_kill_copier, - interrupted_after_addindex_ram, - interrupted_after_addindex_disc, - interrupted_after_addindex_disc_only, - interrupted_after_delindex_ram, - interrupted_after_delindex_disc, - interrupted_after_delindex_disc_only, - interrupted_after_change_type_ram2disc, - interrupted_after_change_type_ram2disc_only, - interrupted_after_change_type_disc2ram, - interrupted_after_change_type_disc2disc_only, - interrupted_after_change_type_disc_only2ram, - interrupted_after_change_type_disc_only2disc, - interrupted_after_change_type_other_node, - interrupted_after_change_schema_type %% Change schema table copy type!! - -% interrupted_before_change_access_mode, -% interrupted_before_transform, -% interrupted_before_restore, - ]. +all() -> +[{group, interrupted_before_log_dump}, + {group, interrupted_after_log_dump}]. + +groups() -> + [{interrupted_before_log_dump, [], + [interrupted_before_create_ram, + interrupted_before_create_disc, + interrupted_before_create_disc_only, + interrupted_before_create_nostore, + interrupted_before_delete_ram, + interrupted_before_delete_disc, + interrupted_before_delete_disc_only, + interrupted_before_add_ram, interrupted_before_add_disc, + interrupted_before_add_disc_only, + interrupted_before_add_kill_copier, + interrupted_before_move_ram, + interrupted_before_move_disc, + interrupted_before_move_disc_only, + interrupted_before_move_kill_copier, + interrupted_before_delcopy_ram, + interrupted_before_delcopy_disc, + interrupted_before_delcopy_disc_only, + interrupted_before_delcopy_kill_copier, + interrupted_before_addindex_ram, + interrupted_before_addindex_disc, + interrupted_before_addindex_disc_only, + interrupted_before_delindex_ram, + interrupted_before_delindex_disc, + interrupted_before_delindex_disc_only, + interrupted_before_change_type_ram2disc, + interrupted_before_change_type_ram2disc_only, + interrupted_before_change_type_disc2ram, + interrupted_before_change_type_disc2disc_only, + interrupted_before_change_type_disc_only2ram, + interrupted_before_change_type_disc_only2disc, + interrupted_before_change_type_other_node, + interrupted_before_change_schema_type]}, + {interrupted_after_log_dump, [], + [interrupted_after_create_ram, + interrupted_after_create_disc, + interrupted_after_create_disc_only, + interrupted_after_create_nostore, + interrupted_after_delete_ram, + interrupted_after_delete_disc, + interrupted_after_delete_disc_only, + interrupted_after_add_ram, interrupted_after_add_disc, + interrupted_after_add_disc_only, + interrupted_after_add_kill_copier, + interrupted_after_move_ram, interrupted_after_move_disc, + interrupted_after_move_disc_only, + interrupted_after_move_kill_copier, + interrupted_after_delcopy_ram, + interrupted_after_delcopy_disc, + interrupted_after_delcopy_disc_only, + interrupted_after_delcopy_kill_copier, + interrupted_after_addindex_ram, + interrupted_after_addindex_disc, + interrupted_after_addindex_disc_only, + interrupted_after_delindex_ram, + interrupted_after_delindex_disc, + interrupted_after_delindex_disc_only, + interrupted_after_change_type_ram2disc, + interrupted_after_change_type_ram2disc_only, + interrupted_after_change_type_disc2ram, + interrupted_after_change_type_disc2disc_only, + interrupted_after_change_type_disc_only2ram, + interrupted_after_change_type_disc_only2disc, + interrupted_after_change_type_other_node, + interrupted_after_change_schema_type]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + interrupted_before_create_ram(suite) -> []; interrupted_before_create_ram(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index a1dea72926..01f1fd026c 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -40,18 +40,41 @@ end_per_testcase(Func, Conf) -> -endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil access of records in the scope of transactions", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - write, read, wread, delete, delete_object, - match_object, select, select14, all_keys, - transaction, nested_activities, - index_tabs, index_lifecycle - ]. +all() -> +[write, read, wread, delete, delete_object, + match_object, select, select14, all_keys, transaction, + {group, nested_activities}, {group, index_tabs}, + {group, index_lifecycle}]. + +groups() -> + [{nested_activities, [], + [basic_nested, {group, nested_transactions}, + mix_of_nested_activities]}, + {nested_transactions, [], + [nested_trans_both_ok, nested_trans_child_dies, + nested_trans_parent_dies, nested_trans_both_dies]}, + {index_tabs, [], + [index_match_object, index_read, {group, index_update}, + index_write]}, + {index_update, [], + [index_update_set, index_update_bag]}, + {index_lifecycle, [], + [add_table_index_ram, add_table_index_disc, + add_table_index_disc_only, create_live_table_index_ram, + create_live_table_index_disc, + create_live_table_index_disc_only, del_table_index_ram, + del_table_index_disc, del_table_index_disc_only, + {group, idx_schema_changes}]}, + {idx_schema_changes, [], + [idx_schema_changes_ram, idx_schema_changes_disc, + idx_schema_changes_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Write records @@ -404,12 +427,6 @@ transaction(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nested_activities(suite) -> - [ - basic_nested, - nested_transactions, - mix_of_nested_activities - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -520,13 +537,6 @@ n_f4() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nested_transactions(doc) -> - ["Verify that nested_transactions are handled as expected"]; -nested_transactions(suite) -> - [nested_trans_both_ok, - nested_trans_child_dies, - nested_trans_parent_dies, - nested_trans_both_dies]. nested_trans_both_ok(suite) -> []; nested_trans_both_ok(Config) when is_list(Config) -> @@ -671,13 +681,6 @@ read_op(Oid) -> Ops end. -index_tabs(suite) -> - [ - index_match_object, - index_read, - index_update, - index_write - ]. %% Read matching records by using an index @@ -767,10 +770,6 @@ index_read(Config) when is_list(Config) -> ?match({'EXIT', {aborted, no_transaction}}, mnesia:index_read(Tab, 2, ValPos)), ?verify_mnesia(Nodes, []). -index_update(suite) -> [index_update_set, index_update_bag]; -index_update(doc) -> ["See Ticket OTP-2083, verifies that a table with a index is " - "update in the correct way i.e. the index finds the correct " - "records after a update"]. index_update_set(suite) -> []; index_update_set(Config)when is_list(Config) -> [Node1] = Nodes = ?acquire_nodes(1, Config), @@ -1046,19 +1045,6 @@ index_write(Config)when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Add and drop indecies -index_lifecycle(suite) -> - [ - add_table_index_ram, - add_table_index_disc, - add_table_index_disc_only, - create_live_table_index_ram, - create_live_table_index_disc, - create_live_table_index_disc_only, - del_table_index_ram, - del_table_index_disc, - del_table_index_disc_only, - idx_schema_changes - ]. add_table_index_ram(suite) -> []; add_table_index_ram(Config) when is_list(Config) -> @@ -1171,13 +1157,6 @@ del_table_index(Config, Storage) -> ?match({atomic, ok}, mnesia:transaction(NestedFun)), ?verify_mnesia(Nodes, []). -idx_schema_changes(suite) -> [idx_schema_changes_ram, - idx_schema_changes_disc, - idx_schema_changes_disc_only]; -idx_schema_changes(doc) -> - ["Tests that index tables are handled correctly when schema changes.", - "For example when a replica is deleted or inserted", - "TICKET OTP-2XXX (ELVIRA)"]. idx_schema_changes_ram(suite) -> []; idx_schema_changes_ram(Config) when is_list(Config) -> -- cgit v1.2.3 From 670f41232381c6c1a47101349567caf9303dea8f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:38:22 +0200 Subject: Update orber tests to conform with common_test standard --- lib/orber/test/cdrcoding_10_SUITE.erl | 39 ++++---- lib/orber/test/cdrcoding_11_SUITE.erl | 39 ++++---- lib/orber/test/cdrcoding_12_SUITE.erl | 39 ++++---- lib/orber/test/cdrlib_SUITE.erl | 21 +++-- lib/orber/test/corba_SUITE.erl | 41 +++++---- lib/orber/test/csiv2_SUITE.erl | 59 ++++-------- lib/orber/test/data_types_SUITE.erl | 19 +++- lib/orber/test/generated_SUITE.erl | 37 +++++--- lib/orber/test/interceptors_SUITE.erl | 19 +++- lib/orber/test/iop_ior_10_SUITE.erl | 19 +++- lib/orber/test/iop_ior_11_SUITE.erl | 19 +++- lib/orber/test/iop_ior_12_SUITE.erl | 19 +++- lib/orber/test/lname_SUITE.erl | 19 +++- lib/orber/test/multi_ORB_SUITE.erl | 112 ++++++++++------------- lib/orber/test/naming_context_SUITE.erl | 30 +++--- lib/orber/test/orber.spec | 20 +--- lib/orber/test/orber_SUITE.erl | 22 +++-- lib/orber/test/orber_acl_SUITE.erl | 25 +++-- lib/orber/test/orber_firewall_ipv4_in_SUITE.erl | 31 ++++--- lib/orber/test/orber_firewall_ipv4_out_SUITE.erl | 32 ++++--- lib/orber/test/orber_firewall_ipv6_in_SUITE.erl | 32 ++++--- lib/orber/test/orber_firewall_ipv6_out_SUITE.erl | 32 ++++--- lib/orber/test/orber_nat_SUITE.erl | 48 +++++----- lib/orber/test/orber_web_SUITE.erl | 22 +++-- lib/orber/test/tc_SUITE.erl | 33 ++++--- 25 files changed, 476 insertions(+), 352 deletions(-) diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl index cfc6f86b54..a08a1aa5b9 100644 --- a/lib/orber/test/cdrcoding_10_SUITE.erl +++ b/lib/orber/test/cdrcoding_10_SUITE.erl @@ -27,7 +27,7 @@ -include("idl_output/Module.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -36,12 +36,11 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -49,13 +48,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> + cases(). -cases() -> - [types, reply, cancel_request, close_connection, message_error]. +groups() -> + [{types, [], + [do_register, null_type, void_type, principal_type, + objref_type, struct_type, union_type, string_type, + array_type, any_type, typecode_type, alias_type, + exception_type, do_unregister]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> + [{group, types}, reply, cancel_request, + close_connection, message_error]. %% request, locate_request, locate_reply]. %%----------------------------------------------------------------- @@ -76,7 +88,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> orber:jump_start(0), if is_list(Config) -> @@ -85,7 +97,7 @@ init_all(Config) when is_list(Config) -> exit("Config not a list") end. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> orber:jump_stop(), Config. @@ -94,11 +106,6 @@ finish_all(Config) when is_list(Config) -> %% Description: Just testing the complex types, the others are %% tested in the cdrlib SUITE. %%----------------------------------------------------------------- -types(doc) -> ["Description", "more description"]; -types(suite) -> [do_register, null_type, void_type, principal_type, - objref_type, struct_type, union_type, string_type, - array_type, any_type, typecode_type, alias_type, - exception_type, do_unregister]. %types(Config) when list(Config) -> % 'oe_orber_test':'oe_register'(), % null_type(), diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl index bd9dff61ba..811dc34c8e 100644 --- a/lib/orber/test/cdrcoding_11_SUITE.erl +++ b/lib/orber/test/cdrcoding_11_SUITE.erl @@ -27,7 +27,7 @@ -include("idl_output/Module.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -36,12 +36,11 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -49,13 +48,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> + cases(). -cases() -> - [types, reply, cancel_request, close_connection, message_error]. +groups() -> + [{types, [], + [do_register, null_type, void_type, principal_type, + objref_type, struct_type, union_type, string_type, + array_type, any_type, typecode_type, alias_type, + exception_type, do_unregister]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> + [{group, types}, reply, cancel_request, + close_connection, message_error]. %% request, locate_request, locate_reply]. %%----------------------------------------------------------------- @@ -76,7 +88,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> orber:jump_start(0), if is_list(Config) -> @@ -85,7 +97,7 @@ init_all(Config) when is_list(Config) -> exit("Config not a list") end. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> orber:jump_stop(), Config. @@ -94,11 +106,6 @@ finish_all(Config) when is_list(Config) -> %% Description: Just testing the complex types, the others are %% tested in the cdrlib SUITE. %%----------------------------------------------------------------- -types(doc) -> ["Description", "more description"]; -types(suite) -> [do_register, null_type, void_type, principal_type, - objref_type, struct_type, union_type, string_type, - array_type, any_type, typecode_type, alias_type, - exception_type, do_unregister]. %types(Config) when list(Config) -> % 'oe_orber_test':'oe_register'(), % null_type(), diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl index d859abca52..967413bef1 100644 --- a/lib/orber/test/cdrcoding_12_SUITE.erl +++ b/lib/orber/test/cdrcoding_12_SUITE.erl @@ -28,7 +28,7 @@ -module(cdrcoding_12_SUITE). -include("idl_output/Module.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -37,12 +37,11 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -50,13 +49,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> + cases(). -cases() -> - [types, reply, cancel_request, close_connection, message_error]. +groups() -> + [{types, [], + [do_register, null_type, void_type, principal_type, + objref_type, struct_type, union_type, string_type, + array_type, any_type, typecode_type, alias_type, + exception_type, do_unregister]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> + [{group, types}, reply, cancel_request, + close_connection, message_error]. %% request, locate_request, locate_reply]. %%----------------------------------------------------------------- @@ -77,7 +89,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> orber:jump_start(0), if is_list(Config) -> @@ -86,7 +98,7 @@ init_all(Config) when is_list(Config) -> exit("Config not a list") end. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> orber:jump_stop(), Config. @@ -95,11 +107,6 @@ finish_all(Config) when is_list(Config) -> %% Description: Just testing the complex types, the others are %% tested in the cdrlib SUITE. %%----------------------------------------------------------------- -types(doc) -> ["Description", "more description"]; -types(suite) -> [do_register, null_type, void_type, principal_type, - objref_type, struct_type, union_type, string_type, - array_type, any_type, typecode_type, alias_type, - exception_type, do_unregister]. do_register(doc) -> []; do_register(suite) -> []; diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index 1b20c1206b..cb0ff87be2 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -25,14 +25,14 @@ %%----------------------------------------------------------------- -module(cdrlib_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(3)). %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -45,10 +45,19 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [short, ushort, long, ulong, longlong, ulonglong, boolean, character, octet, - float, double, enum]. +all() -> +[short, ushort, long, ulong, longlong, ulonglong, + boolean, character, octet, float, double, enum]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl index 0fcb609804..833d67d0ff 100644 --- a/lib/orber/test/corba_SUITE.erl +++ b/lib/orber/test/corba_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(corba_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -51,7 +51,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -64,18 +64,27 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the CORBA/BOA/Object/orber interfaces", ""]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. - -cases() -> - [exception_info_api, corba_api, object_api, orber_api, - orber_objectkeys_api, orber_pseudo_objects, callback_ok_api, - callback_arity_api, callback_module_api, callback_function_api, - callback_precond_api, callback_postcond_api, callback_exit_api, - callback_badarith_api, callback_case_clause_api, - callback_function_clause_api]. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[exception_info_api, corba_api, object_api, orber_api, + orber_objectkeys_api, orber_pseudo_objects, + callback_ok_api, callback_arity_api, + callback_module_api, callback_function_api, + callback_precond_api, callback_postcond_api, + callback_exit_api, callback_badarith_api, + callback_case_clause_api, callback_function_clause_api]. %% boa_api, request, locate_request, locate_reply]. @@ -97,7 +106,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> corba:orb_init([{orber_debug_level, 10}, {giop_version, {1,2}}, {iiop_port, 0}]), mnesia:delete_schema([node()]), @@ -112,7 +121,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> application:stop(orber), application:stop(mnesia), mnesia:delete_schema([node()]), diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 2f1528f703..b12c49bc6b 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -20,7 +20,7 @@ -module(csiv2_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -272,7 +272,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, % code_CertificateChain_api/1, % code_AttributeCertChain_api/1, @@ -316,46 +317,24 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for multi orber interfaces using CSIv2"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> + cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [ -% code_CertificateChain_api, -% code_AttributeCertChain_api, -% code_VerifyingCertChain_api, -% code_AttributeCertificate_api, -% code_Certificate_api, -% code_TBSCertificate_api, -% code_CertificateSerialNumber_api, -% code_Version_api, -% code_AlgorithmIdentifier_api, -% code_Name_api, -% code_RDNSequence_api, -% code_RelativeDistinguishedName_api, -% code_AttributeTypeAndValue_api, -% code_Attribute_api, -% code_Validity_api, -% code_SubjectPublicKeyInfo_api, -% code_UniqueIdentifier_api, -% code_Extensions_api, -% code_Extension_api, -% code_AttributeCertificateInfo_api, -% code_AttCertVersion_api, -% code_Holder_api, -% code_AttCertIssuer_api, -% code_AttCertValidityPeriod_api, -% code_V2Form_api, -% code_IssuerSerial_api, -% code_ObjectDigestInfo_api, -% code_OpenSSL509_api, - ssl_server_peercert_api, - ssl_client_peercert_api]. +cases() -> + [ssl_server_peercert_api, ssl_client_peercert_api]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -379,7 +358,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> if is_list(Config) -> Config; @@ -387,7 +366,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 516d103dc9..8567bbcb5a 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -25,7 +25,7 @@ -module(data_types_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -48,7 +48,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -61,9 +61,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing more or less complex data types"]; -all(suite) -> - [fixed_type, any_type]. +all() -> +[fixed_type, any_type]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 0f85d6bd9f..712c6b0c39 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,16 +84,29 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['OrberApp_IFR', - erlang_binary, erlang_pid, erlang_port, erlang_ref, - 'CosNaming_Binding', 'CosNaming_BindingList', 'CosNaming_Name', - 'CosNaming_NameComponent', 'CosNaming_NamingContextExt_InvalidAddress', - 'CosNaming_NamingContext_AlreadyBound', 'CosNaming_NamingContext_CannotProceed', - 'CosNaming_NamingContext_InvalidName', 'CosNaming_NamingContext_NotEmpty', - 'CosNaming_NamingContext_NotFound', 'CosNaming_BindingIterator', - 'CosNaming_NamingContext', 'CosNaming_NamingContextExt']. +all() -> +['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port, + erlang_ref, 'CosNaming_Binding', + 'CosNaming_BindingList', 'CosNaming_Name', + 'CosNaming_NameComponent', + 'CosNaming_NamingContextExt_InvalidAddress', + 'CosNaming_NamingContext_AlreadyBound', + 'CosNaming_NamingContext_CannotProceed', + 'CosNaming_NamingContext_InvalidName', + 'CosNaming_NamingContext_NotEmpty', + 'CosNaming_NamingContext_NotFound', + 'CosNaming_BindingIterator', 'CosNaming_NamingContext', + 'CosNaming_NamingContextExt']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 4dcca983dc..04f51347d0 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -25,7 +25,7 @@ -module(interceptors_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -78,9 +78,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing Orber Interceptors"]; -all(suite) -> - [local_pseudo, local_default, local_local, local_global]. +all() -> +[local_pseudo, local_default, local_local, local_global]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index 0ac0e08792..7eb3bc4d05 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(iop_ior_10_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/src/orber_iiop.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -46,9 +46,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [encoding, create_and_get_ops]. +all() -> +[encoding, create_and_get_ops]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index 0867223b36..b6fae33242 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(iop_ior_11_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/src/orber_iiop.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -46,9 +46,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [encoding, create_and_get_ops]. +all() -> +[encoding, create_and_get_ops]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index c2a95faad7..48e07c3e73 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -26,7 +26,7 @@ -module(iop_ior_12_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/src/orber_iiop.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -47,9 +47,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [encoding, create_and_get_ops]. +all() -> +[encoding, create_and_get_ops]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index 878d38d446..a38ca07d5b 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(lname_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/COSS/CosNaming/lname.hrl"). @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -47,9 +47,18 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [lname_component, lname]. +all() -> +[lname_component, lname]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index 1c4d648e05..e404d23130 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -20,7 +20,7 @@ -module(multi_ORB_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -50,7 +50,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, basic_PI_api/1, multi_orber_api/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, basic_PI_api/1, multi_orber_api/1, init_per_testcase/2, end_per_testcase/2, multi_pseudo_orber_api/1, light_orber_api/1, light_orber2_api/1, ssl_1_multi_orber_api/1, ssl_2_multi_orber_api/1, ssl_reconfigure_api/1, @@ -86,69 +86,55 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for multi orber interfaces", - "This suite test intra-ORB communication. There are three scenarios:", - "* No security at all (multi_orber_api)", - "* Two secure orbs using ssl (ssl_multi_orb_api)", - "* One secure and one orb with no security. (ssl_multi_orb_api)"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must be first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [fragments_server_api, - fragments_max_server_api, - fragments_max_server_added_api, - fragments_client_api, - flags_added_api, - bad_fragment_id_client_api, - bad_giop_header_api, - bad_id_cancel_request_api, - implicit_context_api, - pseudo_implicit_context_api, - pseudo_two_implicit_context_api, - implicit_context_roundtrip_api, - oneway_implicit_context_api, - oneway_pseudo_implicit_context_api, - oneway_pseudo_two_implicit_context_api, - proxy_interface_api, - proxy_interface_ipv6_api, - local_interface_api, - local_interface_ctx_override_api, - local_interface_acl_override_api, - close_connections_api, - close_connections_local_interface_api, - close_connections_local_interface_ctx_override_api, - close_connections_alt_iiop_addr_api, - close_connections_multiple_profiles_api, - multiple_accept_api, - max_requests_api, - max_requests_added_api, - max_connections_api, - max_packet_size_exceeded_api, - max_packet_size_ok_api, - light_ifr_api, - multi_pseudo_orber_api, - multi_orber_api, - light_orber_api, - light_orber2_api, - basic_PI_api, - iiop_timeout_api, - iiop_timeout_added_api, - setup_connection_timeout_api, - setup_multi_connection_timeout_api, - setup_multi_connection_timeout_attempts_api, - setup_multi_connection_timeout_random_api, - ssl_1_multi_orber_api, - ssl_1_multi_orber_generation_3_api, - ssl_2_multi_orber_api, - ssl_2_multi_orber_generation_3_api, - ssl_reconfigure_generation_3_api, - ssl_reconfigure_api - ]. +cases() -> +[fragments_server_api, fragments_max_server_api, + fragments_max_server_added_api, fragments_client_api, + flags_added_api, bad_fragment_id_client_api, + bad_giop_header_api, bad_id_cancel_request_api, + implicit_context_api, pseudo_implicit_context_api, + pseudo_two_implicit_context_api, + implicit_context_roundtrip_api, + oneway_implicit_context_api, + oneway_pseudo_implicit_context_api, + oneway_pseudo_two_implicit_context_api, + proxy_interface_api, proxy_interface_ipv6_api, + local_interface_api, local_interface_ctx_override_api, + local_interface_acl_override_api, close_connections_api, + close_connections_local_interface_api, + close_connections_local_interface_ctx_override_api, + close_connections_alt_iiop_addr_api, + close_connections_multiple_profiles_api, + multiple_accept_api, max_requests_api, + max_requests_added_api, max_connections_api, + max_packet_size_exceeded_api, max_packet_size_ok_api, + light_ifr_api, multi_pseudo_orber_api, multi_orber_api, + light_orber_api, light_orber2_api, basic_PI_api, + iiop_timeout_api, iiop_timeout_added_api, + setup_connection_timeout_api, + setup_multi_connection_timeout_api, + setup_multi_connection_timeout_attempts_api, + setup_multi_connection_timeout_random_api, + ssl_1_multi_orber_api, + ssl_1_multi_orber_generation_3_api, + ssl_2_multi_orber_api, + ssl_2_multi_orber_generation_3_api, + ssl_reconfigure_generation_3_api, ssl_reconfigure_api]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -172,7 +158,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> if is_list(Config) -> Config; @@ -180,7 +166,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl index ec4483a5e8..881babb7c9 100644 --- a/lib/orber/test/naming_context_SUITE.erl +++ b/lib/orber/test/naming_context_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(naming_context_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). -include_lib("orber/include/corba.hrl"). @@ -35,7 +35,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -43,7 +43,7 @@ -export([name_context/1, check_list/1, name_context_ext/1]). --export([init_all/1, finish_all/1, init_per_testcase/2, end_per_testcase/2]). +-export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). %%----------------------------------------------------------------- @@ -75,13 +75,21 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). -cases() -> - [name_context, check_list, name_context_ext]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[name_context, check_list, name_context_ext]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -103,10 +111,10 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Config. -finish_all(Config) -> +end_per_suite(Config) -> Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/orber.spec b/lib/orber/test/orber.spec index 9d19ea7fc1..a5f48a3611 100644 --- a/lib/orber/test/orber.spec +++ b/lib/orber/test/orber.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../orber_test"}}. +{suites,"orber_test",all}. diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index 546cab84e4..c6c8011f0f 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -18,14 +18,14 @@ %% %% -module(orber_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(15)). -define(application, orber). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -35,11 +35,19 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [app_test, undefined_functions, - install_load_order, install_local_content]. +all() -> +[app_test, undefined_functions, install_load_order, + install_local_content]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl index 1ea44ff2e4..898cd1f4f5 100644 --- a/lib/orber/test/orber_acl_SUITE.erl +++ b/lib/orber/test/orber_acl_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(orber_acl_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(5)). @@ -47,7 +47,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -59,15 +59,24 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Testing API for ACL (Access Control List)"]; -all(suite) -> - [ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, - ipv6_verify, ipv6_range, ipv6_interfaces, ipv6_bm]. +all() -> +[ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, + ipv6_verify, ipv6_range, ipv6_interfaces, ipv6_bm]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- -init_all(Config) -> +init_per_suite(Config) -> if list(Config) -> Config; @@ -75,7 +84,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Config. diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl index 24c8d202bb..1c37431ac4 100644 --- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl @@ -20,7 +20,7 @@ -module(orber_firewall_ipv4_in_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -60,17 +60,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for orber's firewall functionallity."]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [deny_port_api, deny_port_range_api, deny_host_api, deny_peerhost_api, - allow_port_range_api, allow_host_api, allow_peerhost_api, check_address_api]. +cases() -> +[deny_port_api, deny_port_range_api, deny_host_api, + deny_peerhost_api, allow_port_range_api, allow_host_api, + allow_peerhost_api, check_address_api]. init_per_testcase(_Case, Config) -> @@ -83,7 +92,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> if is_list(Config) -> orber:jump_start([{iiop_port, 0}, @@ -93,7 +102,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> orber:jump_stop(), Config. diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl index 809757c988..1e8c279df8 100644 --- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl @@ -20,7 +20,7 @@ -module(orber_firewall_ipv4_out_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -60,18 +60,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for orber's firewall functionallity."]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [deny_port_api, deny_port_range_api, deny_host_api, - allow_port_api, allow_port_range_api, allow_host_api, - local_interface_api]. +cases() -> +[deny_port_api, deny_port_range_api, deny_host_api, + allow_port_api, allow_port_range_api, allow_host_api, + local_interface_api]. init_per_testcase(_Case, Config) -> @@ -84,7 +92,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> if is_list(Config) -> orber:jump_start([{iiop_port, 0}, @@ -94,7 +102,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> orber:jump_stop(), Config. diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl index 3ad203d8e4..33a09f7f0b 100644 --- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl @@ -20,7 +20,7 @@ -module(orber_firewall_ipv6_in_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -60,18 +60,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for orber's firewall functionallity."]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [deny_port_api, deny_port_range_api, deny_host_api, deny_peerhost_api, - allow_port_range_api, allow_host_api, allow_peerhost_api, - check_address_api]. +cases() -> +[deny_port_api, deny_port_range_api, deny_host_api, + deny_peerhost_api, allow_port_range_api, allow_host_api, + allow_peerhost_api, check_address_api]. init_per_testcase(_Case, Config) -> @@ -88,7 +96,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> case orber_test_lib:version_ok() of true -> if @@ -101,7 +109,7 @@ init_all(Config) -> Reason end. -finish_all(Config) -> +end_per_suite(Config) -> Config. diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl index dcd3adad8f..75711a1e1a 100644 --- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl @@ -20,7 +20,7 @@ -module(orber_firewall_ipv6_out_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -60,18 +60,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for orber's firewall functionallity."]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. -cases() -> - [deny_port_api, deny_port_range_api, deny_host_api, - allow_port_api, allow_port_range_api, allow_host_api, - local_interface_api]. +cases() -> +[deny_port_api, deny_port_range_api, deny_host_api, + allow_port_api, allow_port_range_api, allow_host_api, + local_interface_api]. init_per_testcase(_Case, Config) -> @@ -88,7 +96,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> case orber_test_lib:version_ok() of true -> if @@ -101,7 +109,7 @@ init_all(Config) -> Reason end. -finish_all(Config) -> +end_per_suite(Config) -> Config. diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index e49b098c68..207656d377 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -20,7 +20,7 @@ -module(orber_nat_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -50,7 +50,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, nat_ip_address/1, nat_ip_address_multiple/1, nat_ip_address_local/1, nat_ip_address_local_local/1, @@ -68,27 +68,25 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for multi orber interfaces", - "This suite test intra-ORB communication. There are three scenarios:", - "* No security at all (multi_orber_api)", - "* Two secure orbs using ssl (ssl_multi_orb_api)", - "* One secure and one orb with no security. (ssl_multi_orb_api)"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. - -cases() -> - [ - nat_ip_address, - nat_ip_address_multiple, - nat_ip_address_local, - nat_iiop_port, - nat_iiop_port_local, - nat_ip_address_local_local, - nat_iiop_port_local_local, - nat_iiop_ssl_port, - nat_iiop_ssl_port_local - ]. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[nat_ip_address, nat_ip_address_multiple, + nat_ip_address_local, nat_iiop_port, + nat_iiop_port_local, nat_ip_address_local_local, + nat_iiop_port_local_local, nat_iiop_ssl_port, + nat_iiop_ssl_port_local]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -113,7 +111,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> if is_list(Config) -> Config; @@ -121,7 +119,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index fa50100cc2..1b7295e277 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -25,7 +25,7 @@ -module(orber_web_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -78,10 +78,20 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing the Orber Web API"]; -all(suite) -> - [menu, configure, info, nameservice, ifr_select, ifr_data, - create, delete_ctx, add_ctx, delete_obj, server]. +all() -> +[menu, configure, info, nameservice, ifr_select, + ifr_data, create, delete_ctx, add_ctx, delete_obj, + server]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index 53eec26c02..beb7de4c22 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -25,7 +25,7 @@ %%----------------------------------------------------------------- -module(tc_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/src/orber_iiop.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -128,7 +128,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -141,18 +141,23 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> - [null, void, - short, ushort, - long, ulong, - longlong, ulonglong, - boolean, char, wchar, octet, - float, double, longdouble, - any, typecode, principal, object_reference, - struct, union, enum, string, wstring, sequence, array, - alias, exception, fixed, value, value_box, native, - abstract_interface, indirection, get_tc]. +all() -> +[null, void, short, ushort, long, ulong, longlong, + ulonglong, boolean, char, wchar, octet, float, double, + longdouble, any, typecode, principal, object_reference, + struct, union, enum, string, wstring, sequence, array, + alias, exception, fixed, value, value_box, native, + abstract_interface, indirection, get_tc]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. -- cgit v1.2.3 From 8bd07f450816eaaae52d28740d89ead1f930cd02 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:38:51 +0200 Subject: Update kernel tests to conform with common_test standard --- lib/kernel/test/Makefile | 2 +- lib/kernel/test/application_SUITE.erl | 37 +++++--- lib/kernel/test/bif_SUITE.erl | 38 +++++---- lib/kernel/test/cleanup.erl | 17 +++- lib/kernel/test/code_SUITE.erl | 49 +++++++---- lib/kernel/test/disk_log_SUITE.erl | 112 +++++++++++++----------- lib/kernel/test/erl_boot_server_SUITE.erl | 18 +++- lib/kernel/test/erl_distribution_SUITE.erl | 41 ++++----- lib/kernel/test/erl_distribution_wb_SUITE.erl | 18 +++- lib/kernel/test/erl_prim_loader_SUITE.erl | 35 +++++--- lib/kernel/test/error_logger_SUITE.erl | 20 +++-- lib/kernel/test/error_logger_warn_SUITE.erl | 22 +++-- lib/kernel/test/file_SUITE.erl | 94 ++++++++++++--------- lib/kernel/test/file_name_SUITE.erl | 21 +++-- lib/kernel/test/gen_sctp_SUITE.erl | 42 +++++++-- lib/kernel/test/gen_tcp_api_SUITE.erl | 32 ++++--- lib/kernel/test/gen_tcp_echo_SUITE.erl | 24 ++++-- lib/kernel/test/gen_tcp_misc_SUITE.erl | 48 +++++++---- lib/kernel/test/gen_udp_SUITE.erl | 22 +++-- lib/kernel/test/global_SUITE.erl | 94 +++++++++++++-------- lib/kernel/test/global_group_SUITE.erl | 46 ++++++++-- lib/kernel/test/heart_SUITE.erl | 19 +++-- lib/kernel/test/inet_SUITE.erl | 117 ++++++++++++++++++-------- lib/kernel/test/inet_res_SUITE.erl | 44 ++++++++-- lib/kernel/test/inet_sockopt_SUITE.erl | 23 +++-- lib/kernel/test/init_SUITE.erl | 26 ++++-- lib/kernel/test/interactive_shell_SUITE.erl | 20 +++-- lib/kernel/test/kernel.dynspec | 57 ------------- lib/kernel/test/kernel.spec | 4 + lib/kernel/test/kernel.spec.wxworks | 63 ++++++++++++++ lib/kernel/test/kernel_SUITE.erl | 20 +++-- lib/kernel/test/kernel_config_SUITE.erl | 32 ++++--- lib/kernel/test/os_SUITE.erl | 20 +++-- lib/kernel/test/pdict_SUITE.erl | 18 +++- lib/kernel/test/pg2_SUITE.erl | 23 +++-- lib/kernel/test/prim_file_SUITE.erl | 82 ++++++++++-------- lib/kernel/test/ram_file_SUITE.erl | 22 +++-- lib/kernel/test/rpc_SUITE.erl | 24 ++++-- lib/kernel/test/seq_trace_SUITE.erl | 23 +++-- lib/kernel/test/wrap_log_reader_SUITE.erl | 37 ++++---- lib/kernel/test/zlib_SUITE.erl | 69 ++++++--------- 41 files changed, 1013 insertions(+), 562 deletions(-) delete mode 100644 lib/kernel/test/kernel.dynspec create mode 100644 lib/kernel/test/kernel.spec create mode 100644 lib/kernel/test/kernel.spec.wxworks diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile index f84b343de8..5f8f3a6bf6 100644 --- a/lib/kernel/test/Makefile +++ b/lib/kernel/test/Makefile @@ -142,7 +142,7 @@ release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(APP_FILES) $(RELSYSDIR) - $(INSTALL_DATA) kernel.dynspec $(EMAKEFILE)\ + $(INSTALL_DATA) kernel.spec $(EMAKEFILE)\ $(COVERFILE) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index 810689b4a3..d4912680ec 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -18,9 +18,9 @@ %% -module(application_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, failover/1, failover_comp/1, permissions/1, load/1, reported_bugs/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, load_use_cache/1, otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, @@ -30,7 +30,7 @@ nodedown_start/1, init2973/0, loop2973/0, loop5606/1]). -export([config_change/1, - distr_changed/1, distr_changed_tc1/1, distr_changed_tc2/1, + distr_changed_tc1/1, distr_changed_tc2/1, shutdown_func/1, do_shutdown/1]). -define(TESTCASE, testcase_name). @@ -41,12 +41,27 @@ % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). -all(suite) -> - [failover, failover_comp, permissions, load, - load_use_cache, reported_bugs, - start_phases, script_start, nodedown_start, - permit_false_start_local, permit_false_start_dist, - get_key, distr_changed, config_change, shutdown_func]. +all() -> +[failover, failover_comp, permissions, load, + load_use_cache, {group, reported_bugs}, start_phases, + script_start, nodedown_start, permit_false_start_local, + permit_false_start_dist, get_key, + {group, distr_changed}, config_change, shutdown_func]. + +groups() -> + [{reported_bugs, [], + [otp_1586, otp_2078, otp_2012, otp_2718, otp_2973, + otp_3002, otp_3184, otp_4066, otp_4227, otp_5363, + otp_5606]}, + {distr_changed, [], + [distr_changed_tc1, distr_changed_tc2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(otp_2973=Case, Config) -> @@ -932,9 +947,6 @@ nodedown_start(Conf) when is_list(Conf) -> %%%----------------------------------------------------------------- %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> [otp_1586, otp_2078, otp_2012, otp_2718, - otp_2973, otp_3002, otp_3184, otp_4066, - otp_4227, otp_5363, otp_5606]. %%----------------------------------------------------------------- %% Ticket: OTP-1586 @@ -1589,7 +1601,6 @@ get_key(Conf) when is_list(Conf) -> %%%----------------------------------------------------------------- %%% Testing of change of distributed parameter. %%%----------------------------------------------------------------- -distr_changed(suite) -> [distr_changed_tc1, distr_changed_tc2]. distr_changed_tc1(suite) -> []; distr_changed_tc1(doc) -> ["Test change of distributed parameter."]; diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index 47532b0db4..c8ee765dba 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -17,15 +17,15 @@ %% %CopyrightEnd% %% -module(bif_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([spawn_tests/1, +-export([ spawn1/1, spawn2/1, spawn3/1, spawn4/1, - spawn_link_tests/1, + spawn_link1/1, spawn_link2/1, spawn_link3/1, spawn_link4/1, - spawn_opt_tests/1, + spawn_opt2/1, spawn_opt3/1, spawn_opt4/1, spawn_opt5/1, spawn_failures/1, @@ -35,7 +35,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -48,20 +48,26 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [spawn_tests, spawn_link_tests, spawn_opt_tests, spawn_failures, wilderness]. +all() -> +[{group, spawn_tests}, {group, spawn_link_tests}, + {group, spawn_opt_tests}, spawn_failures, wilderness]. + +groups() -> + [{spawn_tests, [], [spawn1, spawn2, spawn3, spawn4]}, + {spawn_link_tests, [], + [spawn_link1, spawn_link2, spawn_link3, spawn_link4]}, + {spawn_opt_tests, [], + [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -spawn_tests(doc) -> ["Test spawn"]; -spawn_tests(suite) -> - [spawn1, spawn2, spawn3, spawn4]. -spawn_link_tests(doc) -> ["Test spawn_link"]; -spawn_link_tests(suite) -> - [spawn_link1, spawn_link2, spawn_link3, spawn_link4]. -spawn_opt_tests(doc) -> ["Test spawn_opt"]; -spawn_opt_tests(suite) -> - [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]. spawn1(doc) -> ["Test spawn/1"]; spawn1(suite) -> diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl index 831ceba8f5..7fb00b4305 100644 --- a/lib/kernel/test/cleanup.erl +++ b/lib/kernel/test/cleanup.erl @@ -18,11 +18,22 @@ %% -module(cleanup). --export([all/1, cleanup/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cleanup/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[cleanup]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> {req, [kernel], [cleanup]}. cleanup(suite) -> []; cleanup(_) -> diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index a5fcaf188d..0f3a79f183 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -18,9 +18,9 @@ %% -module(code_SUITE). --include("test_server.hrl"). -%-compile(export_all). --export([all/1]). +-include_lib("test_server/include/test_server.hrl"). + +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([set_path/1, get_path/1, add_path/1, add_paths/1, del_path/1, replace_path/1, load_file/1, load_abs/1, ensure_loaded/1, delete/1, purge/1, soft_purge/1, is_loaded/1, all_loaded/1, @@ -43,19 +43,27 @@ handle_event/2, handle_call/2, handle_info/2, terminate/2]). -all(suite) -> +all() -> [set_path, get_path, add_path, add_paths, del_path, replace_path, load_file, load_abs, ensure_loaded, delete, purge, soft_purge, is_loaded, all_loaded, load_binary, dir_req, object_code, set_path_file, - pa_pz_option, add_del_path, - dir_disappeared, ext_mod_dep, clash, - load_cached, start_node_with_cache, add_and_rehash, - where_is_file_no_cache, where_is_file_cached, - purge_stacktrace, mult_lib_roots, bad_erl_libs, - code_archive, code_archive2, on_load, on_load_embedded, - big_boot_embedded, - on_load_errors, native_early_modules]. + pa_pz_option, add_del_path, dir_disappeared, + ext_mod_dep, clash, load_cached, start_node_with_cache, + add_and_rehash, where_is_file_no_cache, + where_is_file_cached, purge_stacktrace, mult_lib_roots, + bad_erl_libs, code_archive, code_archive2, on_load, + on_load_embedded, big_boot_embedded, on_load_errors, + native_early_modules]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. init_per_suite(Config) -> %% The compiler will no longer create a Beam file if @@ -76,7 +84,17 @@ init_per_testcase(_Func, Config) -> P=code:get_path(), P=code:get_path(), [{watchdog, Dog}, {code_path, P}|Config]. + +end_per_testcase(mult_lib_roots, Config) -> + {ok, HostName} = inet:gethostname(), + NodeName = list_to_atom("mult_lib_roots@"++HostName), + ?t:stop_node(NodeName), + end_per_testcase(Config); end_per_testcase(_Func, Config) -> + end_per_testcase(Config). + +end_per_testcase(Config) -> + code:purge(code_b_test), Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), P=?config(code_path, Config), @@ -906,6 +924,8 @@ add_and_rehash(Config) when is_list(Config) -> ?line true = rpc:call(Node, code, add_path, [OkDir]), ?line {error,_} = rpc:call(Node, code, add_path, [BadDir]), ?line ok = rpc:call(Node, code, rehash, []), + + ?t:stop_node(Node), ok. where_is_file_no_cache(suite) -> @@ -1007,9 +1027,9 @@ mult_lib_roots(Config) when is_list(Config) -> ?t:start_node(mult_lib_roots, slave, [{args,"-env ERL_LIBS "++ErlLibs}]), - ?line {ok,Cwd} = file:get_cwd(), + ?line TSPath = filename:dirname(code:which(test_server)), ?line Path0 = rpc:call(Node, code, get_path, []), - ?line [Cwd,"."|Path1] = Path0, + ?line [TSPath,"."|Path1] = Path0, ?line [Kernel|Path2] = Path1, ?line [Stdlib|Path3] = Path2, ?line mult_lib_verify_lib(Kernel, "kernel"), @@ -1028,7 +1048,6 @@ mult_lib_roots(Config) when is_list(Config) -> ?line true = rpc:call(Node, code_SUITE_mult_root_module, works_fine, []), - ?line ?t:stop_node(Node), ok. mult_lib_compile(Root, Last) -> diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index f3fa2921ed..e7647c251b 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -28,46 +28,46 @@ -define(config(X,Y), foo). -define(t,test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - halt_int/1, halt_int_inf/1, halt_int_sz/1, + halt_int_inf/1, halt_int_sz_1/1, halt_int_sz_2/1, - read_mode/1, halt_int_ro/1, halt_ext_ro/1, wrap_int_ro/1, + halt_int_ro/1, halt_ext_ro/1, wrap_int_ro/1, wrap_ext_ro/1, halt_trunc/1, halt_misc/1, halt_ro_alog/1, halt_ro_balog/1, halt_ro_crash/1, - wrap_int/1, wrap_int_1/1, wrap_int_2/1, inc_wrap_file/1, + wrap_int_1/1, wrap_int_2/1, inc_wrap_file/1, - halt_ext/1, halt_ext_inf/1, + halt_ext_inf/1, - halt_ext_sz/1, halt_ext_sz_1/1, halt_ext_sz_2/1, + halt_ext_sz_1/1, halt_ext_sz_2/1, - wrap_ext/1, wrap_ext_1/1, wrap_ext_2/1, + wrap_ext_1/1, wrap_ext_2/1, - head/1, head_func/1, plain_head/1, one_header/1, + head_func/1, plain_head/1, one_header/1, - notif/1, wrap_notif/1, full_notif/1, trunc_notif/1, blocked_notif/1, + wrap_notif/1, full_notif/1, trunc_notif/1, blocked_notif/1, new_idx_vsn/1, reopen/1, - block/1, block_blocked/1, block_queue/1, block_queue2/1, + block_blocked/1, block_queue/1, block_queue2/1, unblock/1, - open/1, open_overwrite/1, open_size/1, open_truncate/1, open_error/1, + open_overwrite/1, open_size/1, open_truncate/1, open_error/1, - close/1, close_race/1, close_block/1, close_deadlock/1, + close_race/1, close_block/1, close_deadlock/1, - error/1, error_repair/1, error_log/1, error_index/1, + error_repair/1, error_log/1, error_index/1, chunk/1, @@ -75,15 +75,15 @@ many_users/1, - info/1, info_current/1, + info_current/1, - change_size/1, change_size_before/1, change_size_during/1, + change_size_before/1, change_size_during/1, change_size_after/1, default_size/1, change_size2/1, change_size_truncate/1, change_attribute/1, - distribution/1, dist_open/1, dist_error_open/1, dist_notify/1, + dist_open/1, dist_error_open/1, dist_notify/1, dist_terminate/1, dist_accessible/1, dist_deadlock/1, dist_open2/1, other_groups/1, @@ -142,8 +142,51 @@ change_size_after, default_size]). -all(suite) -> - ?ALL_TESTS. +all() -> +[{group, halt_int}, {group, wrap_int}, + {group, halt_ext}, {group, wrap_ext}, + {group, read_mode}, {group, head}, {group, notif}, + new_idx_vsn, reopen, {group, block}, unblock, + {group, open}, {group, close}, {group, error}, chunk, + truncate, many_users, {group, info}, + {group, change_size}, change_attribute, + {group, distribution}, evil, otp_6278]. + +groups() -> + [{halt_int, [], [halt_int_inf, {group, halt_int_sz}]}, + {halt_int_sz, [], [halt_int_sz_1, halt_int_sz_2]}, + {read_mode, [], + [halt_int_ro, halt_ext_ro, wrap_int_ro, wrap_ext_ro, + halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, + halt_ro_crash]}, + {wrap_int, [], [wrap_int_1, wrap_int_2, inc_wrap_file]}, + {halt_ext, [], [halt_ext_inf, {group, halt_ext_sz}]}, + {halt_ext_sz, [], [halt_ext_sz_1, halt_ext_sz_2]}, + {wrap_ext, [], [wrap_ext_1, wrap_ext_2]}, + {head, [], [head_func, plain_head, one_header]}, + {notif, [], + [wrap_notif, full_notif, trunc_notif, blocked_notif]}, + {block, [], [block_blocked, block_queue, block_queue2]}, + {open, [], + [open_overwrite, open_size, open_truncate, open_error]}, + {close, [], [close_race, close_block, close_deadlock]}, + {error, [], [error_repair, error_log, error_index]}, + {info, [], [info_current]}, + {change_size, [], + [change_size_before, change_size_during, + change_size_after, default_size, change_size2, + change_size_truncate]}, + {distribution, [], + [dist_open, dist_error_open, dist_notify, + dist_terminate, dist_accessible, dist_deadlock, + dist_open2, other_groups]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) -> @@ -172,7 +215,6 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -halt_int(suite) -> [halt_int_inf, halt_int_sz]. halt_int_inf(suite) -> []; halt_int_inf(doc) -> ["Test simple halt disk log, size infinity"]; @@ -187,7 +229,6 @@ halt_int_inf(Conf) when is_list(Conf) -> ?line ok = disk_log:close(a), ?line ok = file:delete(File). -halt_int_sz(suite) -> [halt_int_sz_1, halt_int_sz_2]. halt_int_sz_1(suite) -> []; halt_int_sz_1(doc) -> ["Test simple halt disk log, size defined"]; @@ -275,10 +316,6 @@ halt_int_sz_2(Conf) when is_list(Conf) -> ?line ok = file:delete(File3), ok. -read_mode(suite) -> [halt_int_ro, halt_ext_ro, - wrap_int_ro, wrap_ext_ro, - halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, - halt_ro_crash]. halt_int_ro(suite) -> []; halt_int_ro(doc) -> ["Test simple halt disk log, read only, internal"]; @@ -480,7 +517,6 @@ halt_ro_crash(Conf) when is_list(Conf) -> -wrap_int(suite) -> [wrap_int_1, wrap_int_2, inc_wrap_file]. wrap_int_1(suite) -> []; wrap_int_1(doc) -> ["Test wrap disk log, internal"]; @@ -628,7 +664,6 @@ inc_wrap_file(Conf) when is_list(Conf) -> -halt_ext(suite) -> [halt_ext_inf, halt_ext_sz]. halt_ext_inf(suite) -> []; halt_ext_inf(doc) -> ["Test halt disk log, external, infinity"]; @@ -642,7 +677,6 @@ halt_ext_inf(Conf) when is_list(Conf) -> ?line ok = disk_log:close(a), ?line ok = file:delete(File). -halt_ext_sz(suite) -> [halt_ext_sz_1, halt_ext_sz_2]. halt_ext_sz_1(suite) -> []; halt_ext_sz_1(doc) -> ["Test halt disk log, external, size defined"]; @@ -734,7 +768,6 @@ halt_ext_sz_2(Conf) when is_list(Conf) -> ?line ok = file:delete(File3), ok. -wrap_ext(suite) -> [wrap_ext_1, wrap_ext_2]. wrap_ext_1(suite) -> []; wrap_ext_1(doc) -> ["Test wrap disk log, external, size defined"]; @@ -1147,7 +1180,6 @@ end_times({T1,W1}) -> {W2, _} = statistics(wall_clock), {T2-T1, W2-W1}. -head(suite) -> [head_func, plain_head, one_header]. head_func(suite) -> []; head_func(doc) -> ["Test head parameter"]; @@ -1327,8 +1359,6 @@ one_header(Conf) when is_list(Conf) -> ok. -notif(suite) -> [wrap_notif, full_notif, trunc_notif, - blocked_notif]. wrap_notif(suite) -> []; wrap_notif(doc) -> ["Test notify parameter, wrap"]; @@ -1553,7 +1583,6 @@ reopen(Conf) when is_list(Conf) -> ?line Q = qlen(), ok. -block(suite) -> [block_blocked, block_queue, block_queue2]. block_blocked(suite) -> []; block_blocked(doc) -> @@ -1826,8 +1855,6 @@ try_unblock(Log) -> ?line Error = {error, {not_blocked_by_pid, n}} = disk_log:unblock(Log), ?line "The disk log" ++ _ = format_error(Error). -open(suite) -> [open_overwrite, open_size, - open_truncate, open_error]. open_overwrite(suite) -> []; open_overwrite(doc) -> @@ -2075,7 +2102,6 @@ open_error(Conf) when is_list(Conf) -> ?line del(File, No). -close(suite) -> [close_race, close_block, close_deadlock]. close_race(suite) -> []; close_race(doc) -> @@ -2497,7 +2523,6 @@ lserv(Log) -> end, lserv(Log). -error(suite) -> [error_repair, error_log, error_index]. error_repair(suite) -> []; error_repair(doc) -> @@ -3215,7 +3240,6 @@ del_files(_Size, File) -> -info(suite) -> [info_current]. info_current(suite) -> []; info_current(doc) -> @@ -3420,11 +3444,6 @@ info_current(Conf) when is_list(Conf) -> ok. -change_size(suite) -> [change_size_before, - change_size_during, - change_size_after, - default_size, change_size2, - change_size_truncate]. change_size_before(suite) -> []; change_size_before(doc) -> @@ -4094,13 +4113,6 @@ change_attribute(Conf) when is_list(Conf) -> ?line Q = qlen(), ?line del(File, No). -distribution(suite) -> [dist_open, dist_error_open, - dist_notify, - dist_terminate, - dist_accessible, - dist_deadlock, - dist_open2, - other_groups]. dist_open(suite) -> []; dist_open(doc) -> diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index a4319eb3c1..b9c632ed9a 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -18,9 +18,9 @@ %% -module(erl_boot_server_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, start_link/1, stop/1, add/1, delete/1, responses/1]). @@ -33,8 +33,18 @@ %% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson. %%----------------------------------------------------------------- -all(suite) -> - [start, start_link, stop, add, delete, responses]. +all() -> +[start, start_link, stop, add, delete, responses]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(all_ones, {255, 255, 255, 255}). diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 047bedfa74..96589b6165 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -19,13 +19,13 @@ -module(erl_distribution_SUITE). %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([tick/1, tick_change/1, illegal_nodenames/1, hidden_node/1, table_waste/1, net_setuptime/1, - monitor_nodes/1, + monitor_nodes_nodedown_reason/1, monitor_nodes_complex_nodedown_reason/1, monitor_nodes_node_type/1, @@ -57,10 +57,25 @@ %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [tick, tick_change, illegal_nodenames, hidden_node, - table_waste, net_setuptime, - monitor_nodes]. +all() -> +[tick, tick_change, illegal_nodenames, hidden_node, + table_waste, net_setuptime, {group, monitor_nodes}]. + +groups() -> + [{monitor_nodes, [], + [monitor_nodes_nodedown_reason, + monitor_nodes_complex_nodedown_reason, + monitor_nodes_node_type, monitor_nodes_misc, + monitor_nodes_otp_6481, monitor_nodes_errors, + monitor_nodes_combinations, monitor_nodes_cleanup, + monitor_nodes_many]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(4)), @@ -530,18 +545,6 @@ check_monitor_nodes_res(Pid, Node) -> end. -monitor_nodes(doc) -> - []; -monitor_nodes(suite) -> - [monitor_nodes_nodedown_reason, - monitor_nodes_complex_nodedown_reason, - monitor_nodes_node_type, - monitor_nodes_misc, - monitor_nodes_otp_6481, - monitor_nodes_errors, - monitor_nodes_combinations, - monitor_nodes_cleanup, - monitor_nodes_many]. %% %% Testcase: diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 83f9d09a4b..e34663496a 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -18,10 +18,10 @@ %% -module(erl_distribution_wb_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). @@ -77,8 +77,18 @@ -define(u32(X3,X2,X1,X0), (((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))). -all(suite) -> - [whitebox,switch_options,missing_compulsory_dflags]. +all() -> +[whitebox, switch_options, missing_compulsory_dflags]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index 39007bf085..f68ce4f8f7 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -19,9 +19,9 @@ -module(erl_prim_loader_SUITE). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_path/1, set_path/1, get_file/1, inet_existing/1, inet_coming_up/1, inet_disconnects/1, @@ -35,15 +35,21 @@ %% Test suite for erl_prim_loader. (Most code is run during system start/stop.) %%----------------------------------------------------------------- -all(suite) -> - [ - get_path, set_path, get_file, - inet_existing, inet_coming_up, - inet_disconnects, multiple_slaves, - file_requests, local_archive, - remote_archive, primary_archive, - virtual_dir_in_archive - ]. +all() -> +[get_path, set_path, get_file, inet_existing, + inet_coming_up, inet_disconnects, multiple_slaves, + file_requests, local_archive, remote_archive, + primary_archive, virtual_dir_in_archive]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), @@ -291,7 +297,6 @@ wait_and_shutdown([], _) -> ok. -file_requests(suite) -> {req, [{local_slave_nodes, 1}, {time, 10}]}; file_requests(doc) -> ["Start a node using the 'inet' loading method, ", "verify that the boot server responds to file requests."]; file_requests(Config) when is_list(Config) -> @@ -300,9 +305,11 @@ file_requests(Config) when is_list(Config) -> %% compare with results from file server calls (the %% boot server uses the same file sys and cwd) {ok,Files} = file:list_dir("."), + io:format("Files: ~p~n",[Files]), ?line {ok,Files} = rpc:call(Node, erl_prim_loader, list_dir, ["."]), - {ok,Info} = file:read_file_info("test_server.beam"), - ?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info, ["test_server.beam"]), + {ok,Info} = file:read_file_info(code:which(test_server)), + ?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info, + [code:which(test_server)]), {ok,Cwd} = file:get_cwd(), ?line {ok,Cwd} = rpc:call(Node, erl_prim_loader, get_cwd, []), case file:get_cwd("C:") of diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index eda86861d5..90fdd4a00a 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%----------------------------------------------------------------- %% We don't have to test the normal behaviour here, i.e. the tty @@ -27,7 +27,7 @@ %% error_logger deliver the expected events. %%----------------------------------------------------------------- --export([all/1, error_report/1, info_report/1, error/1, info/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, emulator/1, tty/1, logfile/1, add/1, delete/1]). -export([generate_error/0]). @@ -37,9 +37,19 @@ terminate/2]). -all(suite) -> - [error_report, info_report, error, info, - emulator, tty, logfile, add, delete]. +all() -> +[error_report, info_report, error, info, emulator, tty, + logfile, add, delete]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 626e35dbb2..85a2a0a303 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_warn_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -26,7 +26,7 @@ %% Internal exports. -export([init/1,handle_event/2,handle_info/2,handle_call/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(EXPECT(Pattern), (fun() -> @@ -43,10 +43,20 @@ -define(default_timeout, ?t:minutes(1)). -all(suite) -> - [basic, warnings_info, warnings_warnings, - rb_basic, rb_warnings_info, rb_warnings_warnings, - rb_trunc,rb_utc, file_utc]. +all() -> +[basic, warnings_info, warnings_warnings, rb_basic, + rb_warnings_info, rb_warnings_warnings, rb_trunc, + rb_utc, file_utc]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 596fe301b5..c75b8c03a2 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -40,29 +40,29 @@ -module(?FILE_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, init_per_testcase/2, end_per_testcase/2, - read_write_file/1, dirs/1, files/1, names/1]). + read_write_file/1, names/1]). -export([cur_dir_0/1, cur_dir_1/1, make_del_dir/1, - pos/1, pos1/1, pos2/1]). --export([close/1, consult/1, consult1/1, path_consult/1, delete/1]). --export([eval/1, eval1/1, path_eval/1, script/1, script1/1, path_script/1, - open/1, open1/1, + pos1/1, pos2/1]). +-export([close/1, consult1/1, path_consult/1, delete/1]). +-export([ eval1/1, path_eval/1, script1/1, path_script/1, + open1/1, old_modes/1, new_modes/1, path_open/1, open_errors/1]). --export([file_info/1, file_info_basic_file/1, file_info_basic_directory/1, +-export([ file_info_basic_file/1, file_info_basic_directory/1, file_info_bad/1, file_info_times/1, file_write_file_info/1]). -export([rename/1, access/1, truncate/1, datasync/1, sync/1, read_write/1, pread_write/1, append/1, exclusive/1]). --export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). +-export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). -export([otp_5814/1]). --export([compression/1, read_not_really_compressed/1, +-export([ read_not_really_compressed/1, read_compressed_cooked/1, read_compressed_cooked_binary/1, read_cooked_tar_problem/1, write_compressed/1, compress_errors/1, catenated_gzips/1]). --export([links/1, make_link/1, read_link_info_for_non_link/1, symlinks/1]). +-export([ make_link/1, read_link_info_for_non_link/1, symlinks/1]). -export([copy/1]). @@ -93,21 +93,52 @@ --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> - {conf, init, - [altname, read_write_file, dirs, files, - delete, rename, names, errors, - compression, links, copy, - delayed_write, read_ahead, segment_read, segment_write, - ipread, pid2name, interleaved_read_write, - otp_5814, large_file, read_line_1, read_line_2, read_line_3, read_line_4, - standard_io], - fini}. +all() -> +[altname, read_write_file, {group, dirs}, + {group, files}, delete, rename, names, {group, errors}, + {group, compression}, {group, links}, copy, + delayed_write, read_ahead, segment_read, segment_write, + ipread, pid2name, interleaved_read_write, otp_5814, + large_file, read_line_1, read_line_2, read_line_3, + read_line_4, standard_io]. + +groups() -> + [{dirs, [], [make_del_dir, cur_dir_0, cur_dir_1]}, + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + {group, consult}, {group, eval}, {group, script}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, old_modes, new_modes, path_open, close, access, + read_write, pread_write, append, open_errors, + exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file, file_info_basic_directory, + file_info_bad, file_info_times, file_write_file_info]}, + {consult, [], [consult1, path_consult]}, + {eval, [], [eval1, path_eval]}, + {script, [], [script1, path_script]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed_cooked, read_compressed_cooked_binary, + read_cooked_tar_problem, read_not_really_compressed, + write_compressed, compress_errors, catenated_gzips]}, + {links, [], + [make_link, read_link_info_for_non_link, symlinks]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Config) when is_list(Config) -> case os:type() of @@ -314,7 +345,6 @@ read_write_file(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirs(suite) -> [make_del_dir, cur_dir_0, cur_dir_1]. make_del_dir(suite) -> []; make_del_dir(doc) -> []; @@ -461,12 +491,7 @@ win_cur_dir_1(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -files(suite) -> - [open,pos,file_info,consult,eval,script,truncate, - sync,datasync,advise]. -open(suite) -> [open1,old_modes,new_modes,path_open,close,access,read_write, - pread_write,append,open_errors,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -858,7 +883,6 @@ exclusive(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -pos(suite) -> [pos1,pos2]. pos1(suite) -> []; pos1(doc) -> []; @@ -950,8 +974,6 @@ pos2(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -file_info(suite) -> [file_info_basic_file, file_info_basic_directory, - file_info_bad, file_info_times, file_write_file_info]. file_info_basic_file(suite) -> []; file_info_basic_file(doc) -> []; @@ -1217,7 +1239,6 @@ file_write_file_info(Config) when is_list(Config) -> get_good_directory(Config) -> ?line ?config(priv_dir, Config). -consult(suite) -> [consult1, path_consult]. consult1(suite) -> []; consult1(doc) -> []; @@ -1278,7 +1299,6 @@ path_consult(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -eval(suite) -> [eval1,path_eval]. eval1(suite) -> []; eval1(doc) -> []; @@ -1351,7 +1371,6 @@ path_eval(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -script(suite) -> [script1,path_script]. script1(suite) -> []; script1(doc) -> ""; @@ -1702,7 +1721,6 @@ names(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -errors(suite) -> [e_delete, e_rename, e_make_dir, e_del_dir]. e_delete(suite) -> []; e_delete(doc) -> []; @@ -1959,12 +1977,6 @@ e_del_dir(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -compression(suite) -> - [read_compressed_cooked, read_compressed_cooked_binary, - read_cooked_tar_problem, - read_not_really_compressed, - write_compressed, compress_errors, - catenated_gzips]. %% Trying reading and positioning from a compressed file. @@ -2258,8 +2270,6 @@ altname(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), Result. -links(doc) -> "Test the link functions."; -links(suite) -> [make_link, read_link_info_for_non_link, symlinks]. make_link(doc) -> "Test creating a hard link."; make_link(suite) -> []; diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index fbafbcd9b7..9d1315c3ab 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -18,7 +18,7 @@ %% %CopyrightEnd% %% --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). %% @@ -70,7 +70,9 @@ %% list_dir %% read_link --export([all/1,init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([normal/1,icky/1,very_icky/1,normalize/1]). @@ -78,13 +80,22 @@ init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). +all() -> + [normal, icky, very_icky, normalize]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [normal,icky,very_icky,normalize]. normalize(suite) -> []; diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 39db6ab81c..52f3a6b057 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -18,21 +18,51 @@ %% -module(gen_sctp_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). %%-compile(export_all). --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0, + init_per_suite/1,end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export( [basic/1, api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1, xfer_min/1,xfer_active/1,def_sndrcvinfo/1,implicit_inet6/1]). -all(suite) -> - [basic, - api_open_close,api_listen,api_connect_init,api_opts, - xfer_min,xfer_active,def_sndrcvinfo,implicit_inet6]. +all() -> +[basic, api_open_close, api_listen, api_connect_init, + api_opts, xfer_min, xfer_active, def_sndrcvinfo, + implicit_inet6]. + +groups() -> + []. + +init_per_suite(Config) -> + try gen_sctp:open() of + {ok,Socket} -> + gen_sctp:close(Socket), + []; + _ -> + [] + catch + error:badarg -> + {skip,"SCTP not supported on this machine"}; + _:_ -> + Config + end. + +end_per_suite(_Conifig) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(15)), diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index b8d1b1722c..233c2535b6 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -22,19 +22,32 @@ %% are not tested here, because they are tested indirectly in this and %% and other test suites. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2, - t_accept/1, t_connect_timeout/1, t_accept_timeout/1, - t_connect/1, t_connect_bad/1, - t_recv/1, t_recv_timeout/1, t_recv_eof/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, + t_connect_timeout/1, t_accept_timeout/1, + t_connect_bad/1, + t_recv_timeout/1, t_recv_eof/1, t_shutdown_write/1, t_shutdown_both/1, t_shutdown_error/1, t_fdopen/1, t_implicit_inet6/1]). -all(suite) -> [t_accept, t_connect, t_recv, t_shutdown_write, - t_shutdown_both, t_shutdown_error, t_fdopen, - t_implicit_inet6]. +all() -> +[{group, t_accept}, {group, t_connect}, {group, t_recv}, + t_shutdown_write, t_shutdown_both, t_shutdown_error, + t_fdopen, t_implicit_inet6]. + +groups() -> + [{t_accept, [], [t_accept_timeout]}, + {t_connect, [], [t_connect_timeout, t_connect_bad]}, + {t_recv, [], [t_recv_timeout, t_recv_eof]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), @@ -45,7 +58,6 @@ end_per_testcase(_Func, Config) -> %%% gen_tcp:accept/1,2 -t_accept(suite) -> [t_accept_timeout]. t_accept_timeout(doc) -> "Test that gen_tcp:accept/2 (with timeout) works."; t_accept_timeout(suite) -> []; @@ -55,7 +67,6 @@ t_accept_timeout(Config) when is_list(Config) -> %%% gen_tcp:connect/X -t_connect(suite) -> [t_connect_timeout, t_connect_bad]. t_connect_timeout(doc) -> "Test that gen_tcp:connect/4 (with timeout) works."; t_connect_timeout(Config) when is_list(Config) -> @@ -84,7 +95,6 @@ t_connect_bad(Config) when is_list(Config) -> %%% gen_tcp:recv/X -t_recv(suite) -> [t_recv_timeout, t_recv_eof]. t_recv_timeout(doc) -> "Test that gen_tcp:recv/3 (with timeout works)."; t_recv_timeout(suite) -> []; diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index f45038b7c4..676dc1c593 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -18,11 +18,11 @@ %% -module(gen_tcp_echo_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%-compile(export_all). --export([all/1, init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -31,11 +31,21 @@ -define(TPKT_VRSN, 3). -define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1 -all(suite) -> - [active_echo, passive_echo, active_once_echo, - slow_active_echo, slow_passive_echo, - limit_active_echo, limit_passive_echo, - large_limit_active_echo, large_limit_passive_echo]. +all() -> +[active_echo, passive_echo, active_once_echo, + slow_active_echo, slow_passive_echo, limit_active_echo, + limit_passive_echo, large_limit_active_echo, + large_limit_passive_echo]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:minutes(5)), diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index 8c2c4b9035..02b243a0ce 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -18,11 +18,11 @@ %% -module(gen_tcp_misc_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, controlling_process/1, no_accept/1, close_with_pending_output/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, init_per_testcase/2, end_per_testcase/2, @@ -50,22 +50,34 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). -all(suite) -> - [controlling_process, no_accept, - close_with_pending_output, - data_before_close, iter_max_socks, passive_sockets, - accept_closed_by_other_process, otp_3924, closed_socket, - shutdown_active, shutdown_passive, shutdown_pending, - default_options, http_bad_packet, - busy_send, busy_disconnect_passive, busy_disconnect_active, - fill_sendq, partial_recv_and_close, - partial_recv_and_close_2, partial_recv_and_close_3, so_priority, - primitive_accept,multi_accept_close_listen,accept_timeout, - accept_timeouts_in_order,accept_timeouts_in_order2,accept_timeouts_in_order3, - accept_timeouts_mixed, - killing_acceptor,killing_multi_acceptors,killing_multi_acceptors2, - several_accepts_in_one_go, active_once_closed, send_timeout, otp_7731, - zombie_sockets, otp_7816, otp_8102]. +all() -> +[controlling_process, no_accept, + close_with_pending_output, data_before_close, + iter_max_socks, passive_sockets, + accept_closed_by_other_process, otp_3924, closed_socket, + shutdown_active, shutdown_passive, shutdown_pending, + default_options, http_bad_packet, busy_send, + busy_disconnect_passive, busy_disconnect_active, + fill_sendq, partial_recv_and_close, + partial_recv_and_close_2, partial_recv_and_close_3, + so_priority, primitive_accept, + multi_accept_close_listen, accept_timeout, + accept_timeouts_in_order, accept_timeouts_in_order2, + accept_timeouts_in_order3, accept_timeouts_mixed, + killing_acceptor, killing_multi_acceptors, + killing_multi_acceptors2, several_accepts_in_one_go, + active_once_closed, send_timeout, otp_7731, + zombie_sockets, otp_7816, otp_8102]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + default_options(doc) -> diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 1bd930b8f5..e9ae40b0cd 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -21,7 +21,7 @@ % because udp is not deterministic. % -module(gen_udp_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -29,17 +29,27 @@ % XXX - we should pick a port that we _know_ is closed. That's pretty hard. -define(CLOSED_PORT, 6666). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, buffer_size/1, binary_passive_recv/1, bad_address/1, read_packets/1, open_fd/1, connect/1, implicit_inet6/1]). -all(suite) -> - [send_to_closed, - buffer_size, binary_passive_recv, bad_address, read_packets, - open_fd, connect, implicit_inet6]. +all() -> +[send_to_closed, buffer_size, binary_passive_recv, + bad_address, read_packets, open_fd, connect, + implicit_inet6]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 001debddcf..887ce059d3 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -20,7 +20,8 @@ %-define(line_trace, 1). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, names/1, names_hidden/1, locks/1, locks_hidden/1, bad_input/1, names_and_locks/1, lock_die/1, name_die/1, basic_partition/1, basic_name_partition/1, @@ -42,14 +43,14 @@ -export([global_load/3, lock_global/2, lock_global2/2]). --export([ttt/1]). +-export([]). -export([mass_spawn/1]). -export([start_tracer/0, stop_tracer/0, get_trace/0]). -compile(export_all). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(NODES, [node()|nodes()]). @@ -58,40 +59,59 @@ %% The resource used by the global module. -define(GLOBAL_LOCK, global). -ttt(suite) -> - [ -%% 5&6: succeeds -%% 4&5&6: succeeds -%% 3&4&5&6: succeeds -%% 1&2&3&6: fails -%% 1&2&6: succeeds -%% 3&6: succeeds - names, names_hidden, locks, locks_hidden, - bad_input, - names_and_locks, lock_die, name_die, basic_partition, -% advanced_partition, basic_name_partition, -% stress_partition, simple_ring, simple_line, - ring]. - -all(suite) -> - case init:get_argument(ring_line) of - {ok, _} -> - [ring_line]; - _ -> - [names, names_hidden, locks, locks_hidden, - bad_input, - names_and_locks, lock_die, name_die, basic_partition, - advanced_partition, basic_name_partition, - stress_partition, simple_ring, simple_line, - ring, line, global_lost_nodes, otp_1849, - otp_3162, otp_5640, otp_5737, otp_6931, - simple_disconnect, simple_resolve, simple_resolve2, - simple_resolve3, - leftover_name, re_register_name, name_exit, - external_nodes, many_nodes, sync_0, global_groups_change, - register_1, both_known_1, lost_unregister, - mass_death, garbage_messages] - end. + +all() -> +case init:get_argument(ring_line) of + {ok, _} -> [ring_line]; + _ -> + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + advanced_partition, basic_name_partition, + stress_partition, simple_ring, simple_line, ring, line, + global_lost_nodes, otp_1849, otp_3162, otp_5640, + otp_5737, otp_6931, simple_disconnect, simple_resolve, + simple_resolve2, simple_resolve3, leftover_name, + re_register_name, name_exit, external_nodes, many_nodes, + sync_0, global_groups_change, register_1, both_known_1, + lost_unregister, mass_death, garbage_messages] +end. + +groups() -> + [{ttt, [], + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + ring]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +init_per_suite(Config) -> + + %% Copied from test_server_ctrl ln 647, we have to do this here as + %% the test_server only does this when run without common_test + global:sync(), + case global:whereis_name(test_server) of + undefined -> + io:format(user, "Registering test_server globally!~n",[]), + global:register_name(test_server, whereis(test_server_ctrl)); + Pid -> + case node() of + N when N == node(Pid) -> + io:format(user, "Warning: test_server already running!\n", []), + global:re_register_name(test_server,self()); + _ -> + ok + end + end, + Config. + +end_per_suite(_Config) -> + global:unregister_name(test_server), + ok. + -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index 301f1246c2..a94944c0e9 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -19,7 +19,8 @@ -module(global_group_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1]). -export([start_gg_proc/1, no_gg_proc/1, no_gg_proc_sync/1, compatible/1, one_grp/1, one_grp_x/1, two_grp/1, hidden_groups/1, test_exit/1]). -export([init/1, init/2, init2/2, start_proc/1, start_proc_rereg/1]). @@ -28,16 +29,49 @@ %-compile(export_all). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(NODES, [node()|nodes()]). -define(UNTIL(Seq), loop_until_true(fun() -> Seq end)). -all(suite) -> - [start_gg_proc, no_gg_proc, no_gg_proc_sync, - compatible, one_grp, one_grp_x, two_grp, test_exit, - hidden_groups]. +all() -> +[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, + one_grp, one_grp_x, two_grp, test_exit, hidden_groups]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(Config) -> + + %% Copied from test_server_ctrl ln 647, we have to do this here as + %% the test_server only does this when run without common_test + global:sync(), + case global:whereis_name(test_server) of + undefined -> + io:format(user, "Registering test_server globally!~n",[]), + global:register_name(test_server, whereis(test_server_ctrl)); + Pid -> + case node() of + N when N == node(Pid) -> + io:format(user, "Warning: test_server already running!\n", []), + global:re_register_name(test_server,self()); + _ -> + ok + end + end, + Config. + +end_per_suite(_Config) -> + global:unregister_name(test_server), + ok. -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index b739f555d0..d811183a41 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -18,9 +18,9 @@ %% -module(heart_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, dont_drop/1, kill_pid/1, fini/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -53,9 +53,18 @@ end_per_testcase(_Func, Config) -> %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [{conf, ostype, [start, restart, reboot, - set_cmd, clear_cmd, kill_pid], fini}]. +all() -> +[start, restart, reboot, set_cmd, clear_cmd, kill_pid]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + ostype(Config) when is_list(Config) -> case os:type() of diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index ec05bf99b9..596f31eb7e 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -18,29 +18,63 @@ %% -module(inet_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/1, t_gethostbyaddr/1, t_getaddr/1, t_gethostbyname/1, - t_gethostbyaddr_v6/1, t_getaddr_v6/1, t_gethostbyname_v6/1, - ipv4_to_ipv6/1, host_and_addr/1, parse/1, t_gethostnative/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + t_gethostbyaddr/0, t_gethostbyaddr/1, + t_getaddr/0, t_getaddr/1, + t_gethostbyname/0, t_gethostbyname/1, + t_gethostbyaddr_v6/0, t_gethostbyaddr_v6/1, + t_getaddr_v6/0, t_getaddr_v6/1, + t_gethostbyname_v6/0, t_gethostbyname_v6/1, + ipv4_to_ipv6/0, ipv4_to_ipv6/1, + host_and_addr/0, host_and_addr/1, + t_gethostnative/1, gethostnative_parallell/1, cname_loop/1, - gethostnative_soft_restart/1,gethostnative_debug_level/1,getif/1, - getif_ifr_name_overflow/1,getservbyname_overflow/1,getifaddrs/1]). + gethostnative_soft_restart/0, gethostnative_soft_restart/1, + gethostnative_debug_level/0, gethostnative_debug_level/1, + getif/1, + getif_ifr_name_overflow/1,getservbyname_overflow/1, getifaddrs/1]). -export([get_hosts/1, get_ipv6_hosts/1, parse_hosts/1, parse_address/1, kill_gethost/0, parallell_gethost/0]). -export([init_per_testcase/2, end_per_testcase/2]). +all() -> + [t_gethostbyaddr, t_gethostbyname, t_getaddr, + t_gethostbyaddr_v6, t_gethostbyname_v6, t_getaddr_v6, + ipv4_to_ipv6, host_and_addr, {group, parse}, + t_gethostnative, gethostnative_parallell, cname_loop, + gethostnative_debug_level, gethostnative_soft_restart, + getif, getif_ifr_name_overflow, getservbyname_overflow, + getifaddrs]. + +groups() -> + [{parse, [], [parse_hosts, parse_address]}]. + +%% Required configuaration +required(v4) -> + [{require, test_host_ipv4_only}, + {require, test_dummy_host}]; +required(v6) -> + [{require, test_host_ipv6_only}, + {require, test_dummy_ipv6_host}]; +required(hosts) -> + case os:type() of + {OS, _} when OS =:= win32; OS =:= vxworks -> + [{require, hardcoded_hosts}, + {require, hardcoded_ipv6_hosts}]; + _Else -> + [{require, test_hosts}] + end. + +init_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [t_gethostbyaddr, t_gethostbyname, t_getaddr, - t_gethostbyaddr_v6, t_gethostbyname_v6, t_getaddr_v6, - ipv4_to_ipv6, host_and_addr, parse,t_gethostnative, - gethostnative_parallell, cname_loop, - gethostnative_debug_level,gethostnative_soft_restart, - getif,getif_ifr_name_overflow,getservbyname_overflow,getifaddrs]. +end_per_group(_GroupName, Config) -> + Config. init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), @@ -50,10 +84,12 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). - +t_gethostbyaddr() -> + required(v4). t_gethostbyaddr(doc) -> "Test the inet:gethostbyaddr/1 function."; t_gethostbyaddr(Config) when is_list(Config) -> - ?line {Name,FullName,IPStr,IP,Aliases,_,_} = ?config(test_host_ipv4_only, Config), + ?line {Name,FullName,IPStr,IP,Aliases,_,_} = + ct:get_config(test_host_ipv4_only), ?line {ok,HEnt} = inet:gethostbyaddr(IPStr), ?line {ok,HEnt} = inet:gethostbyaddr(IP), ?line {error,Error} = inet:gethostbyaddr(Name), @@ -75,15 +111,16 @@ t_gethostbyaddr(Config) when is_list(Config) -> end, ?line {_DName, _DFullName, DIPStr, DIP, _, _, _} = - ?config(test_dummy_host, Config), + ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:gethostbyaddr(DIPStr), ?line {error,nxdomain} = inet:gethostbyaddr(DIP), ok. +t_gethostbyaddr_v6() -> required(v6). t_gethostbyaddr_v6(doc) -> "Test the inet:gethostbyaddr/1 inet6 function."; t_gethostbyaddr_v6(Config) when is_list(Config) -> ?line {Name6, FullName6, IPStr6, IP6, Aliases6} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line case inet:gethostbyaddr(IPStr6) of %% Even if IPv6 is not supported, the native resolver may succeed @@ -103,27 +140,28 @@ t_gethostbyaddr_v6(Config) when is_list(Config) -> {HEnt6#hostent.h_aliases,[[],Aliases6]}]), ?line {_DName6, _DFullName6, DIPStr6, DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:gethostbyaddr(DIPStr6), ?line {error,nxdomain} = inet:gethostbyaddr(DIP6), ok end. +t_gethostbyname() -> required(v4). t_gethostbyname(doc) -> "Test the inet:gethostbyname/1 function."; t_gethostbyname(suite) -> []; t_gethostbyname(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,IP,Aliases,IP_46_Str,_} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line {ok,_} = inet:gethostbyname(IPStr), ?line {ok,HEnt} = inet:gethostbyname(Name), ?line {ok,HEnt} = inet:gethostbyname(list_to_atom(Name)), ?line HEnt_ = HEnt#hostent{h_addrtype = inet, h_length = 4, h_addr_list = [IP]}, + ?line HEnt_ = HEnt, ?line check_elems([{HEnt#hostent.h_name,[Name,FullName]}, {HEnt#hostent.h_aliases,[[],Aliases]}]), - ?line {ok,HEntF} = inet:gethostbyname(FullName), ?line HEntF_ = HEntF#hostent{h_name = FullName, h_addrtype = inet, @@ -133,15 +171,16 @@ t_gethostbyname(Config) when is_list(Config) -> ?line check_elems([{HEnt#hostent.h_aliases,[[],Aliases]}]), ?line {DName, _DFullName, _DIPStr, _DIP, _, _, _} = - ?config(test_dummy_host, Config), + ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:gethostbyname(DName), ?line {error,nxdomain} = inet:gethostbyname(IP_46_Str). +t_gethostbyname_v6() -> required(v6). t_gethostbyname_v6(doc) -> "Test the inet:gethostbyname/1 inet6 function."; t_gethostbyname_v6(suite) -> []; t_gethostbyname_v6(Config) when is_list(Config) -> ?line {Name, _, _, _,Aliases,IP_46_Str,IP_46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), case {inet:gethostbyname(IP_46_Str, inet6), inet:gethostbyname(Name, inet6)} of @@ -154,7 +193,7 @@ t_gethostbyname_v6(Config) when is_list(Config) -> ?line check_elems([{HEnt46#hostent.h_aliases,[[],Aliases]}]), ?line {Name6, FullName6, IPStr6, IP6, Aliases6} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line {ok,_} = inet:gethostbyname(IPStr6, inet6), ?line {ok,HEnt6} = inet:gethostbyname(Name6, inet6), ?line {ok,HEnt6} = inet:gethostbyname(list_to_atom(Name6), inet6), @@ -200,7 +239,7 @@ t_gethostbyname_v6(Config) when is_list(Config) -> end, ?line {DName6, _DFullName6, _DIPStr6, _DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:gethostbyname(DName6, inet6), ok; {_,_} -> @@ -219,11 +258,12 @@ check_elem(Val, [], Tests0) -> ?t:fail({no_match,Val,Tests0}). +t_getaddr() -> required(v4). t_getaddr(doc) -> "Test the inet:getaddr/2 function."; t_getaddr(suite) -> []; t_getaddr(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,IP,_,IP_46_Str,IP46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line {ok,IP} = inet:getaddr(list_to_atom(Name), inet), ?line {ok,IP} = inet:getaddr(Name, inet), ?line {ok,IP} = inet:getaddr(FullName, inet), @@ -232,17 +272,18 @@ t_getaddr(Config) when is_list(Config) -> ?line {error,nxdomain} = inet:getaddr(IP_46_Str, inet), ?line {error,eafnosupport} = inet:getaddr(IP46, inet), - ?line {DName, DFullName, DIPStr, DIP, _, _, _} = ?config(test_dummy_host, Config), + ?line {DName, DFullName, DIPStr, DIP, _, _, _} = ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:getaddr(DName, inet), ?line {error,nxdomain} = inet:getaddr(DFullName, inet), ?line {ok,DIP} = inet:getaddr(DIPStr, inet), ?line {ok,DIP} = inet:getaddr(DIP, inet). +t_getaddr_v6() -> required(v4) ++ required(v6). t_getaddr_v6(doc) -> "Test the inet:getaddr/2 function."; t_getaddr_v6(suite) -> []; t_getaddr_v6(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,_IP,_,IP_46_Str,IP46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), case {inet:getaddr(IP_46_Str, inet6),inet:getaddr(Name, inet6)} of {{ok,IP46},{ok,_}} -> %% Since we suceeded in parsing an IPv6 address string and @@ -261,7 +302,7 @@ t_getaddr_v6(Config) when is_list(Config) -> %% inet_db:res_option(lookup)) %% end, ?line {Name6, FullName6, IPStr6, IP6, _} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line {ok,_} = inet:getaddr(list_to_atom(Name6), inet6), ?line {ok,_} = inet:getaddr(Name6, inet6), ?line {ok,_} = inet:getaddr(FullName6, inet6), @@ -269,7 +310,7 @@ t_getaddr_v6(Config) when is_list(Config) -> ?line {ok,IP6} = inet:getaddr(IPStr6, inet6), ?line {DName6, DFullName6, DIPStr6, DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:getaddr(DName6, inet6), ?line {error,nxdomain} = inet:getaddr(DFullName6, inet6), ?line {ok,DIP6} = inet:getaddr(DIPStr6, inet6), @@ -279,6 +320,7 @@ t_getaddr_v6(Config) when is_list(Config) -> {skip, "IPv6 is not supported on this host"} end. +ipv4_to_ipv6() -> required(v4). ipv4_to_ipv6(doc) -> "Test if IPv4 address is converted to IPv6 address."; ipv4_to_ipv6(suite) -> []; ipv4_to_ipv6(Config) when is_list(Config) -> @@ -287,7 +329,7 @@ ipv4_to_ipv6(Config) when is_list(Config) -> %% address should be returned. If no IPv6 support on this host, an %% error should beturned. ?line {_Name,_FullName,IPStr,_IP,Aliases,IP_46_Str,IP_46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line IP4to6Res = case inet:getaddr(IPStr, inet6) of {ok,IP_46} -> @@ -314,6 +356,7 @@ ipv4_to_ipv6(Config) when is_list(Config) -> end, ok. +host_and_addr() -> required(hosts). host_and_addr(doc) -> ["Test looking up hosts and addresses. Use 'ypcat hosts' ", "or the local eqivalent to find all hosts."]; host_and_addr(suite) -> []; @@ -339,12 +382,12 @@ get_hosts(Config) -> {unix, _} -> List = lists:map(fun(X) -> atom_to_list(X)++" " - end, ?config(test_hosts, Config)), + end, ct:get_config(test_hosts)), Cmd = "ypmatch "++List++" hosts.byname", HostFile = os:cmd(Cmd), get_hosts(HostFile, [], [], []); _ -> - ?config(hardcoded_hosts, Config) + ct:get_config(hardcoded_hosts) end. get_ipv6_hosts(Config) -> @@ -352,12 +395,12 @@ get_ipv6_hosts(Config) -> {unix, _} -> List = lists:map(fun(X) -> atom_to_list(X)++" " - end, ?config(test_hosts, Config)), + end, ct:get_config(test_hosts)), Cmd = "ypmatch "++List++" ipnodes.byname", HostFile = os:cmd(Cmd), get_hosts(HostFile, [], [], []); _ -> - ?config(hardcoded_ipv6_hosts, Config) + ct:get_config(hardcoded_ipv6_hosts) end. get_hosts([$\t|Rest], Cur, Ip, Result) when Ip /= [] -> @@ -376,9 +419,6 @@ get_hosts([C|Rest], Cur, Ip, Result) -> get_hosts([], _, _, Result) -> Result. -parse(suite) -> [parse_hosts, parse_address]; -parse(doc) -> ["Test that parsing of the hosts file or equivalent works,", - "and that erroneous lines are skipped"]. parse_hosts(Config) when is_list(Config) -> ?line DataDir = ?config(data_dir,Config), @@ -730,6 +770,7 @@ cname_loop(Config) when is_list(Config) -> lookup_count=300, lookup_processes=20}). +gethostnative_soft_restart() -> required(hosts). gethostnative_soft_restart(suite) -> []; gethostnative_soft_restart(doc) -> @@ -740,6 +781,8 @@ gethostnative_soft_restart(Config) when is_list(Config) -> #gethostnative_control{ control_seq=[soft_restart]}). + +gethostnative_debug_level() -> required(hosts). gethostnative_debug_level(suite) -> []; gethostnative_debug_level(doc) -> diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index cc32d1f8f9..9c7f232631 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -18,24 +18,42 @@ %% -module(inet_res_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([basic/1, resolve/1, edns0/1, txt_record/1, files_monitor/1]). --export([gethostbyaddr/1, gethostbyaddr_v6/1, - gethostbyname/1, gethostbyname_v6/1, - getaddr/1, getaddr_v6/1, ipv4_to_ipv6/1, host_and_addr/1]). +-export([ + gethostbyaddr/0, gethostbyaddr/1, + gethostbyaddr_v6/0, gethostbyaddr_v6/1, + gethostbyname/0, gethostbyname/1, + gethostbyname_v6/0, gethostbyname_v6/1, + getaddr/0, getaddr/1, + getaddr_v6/0, getaddr_v6/1, + ipv4_to_ipv6/0, ipv4_to_ipv6/1, + host_and_addr/0, host_and_addr/1 + ]). -define(RUN_NAMED, "run-named"). -all(suite) -> - [basic, resolve, edns0, txt_record, files_monitor, - gethostbyaddr, gethostbyaddr_v6, gethostbyname, gethostbyname_v6, - getaddr, getaddr_v6, ipv4_to_ipv6, host_and_addr]. +all() -> +[basic, resolve, edns0, txt_record, files_monitor, + gethostbyaddr, gethostbyaddr_v6, gethostbyname, + gethostbyname_v6, getaddr, getaddr_v6, ipv4_to_ipv6, + host_and_addr]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. zone_dir(basic) -> otptest; @@ -450,11 +468,19 @@ do_files_monitor(Config) -> %% Compatibility tests. Call the inet_SUITE tests, but with %% lookup = [file,dns] instead of [native] +gethostbyaddr() -> inet_SUITE:t_gethostbyaddr(). gethostbyaddr(Config) -> inet_SUITE:t_gethostbyaddr(Config). +gethostbyaddr_v6() -> inet_SUITE:t_gethostbyaddr_v6(). gethostbyaddr_v6(Config) -> inet_SUITE:t_gethostbyaddr_v6(Config). +gethostbyname() -> inet_SUITE:t_gethostbyname(). gethostbyname(Config) -> inet_SUITE:t_gethostbyname(Config). +gethostbyname_v6() -> inet_SUITE:t_gethostbyname_v6(). gethostbyname_v6(Config) -> inet_SUITE:t_gethostbyname_v6(Config). +getaddr() -> inet_SUITE:t_getaddr(). getaddr(Config) -> inet_SUITE:t_getaddr(Config). +getaddr_v6() -> inet_SUITE:t_getaddr_v6(). getaddr_v6(Config) -> inet_SUITE:t_getaddr_v6(Config). +ipv4_to_ipv6() -> inet_SUITE:ipv4_to_ipv6(). ipv4_to_ipv6(Config) -> inet_SUITE:ipv4_to_ipv6(Config). +host_and_addr() -> inet_SUITE:host_and_addr(). host_and_addr(Config) -> inet_SUITE:host_and_addr(Config). diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index da97accdbe..f9606ff15a 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -18,7 +18,7 @@ %% -module(inet_sockopt_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(C_GET_IPPROTO_TCP,1). @@ -48,7 +48,7 @@ -define(C_QUIT,99). --export([all/1, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, doc_examples_raw/1,doc_examples_raw_getbin/1, large_raw/1,large_raw_getbin/1,combined/1,combined_getbin/1, type_errors/1]). @@ -56,10 +56,21 @@ -export([init_per_testcase/2, end_per_testcase/2]). -all(suite) -> - [simple,loop_all,simple_raw,simple_raw_getbin, - doc_examples_raw, doc_examples_raw_getbin, - large_raw,large_raw_getbin,combined,combined_getbin,type_errors]. +all() -> +[simple, loop_all, simple_raw, simple_raw_getbin, + doc_examples_raw, doc_examples_raw_getbin, large_raw, + large_raw_getbin, combined, combined_getbin, + type_errors]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index af538b0b8b..ecfc8f8fd0 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -18,13 +18,13 @@ %% -module(init_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_arguments/1, get_argument/1, boot_var/1, restart/1, get_plain_arguments/1, - reboot/1, stop/1, get_status/1, script_id/1, boot/1]). + reboot/1, stop/1, get_status/1, script_id/1]). -export([boot1/1, boot2/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -38,11 +38,20 @@ %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [get_arguments, get_argument, boot_var, - get_plain_arguments, - restart, - get_status, script_id, boot]. +all() -> +[get_arguments, get_argument, boot_var, + get_plain_arguments, restart, get_status, script_id, + {group, boot}]. + +groups() -> + [{boot, [], [boot1, boot2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)), @@ -488,7 +497,6 @@ script_id(Config) when is_list(Config) -> %% ------------------------------------------------ %% Start the slave system with -boot flag. %% ------------------------------------------------ -boot(suite) -> [boot1, boot2]. boot1(doc) -> []; boot1(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]}; diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index e880233588..8bf08a701a 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -17,8 +17,8 @@ %% %CopyrightEnd% %% -module(interactive_shell_SUITE). --include("test_server.hrl"). --export([all/1, get_columns_and_rows/1, exit_initial/1, job_control_local/1, +-include_lib("test_server/include/test_server.hrl"). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, job_control_remote_noshell/1]). @@ -44,9 +44,19 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). -all(suite) -> - [get_columns_and_rows, exit_initial, job_control_local, - job_control_remote, job_control_remote_noshell]. +all() -> +[get_columns_and_rows, exit_initial, job_control_local, + job_control_remote, job_control_remote_noshell]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %-define(DEBUG,1). -ifdef(DEBUG). diff --git a/lib/kernel/test/kernel.dynspec b/lib/kernel/test/kernel.dynspec deleted file mode 100644 index 297a7c71ea..0000000000 --- a/lib/kernel/test/kernel.dynspec +++ /dev/null @@ -1,57 +0,0 @@ -%% -*- erlang -*- -%% You can test this file using this command. -%% file:script("kernel.dynspec", [{'Os',"Unix"}]). - -case Os of - "VxWorks" -> - FsCantHandle = "VxWorks filesystem can't handle this", - FsOverload = "VxWorks filesystem would overload", - CantHandle = "VxWorks can't handle this", - SlaveMisadaption = "Test not adopted to slaves on different machine", - [{skip,{application_SUITE, - "VxWorks: requires manual testing "++ - "(requires multiple nodes (OTP-1774))"}}, - {skip,{bif_SUITE, spawn_link_race1, "Known bug."}}, - {skip,{erl_distribution_SUITE, "VxWorks: More vx nodes needed"}}, - {skip,{file_SUITE,read_write_file,FsCantHandle}}, - {skip,{file_SUITE,cur_dir_0,FsCantHandle}}, - {skip,{file_SUITE,open1,FsCantHandle}}, - {skip,{file_SUITE,file_info_times,FsCantHandle}}, - {skip,{file_SUITE,file_write_file_info,FsCantHandle}}, - {skip,{file_SUITE,truncate,FsCantHandle}}, - {skip,{file_SUITE,rename,FsCantHandle}}, - {skip,{file_SUITE,e_delete,FsCantHandle}}, - {skip,{file_SUITE,e_rename,FsCantHandle}}, - {skip,{file_SUITE,delayed_write,FsCantHandle}}, - {skip,{file_SUITE,read_ahead,FsCantHandle}}, - {skip,{file_SUITE,segment_write,FsOverload}}, - {skip,{file_SUITE,segment_read,FsOverload}}, - {skip,{file_SUITE,compress_errors,FsCantHandle}}, - {skip,{global_SUITE, - "To heavy on slavenodes for VxWorks (and more)."}}, - {skip,{global_group_SUITE, "To heavy on slavenodes for VxWorks."}}, - {skip,{heart_SUITE, "Not for VxWorks heart, it's special"}}, - {skip,{init_SUITE,restart,"Uses peer nodes"}}, - {skip,{kernel_config_SUITE, "VxWorks does not support slave nodes"}}, - {skip,{os_SUITE,space_in_cwd,CantHandle}}, - {skip,{os_SUITE,space_in_name,CantHandle}}, - {skip,{os_SUITE,quoting,CantHandle}}, - {skip,{prim_file_SUITE,open1,FsCantHandle}}, - {skip,{prim_file_SUITE,compress_errors,FsCantHandle}}, - {skip,{seq_trace_SUITE,distributed_recv,SlaveMisadaption}}, - {skip,{seq_trace_SUITE,distributed_exit,SlaveMisadaption}}]; - _ -> - [] -end ++ -try gen_sctp:open() of - {ok,Socket} -> - gen_sctp:close(Socket), - []; - _ -> - [] -catch - error:badarg -> - [{skip,{gen_sctp_SUITE,"SCTP not supported on this machine"}}]; - _:_ -> - [] -end. diff --git a/lib/kernel/test/kernel.spec b/lib/kernel/test/kernel.spec new file mode 100644 index 0000000000..9bb95f9ada --- /dev/null +++ b/lib/kernel/test/kernel.spec @@ -0,0 +1,4 @@ +{config, "../test_server/ts.config"}. +{config, "../test_server/ts.unix.config"}. + +{suites, "kernel_test", all}. diff --git a/lib/kernel/test/kernel.spec.wxworks b/lib/kernel/test/kernel.spec.wxworks new file mode 100644 index 0000000000..370e474e64 --- /dev/null +++ b/lib/kernel/test/kernel.spec.wxworks @@ -0,0 +1,63 @@ +%% -*- erlang -*- +{suites,"kernel_test",all}. +{skip_cases,"kernel_test",bif_SUITE,[spawn_link_race1],"Known bug."}. +{skip_cases,"kernel_test",file_SUITE, + [read_write_file], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [cur_dir_0], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [open1], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [file_info_times], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [file_write_file_info], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [truncate], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [rename], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [e_delete], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [e_rename], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [delayed_write], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [read_ahead], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [segment_write], + "VxWorks filesystem would overload"}. +{skip_cases,"kernel_test",file_SUITE, + [segment_read], + "VxWorks filesystem would overload"}. +{skip_cases,"kernel_test",file_SUITE, + [compress_errors], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",init_SUITE,[restart],"Uses peer nodes"}. +{skip_cases,"kernel_test",os_SUITE,[space_in_cwd],"VxWorks can't handle this"}. +{skip_cases,"kernel_test",os_SUITE, + [space_in_name], + "VxWorks can't handle this"}. +{skip_cases,"kernel_test",os_SUITE,[quoting],"VxWorks can't handle this"}. +{skip_cases,"kernel_test",prim_file_SUITE, + [open1], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",prim_file_SUITE, + [compress_errors], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",seq_trace_SUITE, + [distributed_recv], + "Test not adopted to slaves on different machine"}. +{skip_cases,"kernel_test",seq_trace_SUITE, + [distributed_exit], + "Test not adopted to slaves on different machine"}. diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 76589ab915..3cf3723a85 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -20,14 +20,14 @@ %%% Kernel application test suite. %%%----------------------------------------------------------------- -module(kernel_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -36,10 +36,18 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [app_test]. +all() -> +[app_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index c72fc3f02d..bfb86ebec4 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -18,23 +18,33 @@ %% -module(kernel_config_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, sync/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, sync/1]). --export([init/1, fini/1]). +-export([init_per_suite/1, end_per_suite/1]). -all(suite) -> - [{conf, init, [sync], fini}]. +all() -> +[sync]. -init(doc) -> []; -init(suite) -> []; -init(Config) when is_list(Config) -> +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(doc) -> []; +init_per_suite(suite) -> []; +init_per_suite(Config) when is_list(Config) -> Config. -fini(doc) -> []; -fini(suite) -> []; -fini(Config) when is_list(Config) -> +end_per_suite(doc) -> []; +end_per_suite(suite) -> []; +end_per_suite(Config) when is_list(Config) -> stop_node(init_test), Config. diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index eacf3c7584..a61c390cf3 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -18,15 +18,25 @@ %% -module(os_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([space_in_cwd/1, quoting/1, space_in_name/1, bad_command/1, find_executable/1, unix_comment_in_command/1, evil/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[space_in_cwd, quoting, space_in_name, bad_command, + find_executable, unix_comment_in_command, evil]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [space_in_cwd, quoting, space_in_name, bad_command, find_executable, - unix_comment_in_command, evil]. space_in_cwd(doc) -> "Test that executing a command in a current working directory " diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 09d14208c9..2d33487610 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -20,7 +20,7 @@ %% NB: The ?line macro cannot be used when testing the dictionary. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(M(A,B),m(A,B,?MODULE,?LINE)). -ifdef(DEBUG). @@ -29,7 +29,7 @@ -define(DEBUGF(A,B), noop). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, simple/1, complicated/1, heavy/1, info/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). @@ -42,8 +42,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [simple, complicated, heavy, info]. +all() -> +[simple, complicated, heavy, info]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + simple(doc) -> ["Tests simple functionality in process dictionary."]; diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index 08a6b844f6..cd9de48c63 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -20,13 +20,13 @@ %%----------------------------------------------------------------- -module(pg2_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([tickets/1, +-export([ otp_7277/1, otp_8259/1, otp_8653/1, compat/1, basic/1]). @@ -49,11 +49,20 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [tickets]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], + [otp_7277, otp_8259, otp_8653, compat, basic]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [otp_7277, otp_8259, otp_8653, compat, basic]. otp_7277(doc) -> "OTP-7277. Bugfix leave()."; diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 1688ec45ca..9d0d704b92 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -17,17 +17,17 @@ %% %CopyrightEnd% %% -module(prim_file_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, - read_write_file/1, dirs/1, files/1]). + read_write_file/1]). -export([cur_dir_0a/1, cur_dir_0b/1, cur_dir_1a/1, cur_dir_1b/1, make_del_dir_a/1, make_del_dir_b/1, - pos/1, pos1/1, pos2/1]). + pos1/1, pos2/1]). -export([close/1, delete_a/1, delete_b/1]). --export([open/1, open1/1, modes/1]). --export([file_info/1, +-export([ open1/1, modes/1]). +-export([ file_info_basic_file_a/1, file_info_basic_file_b/1, file_info_basic_directory_a/1, file_info_basic_directory_b/1, file_info_bad_a/1, file_info_bad_b/1, @@ -36,13 +36,13 @@ -export([rename_a/1, rename_b/1, access/1, truncate/1, datasync/1, sync/1, read_write/1, pread_write/1, append/1, exclusive/1]). --export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). +-export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). --export([compression/1, read_not_really_compressed/1, +-export([ read_not_really_compressed/1, read_compressed/1, write_compressed/1, compress_errors/1]). --export([links/1, +-export([ make_link_a/1, make_link_b/1, read_link_info_for_non_link/1, symlinks_a/1, symlinks_b/1, @@ -50,7 +50,7 @@ -export([advise/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -define(PRIM_FILE, prim_file). @@ -67,12 +67,43 @@ _ -> apply(?PRIM_FILE, F, [H | A]) end). -all(suite) -> {req, [kernel], - {conf, init, - [read_write_file, dirs, files, - delete_a, delete_b, rename_a, rename_b, errors, - compression, links, list_dir_limit], - fini}}. +all() -> +[read_write_file, {group, dirs}, {group, files}, + delete_a, delete_b, rename_a, rename_b, {group, errors}, + {group, compression}, {group, links}, list_dir_limit]. + +groups() -> + [{dirs, [], + [make_del_dir_a, make_del_dir_b, cur_dir_0a, cur_dir_0b, + cur_dir_1a, cur_dir_1b]}, + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, modes, close, access, read_write, pread_write, + append, exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file_a, file_info_basic_file_b, + file_info_basic_directory_a, + file_info_basic_directory_b, file_info_bad_a, + file_info_bad_b, file_info_times_a, file_info_times_b, + file_write_file_info_a, file_write_file_info_b]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed, read_not_really_compressed, + write_compressed, compress_errors]}, + {links, [], + [make_link_a, make_link_b, read_link_info_for_non_link, + symlinks_a, symlinks_b]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Config) when is_list(Config) -> case os:type() of @@ -190,9 +221,6 @@ read_write_file(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirs(suite) -> [make_del_dir_a, make_del_dir_b, - cur_dir_0a, cur_dir_0b, - cur_dir_1a, cur_dir_1b]. make_del_dir_a(suite) -> []; make_del_dir_a(doc) -> []; @@ -382,10 +410,7 @@ win_cur_dir_1(_Config, Handle) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -files(suite) -> [open,pos,file_info,truncate,sync,datasync,advise]. -open(suite) -> [open1,modes,close,access,read_write, - pread_write,append,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -628,7 +653,6 @@ exclusive(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -pos(suite) -> [pos1,pos2]. pos1(suite) -> []; pos1(doc) -> []; @@ -716,12 +740,6 @@ pos2(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -file_info(suite) -> [file_info_basic_file_a, file_info_basic_file_b, - file_info_basic_directory_a, - file_info_basic_directory_b, - file_info_bad_a, file_info_bad_b, - file_info_times_a, file_info_times_b, - file_write_file_info_a, file_write_file_info_b]. file_info_basic_file_a(suite) -> []; file_info_basic_file_a(doc) -> []; @@ -1298,7 +1316,6 @@ rename(Config, Handle, Suffix) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -errors(suite) -> [e_delete, e_rename, e_make_dir, e_del_dir]. e_delete(suite) -> []; e_delete(doc) -> []; @@ -1550,8 +1567,6 @@ e_del_dir(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -compression(suite) -> [read_compressed, read_not_really_compressed, - write_compressed, compress_errors]. %% Trying reading and positioning from a compressed file. @@ -1704,11 +1719,6 @@ compress_errors(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -links(doc) -> "Test the link functions."; -links(suite) -> - [make_link_a, make_link_b, - read_link_info_for_non_link, - symlinks_a, symlinks_b]. make_link_a(doc) -> "Test creating a hard link."; make_link_a(suite) -> []; diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index fadf695c53..6b5df2a887 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -19,14 +19,14 @@ -module(ram_file_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, %% init/1, fini/1, init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, truncate/1, sync/1, get_set_file/1, compress/1, uuencode/1, large_file_errors/1, large_file_light/1, large_file_heavy/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -define(FILE_MODULE, file). % Name of module to test @@ -34,10 +34,20 @@ %%-------------------------------------------------------------------------- -all(suite) -> - [open_modes, open_old_modes, pread_pwrite, position, - truncate, sync, get_set_file, compress, uuencode, - large_file_errors, large_file_light, large_file_heavy]. +all() -> +[open_modes, open_old_modes, pread_pwrite, position, + truncate, sync, get_set_file, compress, uuencode, + large_file_errors, large_file_light, large_file_heavy]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Time = diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 2b7de40797..4c31924052 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(rpc_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([call/1, block_call/1, multicall/1, multicall_timeout/1, multicall_dies/1, multicall_node_dies/1, called_dies/1, called_node_dies/1, @@ -26,13 +26,23 @@ -export([suicide/2, suicide/3, f/0, f2/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[call, block_call, multicall, multicall_timeout, + multicall_dies, multicall_node_dies, called_dies, + called_node_dies, called_throws, call_benchmark, + async_call]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [call, block_call, multicall, multicall_timeout, - multicall_dies, multicall_node_dies, - called_dies, called_node_dies, - called_throws, call_benchmark, async_call]. call(doc) -> "Test different rpc calls"; diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index 3b54216fa9..c7736b3f27 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,7 @@ %% -module(seq_trace_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -30,14 +30,25 @@ do_match_set_seq_token/1, do_gc_seq_token/1, countdown_start/2]). %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). -all(suite) -> [token_set_get, tracer_set_get, print, - send, distributed_send, recv, distributed_recv, - trace_exit, distributed_exit, call, port, - match_set_seq_token, gc_seq_token]. +all() -> +[token_set_get, tracer_set_get, print, send, + distributed_send, recv, distributed_recv, trace_exit, + distributed_exit, call, port, match_set_seq_token, + gc_seq_token]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index ea1ee77efb..616d777e9b 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -28,25 +28,38 @@ -define(config(X,Y), foo). -define(t,test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, no_file/1, - one/1, one_empty/1, one_filled/1, - two/1, two_filled/1, - four/1, four_filled/1, - wrap/1, wrap_filled/1, + one_empty/1, one_filled/1, + two_filled/1, + four_filled/1, + wrap_filled/1, wrapping/1, external/1, error/1]). -export([init_per_testcase/2, end_per_testcase/2]). -all(suite) -> - [no_file, one, two, four, wrap, wrapping, external, error]. +all() -> +[no_file, {group, one}, {group, two}, {group, four}, + {group, wrap}, wrapping, external, error]. + +groups() -> + [{one, [], [one_empty, one_filled]}, + {two, [], [two_filled]}, {four, [], [four_filled]}, + {wrap, [], [wrap_filled]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(60)), @@ -76,8 +89,6 @@ no_file(Conf) when is_list(Conf) -> delete_files(File), ok. -one(suite) -> [one_empty, one_filled]; -one(doc) -> ["One index file"]. one_empty(suite) -> []; one_empty(doc) -> ["One empty index file"]; @@ -139,8 +150,6 @@ test_one(File) -> {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE), ok. -two(suite) -> [two_filled]; -two(doc) -> ["Two index files"]. two_filled(suite) -> []; two_filled(doc) -> ["Two filled index files"]; @@ -181,8 +190,6 @@ test_two(File) -> {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE), ok. -four(suite) -> [four_filled]; -four(doc) -> ["Four index files"]. four_filled(suite) -> []; four_filled(doc) -> ["Four filled index files"]; @@ -226,8 +233,6 @@ test_four(File) -> {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE), ok. -wrap(suite) -> [wrap_filled]; -wrap(doc) -> ["Wrap index file, first wrapping"]. wrap_filled(suite) -> []; wrap_filled(doc) -> ["First wrap, open, filled index file"]; diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index 8ef3d0040f..135ef5ddaa 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -19,7 +19,7 @@ -module(zlib_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -compile(export_all). @@ -69,33 +69,32 @@ error(Format, Args, File, Line) -> %% end, %% log("<>ERROR<>~n" ++ Format, Args, File, Line). -all(suite) -> - [api, examples, func, smp, otp_7359]. - -api(doc) -> "Basic the api tests"; -api(suite) -> - [api_open_close, - api_deflateInit, - api_deflateSetDictionary, - api_deflateReset, - api_deflateParams, - api_deflate, - api_deflateEnd, - api_inflateInit, - api_inflateSetDictionary, - api_inflateSync, - api_inflateReset, - api_inflate, - api_inflateEnd, - api_setBufsz, - api_getBufsz, - api_crc32, - api_adler32, - api_getQSize, - api_un_compress, - api_un_zip, -% api_g_un_zip_file, - api_g_un_zip]. +all() -> +[{group, api}, {group, examples}, {group, func}, smp, + otp_7359]. + +groups() -> + [{api, [], + [api_open_close, api_deflateInit, + api_deflateSetDictionary, api_deflateReset, + api_deflateParams, api_deflate, api_deflateEnd, + api_inflateInit, api_inflateSetDictionary, + api_inflateSync, api_inflateReset, api_inflate, + api_inflateEnd, api_setBufsz, api_getBufsz, api_crc32, + api_adler32, api_getQSize, api_un_compress, api_un_zip, + api_g_un_zip]}, + {examples, [], [intro]}, + {func, [], + [zip_usage, gz_usage, gz_usage2, compress_usage, + dictionary_usage, large_deflate, crc, adler]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + api_open_close(doc) -> "Test open/0 and close/1"; api_open_close(suite) -> []; @@ -517,11 +516,6 @@ bad_len_data() -> %% zlib:zip(<<42>>), one byte changed. <<31,139,8,0,0,0,0,0,0,3,211,2,0,91,38,185,9,2,0,0,0>>. -examples(doc) -> "Test the doc examples"; -examples(suite) -> - [ - intro - ]. intro(suite) -> []; intro(doc) -> ""; @@ -551,15 +545,6 @@ intro(Config) when is_list(Config) -> Orig = list_to_binary(lists:duplicate(5, D)), ?m(Orig, zlib:uncompress(Res)). -func(doc) -> "Test the functionality"; -func(suite) -> - [zip_usage, gz_usage, gz_usage2, compress_usage, - dictionary_usage, - large_deflate, - %% inflateSync, - crc, - adler - ]. large_deflate(doc) -> "Test deflate large file, which had a bug reported on erlang-bugs"; large_deflate(suite) -> []; -- cgit v1.2.3 From f02cc10b4bda484996b7b93436fcaf8d714cb3da Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:39:40 +0200 Subject: Update inets tests to conform with common_test standard --- lib/inets/test/ftp_SUITE.erl | 112 ++++---- lib/inets/test/ftp_format_SUITE.erl | 33 +-- lib/inets/test/ftp_freebsd_x86_test.erl | 25 +- lib/inets/test/ftp_linux_ppc_test.erl | 25 +- lib/inets/test/ftp_linux_x86_test.erl | 34 +-- lib/inets/test/ftp_macosx_ppc_test.erl | 25 +- lib/inets/test/ftp_macosx_x86_test.erl | 25 +- lib/inets/test/ftp_netbsd_x86_test.erl | 25 +- lib/inets/test/ftp_openbsd_x86_test.erl | 25 +- lib/inets/test/ftp_solaris10_sparc_test.erl | 25 +- lib/inets/test/ftp_solaris10_x86_test.erl | 25 +- lib/inets/test/ftp_solaris8_sparc_test.erl | 25 +- lib/inets/test/ftp_solaris9_sparc_test.erl | 25 +- lib/inets/test/ftp_ticket_test.erl | 18 +- lib/inets/test/ftp_windows_2003_server_test.erl | 25 +- lib/inets/test/ftp_windows_xp_test.erl | 25 +- lib/inets/test/http_format_SUITE.erl | 45 ++-- lib/inets/test/httpc_SUITE.erl | 126 +++------ lib/inets/test/httpc_cookie_SUITE.erl | 35 ++- lib/inets/test/httpd_SUITE.erl | 327 ++++++++---------------- lib/inets/test/httpd_basic_SUITE.erl | 21 +- lib/inets/test/inets.spec | 3 +- lib/inets/test/inets_SUITE.erl | 39 ++- lib/inets/test/inets_app_test.erl | 24 +- lib/inets/test/inets_appup_test.erl | 19 +- lib/inets/test/inets_sup_SUITE.erl | 25 +- lib/inets/test/tftp_SUITE.erl | 24 +- 27 files changed, 564 insertions(+), 621 deletions(-) diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl index 03af34ec3c..691157534b 100644 --- a/lib/inets/test/ftp_SUITE.erl +++ b/lib/inets/test/ftp_SUITE.erl @@ -20,28 +20,28 @@ -module(ftp_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). % -export([init_per_testcase/2, end_per_testcase/2]). -export([init_per_suite/1, end_per_suite/1]). %% Test cases must be exported. --export([solaris8_test/1, - solaris9_test/1, - solaris10_test/1, - linux_x86_test/1, - linux_ppc_test/1, - macosx_x86_test/1, - macosx_ppc_test/1, - openbsd_test/1, - freebsd_test/1, - netbsd_test/1, - windows_xp_test/1, - windows_2003_server_test/1, - ticket_tests/1]). +-export([ + + + + + + + + + + + +]). -define(FTP_USER, "anonymous"). -define(FTP_PASS, passwd()). @@ -72,52 +72,42 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Test the ftp client in the inets application."]; -all(suite) -> - [ - solaris8_test, - solaris9_test, - solaris10_test, - linux_x86_test, - linux_ppc_test, - macosx_x86_test, - macosx_ppc_test, - openbsd_test, - freebsd_test, - netbsd_test, - windows_xp_test, - windows_2003_server_test, - ticket_tests - ]. - -solaris8_test(suite) -> - [{ftp_solaris8_sparc_test,all}]. -solaris9_test(suite) -> - [{ftp_solaris9_sparc_test,all}]. -solaris10_test(suite) -> - [{ftp_solaris10_sparc_test,all}, {ftp_solaris10_x86_test,all}]. -linux_x86_test(suite) -> - [{ftp_linux_x86_test,all}]. -linux_ppc_test(suite) -> - [{ftp_linux_ppc_test,all}]. -macosx_x86_test(suite) -> - [{ftp_macosx_x86_test,all}]. -macosx_ppc_test(suite) -> - [{ftp_macosx_ppc_test,all}]. -openbsd_test(suite) -> - [{ftp_openbsd_x86_test,all}]. -freebsd_test(suite) -> - [{ftp_freebsd_x86_test,all}]. -netbsd_test(suite) -> - [{ftp_netbsd_x86_test,all}]. -windows_xp_test(suite) -> - [{ftp_windows_xp_test,all}]. -windows_2003_server_test(suite) -> - [{ftp_windows_2003_server_test,all}]. - -ticket_tests(suite) -> - [{ftp_ticket_test, all}]. +all() -> +[{group, solaris8_test}, {group, solaris9_test}, + {group, solaris10_test}, {group, linux_x86_test}, + {group, linux_ppc_test}, {group, macosx_x86_test}, + {group, macosx_ppc_test}, {group, openbsd_test}, + {group, freebsd_test}, {group, netbsd_test}, + {group, windows_xp_test}, + {group, windows_2003_server_test}, + {group, ticket_tests}]. + +groups() -> + [{solaris8_test, [], [{ftp_solaris8_sparc_test, all}]}, + {solaris9_test, [], [{ftp_solaris9_sparc_test, all}]}, + {solaris10_test, [], + [{ftp_solaris10_sparc_test, all}, + {ftp_solaris10_x86_test, all}]}, + {linux_x86_test, [], [{ftp_linux_x86_test, all}]}, + {linux_ppc_test, [], [{ftp_linux_ppc_test, all}]}, + {macosx_x86_test, [], [{ftp_macosx_x86_test, all}]}, + {macosx_ppc_test, [], [{ftp_macosx_ppc_test, all}]}, + {openbsd_test, [], [{ftp_openbsd_x86_test, all}]}, + {freebsd_test, [], [{ftp_freebsd_x86_test, all}]}, + {netbsd_test, [], [{ftp_netbsd_x86_test, all}]}, + {windows_xp_test, [], [{ftp_windows_xp_test, all}]}, + {windows_2003_server_test, [], + [{ftp_windows_2003_server_test, all}]}, + {ticket_tests, [], [{ftp_ticket_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 0b5829c28c..2499176898 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -20,23 +20,34 @@ -module(ftp_format_SUITE). -author('ingela@erix.ericsson.se'). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("ftp_internal.hrl"). %% Test server specific exports --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. --export([ftp_response/1, ftp_150/1, +-export([ ftp_150/1, ftp_200/1, ftp_220/1, ftp_226/1, ftp_257/1, ftp_331/1, ftp_425/1, ftp_other_status_codes/1, ftp_multiple_lines/1, ftp_multipel_ctrl_messages/1, format_error/1]). -all(doc) -> - ["Test library functions for the ftp client."]; -all(suite) -> - [ftp_response, format_error]. +all() -> +[{group, ftp_response}, format_error]. + +groups() -> + [{ftp_response, [], + [ftp_150, ftp_200, ftp_220, ftp_226, ftp_257, ftp_331, + ftp_425, ftp_other_status_codes, ftp_multiple_lines, + ftp_multipel_ctrl_messages]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_, Config) -> Dog = test_server:timetrap(?t:minutes(1)), @@ -51,14 +62,6 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -ftp_response(doc) -> - ["Test ftp_response:parse_lines/3 and ftp_response:interpret/1." - " This test case will simulate that the " - "message will be recived a little at the time on a socket and the " - "package may be broken up into smaller parts at arbitrary point."]; -ftp_response(suite) -> - [ftp_150, ftp_200, ftp_220, ftp_226, ftp_257, ftp_331, ftp_425, - ftp_other_status_codes, ftp_multiple_lines, ftp_multipel_ctrl_messages]. ftp_150(doc) -> ["Especially check that respons can be devided in a random place."]; diff --git a/lib/inets/test/ftp_freebsd_x86_test.erl b/lib/inets/test/ftp_freebsd_x86_test.erl index 81dc320a14..d7b9a65470 100644 --- a/lib/inets/test/ftp_freebsd_x86_test.erl +++ b/lib/inets/test/ftp_freebsd_x86_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,23 +86,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_linux_ppc_test.erl b/lib/inets/test/ftp_linux_ppc_test.erl index d2e8e440e9..061e49d6c9 100644 --- a/lib/inets/test/ftp_linux_ppc_test.erl +++ b/lib/inets/test/ftp_linux_ppc_test.erl @@ -23,7 +23,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -87,23 +87,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_linux_x86_test.erl b/lib/inets/test/ftp_linux_x86_test.erl index 48a90579dd..eb7feb6045 100644 --- a/lib/inets/test/ftp_linux_x86_test.erl +++ b/lib/inets/test/ftp_linux_x86_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,30 +86,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; - -all(suite) -> - [ - open, - open_port, - passive, - active, - api_missuse, - not_owner, - progress_report - ]. +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_macosx_ppc_test.erl b/lib/inets/test/ftp_macosx_ppc_test.erl index ced8debee1..c9f33b8beb 100644 --- a/lib/inets/test/ftp_macosx_ppc_test.erl +++ b/lib/inets/test/ftp_macosx_ppc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -87,21 +87,28 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_macosx_x86_test.erl b/lib/inets/test/ftp_macosx_x86_test.erl index 29d0d517ed..17b7160b95 100644 --- a/lib/inets/test/ftp_macosx_x86_test.erl +++ b/lib/inets/test/ftp_macosx_x86_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,22 +86,29 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_netbsd_x86_test.erl b/lib/inets/test/ftp_netbsd_x86_test.erl index ed30aee2b4..64f215e550 100644 --- a/lib/inets/test/ftp_netbsd_x86_test.erl +++ b/lib/inets/test/ftp_netbsd_x86_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,22 +86,29 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_openbsd_x86_test.erl b/lib/inets/test/ftp_openbsd_x86_test.erl index adde553196..5785820bfc 100644 --- a/lib/inets/test/ftp_openbsd_x86_test.erl +++ b/lib/inets/test/ftp_openbsd_x86_test.erl @@ -23,7 +23,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -87,23 +87,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris10_sparc_test.erl b/lib/inets/test/ftp_solaris10_sparc_test.erl index 9671afc069..3e8d8d6fd0 100644 --- a/lib/inets/test/ftp_solaris10_sparc_test.erl +++ b/lib/inets/test/ftp_solaris10_sparc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -87,23 +87,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) ->?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris10_x86_test.erl b/lib/inets/test/ftp_solaris10_x86_test.erl index 1d44e36578..6f703b8e30 100644 --- a/lib/inets/test/ftp_solaris10_x86_test.erl +++ b/lib/inets/test/ftp_solaris10_x86_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD, ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_), ?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -88,23 +88,30 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. %%-------------------------------------------------------------------- open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris8_sparc_test.erl b/lib/inets/test/ftp_solaris8_sparc_test.erl index 9e7511f162..982ef6ce1c 100644 --- a/lib/inets/test/ftp_solaris8_sparc_test.erl +++ b/lib/inets/test/ftp_solaris8_sparc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,22 +86,29 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_solaris9_sparc_test.erl b/lib/inets/test/ftp_solaris9_sparc_test.erl index fe61c8615a..1db0708182 100644 --- a/lib/inets/test/ftp_solaris9_sparc_test.erl +++ b/lib/inets/test/ftp_solaris9_sparc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -85,22 +85,29 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_ticket_test.erl b/lib/inets/test/ftp_ticket_test.erl index 6748df03bb..3b0163a203 100644 --- a/lib/inets/test/ftp_ticket_test.erl +++ b/lib/inets/test/ftp_ticket_test.erl @@ -35,14 +35,24 @@ end_per_testcase(Case, Config) -> ftp_suite_lib:end_per_testcase(Case, Config). -all(suite) -> - {conf,init,tickets(),fin}. +all() -> +tickets(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Config) -> ?LIB_MOD:ftpd_init(ticket_test, Config). -tickets() -> - [ticket_6035]. +tickets() -> +[ticket_6035]. fin(Config) -> diff --git a/lib/inets/test/ftp_windows_2003_server_test.erl b/lib/inets/test/ftp_windows_2003_server_test.erl index de019bd1cd..98cbb70a75 100644 --- a/lib/inets/test/ftp_windows_2003_server_test.erl +++ b/lib/inets/test/ftp_windows_2003_server_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,22 +86,29 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. %% Test cases starts here. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/ftp_windows_xp_test.erl b/lib/inets/test/ftp_windows_xp_test.erl index 53803ba3d8..a63b5a0844 100644 --- a/lib/inets/test/ftp_windows_xp_test.erl +++ b/lib/inets/test/ftp_windows_xp_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -define(LIB_MOD,ftp_suite_lib). -define(CASE_WRAPPER(_A_,_B_,_C_),?LIB_MOD:wrapper(_A_,_B_,_C_)). @@ -86,20 +86,27 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test ftp client"]; +all() -> +[open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. + +groups() -> + [{passive, [], ftp_suite_lib:passive(suite)}, + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [open, open_port, passive, active, api_missuse, - not_owner, progress_report]. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). open_port(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open_port/1). -passive(suite) -> ?LIB_MOD:passive(suite). -active(suite) -> ?LIB_MOD:active(suite). api_missuse(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:api_missuse/1). not_owner(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:not_owner/1). -progress_report(suite) -> ?LIB_MOD:progress_report(suite). passive_user(X) -> ?LIB_MOD:passive_user(X). passive_pwd(X) -> ?LIB_MOD:passive_pwd(X). diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl index 79945f0f4d..c53ae446d8 100644 --- a/lib/inets/test/http_format_SUITE.erl +++ b/lib/inets/test/http_format_SUITE.erl @@ -21,28 +21,41 @@ -module(http_format_SUITE). -author('ingela@erix.ericsson.se'). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("http_internal.hrl"). %% Test server specific exports --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. --export([chunk/1, chunk_decode/1, chunk_encode/1, +-export([ chunk_decode/1, chunk_encode/1, chunk_extensions_otp_6005/1, chunk_decode_otp_6264/1, chunk_decode_empty_chunk_otp_6511/1, chunk_decode_trailer/1, - http_response/1, http_request/1, validate_request_line/1, script/1, + http_response/1, http_request/1, validate_request_line/1, esi_parse_headers/1, cgi_parse_headers/1, is_absolut_uri/1, convert_netscapecookie_date/1]). -all(doc) -> - ["Test library functions to the http client and server."]; -all(suite) -> - [chunk, - http_response, http_request, validate_request_line, - script, is_absolut_uri, convert_netscapecookie_date]. +all() -> +[{group, chunk}, http_response, http_request, + validate_request_line, {group, script}, is_absolut_uri, + convert_netscapecookie_date]. + +groups() -> + [{script, [], [esi_parse_headers, cgi_parse_headers]}, + {chunk, [], + [chunk_decode, chunk_encode, chunk_extensions_otp_6005, + chunk_decode_otp_6264, + chunk_decode_empty_chunk_otp_6511, + chunk_decode_trailer]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_, Config) -> Dog = test_server:timetrap(?t:minutes(1)), @@ -57,17 +70,7 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -script(doc) -> - ["Test header parsing in esi/cgi functionality."]; -script(suite) -> - [esi_parse_headers, cgi_parse_headers]. - -chunk(doc) -> - ["Test chunk encoding"]; -chunk(suite) -> - [chunk_decode, chunk_encode, chunk_extensions_otp_6005, - chunk_decode_otp_6264, chunk_decode_empty_chunk_otp_6511, - chunk_decode_trailer]. + %%------------------------------------------------------------------------- chunk_decode(doc) -> diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 94d5a48ef6..328b0a01f8 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -24,7 +24,7 @@ -module(httpc_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/file.hrl"). @@ -59,63 +59,44 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Test the http client in the intes application."]; -all(suite) -> - [ - proxy_options, - proxy_head, - proxy_get, - proxy_trace, - proxy_post, - proxy_put, - proxy_delete, - proxy_auth, - proxy_headers, - proxy_emulate_lower_versions, - http_options, - http_head, - http_get, - http_post, - http_dummy_pipe, - http_inets_pipe, - http_trace, - http_async, - http_save_to_file, - http_save_to_file_async, - http_headers, - http_headers_dummy, - http_bad_response, - ssl_head, - ossl_head, - essl_head, - ssl_get, - ossl_get, - essl_get, - ssl_trace, - ossl_trace, - essl_trace, - http_redirect, - http_redirect_loop, - http_internal_server_error, - http_userinfo, - http_cookie, - http_server_does_not_exist, - http_invalid_http, - http_emulate_lower_versions, - http_relaxed, - page_does_not_exist, - proxy_page_does_not_exist, - proxy_https_not_supported, - http_stream, - http_stream_once, - proxy_stream, - parse_url, - options, - ipv6, - headers_as_is, - tickets - ]. +all() -> +[proxy_options, proxy_head, proxy_get, proxy_trace, + proxy_post, proxy_put, proxy_delete, proxy_auth, + proxy_headers, proxy_emulate_lower_versions, + http_options, http_head, http_get, http_post, + http_dummy_pipe, http_inets_pipe, http_trace, + http_async, http_save_to_file, http_save_to_file_async, + http_headers, http_headers_dummy, http_bad_response, + ssl_head, ossl_head, essl_head, ssl_get, ossl_get, + essl_get, ssl_trace, ossl_trace, essl_trace, + http_redirect, http_redirect_loop, + http_internal_server_error, http_userinfo, http_cookie, + http_server_does_not_exist, http_invalid_http, + http_emulate_lower_versions, http_relaxed, + page_does_not_exist, proxy_page_does_not_exist, + proxy_https_not_supported, http_stream, + http_stream_once, proxy_stream, parse_url, options, + ipv6, headers_as_is, {group, tickets}]. + +groups() -> + [{tickets, [], + [hexed_query_otp_6191, empty_body_otp_6243, + empty_response_header_otp_6830, + transfer_encoding_otp_6807, proxy_not_modified_otp_6821, + no_content_204_otp_6982, missing_CR_otp_7304, + {group, otp_7883}, {group, otp_8154}, {group, otp_8106}, + otp_8056, otp_8352, otp_8371, otp_8739]}, + {otp_7883, [], [otp_7883_1, otp_7883_2]}, + {otp_8154, [], [otp_8154_1]}, + {otp_8106, [], + [otp_8106_pid, otp_8106_fun, otp_8106_mfa]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config @@ -295,25 +276,6 @@ finish(Config) -> %% Test cases starts here. %%------------------------------------------------------------------------- -tickets(doc) -> - ["."]; -tickets(suite) -> - [ - hexed_query_otp_6191, - empty_body_otp_6243, - empty_response_header_otp_6830, - transfer_encoding_otp_6807, - proxy_not_modified_otp_6821, - no_content_204_otp_6982, - missing_CR_otp_7304, - otp_7883, - otp_8154, - otp_8106, - otp_8056, - otp_8352, - otp_8371, - otp_8739 - ]. %%------------------------------------------------------------------------- @@ -1979,8 +1941,6 @@ missing_CR_otp_7304(Config) when is_list(Config) -> %%------------------------------------------------------------------------- -otp_7883(suite) -> - [otp_7883_1, otp_7883_2]. otp_7883_1(doc) -> ["OTP-7883-sync"]; @@ -2028,8 +1988,6 @@ otp_7883_2(Config) when is_list(Config) -> %%------------------------------------------------------------------------- -otp_8154(suite) -> - [otp_8154_1]. otp_8154_1(doc) -> ["OTP-8154"]; @@ -2309,12 +2267,6 @@ f(F, A) -> lists:flatten(io_lib:format(F,A)). %%------------------------------------------------------------------------- -otp_8106(suite) -> - [ - otp_8106_pid, - otp_8106_fun, - otp_8106_mfa - ]. otp_8106_pid(doc) -> diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl index ad5df656c6..31bc4f510a 100644 --- a/lib/inets/test/httpc_cookie_SUITE.erl +++ b/lib/inets/test/httpc_cookie_SUITE.erl @@ -19,11 +19,11 @@ %% -module(httpc_cookie_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("stdlib/include/ms_transform.hrl"). %% Test server specific exports --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([session_cookies_only/1, netscape_cookies/1, @@ -116,22 +116,21 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Describe the main purpose of this suite"]; - -all(suite) -> - [ - session_cookies_only, - netscape_cookies, - cookie_cancel, - cookie_expires, - persistent_cookie, - domain_cookie, - secure_cookie, - update_cookie, - update_cookie_session, - cookie_attributes - ]. +all() -> +[session_cookies_only, netscape_cookies, cookie_cancel, + cookie_expires, persistent_cookie, domain_cookie, + secure_cookie, update_cookie, update_cookie_session, + cookie_attributes]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases starts here. %%-------------------------------------------------------------------- diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index 3255cbec06..b93edaf93b 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -20,27 +20,26 @@ -module(httpd_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("test_server_line.hrl"). -include("inets_test_lib.hrl"). -include_lib("kernel/include/file.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, init_per_suite/1, end_per_suite/1]). %% Test cases must be exported. -export([ - ip/1, - ssl/1, pssl/1, ossl/1, essl/1, - http_1_1_ip/1, - http_1_0_ip/1, - http_0_9_ip/1, - ipv6/1, - tickets/1 - ]). + + + + + + +]). %% Core Server tests -export([ @@ -249,18 +248,106 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Test the http server in the intes application."]; -all(suite) -> - [ - ip, - ssl, - http_1_1_ip, - http_1_0_ip, - http_0_9_ip, - %% ipv6, - tickets - ]. +all() -> +[{group, ip}, {group, ssl}, {group, http_1_1_ip}, + {group, http_1_0_ip}, {group, http_0_9_ip}, + {group, tickets}]. + +groups() -> + [{ip, [], + [ip_mod_alias, ip_mod_actions, ip_mod_security, + ip_mod_auth, ip_mod_auth_api, ip_mod_auth_mnesia_api, + ip_mod_htaccess, ip_mod_cgi, ip_mod_esi, ip_mod_get, + ip_mod_head, ip_mod_all, ip_load_light, ip_load_medium, + ip_load_heavy, ip_dos_hostname, ip_time_test, + ip_restart_no_block, ip_restart_disturbing_block, + ip_restart_non_disturbing_block, + ip_block_disturbing_idle, ip_block_non_disturbing_idle, + ip_block_503, ip_block_disturbing_active, + ip_block_non_disturbing_active, + ip_block_disturbing_active_timeout_not_released, + ip_block_disturbing_active_timeout_released, + ip_block_non_disturbing_active_timeout_not_released, + ip_block_non_disturbing_active_timeout_released, + ip_block_disturbing_blocker_dies, + ip_block_non_disturbing_blocker_dies]}, + {ssl, [], + [{group, pssl}, {group, ossl}, {group, essl}]}, + {pssl, [], + [pssl_mod_alias, pssl_mod_actions, pssl_mod_security, + pssl_mod_auth, pssl_mod_auth_api, + pssl_mod_auth_mnesia_api, pssl_mod_htaccess, + pssl_mod_cgi, pssl_mod_esi, pssl_mod_get, pssl_mod_head, + pssl_mod_all, pssl_load_light, pssl_load_medium, + pssl_load_heavy, pssl_dos_hostname, pssl_time_test, + pssl_restart_no_block, pssl_restart_disturbing_block, + pssl_restart_non_disturbing_block, + pssl_block_disturbing_idle, + pssl_block_non_disturbing_idle, pssl_block_503, + pssl_block_disturbing_active, + pssl_block_non_disturbing_active, + pssl_block_disturbing_active_timeout_not_released, + pssl_block_disturbing_active_timeout_released, + pssl_block_non_disturbing_active_timeout_not_released, + pssl_block_non_disturbing_active_timeout_released, + pssl_block_disturbing_blocker_dies, + pssl_block_non_disturbing_blocker_dies]}, + {ossl, [], + [ossl_mod_alias, ossl_mod_actions, ossl_mod_security, + ossl_mod_auth, ossl_mod_auth_api, + ossl_mod_auth_mnesia_api, ossl_mod_htaccess, + ossl_mod_cgi, ossl_mod_esi, ossl_mod_get, ossl_mod_head, + ossl_mod_all, ossl_load_light, ossl_load_medium, + ossl_load_heavy, ossl_dos_hostname, ossl_time_test, + ossl_restart_no_block, ossl_restart_disturbing_block, + ossl_restart_non_disturbing_block, + ossl_block_disturbing_idle, + ossl_block_non_disturbing_idle, ossl_block_503, + ossl_block_disturbing_active, + ossl_block_non_disturbing_active, + ossl_block_disturbing_active_timeout_not_released, + ossl_block_disturbing_active_timeout_released, + ossl_block_non_disturbing_active_timeout_not_released, + ossl_block_non_disturbing_active_timeout_released, + ossl_block_disturbing_blocker_dies, + ossl_block_non_disturbing_blocker_dies]}, + {essl, [], + [essl_mod_alias, essl_mod_actions, essl_mod_security, + essl_mod_auth, essl_mod_auth_api, + essl_mod_auth_mnesia_api, essl_mod_htaccess, + essl_mod_cgi, essl_mod_esi, essl_mod_get, essl_mod_head, + essl_mod_all, essl_load_light, essl_load_medium, + essl_load_heavy, essl_dos_hostname, essl_time_test, + essl_restart_no_block, essl_restart_disturbing_block, + essl_restart_non_disturbing_block, + essl_block_disturbing_idle, + essl_block_non_disturbing_idle, essl_block_503, + essl_block_disturbing_active, + essl_block_non_disturbing_active, + essl_block_disturbing_active_timeout_not_released, + essl_block_disturbing_active_timeout_released, + essl_block_non_disturbing_active_timeout_not_released, + essl_block_non_disturbing_active_timeout_released, + essl_block_disturbing_blocker_dies, + essl_block_non_disturbing_blocker_dies]}, + {http_1_1_ip, [], + [ip_host, ip_chunked, ip_expect, ip_range, ip_if_test, + ip_http_trace, ip_http1_1_head, + ip_mod_cgi_chunked_encoding_test]}, + {http_1_0_ip, [], + [ip_head_1_0, ip_get_1_0, ip_post_1_0]}, + {http_0_9_ip, [], [ip_get_0_9]}, + {ipv6, [], [ipv6_hostname, ipv6_address]}, + {tickets, [], + [ticket_5775, ticket_5865, ticket_5913, ticket_6003, + ticket_7304]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config @@ -615,219 +702,23 @@ end_per_testcase2(Case, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -ip(doc) -> - ["HTTP tests using TCP/IP"]; -ip(suite) -> - [ - ip_mod_alias, - ip_mod_actions, - ip_mod_security, - ip_mod_auth, - ip_mod_auth_api, - ip_mod_auth_mnesia_api, - ip_mod_htaccess, - ip_mod_cgi, - ip_mod_esi, - ip_mod_get, - ip_mod_head, - ip_mod_all, - ip_load_light, - ip_load_medium, - ip_load_heavy, - ip_dos_hostname, - ip_time_test, - ip_restart_no_block, - ip_restart_disturbing_block, - ip_restart_non_disturbing_block, - ip_block_disturbing_idle, - ip_block_non_disturbing_idle, - ip_block_503, - ip_block_disturbing_active, - ip_block_non_disturbing_active, - ip_block_disturbing_active_timeout_not_released, - ip_block_disturbing_active_timeout_released, - ip_block_non_disturbing_active_timeout_not_released, - ip_block_non_disturbing_active_timeout_released, - ip_block_disturbing_blocker_dies, - ip_block_non_disturbing_blocker_dies - ]. %%------------------------------------------------------------------------- -ssl(doc) -> - ["HTTP test using SSL"]; -ssl(suite) -> - [ - pssl, - ossl, - essl - ]. -pssl(doc) -> - ["HTTP test using SSL - using old way of configuring SSL"]; -pssl(suite) -> - [ - pssl_mod_alias, - pssl_mod_actions, - pssl_mod_security, - pssl_mod_auth, - pssl_mod_auth_api, - pssl_mod_auth_mnesia_api, - pssl_mod_htaccess, - pssl_mod_cgi, - pssl_mod_esi, - pssl_mod_get, - pssl_mod_head, - pssl_mod_all, - pssl_load_light, - pssl_load_medium, - pssl_load_heavy, - pssl_dos_hostname, - pssl_time_test, - pssl_restart_no_block, - pssl_restart_disturbing_block, - pssl_restart_non_disturbing_block, - pssl_block_disturbing_idle, - pssl_block_non_disturbing_idle, - pssl_block_503, - pssl_block_disturbing_active, - pssl_block_non_disturbing_active, - pssl_block_disturbing_active_timeout_not_released, - pssl_block_disturbing_active_timeout_released, - pssl_block_non_disturbing_active_timeout_not_released, - pssl_block_non_disturbing_active_timeout_released, - pssl_block_disturbing_blocker_dies, - pssl_block_non_disturbing_blocker_dies - ]. -ossl(doc) -> - ["HTTP test using SSL - using new way of configuring usage of old SSL"]; -ossl(suite) -> - [ - ossl_mod_alias, - ossl_mod_actions, - ossl_mod_security, - ossl_mod_auth, - ossl_mod_auth_api, - ossl_mod_auth_mnesia_api, - ossl_mod_htaccess, - ossl_mod_cgi, - ossl_mod_esi, - ossl_mod_get, - ossl_mod_head, - ossl_mod_all, - ossl_load_light, - ossl_load_medium, - ossl_load_heavy, - ossl_dos_hostname, - ossl_time_test, - ossl_restart_no_block, - ossl_restart_disturbing_block, - ossl_restart_non_disturbing_block, - ossl_block_disturbing_idle, - ossl_block_non_disturbing_idle, - ossl_block_503, - ossl_block_disturbing_active, - ossl_block_non_disturbing_active, - ossl_block_disturbing_active_timeout_not_released, - ossl_block_disturbing_active_timeout_released, - ossl_block_non_disturbing_active_timeout_not_released, - ossl_block_non_disturbing_active_timeout_released, - ossl_block_disturbing_blocker_dies, - ossl_block_non_disturbing_blocker_dies - ]. -essl(doc) -> - ["HTTP test using SSL - using new way of configuring usage of new SSL"]; -essl(suite) -> - [ - essl_mod_alias, - essl_mod_actions, - essl_mod_security, - essl_mod_auth, - essl_mod_auth_api, - essl_mod_auth_mnesia_api, - essl_mod_htaccess, - essl_mod_cgi, - essl_mod_esi, - essl_mod_get, - essl_mod_head, - essl_mod_all, - essl_load_light, - essl_load_medium, - essl_load_heavy, - essl_dos_hostname, - essl_time_test, - essl_restart_no_block, - essl_restart_disturbing_block, - essl_restart_non_disturbing_block, - essl_block_disturbing_idle, - essl_block_non_disturbing_idle, - essl_block_503, - essl_block_disturbing_active, - essl_block_non_disturbing_active, - essl_block_disturbing_active_timeout_not_released, - essl_block_disturbing_active_timeout_released, - essl_block_non_disturbing_active_timeout_not_released, - essl_block_non_disturbing_active_timeout_released, - essl_block_disturbing_blocker_dies, - essl_block_non_disturbing_blocker_dies - ]. %%------------------------------------------------------------------------- -http_1_1_ip(doc) -> - ["HTTP/1.1"]; -http_1_1_ip(suite) -> - [ - ip_host, - ip_chunked, - ip_expect, - ip_range, - ip_if_test, - ip_http_trace, - ip_http1_1_head, - ip_mod_cgi_chunked_encoding_test - ]. %%------------------------------------------------------------------------- -http_1_0_ip(doc) -> - ["HTTP/1.0"]; -http_1_0_ip(suite) -> - [ - ip_head_1_0, - ip_get_1_0, - ip_post_1_0 - ]. %%------------------------------------------------------------------------- -http_0_9_ip(doc) -> - ["HTTP/0.9"]; -http_0_9_ip(suite) -> - [ - ip_get_0_9 - ]. %%------------------------------------------------------------------------- -ipv6(doc) -> - ["Tests ipv6 functionality."]; -ipv6(suite) -> - [ - ipv6_hostname, - ipv6_address - ]. %%------------------------------------------------------------------------- -tickets(doc) -> - ["Test cases for reported bugs."]; -tickets(suite) -> - [ - ticket_5775, - ticket_5865, - ticket_5913, - ticket_6003, - ticket_7304 - ]. %%------------------------------------------------------------------------- ip_mod_alias(doc) -> diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 9ba2e73942..8a654a7480 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -19,23 +19,24 @@ %% -module(httpd_basic_SUITE). --include("test_server.hrl"). --include("test_server_line.hrl"). +-include_lib("common_test/include/ct.hrl"). %% Note: This directive should only be used in test suites. -compile(export_all). -define(URL_START, "http://localhost:"). -all(doc) -> - ["Basic test of httpd."]; +all() -> + [uri_too_long_414, header_too_long_413, escaped_url_in_error_body]. -all(suite) -> - [ - uri_too_long_414, - header_too_long_413, - escaped_url_in_error_body - ]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/inets/test/inets.spec b/lib/inets/test/inets.spec index a9b4524295..44c7c98916 100644 --- a/lib/inets/test/inets.spec +++ b/lib/inets/test/inets.spec @@ -1,2 +1 @@ -{topcase, {dir, "../inets_test"}}. -{hosts, ["tuor"]}. +{suites,"inets_test",all}. diff --git a/lib/inets/test/inets_SUITE.erl b/lib/inets/test/inets_SUITE.erl index 56983caace..3907e5ac3d 100644 --- a/lib/inets/test/inets_SUITE.erl +++ b/lib/inets/test/inets_SUITE.erl @@ -19,7 +19,7 @@ %% -module(inets_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("inets_test_lib.hrl"). @@ -28,25 +28,24 @@ -define(NUM_DEFAULT_SERVICES, 1). -all(doc) -> - ["Test suites for the inets application."]; +all() -> +[{group, app_test}, {group, appup_test}, + {group, services_test}, httpd_reload]. + +groups() -> + [{services_test, [], + [start_inets, start_httpc, start_httpd, start_ftpc, + start_tftpd]}, + {app_test, [], [{inets_app_test, all}]}, + {appup_test, [], [{inets_appup_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [ - app_test, - appup_test, - services_test, - httpd_reload - ]. -services_test(suite) -> - [ - start_inets, - start_httpc, - start_httpd, - start_ftpc, - start_tftpd - ]. %%-------------------------------------------------------------------- @@ -100,11 +99,7 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -app_test(suite) -> - [{inets_app_test, all}]. -appup_test(suite) -> - [{inets_appup_test, all}]. %%------------------------------------------------------------------------- diff --git a/lib/inets/test/inets_app_test.erl b/lib/inets/test/inets_app_test.erl index 11a669b930..71f94a4327 100644 --- a/lib/inets/test/inets_app_test.erl +++ b/lib/inets/test/inets_app_test.erl @@ -44,16 +44,20 @@ end_per_testcase(_Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs - ], - {req, [], {conf, app_init, Cases, app_fin}}. +all() -> +Cases = [fields, modules, exportall, app_depend, + undef_funcs], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/inets/test/inets_appup_test.erl b/lib/inets/test/inets_appup_test.erl index bb77823b85..5065db202e 100644 --- a/lib/inets/test/inets_appup_test.erl +++ b/lib/inets/test/inets_appup_test.erl @@ -41,12 +41,19 @@ end_per_testcase(_Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup - ], - {req, [], {conf, appup_init, Cases, appup_fin}}. +all() -> +Cases = [appup], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/inets/test/inets_sup_SUITE.erl b/lib/inets/test/inets_sup_SUITE.erl index 1e701bc074..aef59597a8 100644 --- a/lib/inets/test/inets_sup_SUITE.erl +++ b/lib/inets/test/inets_sup_SUITE.erl @@ -20,22 +20,25 @@ -module(inets_sup_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). %% Note: This directive should only be used in test suites. -compile(export_all). -all(doc) -> - ["Test that the inets supervisorstructur is the expected one."]; -all(suite) -> - [ - default_tree, - ftpc_worker, - tftpd_worker, - httpd_subtree, - httpc_subtree - ]. +all() -> +[default_tree, ftpc_worker, tftpd_worker, httpd_subtree, + httpc_subtree]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index 7c75b809ae..44fc189a96 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -71,17 +71,19 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Top test case %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Test suites for TFTP."]; - -all(suite) -> - [ - simple, - extra, - reuse_connection, - resend_client, - resend_server - ]. +all() -> +[simple, extra, reuse_connection, resend_client, + resend_server]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Simple -- cgit v1.2.3 From 87e168ba95f57d6d5de88c2b2f06d37039bb40e5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:40:08 +0200 Subject: Update erl_interface tests to conform with common_test standard --- lib/erl_interface/test/ei_accept_SUITE.erl | 17 +++++-- lib/erl_interface/test/ei_connect_SUITE.erl | 23 +++++---- lib/erl_interface/test/ei_decode_SUITE.erl | 29 ++++++----- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 20 +++++--- lib/erl_interface/test/ei_encode_SUITE.erl | 29 ++++++----- lib/erl_interface/test/ei_format_SUITE.erl | 22 ++++++--- lib/erl_interface/test/ei_print_SUITE.erl | 17 +++++-- lib/erl_interface/test/ei_tmo_SUITE.erl | 19 +++++-- lib/erl_interface/test/erl_connect_SUITE.erl | 18 +++++-- lib/erl_interface/test/erl_eterm_SUITE.erl | 60 ++++++++++------------- lib/erl_interface/test/erl_ext_SUITE.erl | 24 +++++---- lib/erl_interface/test/erl_format_SUITE.erl | 17 +++++-- lib/erl_interface/test/erl_global_SUITE.erl | 17 +++++-- lib/erl_interface/test/erl_interface.spec | 3 +- lib/erl_interface/test/erl_match_SUITE.erl | 19 +++++-- lib/erl_interface/test/port_call_SUITE.erl | 18 +++++-- 16 files changed, 231 insertions(+), 121 deletions(-) diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index c6a78a0065..d1309734f6 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -20,15 +20,26 @@ %% -module(ei_accept_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_accept_SUITE_data/ei_accept_test_cases.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, ei_accept/1, ei_threaded_accept/1]). -import(runner, [get_term/1,send_term/2]). -all(suite) -> [ei_accept, ei_threaded_accept]. +all() -> +[ei_accept, ei_threaded_accept]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:seconds(30)), diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index fe9b270093..603a300a26 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -20,11 +20,11 @@ %% -module(ei_connect_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_connect_SUITE_data/ei_connect_test_cases.hrl"). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, @@ -40,13 +40,18 @@ -import(runner, [get_term/1,send_term/2]). -all(suite) -> [ ei_send, - ei_reg_send, - ei_format_pid, - ei_rpc, - ei_send_funs, - ei_threaded_send, - ei_set_get_tracelevel]. +all() -> +[ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs, + ei_threaded_send, ei_set_get_tracelevel]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index 524a04a3b4..cf30ef96d1 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -20,12 +20,12 @@ %% -module(ei_decode_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_decode_SUITE_data/ei_decode_test_cases.hrl"). -export( [ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, test_ei_decode_long/1, test_ei_decode_ulong/1, test_ei_decode_longlong/1, @@ -35,16 +35,21 @@ test_ei_decode_misc/1 ]). -all(suite) -> - [ - test_ei_decode_long, - test_ei_decode_ulong, - test_ei_decode_longlong, - test_ei_decode_ulonglong, - test_ei_decode_char, - test_ei_decode_nonoptimal, - test_ei_decode_misc - ]. +all() -> +[test_ei_decode_long, test_ei_decode_ulong, + test_ei_decode_longlong, test_ei_decode_ulonglong, + test_ei_decode_char, test_ei_decode_nonoptimal, + test_ei_decode_misc]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index 8c8ec9bacb..b4bb6e187c 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -20,19 +20,27 @@ %% -module(ei_decode_encode_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_decode_encode_SUITE_data/ei_decode_encode_test_cases.hrl"). -export( [ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, test_ei_decode_encode/1 ]). -all(suite) -> - [ - test_ei_decode_encode - ]. +all() -> +[test_ei_decode_encode]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index 6b9de4f093..bc8bcc07a3 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -20,12 +20,12 @@ %% -module(ei_encode_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_encode_SUITE_data/ei_encode_test_cases.hrl"). -export( [ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, test_ei_encode_long/1, test_ei_encode_ulong/1, test_ei_encode_longlong/1, @@ -35,16 +35,21 @@ test_ei_encode_fails/1 ]). -all(suite) -> - [ - test_ei_encode_long, - test_ei_encode_ulong, - test_ei_encode_longlong, - test_ei_encode_ulonglong, - test_ei_encode_char, - test_ei_encode_misc, - test_ei_encode_fails - ]. +all() -> +[test_ei_encode_long, test_ei_encode_ulong, + test_ei_encode_longlong, test_ei_encode_ulonglong, + test_ei_encode_char, test_ei_encode_misc, + test_ei_encode_fails]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 9ae4a715b0..29209d50b9 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -20,12 +20,12 @@ %% -module(ei_format_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_format_SUITE_data/ei_format_test_cases.hrl"). -export([ format_wo_ver/1, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1 @@ -36,12 +36,18 @@ %% This test suite test the erl_format() function. %% It uses the port program "ei_format_test". -all(suite) -> [ - format_wo_ver, - atoms, - tuples, - lists - ]. +all() -> +[format_wo_ver, atoms, tuples, lists]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index 61365fcd46..c5c0e84358 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -20,17 +20,28 @@ %% -module(ei_print_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("ei_print_SUITE_data/ei_print_test_cases.hrl"). --export([all/1, atoms/1, tuples/1, lists/1, strings/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). -import(runner, [get_term/1]). %% This test suite test the ei_print() function. %% It uses the port program "ei_format_test". -all(suite) -> [atoms, tuples, lists, strings]. +all() -> +[atoms, tuples, lists, strings]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index e536fd2688..c1bf5e35f6 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -20,18 +20,29 @@ %% -module(ei_tmo_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). -include("ei_tmo_SUITE_data/ei_tmo_test_cases.hrl"). -define(dummy_host,test01). --export([all/1, init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). -all(suite) -> [framework_check,ei_accept_tmo,ei_connect_tmo, - ei_send_tmo,ei_recv_tmo]. +all() -> +[framework_check, ei_accept_tmo, ei_connect_tmo, + ei_send_tmo, ei_recv_tmo]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(1)), diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index fd568e56b9..6a8d5a998e 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -20,16 +20,26 @@ %% -module(erl_connect_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_connect_SUITE_data/erl_connect_test_cases.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]). -import(runner, [get_term/1,send_term/2]). -all(suite) -> - [erl_send,erl_reg_send,erl_send_cookie_file]. +all() -> +[erl_send, erl_reg_send, erl_send_cookie_file]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index e77f114066..084415ec41 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -20,7 +20,7 @@ %% -module(erl_eterm_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_eterm_SUITE_data/eterm_test_cases.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -33,7 +33,7 @@ %%% 5. Miscellanous functions. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/1, build_terms/1, round_trip_conversion/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, decode_terms/1, decode_float/1, t_erl_mk_int/1, t_erl_mk_list/1, basic_copy/1, @@ -73,38 +73,30 @@ %% This test suite controls the running of the C language functions %% in eterm_test.c and print_term.c. -all(suite) -> [build_terms, round_trip_conversion, - decode_terms, decode_float, - t_erl_mk_int, t_erl_mk_list, - basic_copy, - t_erl_mk_atom, - t_erl_mk_binary, - t_erl_mk_empty_list, - t_erl_mk_float, - t_erl_mk_pid, - t_erl_mk_xpid, - t_erl_mk_port, - t_erl_mk_xport, - t_erl_mk_ref, - t_erl_mk_long_ref, - t_erl_mk_string, - t_erl_mk_estring, - t_erl_mk_tuple, - t_erl_mk_uint, - t_erl_mk_var, - t_erl_size, - t_erl_var_content, - t_erl_element, - t_erl_cons, - t_erl_length, t_erl_hd, t_erl_tl, - type_checks, extractor_macros, - t_erl_iolist_length, t_erl_iolist_to_binary, - t_erl_iolist_to_string, - erl_print_term, print_string, - t_erl_free_compound, - high_chaparal, - broken_data, - cnode_1]. +all() -> +[build_terms, round_trip_conversion, decode_terms, + decode_float, t_erl_mk_int, t_erl_mk_list, basic_copy, + t_erl_mk_atom, t_erl_mk_binary, t_erl_mk_empty_list, + t_erl_mk_float, t_erl_mk_pid, t_erl_mk_xpid, + t_erl_mk_port, t_erl_mk_xport, t_erl_mk_ref, + t_erl_mk_long_ref, t_erl_mk_string, t_erl_mk_estring, + t_erl_mk_tuple, t_erl_mk_uint, t_erl_mk_var, t_erl_size, + t_erl_var_content, t_erl_element, t_erl_cons, + t_erl_length, t_erl_hd, t_erl_tl, type_checks, + extractor_macros, t_erl_iolist_length, + t_erl_iolist_to_binary, t_erl_iolist_to_string, + erl_print_term, print_string, t_erl_free_compound, + high_chaparal, broken_data, cnode_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index d1c27d8158..c3a47a75a0 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -20,11 +20,11 @@ %% -module(erl_ext_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_ext_SUITE_data/ext_test_cases.hrl"). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, compare_tuple/1, compare_list/1, compare_string/1, @@ -34,13 +34,19 @@ -import(runner, [get_term/1]). -all(suite) -> [ - compare_tuple, - compare_list, - compare_string, - compare_list_string, - compare_nc_ext - ]. +all() -> +[compare_tuple, compare_list, compare_string, + compare_list_string, compare_nc_ext]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + compare_tuple(suite) -> []; compare_tuple(doc) -> []; diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index c8809fdde9..3e828d14b7 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -20,17 +20,28 @@ %% -module(erl_format_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_format_SUITE_data/format_test_cases.hrl"). --export([all/1, atoms/1, tuples/1, lists/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). -import(runner, [get_term/1]). %% This test suite test the erl_format() function. %% It uses the port program "format_test". -all(suite) -> [atoms, tuples, lists]. +all() -> +[atoms, tuples, lists]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl index 4f332037c6..3d080f482d 100644 --- a/lib/erl_interface/test/erl_global_SUITE.erl +++ b/lib/erl_interface/test/erl_global_SUITE.erl @@ -20,24 +20,33 @@ %% -module(erl_global_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_global_SUITE_data/erl_global_test_cases.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,suite/0,init_per_suite/1,end_per_suite/1, + init_per_testcase/2,end_per_testcase/2, erl_global_registration/1, erl_global_whereis/1, erl_global_names/1]). -import(runner, [get_term/1,send_term/2]). -define(GLOBAL_NAME, global_register_node_test). -all(suite) -> +all() -> [erl_global_registration, erl_global_whereis, erl_global_names]. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/lib/erl_interface/test/erl_interface.spec b/lib/erl_interface/test/erl_interface.spec index 2789bd3e2c..59542b6558 100644 --- a/lib/erl_interface/test/erl_interface.spec +++ b/lib/erl_interface/test/erl_interface.spec @@ -1,2 +1 @@ -{topcase, {dir, "../erl_interface_test"}}. - +{suites,"erl_interface_test",all}. diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index 2c0cdc0c27..d2ab6bd722 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -20,10 +20,10 @@ %% -module(erl_match_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/1, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, bind/1, integers/1, floats/1, binaries/1, strings/1]). %% For interactive running of matcher. @@ -31,8 +31,19 @@ %% This test suite tests the erl_match() function. -all(suite) -> [atoms, lists, tuples, references, pids, ports, bind, - integers, floats, binaries, strings]. +all() -> +[atoms, lists, tuples, references, pids, ports, bind, + integers, floats, binaries, strings]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + atoms(suite) -> []; atoms(Config) when is_list(Config) -> diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 55507b2a1b..3c1127bb18 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -31,13 +31,23 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/1, basic/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1]). % Private exports --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [basic]. +all() -> +[basic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + basic(suite) -> []; basic(Config) when is_list(Config) -> -- cgit v1.2.3 From 1137a924c290f72ed9c2213b38caaef8230cb005 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:40:35 +0200 Subject: Update ic tests to conform with common_test standard --- lib/ic/test/c_client_erl_server_SUITE.erl | 37 +++++--- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 37 +++++--- .../test/c_client_erl_server_proto_tmo_SUITE.erl | 37 +++++--- lib/ic/test/erl_client_c_server_SUITE.erl | 36 ++++--- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 36 ++++--- lib/ic/test/ic.spec | 2 +- lib/ic/test/ic_SUITE.erl | 90 +++++++++--------- lib/ic/test/ic_be_SUITE.erl | 17 +++- lib/ic/test/ic_pp_SUITE.erl | 103 ++++++++------------- lib/ic/test/ic_pragma_SUITE.erl | 28 ++++-- lib/ic/test/ic_register_SUITE.erl | 31 ++++--- lib/ic/test/java_client_erl_server_SUITE.erl | 34 ++++--- 12 files changed, 268 insertions(+), 220 deletions(-) diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 9970ea0f6a..e23b943348 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -24,10 +24,10 @@ -module(c_client_erl_server_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/1, void_test/1, long_test/1, long_long_test/1, + all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -63,18 +63,27 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of IC with a C-client and an Erlang generic server. " - "The communication is via Erlang distribution."; -all(suite) -> - [void_test, long_test, long_long_test, unsigned_short_test, - unsigned_long_test, unsigned_long_long_test, double_test, - char_test, wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, seq4_test, - seq5_test, array1_test, array2_test, enum_test, string1_test, - string2_test, string3_test, string4_test, pid_test, port_test, - ref_test, term_test, typedef_test, inline_sequence_test, - term_sequence_test, term_struct_test, wstring1_test]. +all() -> +[void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + array1_test(doc) -> ""; diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index d44a599660..fa7ab31db8 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -23,10 +23,10 @@ %%---------------------------------------------------------------------- -module(c_client_erl_server_proto_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/1, void_test/1, long_test/1, long_long_test/1, + all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -62,18 +62,27 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of IC with a C-client and an Erlang generic server. " - "The communication is via Erlang distribution."; -all(suite) -> - [void_test, long_test, long_long_test, unsigned_short_test, - unsigned_long_test, unsigned_long_long_test, double_test, - char_test, wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, seq4_test, - seq5_test, array1_test, array2_test, enum_test, string1_test, - string2_test, string3_test, string4_test, pid_test, port_test, - ref_test, term_test, typedef_test, inline_sequence_test, - term_sequence_test, term_struct_test, wstring1_test]. +all() -> +[void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + array1_test(doc) -> ""; diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index d3f7b08f6a..625a7fd253 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -23,10 +23,10 @@ %%---------------------------------------------------------------------- -module(c_client_erl_server_proto_tmo_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/1, void_test/1, long_test/1, long_long_test/1, + all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -62,18 +62,27 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of IC with a C-client and an Erlang generic server. " - "The communication is via Erlang distribution."; -all(suite) -> - [void_test, long_test, long_long_test, unsigned_short_test, - unsigned_long_test, unsigned_long_long_test, double_test, - char_test, wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, seq4_test, - seq5_test, array1_test, array2_test, enum_test, string1_test, - string2_test, string3_test, string4_test, pid_test, port_test, - ref_test, term_test, typedef_test, inline_sequence_test, - term_sequence_test, term_struct_test, wstring1_test]. +all() -> +[void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + array1_test(doc) -> ""; diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index 03f628abd9..5dc3049671 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -24,9 +24,9 @@ -module(erl_client_c_server_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -63,18 +63,26 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of IC with an Erlang client and a C server. " - "The communication is via Erlang distribution."; -all(suite) -> - [void_test, long_test, longlong_test, ushort_test, - ulong_test, ulonglong_test, double_test, - char_test, wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, seq4_test, - seq5_test, array1_test, array2_test, enum_test, string1_test, - string2_test, string3_test, string4_test, pid_test, port_test, - ref_test, term_test, typedef_test, inline_sequence_test, - term_sequence_test, term_struct_test, wstring1_test]. +all() -> +[void_test, long_test, longlong_test, ushort_test, + ulong_test, ulonglong_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + array1_test(doc) -> ""; diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index 5e1e84c6f9..b5f49ba13e 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -24,9 +24,9 @@ -module(erl_client_c_server_proto_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2, all/1, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -63,18 +63,26 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -all(doc) -> - "Test of IC with an Erlang client and a C server. " - "The communication is via Erlang distribution."; -all(suite) -> - [void_test, long_test, longlong_test, ushort_test, - ulong_test, ulonglong_test, double_test, - char_test, wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, seq4_test, - seq5_test, array1_test, array2_test, enum_test, string1_test, - string2_test, string3_test, string4_test, pid_test, port_test, - ref_test, term_test, typedef_test, inline_sequence_test, - term_sequence_test, term_struct_test, wstring1_test]. +all() -> +[void_test, long_test, longlong_test, ushort_test, + ulong_test, ulonglong_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + array1_test(doc) -> ""; diff --git a/lib/ic/test/ic.spec b/lib/ic/test/ic.spec index 280c2aba47..4fafc1b681 100644 --- a/lib/ic/test/ic.spec +++ b/lib/ic/test/ic.spec @@ -1 +1 @@ -{topcase, {dir, "../ic_test"}}. +{suites,"ic_test",all}. diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index 6682c82f01..ac77d9c10e 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -22,9 +22,9 @@ %%%---------------------------------------------------------------------- -module(ic_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -include_lib("orber/src/orber_ifr.hrl"). @@ -33,36 +33,36 @@ %% The type cases --export([type/1, type_norm/1]). +-export([ type_norm/1]). %% The syntax case --export([syntax/1]). +-export([]). -export([syntax1/1, syntax2/1, syntax3/1, syntax4/1, syntax5/1, syntax6/1]). %% The constant cases --export([const/1]). +-export([]). -export([const_norm/1, const_bad_tk/1, const_bad_type/1]). -export([const_bad_comb/1]). %% The union cases --export([union/1]). +-export([]). -export([union_norm/1, union_type/1, union_mult_err/1, union_case_mult/1]). -export([union_default/1]). %% The enum cases --export([enum/1]). +-export([]). -export([enum_norm/1]). %% The struct cases --export([struct/1]). +-export([]). -export([struct_norm/1]). %% The oneway cases --export([oneway/1]). +-export([]). -export([oneway_norm/1, oneway_raises/1, oneway_out/1, oneway_void/1, oneway_followed/1]). %% The attributes cases --export([attr/1]). +-export([]). -export([attr_norm/1]). %% The raises registration case @@ -72,12 +72,12 @@ %% The typeID case %% general stuff --export([general/1]). +-export([]). -export([typeid/1, undef_id/1, dir/1, nasty_names/1, coss/1, mult_ids/1]). -export([forward/1, include/1, app_test/1]). %% inheritance stuff --export([inherit/1, inherit_norm/1, inherit_warn/1, inherit_err/1]). +-export([ inherit_norm/1, inherit_warn/1, inherit_err/1]). %% Standard options to the ic compiler, NOTE unholy use of OutDir @@ -86,10 +86,38 @@ %% Top of cases -all(doc) -> - []; -all(suite) -> [app_test, const, union, enum, attr, type, struct, general, inherit, - oneway, syntax, raises_reg]. +all() -> +[app_test, {group, const}, {group, union}, + {group, enum}, {group, attr}, {group, type}, + {group, struct}, {group, general}, {group, inherit}, + {group, oneway}, {group, syntax}, raises_reg]. + +groups() -> + [{const, [], + [const_norm, const_bad_tk, const_bad_type, + const_bad_comb]}, + {union, [], + [union_norm, union_type, union_mult_err, + union_case_mult, union_default]}, + {enum, [], [enum_norm]}, {struct, [], [struct_norm]}, + {general, [], + [typeid, undef_id, mult_ids, forward, include, + nasty_names]}, + {inherit, [], + [inherit_norm, inherit_warn, inherit_err]}, + {oneway, [], + [oneway_norm, oneway_out, oneway_raises, oneway_void, + oneway_followed]}, + {attr, [], [attr_norm]}, {type, [], [type_norm]}, + {syntax, [], + [syntax1, syntax2, syntax3, syntax4, syntax5, syntax6]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + app_test(doc) -> []; @@ -103,7 +131,6 @@ app_test(_Config) -> %% Test of constant expressions. %% -const(suite) -> [const_norm, const_bad_tk, const_bad_type, const_bad_comb]. const_norm(doc) -> @@ -159,10 +186,6 @@ const_bad_comb(Config) when is_list(Config) -> -union(suite) -> [union_norm, union_type, union_mult_err, union_case_mult, - union_default]; -union(doc) -> - ["Checks allowed usage of the union as well as the illegal cases"]. union_norm(doc) -> @@ -277,9 +300,6 @@ union_case_mult(Config) when is_list(Config) -> %% Enum cases %% -enum(suite) -> [enum_norm]; -enum(doc) -> - ["Checks allowed usage of the enum as well as the illegal cases"]. enum_norm(doc) -> ["Checks that normal enum declarations works."]; @@ -300,9 +320,6 @@ enum_norm(Config) when is_list(Config) -> %% Struct cases %% -struct(suite) -> [struct_norm]; -struct(doc) -> - ["Checks allowed usage of the struct as well as the illegal cases"]. struct_norm(doc) -> ["Checks that normal struct declarations works."]; @@ -331,10 +348,6 @@ struct_norm(Config) when is_list(Config) -> %% General cases %% -general(doc) -> - ["Check general things like directories and type identifier", - "detection."]; -general(suite) -> [typeid, undef_id, mult_ids, forward, include, nasty_names]. %% coss (add sometimes, takes 440 seconds!) typeid(doc) -> @@ -490,9 +503,6 @@ include(Config) when is_list(Config) -> %% Inhertit cases %% -inherit(doc) -> - ["Check the inheritance mechanism."]; -inherit(suite) -> [inherit_norm, inherit_warn, inherit_err]. inherit_norm(doc) -> ["Checks that normal inheritance works."]; @@ -547,9 +557,6 @@ inherit_err(Config) when is_list(Config) -> ok. -oneway(doc) -> - ["Check the oneway operation mechanism."]; -oneway(suite) -> [oneway_norm, oneway_out, oneway_raises, oneway_void, oneway_followed ]. oneway_norm(doc) -> ["Checks that normal oneway operations works."]; @@ -618,9 +625,6 @@ oneway_followed(Config) when is_list(Config) -> ?line ok = compile(OutDir, oneway_followed_files(), [load]), ok. -attr(doc) -> - ["Check that attributes work."]; -attr(suite) -> [attr_norm]. attr_norm(doc) -> ["Checks that normal attr operations works."]; @@ -636,9 +640,6 @@ attr_norm(Config) when is_list(Config) -> ?line ok = compile(OutDir, attr_norm_files(), [load]), ok. -type(doc) -> - ["Check that typeibutes work."]; -type(suite) -> [type_norm]. type_norm(doc) -> ["Checks all types are handled."]; @@ -655,9 +656,6 @@ type_norm(Config) when is_list(Config) -> ok. -syntax(doc) -> - ["Check that syntax errors are discovered."]; -syntax(suite) -> [syntax1, syntax2, syntax3, syntax4, syntax5, syntax6]. syntax1(suite) -> []; syntax1(Config) when is_list(Config) -> diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index 5428fbc086..e53cbf9a15 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -22,10 +22,10 @@ %%%---------------------------------------------------------------------- -module(ic_be_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,plain/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,plain/1]). -define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). @@ -33,7 +33,18 @@ %% Top of cases -all(suite) -> [plain]. +all() -> +[plain]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl index 8002d9644a..140c81feeb 100644 --- a/lib/ic/test/ic_pp_SUITE.erl +++ b/lib/ic/test/ic_pp_SUITE.erl @@ -22,7 +22,7 @@ %%---------------------------------------------------------------------- -module(ic_pp_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). @@ -32,50 +32,55 @@ -define(GCC, "g++"). -define(GCC_VER, "2.95.3"). --export([all/1]). --export([arg/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([arg_norm/1]). --export([cascade/1]). -export([cascade_norm/1]). --export([comment/1]). -export([comment_norm/1]). --export([concat/1]). -export([concat_norm/1]). --export([define/1]). -export([define_norm/1]). --export(['if'/1]). -export([if_norm/1]). -export([if_zero/1]). --export([misc/1]). -export([misc_norm/1]). --export([improp_nest_constr/1]). -export([improp_nest_constr_norm/1]). --export([inc/1]). -export([inc_norm/1]). --export([line/1]). -export([line_norm/1]). --export([nopara/1]). -export([nopara_norm/1]). --export([predef/1]). -export([predef_norm/1]). --export([predef_time/1]). -export([predef_time_norm/1]). --export([self_ref/1]). -export([self_ref_norm/1]). --export([separate/1]). -export([separate_norm/1]). --export([swallow_sc/1]). -export([swallow_sc_norm/1]). --export([unintended_grp/1]). -export([unintended_grp_norm/1]). --export([cases/0, init_all/1, finish_all/1]). +-export([cases/0, init_per_suite/1, end_per_suite/1]). -all(doc) -> ["Preprocessing tests for IC"]; -all(suite) -> - {req, [], {conf, init_all, cases(), finish_all}}. +all() -> + cases(). -init_all(Config) -> +groups() -> + [{arg, [], [arg_norm]}, {cascade, [], [cascade_norm]}, + {comment, [], [comment_norm]}, + {concat, [], [concat_norm]}, + {define, [], [define_norm]}, {inc, [], [inc_norm]}, + {improp_nest_constr, [], [improp_nest_constr_norm]}, + {misc, [], [misc_norm]}, {line, [], [line_norm]}, + {nopara, [], [nopara_norm]}, + {predef, [], [predef_norm]}, + {predef_time, [], [predef_time_norm]}, + {self_ref, [], [self_ref_norm]}, + {separate, [], [separate_norm]}, + {swallow_sc, [], [swallow_sc_norm]}, + {unintended_grp, [], [unintended_grp_norm]}, + {'if', [],[if_norm, if_zero]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(Config) -> if is_list(Config) -> case os:type() of @@ -120,14 +125,18 @@ skip_white([$\t|T]) -> skip_white(T); skip_white(L) -> L. -finish_all(Config) -> +end_per_suite(Config) -> Config. -cases() -> - [arg, cascade, comment, concat, define, misc, 'if', improp_nest_constr, inc, - line, nopara, predef, predef_time, self_ref, separate, swallow_sc, - unintended_grp]. +cases() -> + [{group, arg}, {group, cascade}, {group, comment}, + {group, concat}, {group, define}, {group, misc}, {group, 'if'}, + {group, improp_nest_constr}, {group, inc}, + {group, line}, {group, nopara}, {group, predef}, + {group, predef_time}, {group, self_ref}, + {group, separate}, {group, swallow_sc}, + {group, unintended_grp}]. @@ -135,8 +144,6 @@ cases() -> %% arg %%-------------------------------------------------------------------- -arg(suite) -> [arg_norm]; -arg(doc) -> ["Check #define with some arguments"]. arg_norm(doc) -> ["Checks arguments for #define."]; arg_norm(suite) -> []; @@ -153,8 +160,6 @@ arg_norm(Config) when is_list(Config) -> %% cascade %%-------------------------------------------------------------------- -cascade(suite) -> [cascade_norm]; -cascade(doc) -> ["Check cascade #define"]. cascade_norm(doc) -> ["Check cascade #define."]; cascade_norm(suite) -> []; @@ -171,8 +176,6 @@ cascade_norm(Config) when is_list(Config) -> %% comment %%-------------------------------------------------------------------- -comment(suite) -> [comment_norm]; -comment(doc) -> ["Check comments"]. comment_norm(doc) -> ["Check comments."]; comment_norm(suite) -> []; @@ -189,8 +192,6 @@ comment_norm(Config) when is_list(Config) -> %% concat %%-------------------------------------------------------------------- -concat(suite) -> [concat_norm]; -concat(doc) -> ["Check concatinations, i.e ## "]. concat_norm(doc) -> ["Check concatinations, i.e ## ."]; concat_norm(suite) -> []; @@ -207,8 +208,6 @@ concat_norm(Config) when is_list(Config) -> %% define %%-------------------------------------------------------------------- -define(suite) -> [define_norm]; -define(doc) -> ["Check misceleaneous #define"]. define_norm(doc) -> ["Check misceleaneous #define."]; define_norm(suite) -> []; @@ -225,10 +224,6 @@ define_norm(Config) when is_list(Config) -> %% if %%-------------------------------------------------------------------- -'if'(suite) -> [if_norm, if_zero]; -'if'(doc) -> ["Check #if, #elif, and #endif. Note these are not implementen and will ~n - result in an error message from internal_pp"]. - if_norm(doc) -> ["Check #if, #elif, and #endif. ."]; if_norm(suite) -> []; if_norm(Config) when is_list(Config) -> @@ -254,8 +249,6 @@ if_zero(Config) when is_list(Config) -> %% inc %%-------------------------------------------------------------------- -inc(suite) -> [inc_norm]; -inc(doc) -> ["Check #include"]. inc_norm(doc) -> ["Check #include."]; inc_norm(suite) -> []; @@ -273,8 +266,6 @@ inc_norm(Config) when is_list(Config) -> %% improp_nest_constr %%-------------------------------------------------------------------- -improp_nest_constr(suite) -> [improp_nest_constr_norm]; -improp_nest_constr(doc) -> ["Check improperly nested constructs"]. improp_nest_constr_norm(doc) -> ["Check improperly nested constructs."]; improp_nest_constr_norm(suite) -> []; @@ -291,8 +282,6 @@ improp_nest_constr_norm(Config) when is_list(Config) -> %% misc %%-------------------------------------------------------------------- -misc(suite) -> [misc_norm]; -misc(doc) -> ["Misceleaneous checks"]. misc_norm(doc) -> ["Misceleaneous checks."]; misc_norm(suite) -> []; @@ -309,8 +298,6 @@ misc_norm(Config) when is_list(Config) -> %% line %%-------------------------------------------------------------------- -line(suite) -> [line_norm]; -line(doc) -> ["Checks #line"]. line_norm(doc) -> ["Checks #line."]; line_norm(suite) -> []; @@ -327,8 +314,6 @@ line_norm(Config) when is_list(Config) -> %% nopara %%-------------------------------------------------------------------- -nopara(suite) -> [nopara_norm]; -nopara(doc) -> ["Checks #define with no parameters"]. nopara_norm(doc) -> ["Checks #define with no parameters."]; nopara_norm(suite) -> []; @@ -345,8 +330,6 @@ nopara_norm(Config) when is_list(Config) -> %% predef %%-------------------------------------------------------------------- -predef(suite) -> [predef_norm]; -predef(doc) -> ["Checks predefined macros. Note: not __TIME__ and __DATE__"]. predef_norm(doc) -> ["Checks predefined macros. Note: not __TIME__ and __DATE__."]; predef_norm(suite) -> []; @@ -363,8 +346,6 @@ predef_norm(Config) when is_list(Config) -> %% predef_time %%-------------------------------------------------------------------- -predef_time(suite) -> [predef_time_norm]; -predef_time(doc) -> ["Checks the predefined macros __TIME__ and __DATE__"]. predef_time_norm(doc) -> ["Checks the predefined macros __TIME__ and __DATE__."]; predef_time_norm(suite) -> []; @@ -381,8 +362,6 @@ predef_time_norm(Config) when is_list(Config) -> %% self_ref %%-------------------------------------------------------------------- -self_ref(suite) -> [self_ref_norm]; -self_ref(doc) -> ["Checks self referring macros"]. self_ref_norm(doc) -> ["Checks self referring macros."]; self_ref_norm(suite) -> []; @@ -399,8 +378,6 @@ self_ref_norm(Config) when is_list(Config) -> %% separate %%-------------------------------------------------------------------- -separate(suite) -> [separate_norm]; -separate(doc) -> ["Checks separete expansion of macro arguments"]. separate_norm(doc) -> ["Checks separete expansion of macro arguments."]; separate_norm(suite) -> []; @@ -417,8 +394,6 @@ separate_norm(Config) when is_list(Config) -> %% swallow_sc %%-------------------------------------------------------------------- -swallow_sc(suite) -> [swallow_sc_norm]; -swallow_sc(doc) -> ["Checks swallowing an undesirable semicolon"]. swallow_sc_norm(doc) -> ["Checks swallowing an undesirable semicolon."]; swallow_sc_norm(suite) -> []; @@ -435,8 +410,6 @@ swallow_sc_norm(Config) when is_list(Config) -> %% unintended_grp %%-------------------------------------------------------------------- -unintended_grp(suite) -> [unintended_grp_norm]; -unintended_grp(doc) -> ["Checks unintended grouping of arithmetic"]. unintended_grp_norm(doc) -> ["Checks unintended grouping of arithmetic."]; unintended_grp_norm(suite) -> []; diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index ac5f2fd0c5..ae43e7f64d 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -27,12 +27,12 @@ %%----------------------------------------------------------------- -module(ic_pragma_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, init_all/1, finish_all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1]). -export([ifr_pragma_reg/1, pragma_error/1, uggly_pragmas/1]). @@ -53,18 +53,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). -cases() -> - [ifr_pragma_reg,pragma_error,uggly_pragmas]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[ifr_pragma_reg, pragma_error, uggly_pragmas]. %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- -init_all(Config) -> +init_per_suite(Config) -> io:format("Setting up.....~n"), mnesia:stop(), mnesia:delete_schema([node()]), @@ -79,7 +87,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> io:format("Setting down.....~n"), orber:stop(), orber:uninstall(), diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index 0ddf8ff95c..6531030dc8 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -26,12 +26,12 @@ %%----------------------------------------------------------------- -module(ic_register_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, init_all/1, finish_all/1, ifr_reg_unreg/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, ifr_reg_unreg/1]). -export([ifr_inheritence_reg/1,ifr_reg_unreg_with_inheritence/1]). -export([ifr_reg_unreg_with_inheritence_bad_order/1]). @@ -57,20 +57,29 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["Description", "more description"]; -all(suite) -> {req, - [mnesia], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). -cases() -> - [ifr_reg_unreg,ifr_reg_unreg_with_inheritence, - ifr_reg_unreg_with_inheritence_bad_order,ifr_inheritence_reg]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[ifr_reg_unreg, ifr_reg_unreg_with_inheritence, + ifr_reg_unreg_with_inheritence_bad_order, + ifr_inheritence_reg]. %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- -init_all(Config) -> +init_per_suite(Config) -> io:format("Setting up.....~n"), mnesia:stop(), mnesia:delete_schema([node()]), @@ -85,7 +94,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> io:format("Setting down.....~n"), orber:stop(), orber:uninstall(), diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index 67bc536e28..f2683896ed 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -22,10 +22,10 @@ %%%---------------------------------------------------------------------- -module(java_client_erl_server_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_all/1,finish_all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1,init_per_testcase/2,end_per_testcase/2]). -export([marshal_ll/1,marshal_ull/1, marshal_l/1,marshal_ul/1, marshal_s/1,marshal_us/1, @@ -36,19 +36,25 @@ %% Top of cases -all(doc) -> - "Test of IC with a Java-client and an Erlang generic server. " - "The communication is via Erlang distribution."; -all(suite) -> {conf,init_all,cases(),finish_all}. +all() -> +cases(). -cases() -> [marshal_ll,marshal_ull, - marshal_l,marshal_ul, - marshal_s,marshal_us, - marshal_c,marshal_wc, - marshal_str, - marshal_any_3,marshal_any_2]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[marshal_ll, marshal_ull, marshal_l, marshal_ul, + marshal_s, marshal_us, marshal_c, marshal_wc, + marshal_str, marshal_any_3, marshal_any_2]. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case case code:priv_dir(jinterface) of {error,bad_name} -> false; @@ -76,7 +82,7 @@ find_executable([E|T]) -> Path -> Path end. -finish_all(Config) -> Config. +end_per_suite(Config) -> Config. -- cgit v1.2.3 From a424e5a7dffcbf4685ee3be9fdec7002fa03294b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:40:58 +0200 Subject: Update debugger tests to conform with common_test standard --- lib/debugger/test/andor_SUITE.erl | 27 ++++++++++++++------ lib/debugger/test/bs_bincomp_SUITE.erl | 20 +++++++++++---- lib/debugger/test/bs_construct_SUITE.erl | 28 ++++++++++++++------- lib/debugger/test/bs_match_bin_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/bs_match_int_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/bs_match_misc_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/bs_match_tail_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/bs_utf_SUITE.erl | 28 ++++++++++++++------- lib/debugger/test/bug_SUITE.erl | 21 +++++++++++----- lib/debugger/test/cleanup.erl | 17 ++++++++++--- lib/debugger/test/dbg_ui_SUITE.erl | 35 +++++++++++++++----------- lib/debugger/test/debugger.spec | 2 +- lib/debugger/test/debugger_SUITE.erl | 19 +++++++++++--- lib/debugger/test/erl_eval_SUITE.erl | 27 +++++++++++++------- lib/debugger/test/exception_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/fun_SUITE.erl | 29 +++++++++++++++------- lib/debugger/test/guard_SUITE.erl | 41 +++++++++++++++++++------------ lib/debugger/test/int_SUITE.erl | 29 +++++++++++++--------- lib/debugger/test/int_break_SUITE.erl | 18 +++++++++++--- lib/debugger/test/int_eval_SUITE.erl | 24 ++++++++++++------ lib/debugger/test/lc_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/record_SUITE.erl | 26 ++++++++++++++------ lib/debugger/test/trycatch_SUITE.erl | 30 ++++++++++++++-------- 23 files changed, 395 insertions(+), 182 deletions(-) diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl index 346ca42376..2ac7a73ebe 100644 --- a/lib/debugger/test/andor_SUITE.erl +++ b/lib/debugger/test/andor_SUITE.erl @@ -20,14 +20,24 @@ %% -module(andor_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[cases()]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [{conf,init_all,cases(),finish_all}]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -39,16 +49,17 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. -cases() -> - [t_andalso,t_orelse,inside,overlap,combined,in_case]. +cases() -> +[t_andalso, t_orelse, inside, overlap, combined, + in_case]. t_andalso(Config) when is_list(Config) -> Bs = [true,false], diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index 0a574ecd5f..d25f68e91d 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -23,11 +23,11 @@ -module(bs_bincomp_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -39,9 +39,19 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [byte_aligned,bit_aligned,extended_byte_aligned, - extended_bit_aligned,mixed]. +all() -> +[byte_aligned, bit_aligned, extended_byte_aligned, + extended_bit_aligned, mixed]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + byte_aligned(Config) when is_list(Config) -> diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl index 4416a675b8..9971b90a42 100644 --- a/lib/debugger/test/bs_construct_SUITE.erl +++ b/lib/debugger/test/bs_construct_SUITE.erl @@ -19,18 +19,28 @@ -module(bs_construct_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, coerce_to_float/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [test1, test2, test3, test4, test5, testf, - not_used, in_guard, coerce_to_float]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[test1, test2, test3, test4, test5, testf, not_used, + in_guard, coerce_to_float]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -42,12 +52,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. big(1) -> diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl index ab2ce88e12..d422580b20 100644 --- a/lib/debugger/test/bs_match_bin_SUITE.erl +++ b/lib/debugger/test/bs_match_bin_SUITE.erl @@ -21,16 +21,26 @@ -module(bs_match_bin_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, byte_split_binary/1,bit_split_binary/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [byte_split_binary,bit_split_binary]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[byte_split_binary, bit_split_binary]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -42,12 +52,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. byte_split_binary(doc) -> "Tries to split a binary at all byte-aligned positions."; diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl index 0cb9062575..14ccbe425a 100644 --- a/lib/debugger/test/bs_match_int_SUITE.erl +++ b/lib/debugger/test/bs_match_int_SUITE.erl @@ -20,18 +20,28 @@ -module(bs_match_int_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(lists, [seq/2]). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [integer,signed_integer,dynamic,more_dynamic,mml]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[integer, signed_integer, dynamic, more_dynamic, mml]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -43,12 +53,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. integer(suite) -> []; diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl index 7414685f0c..d9116c6f8a 100644 --- a/lib/debugger/test/bs_match_misc_SUITE.erl +++ b/lib/debugger/test/bs_match_misc_SUITE.erl @@ -20,16 +20,26 @@ -module(bs_match_misc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [bound_var,bound_tail,t_float,little_float,sean]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[bound_var, bound_tail, t_float, little_float, sean]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -41,12 +51,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. bound_var(doc) -> "Test matching of bound variables."; diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl index 9c8d753371..3f5dea3011 100644 --- a/lib/debugger/test/bs_match_tail_SUITE.erl +++ b/lib/debugger/test/bs_match_tail_SUITE.erl @@ -20,16 +20,26 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, aligned/1,unaligned/1,zero_tail/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [aligned,unaligned,zero_tail]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[aligned, unaligned, zero_tail]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -41,12 +51,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. aligned(doc) -> "Test aligned tails."; diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index a114bc2b46..c15c4be351 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -21,20 +21,30 @@ -module(bs_utf_SUITE). --export([all/1,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1, init_per_testcase/2,end_per_testcase/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -compile([no_jopt,time]). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [utf8_roundtrip,unused_utf_char,utf16_roundtrip, - utf32_roundtrip,guard,extreme_tripping]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[utf8_roundtrip, unused_utf_char, utf16_roundtrip, + utf32_roundtrip, guard, extreme_tripping]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -46,12 +56,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. utf8_roundtrip(Config) when is_list(Config) -> diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl index cf732c8115..fab94cc08f 100644 --- a/lib/debugger/test/bug_SUITE.erl +++ b/lib/debugger/test/bug_SUITE.erl @@ -20,18 +20,27 @@ %% -module(bug_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([ticket_tests/1]). +-export([]). -export([otp2163/1, otp4845/1]). -all(suite) -> [ticket_tests]. +all() -> +[{group, ticket_tests}]. + +groups() -> + [{ticket_tests, [], [otp2163, otp4845]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -ticket_tests(doc) -> ["Tests tickets regarding bugs"]; -ticket_tests(suite) -> [otp2163, otp4845]. otp2163(doc) -> ["BIF exit reason"]; otp2163(suite) -> []; diff --git a/lib/debugger/test/cleanup.erl b/lib/debugger/test/cleanup.erl index 59b4c35ac7..5f1ea71d2e 100644 --- a/lib/debugger/test/cleanup.erl +++ b/lib/debugger/test/cleanup.erl @@ -20,11 +20,22 @@ %% -module(cleanup). --export([all/1, cleanup/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cleanup/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[cleanup]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> {req, [interpreter], [cleanup]}. cleanup(suite) -> []; cleanup(_) -> diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 00e75d6bb3..6207524be5 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -21,11 +21,11 @@ -module(dbg_ui_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([function_tests/1]). @@ -37,7 +37,7 @@ % Manual test suites/cases exports --export([manual_tests/1]). +-export([]). -export([start1/1, interpret1/1, quit1/1, start2/1, interpret2/1, break2/1, options2/1, quit2/1, interpret3/1, all_step3/1,all_next3/1,save3/1,restore3/1,finish3/1, @@ -62,8 +62,24 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). -all (suite)-> - {req, [debugger], [function_tests, manual_tests]}. +all() -> +[function_tests, {group, manual_tests}]. + +groups() -> + [{manual_tests, [], + [start1, interpret1, quit1, start2, interpret2, break2, + options2, interpret3, all_step3, all_next3, save3, + restore3, finish3, killinit3, killone3, killall3, + deleteone3, deleteall3, viewbreak4, delete4, attach5, + normal5, exit5, options5, distsetup6, all_step6, + all_next6]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + function_tests (doc) -> @@ -164,15 +180,6 @@ check(Case, Config) -> -manual_tests(doc) -> ["Manual tests"]; -manual_tests(suite) -> [start1, interpret1, quit1, - start2, interpret2, break2, options2, - interpret3, all_step3,all_next3,save3,restore3,finish3, - killinit3, killone3, killall3, deleteone3, deleteall3, - viewbreak4, delete4, - attach5, normal5, exit5, options5, - distsetup6, all_step6, all_next6 - ]. diff --git a/lib/debugger/test/debugger.spec b/lib/debugger/test/debugger.spec index cc8a5aff37..426b2757ac 100644 --- a/lib/debugger/test/debugger.spec +++ b/lib/debugger/test/debugger.spec @@ -1 +1 @@ -{topcase, {dir, "../debugger_test"}}. +{suites,"debugger_test",all}. diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index 648c6808a9..a10b2aecbc 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -22,14 +22,25 @@ %% Test break points. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). -all(suite) -> - [app_test,erts_debug,no_abstract_code,encrypted_debug_info]. +all() -> +[app_test, erts_debug, no_abstract_code, + encrypted_debug_info]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> Dog=test_server:timetrap(?t:minutes(0.5)), diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index 9c62e1713a..f49e95669e 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -57,7 +57,7 @@ config(priv_dir,_) -> ".". -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, end_per_testcase/2]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -70,13 +70,22 @@ end_per_testcase(_Case, Config) -> ok. -endif. -all(doc) -> - ["Test cases for the 'erl_eval' module."]; -all(suite) -> - [guard_1, guard_2, match_pattern, string_plusplus, pattern_expr, - match_bin, guard_3, guard_4, - lc, simple_cases, unary_plus, apply_atom, otp_5269, otp_6539, otp_6543, - otp_6787, otp_6977, otp_7550, otp_8133, funs, try_catch, eval_expr_5]. +all() -> +[guard_1, guard_2, match_pattern, string_plusplus, + pattern_expr, match_bin, guard_3, guard_4, lc, + simple_cases, unary_plus, apply_atom, otp_5269, + otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, + otp_8133, funs, try_catch, eval_expr_5]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + guard_1(doc) -> ["(OTP-2405)"]; diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl index 1ba4945e33..9fc1a28b2f 100644 --- a/lib/debugger/test/exception_SUITE.erl +++ b/lib/debugger/test/exception_SUITE.erl @@ -20,18 +20,28 @@ %% -module(exception_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, badmatch/1,pending_errors/1,nil_arith/1]). -export([bad_guy/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [badmatch, pending_errors, nil_arith]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[badmatch, pending_errors, nil_arith]. -define(try_match(E), catch ?MODULE:bar(), @@ -47,12 +57,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. badmatch(doc) -> "Test that deliberately bad matches are reported correctly."; diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl index 721048b6b6..c52ddec1b5 100644 --- a/lib/debugger/test/fun_SUITE.erl +++ b/lib/debugger/test/fun_SUITE.erl @@ -20,20 +20,31 @@ %% -module(fun_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2,end_per_testcase/2, - init_all/1,finish_all/1, + init_per_suite/1,end_per_suite/1, good_call/1,bad_apply/1,bad_fun_call/1,badarity/1, ext_badarity/1,otp_6061/1]). -export([nothing/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [good_call,bad_apply,bad_fun_call,badarity,ext_badarity,otp_6061]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[good_call, bad_apply, bad_fun_call, badarity, + ext_badarity, otp_6061]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -45,12 +56,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. good_call(Config) when is_list(Config) -> diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl index 13a0e67041..8b127f183f 100644 --- a/lib/debugger/test/guard_SUITE.erl +++ b/lib/debugger/test/guard_SUITE.erl @@ -20,7 +20,7 @@ %% -module(guard_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, bad_arith/1,bad_tuple/1,test_heap_guards/1,guard_bifs/1, type_tests/1,const_guard/1, const_cond/1,basic_not/1,complex_not/1, @@ -35,24 +35,33 @@ basic_andalso_orelse/1,traverse_dcd/1, check_qlc_hrl/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init/4]). -import(lists, [member/2]). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [bad_arith,bad_tuple,test_heap_guards,guard_bifs,type_tests,const_guard, - const_cond,basic_not,complex_not, - semicolon,complex_semicolon, - comma,or_guard,more_or_guards, - complex_or_guards,and_guard, - xor_guard,more_xor_guards, - build_in_guard,old_guard_tests,gbif, - t_is_boolean,is_function_2,tricky,rel_ops, - basic_andalso_orelse,traverse_dcd,check_qlc_hrl]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[bad_arith, bad_tuple, test_heap_guards, guard_bifs, + type_tests, const_guard, const_cond, basic_not, + complex_not, semicolon, complex_semicolon, comma, + or_guard, more_or_guards, complex_or_guards, and_guard, + xor_guard, more_xor_guards, build_in_guard, + old_guard_tests, gbif, t_is_boolean, is_function_2, + tricky, rel_ops, basic_andalso_orelse, traverse_dcd, + check_qlc_hrl]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -64,12 +73,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. bad_arith(doc) -> "Test that a bad arithmetic operation in a guard works correctly."; diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl index 0326325888..f235d6e385 100644 --- a/lib/debugger/test/int_SUITE.erl +++ b/lib/debugger/test/int_SUITE.erl @@ -19,15 +19,15 @@ %% -module(int_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases --export([interpret/1, guards/1, list_suite/1, interpretable/1]). --export([append/1, append_1/1, append_2/1, member/1, reverse/1]). +-export([interpret/1, guards/1, interpretable/1]). +-export([ append_1/1, append_2/1, member/1, reverse/1]). %% Default timetrap timeout (set in init_per_testcase) -define(default_timeout, ?t:minutes(1)). @@ -59,8 +59,19 @@ end_per_testcase(_Case, Config) -> ?line test_server:timetrap_cancel(Dog), ?line ok. -all(suite)-> - [interpret, guards, list_suite, interpretable]. +all() -> +[interpret, guards, {group, list_suite}, interpretable]. + +groups() -> + [{list_suite, [], [{group, append}, reverse, member]}, + {append, [], [append_1, append_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + interpret(suite) -> []; @@ -97,13 +108,7 @@ guards(Config) when is_list(Config) -> ok = guards:guards(). -list_suite(suite) -> - [append, reverse, member]. -append(doc) -> - ["Tests lists1:append/1 & lists1:append/2"]; -append(suite) -> - [append_1, append_2]. append_1(suite) -> []; diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index c70551de6e..cd33046efa 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -22,15 +22,25 @@ %% Test break points. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,cleanup/1]). -export([auto_attach/1]). -all(suite) -> - [basic,cleanup]. +all() -> +[basic, cleanup]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line DataDir = ?config(data_dir, Config), diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index 390147147e..9f0836c406 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -22,7 +22,7 @@ %% Purpose: Deeper test of the evaluator. --export([all/1,init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, bifs_outside_erlang/1, spawning/1, applying/1, catch_and_throw/1, external_call/1, test_module_info/1, apply_interpreted_fun/1, apply_uninterpreted_fun/1, @@ -33,13 +33,23 @@ -define(IM, my_int_eval_module). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[bifs_outside_erlang, spawning, applying, + catch_and_throw, external_call, test_module_info, + apply_interpreted_fun, apply_uninterpreted_fun, + interpreted_exit, otp_8310]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [bifs_outside_erlang,spawning,applying,catch_and_throw, - external_call,test_module_info, - apply_interpreted_fun,apply_uninterpreted_fun, - interpreted_exit, otp_8310]. init_per_testcase(_Case, Config) -> ?line DataDir = ?config(data_dir, Config), diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl index daa53e41a3..362e18eba1 100644 --- a/lib/debugger/test/lc_SUITE.erl +++ b/lib/debugger/test/lc_SUITE.erl @@ -21,16 +21,26 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, basic/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [basic]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[basic]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -42,12 +52,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. basic(Config) when list(Config) -> diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl index 9021ad55d1..684bc2eaa3 100644 --- a/lib/debugger/test/record_SUITE.erl +++ b/lib/debugger/test/record_SUITE.erl @@ -22,16 +22,26 @@ -module(record_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, errors/1,record_test/1,eval_once/1]). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [errors,record_test,eval_once]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[errors, record_test, eval_once]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -43,12 +53,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. -record(foo, {a,b,c,d}). diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl index e039d0ff85..2d951be68f 100644 --- a/lib/debugger/test/trycatch_SUITE.erl +++ b/lib/debugger/test/trycatch_SUITE.erl @@ -20,20 +20,30 @@ %% -module(trycatch_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2,init_all/1,finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [{conf,init_all,cases(),finish_all}]. +all() -> +[cases()]. -cases() -> - [basic,lean_throw,try_of,try_after,%after_bind, - catch_oops,after_oops,eclectic,rethrow, - nested_of,nested_catch,nested_after]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +cases() -> +[basic, lean_throw, try_of, try_after, catch_oops, + after_oops, eclectic, rethrow, nested_of, nested_catch, + nested_after]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -45,12 +55,12 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), ok. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> ok. basic(Conf) when is_list(Conf) -> -- cgit v1.2.3 From 3d0f4a3085f11389e5b22d10f96f0cbf08c9337f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:43:56 +0200 Subject: Update compiler tests to conform with common_test standard --- lib/compiler/test/andor_SUITE.erl | 22 ++++++++---- lib/compiler/test/apply_SUITE.erl | 20 ++++++++--- lib/compiler/test/beam_validator_SUITE.erl | 41 ++++++++++++--------- lib/compiler/test/bs_bincomp_SUITE.erl | 22 ++++++++---- lib/compiler/test/bs_bit_binaries_SUITE.erl | 25 +++++++++---- lib/compiler/test/bs_construct_SUITE.erl | 23 ++++++++---- lib/compiler/test/bs_match_SUITE.erl | 35 ++++++++++++------ lib/compiler/test/bs_utf_SUITE.erl | 24 +++++++++---- lib/compiler/test/compilation_SUITE.erl | 55 +++++++++++++++-------------- lib/compiler/test/compile_SUITE.erl | 36 +++++++++++-------- lib/compiler/test/core_SUITE.erl | 20 ++++++++--- lib/compiler/test/core_fold_SUITE.erl | 22 ++++++++---- lib/compiler/test/error_SUITE.erl | 20 ++++++++--- lib/compiler/test/float_SUITE.erl | 21 ++++++++--- lib/compiler/test/fun_SUITE.erl | 20 ++++++++--- lib/compiler/test/guard_SUITE.erl | 38 ++++++++++++-------- lib/compiler/test/inline_SUITE.erl | 21 ++++++++--- lib/compiler/test/lc_SUITE.erl | 20 ++++++++--- lib/compiler/test/match_SUITE.erl | 22 ++++++++---- lib/compiler/test/misc_SUITE.erl | 24 +++++++++---- lib/compiler/test/num_bif_SUITE.erl | 28 ++++++++++----- lib/compiler/test/parteval_SUITE.erl | 17 +++++++-- lib/compiler/test/pmod_SUITE.erl | 20 ++++++++--- lib/compiler/test/receive_SUITE.erl | 19 +++++++--- lib/compiler/test/record_SUITE.erl | 23 ++++++++---- lib/compiler/test/trycatch_SUITE.erl | 27 +++++++++----- lib/compiler/test/warnings_SUITE.erl | 24 +++++++++---- 27 files changed, 475 insertions(+), 214 deletions(-) diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index 84cfd16e60..990ec13887 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -18,16 +18,26 @@ %% -module(andor_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1,before_and_inside_if/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(andor_SUITE), + [t_case, t_and_or, t_andalso, t_orelse, inside, overlap, + combined, in_case, before_and_inside_if]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [t_case,t_and_or,t_andalso,t_orelse,inside,overlap,combined,in_case, - before_and_inside_if]. t_case(Config) when is_list(Config) -> %% We test boolean cases almost but not quite like cases diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index f955440402..7b34334fd1 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -18,15 +18,25 @@ %% -module(apply_SUITE). --export([all/1,mfa/1,fun_apply/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). -export([foo/0,bar/1,baz/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(apply_SUITE), + [mfa, fun_apply]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [mfa,fun_apply]. -define(APPLY0(M, F), (fun(Res) -> Res = M:F() end)(apply(M, F, []))). -define(APPLY1(M, F, A1), (fun(Res) -> Res = M:F(A1) end)(apply(M, F, [A1]))). diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 94745e995c..85053f71ed 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_validator_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, beam_files/1,compiler_bug/1,stupid_but_valid/1, xrange/1,yrange/1,stack/1,call_last/1,merge_undefined/1, uninit/1,unsafe_catch/1, @@ -30,7 +30,7 @@ state_after_fault_in_catch/1,no_exception_in_catch/1, undef_label/1,illegal_instruction/1,failing_gc_guard_bif/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(10)), @@ -41,23 +41,30 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - test_lib:recompile(?MODULE), - [beam_files,compiler_bug,stupid_but_valid, - xrange,yrange,stack,call_last,merge_undefined, - uninit,unsafe_catch, - dead_code,mult_labels, - overwrite_catchtag,overwrite_trytag,accessing_tags,bad_catch_try, - cons_guard, - freg_range,freg_uninit,freg_state, - bin_match,bin_aligned, - bad_dsetel,state_after_fault_in_catch,no_exception_in_catch, - undef_label,illegal_instruction,failing_gc_guard_bif]. +all() -> +test_lib:recompile(beam_validator_SUITE), + [beam_files, compiler_bug, stupid_but_valid, xrange, + yrange, stack, call_last, merge_undefined, uninit, + unsafe_catch, dead_code, mult_labels, + overwrite_catchtag, overwrite_trytag, accessing_tags, + bad_catch_try, cons_guard, freg_range, freg_uninit, + freg_state, bin_match, bin_aligned, bad_dsetel, + state_after_fault_in_catch, no_exception_in_catch, + undef_label, illegal_instruction, failing_gc_guard_bif]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + beam_files(Config) when is_list(Config) -> - ?line {ok,Cwd} = file:get_cwd(), - ?line Parent = filename:dirname(Cwd), - ?line Wc = filename:join([Parent,"*","*.beam"]), + ?line DataDir = proplists:get_value(data_dir, Config), + ?line Wc = filename:join([DataDir,"..","..","*","*.beam"]), %% Must have at least two files here, or there will be %% a grammatical error in the output of the io:format/2 call below. ;-) ?line [_,_|_] = Fs = filelib:wildcard(Wc), diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl index 74f69893af..4eb815ab59 100644 --- a/lib/compiler/test/bs_bincomp_SUITE.erl +++ b/lib/compiler/test/bs_bincomp_SUITE.erl @@ -21,19 +21,27 @@ -module(bs_bincomp_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1, nomatch/1,sizes/1,tail/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - test_lib:recompile(?MODULE), - [byte_aligned,bit_aligned,extended_byte_aligned, - extended_bit_aligned,mixed,filters,trim_coverage, - nomatch,sizes,tail]. +all() -> + test_lib:recompile(bs_bincomp_SUITE), + [byte_aligned, bit_aligned, extended_byte_aligned, + extended_bit_aligned, mixed, filters, trim_coverage, + nomatch, sizes, tail]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. byte_aligned(Config) when is_list(Config) -> cs_init(), diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 7d533861e0..6d3d26120e 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -21,19 +21,30 @@ -module(bs_bit_binaries_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, send_and_receive_alot/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(bs_bit_binaries_SUITE), + [misc, horrid_match, test_bitstr, test_bit_size, + asymmetric_tests, big_asymmetric_tests, + binary_to_and_from_list, big_binary_to_and_from_list, + send_and_receive, send_and_receive_alot]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [misc,horrid_match,test_bitstr,test_bit_size,asymmetric_tests, - big_asymmetric_tests,binary_to_and_from_list,big_binary_to_and_from_list, - send_and_receive,send_and_receive_alot]. misc(Config) when is_list(Config) -> ?line <<1:100>> = <<1:100>>, diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index eafc2f4b0f..0a19a9e20c 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -23,17 +23,28 @@ -module(bs_construct_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, two/1,test1/1,fail/1,float_bin/1,in_guard/1,in_catch/1, nasty_literals/1,coerce_to_float/1,side_effect/1, opt/1,otp_7556/1,float_arith/1,otp_8054/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(bs_construct_SUITE), + [two, test1, fail, float_bin, in_guard, in_catch, + nasty_literals, side_effect, opt, otp_7556, float_arith, + otp_8054]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [two,test1,fail,float_bin,in_guard,in_catch,nasty_literals, - side_effect,opt,otp_7556,float_arith,otp_8054]. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 5dc57c2928..b1ec1c4d59 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_SUITE). -compile(nowarn_shadow_vars). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1, bin_tail/1,save_restore/1,shadowed_size_var/1, partitioned_bs_match/1,function_clause/1, @@ -35,18 +35,31 @@ -export([coverage_id/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - test_lib:recompile(?MODULE), - [fun_shadow,int_float,otp_5269,null_fields,wiger,bin_tail,save_restore, - shadowed_size_var,partitioned_bs_match,function_clause,unit, - shared_sub_bins,bin_and_float,dec_subidentifiers,skip_optional_tag, - wfbm,degenerated_match,bs_sum,coverage,multiple_uses,zero_label, - followed_by_catch,matching_meets_construction,simon,matching_and_andalso, - otp_7188,otp_7233,otp_7240,otp_7498,match_string,zero_width,bad_size, - haystack,cover_beam_bool]. +all() -> +test_lib:recompile(bs_match_SUITE), + [fun_shadow, int_float, otp_5269, null_fields, wiger, + bin_tail, save_restore, shadowed_size_var, + partitioned_bs_match, function_clause, unit, + shared_sub_bins, bin_and_float, dec_subidentifiers, + skip_optional_tag, wfbm, degenerated_match, bs_sum, + coverage, multiple_uses, zero_label, followed_by_catch, + matching_meets_construction, simon, + matching_and_andalso, otp_7188, otp_7233, otp_7240, + otp_7498, match_string, zero_width, bad_size, haystack, + cover_beam_bool]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index 4281874a24..fd1e3ab8d0 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -19,18 +19,28 @@ -module(bs_utf_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1, literals/1,coverage/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(bs_utf_SUITE), + [utf8_roundtrip, unused_utf_char, utf16_roundtrip, + utf32_roundtrip, guard, extreme_tripping, literals, + coverage]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [utf8_roundtrip,unused_utf_char,utf16_roundtrip, - utf32_roundtrip,guard,extreme_tripping, - literals,coverage]. utf8_roundtrip(Config) when is_list(Config) -> ?line [utf8_roundtrip_1(P) || P <- utf_data()], diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 935e384d2d..364e8ceba8 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -20,34 +20,38 @@ -module(compilation_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -compile(export_all). -all(suite) -> - test_lib:recompile(?MODULE), - [self_compile_old_inliner,self_compile, - compiler_1,compiler_3,compiler_5, - beam_compiler_1, beam_compiler_2, beam_compiler_3, - beam_compiler_4, beam_compiler_5, beam_compiler_6, - beam_compiler_7, beam_compiler_8, beam_compiler_9, - beam_compiler_10, beam_compiler_11, beam_compiler_12, - nested_tuples_in_case_expr, - otp_2330, guards, vsn, - otp_2380, otp_2141, otp_2173, otp_4790, - const_list_256, - bin_syntax_1, bin_syntax_2, bin_syntax_3, - bin_syntax_4, bin_syntax_5, bin_syntax_6, - live_var, convopts, - bad_functional_value, - catch_in_catch, redundant_case, long_string, - otp_5076, complex_guard, otp_5092, otp_5151, - otp_5235,otp_5244, - trycatch_4, opt_crash, - otp_5404,otp_5436,otp_5481,otp_5553,otp_5632, - otp_5714,otp_5872,otp_6121,otp_6121a,otp_6121b, - otp_7202,otp_7345,on_load,string_table,otp_8949_a,otp_8949_a - ]. +all() -> + test_lib:recompile(compilation_SUITE), + [self_compile_old_inliner, self_compile, compiler_1, + compiler_3, compiler_5, beam_compiler_1, + beam_compiler_2, beam_compiler_3, beam_compiler_4, + beam_compiler_5, beam_compiler_6, beam_compiler_7, + beam_compiler_8, beam_compiler_9, beam_compiler_10, + beam_compiler_11, beam_compiler_12, + nested_tuples_in_case_expr, otp_2330, guards, + {group, vsn}, otp_2380, otp_2141, otp_2173, otp_4790, + const_list_256, bin_syntax_1, bin_syntax_2, + bin_syntax_3, bin_syntax_4, bin_syntax_5, bin_syntax_6, + live_var, convopts, bad_functional_value, + catch_in_catch, redundant_case, long_string, otp_5076, + complex_guard, otp_5092, otp_5151, otp_5235, otp_5244, + trycatch_4, opt_crash, otp_5404, otp_5436, otp_5481, + otp_5553, otp_5632, otp_5714, otp_5872, otp_6121, + otp_6121a, otp_6121b, otp_7202, otp_7345, on_load, + string_table,otp_8949_a,otp_8949_a]. + +groups() -> + [{vsn, [], [vsn_1, vsn_2, vsn_3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -define(comp(N), N(Config) when is_list(Config) -> try_it(N, Config)). @@ -311,7 +315,6 @@ from(H, [H | T]) -> T; from(H, [_ | T]) -> from(H, T); from(_, []) -> []. -vsn(suite) -> [vsn_1, vsn_2, vsn_3]. vsn_1(doc) -> "Test generation of 'vsn' attribute"; diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index e1cc5dafb5..b2842e937b 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -20,14 +20,14 @@ %% Tests compile:file/1 and compile:file/2 with various options. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, app_test/1, file_1/1, module_mismatch/1, big_file/1, outdir/1, binary/1, cond_and_ifdef/1, listings/1, listings_big/1, other_output/1, package_forms/1, encrypted_abstr/1, - bad_record_use/1, bad_record_use1/1, bad_record_use2/1, strict_record/1, + bad_record_use1/1, bad_record_use2/1, strict_record/1, missing_testheap/1, cover/1, env/1, core/1, asm/1]). -export([init/3]). @@ -35,17 +35,26 @@ %% To cover the stripping of 'type' and 'spec' in beam_asm. -type all_return_type() :: [atom()]. --spec all('suite' | [_]) -> all_return_type(). +-spec all() -> all_return_type(). + +all() -> +test_lib:recompile(compile_SUITE), + [app_test, file_1, module_mismatch, big_file, outdir, + binary, cond_and_ifdef, listings, listings_big, + other_output, package_forms, encrypted_abstr, + {group, bad_record_use}, strict_record, + missing_testheap, cover, env, core, asm]. + +groups() -> + [{bad_record_use, [], + [bad_record_use1, bad_record_use2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [app_test, - file_1, module_mismatch, big_file, outdir, binary, - cond_and_ifdef, listings, listings_big, - other_output, package_forms, - encrypted_abstr, - bad_record_use, strict_record, - missing_testheap, cover, env, core, asm]. %% Test that the Application file has no `basic' errors."; @@ -465,7 +474,6 @@ exists(Name) -> {error, _} -> false end. -bad_record_use(suite) -> [bad_record_use1, bad_record_use2]. %% Tests that the compiler does not accept %% bad use of records. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index fa2e6be778..0c7cb907b4 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -18,10 +18,10 @@ %% -module(core_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(comp(N), N(Config) when is_list(Config) -> try_it(N, Config)). @@ -35,9 +35,19 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - test_lib:recompile(?MODULE), - [dehydrated_itracer,nested_tries]. +all() -> +test_lib:recompile(core_SUITE), + [dehydrated_itracer, nested_tries]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + ?comp(dehydrated_itracer). ?comp(nested_tries). diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 2791aee782..cb2d46ef40 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -18,18 +18,28 @@ %% -module(core_fold_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_element/1,setelement/1,t_length/1,append/1,t_apply/1,bifs/1, eq/1,nested_call_in_case/1,coverage/1]). -export([foo/0,foo/1,foo/2,foo/3]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(core_fold_SUITE), + [t_element, setelement, t_length, append, t_apply, bifs, + eq, nested_call_in_case, coverage]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [t_element,setelement,t_length,append,t_apply,bifs, - eq,nested_call_in_case,coverage]. t_element(Config) when is_list(Config) -> X = make_ref(), diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index ec58a0761e..b6976c73b5 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -18,14 +18,24 @@ %% -module(error_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]). -all(suite) -> - test_lib:recompile(?MODULE), - [head_mismatch_line,warnings_as_errors,bif_clashes]. +all() -> +test_lib:recompile(error_SUITE), + [head_mismatch_line, warnings_as_errors, bif_clashes]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + bif_clashes(Config) when is_list(Config) -> diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index b48b1daa32..864458e4a8 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -17,13 +17,24 @@ %% %CopyrightEnd% %% -module(float_SUITE). --export([all/1,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(float_SUITE), + [pending, bif_calls, math_functions, + mixed_float_and_int]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [pending,bif_calls,math_functions,mixed_float_and_int]. %% Thanks to Tobias Lindahl %% Shows the effect of pending exceptions on the x86. diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index a740d63c06..ff04c043d4 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -18,14 +18,24 @@ %% -module(fun_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(fun_SUITE), + [test1, overwritten_fun, otp_7202, bif_fun]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [test1,overwritten_fun,otp_7202,bif_fun]. %%% The help functions below are copied from emulator:bs_construct_SUITE. diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 8f23bd2e5a..1d8c0b0a3a 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -18,9 +18,9 @@ %% -module(guard_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, misc/1,const_cond/1,basic_not/1,complex_not/1,nested_nots/1, semicolon/1,complex_semicolon/1,comma/1, or_guard/1,more_or_guards/1, @@ -33,17 +33,25 @@ basic_andalso_orelse/1,traverse_dcd/1, check_qlc_hrl/1,andalso_semi/1,t_tuple_size/1,binary_part/1]). -all(suite) -> - test_lib:recompile(?MODULE), - [misc,const_cond,basic_not,complex_not,nested_nots, - semicolon,complex_semicolon, - comma,or_guard,more_or_guards, - complex_or_guards,and_guard, - xor_guard,more_xor_guards, - build_in_guard,old_guard_tests,gbif, - t_is_boolean,is_function_2,tricky,rel_ops,literal_type_tests, - basic_andalso_orelse,traverse_dcd,check_qlc_hrl,andalso_semi, - t_tuple_size,binary_part]. +all() -> +test_lib:recompile(guard_SUITE), + [misc, const_cond, basic_not, complex_not, nested_nots, + semicolon, complex_semicolon, comma, or_guard, + more_or_guards, complex_or_guards, and_guard, xor_guard, + more_xor_guards, build_in_guard, old_guard_tests, gbif, + t_is_boolean, is_function_2, tricky, rel_ops, + literal_type_tests, basic_andalso_orelse, traverse_dcd, + check_qlc_hrl, andalso_semi, t_tuple_size, binary_part]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + misc(Config) when is_list(Config) -> ?line 42 = case id(42) of @@ -1137,7 +1145,7 @@ make_test([{T,L}|Ts]) -> make_test([]) -> []. test(T, L) -> - S0 = io_lib:format("begin io:format(\"~~p~~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T,L,T,L]), + S0 = io_lib:format("begin io:format(\"~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T,L,T,L]), S = lists:flatten(S0), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), @@ -1145,7 +1153,7 @@ test(T, L) -> {match,0,{atom,0,Val},hd(E)}. test(T, L1, L2) -> - S0 = io_lib:format("begin io:format(\"~~p~~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L1,L2,T,L1,L2]), + S0 = io_lib:format("begin io:format(\"~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L1,L2,T,L1,L2]), S = lists:flatten(S0), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index af93f5d4d7..35b7fa91a0 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -20,7 +20,7 @@ -module(inline_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -compile(export_all). -compile({inline,[badarg/2]}). @@ -28,10 +28,21 @@ %% Needed by test case `lists'. -compile(inline_list_funcs). -all(suite) -> - test_lib:recompile(?MODULE), - [attribute,bsdecode,bsdes,barnes2,decode1,smith,itracer,pseudoknot,lists, - really_inlined,otp_7223,coverage]. +all() -> +test_lib:recompile(inline_SUITE), + [attribute, bsdecode, bsdes, barnes2, decode1, smith, + itracer, pseudoknot, lists, really_inlined, otp_7223, + coverage]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + attribute(Config) when is_list(Config) -> Name = "attribute", diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index d0c0397439..55ca2d0501 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -19,15 +19,25 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,deeply_nested/1,no_generator/1, empty_generator/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(lc_SUITE), + [basic, deeply_nested, no_generator, empty_generator]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [basic,deeply_nested,no_generator,empty_generator]. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index fd51b777ac..9c9907d9b4 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -18,17 +18,27 @@ %% -module(match_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, pmatch/1,mixed/1,aliases/1,match_in_call/1, untuplify/1,shortcut_boolean/1,letify_guard/1, selectify/1,underscore/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(match_SUITE), + [pmatch, mixed, aliases, match_in_call, untuplify, + shortcut_boolean, letify_guard, selectify, underscore]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [pmatch,mixed,aliases,match_in_call,untuplify,shortcut_boolean, - letify_guard,selectify,underscore]. pmatch(Config) when is_list(Config) -> ?line ok = doit(1), diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index d01d53658c..1054be0a5f 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -18,11 +18,11 @@ %% -module(misc_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, tobias/1,empty_string/1,md5/1,silly_coverage/1, confused_literals/1,integer_encoding/1,override_bif/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% For the override_bif testcase. %% NB, no other testcases in this testsuite can use these without erlang:prefix! @@ -50,12 +50,22 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. --spec all(any()) -> misc_SUITE_test_cases(). +-spec all() -> misc_SUITE_test_cases(). + +all() -> +test_lib:recompile(misc_SUITE), + [tobias, empty_string, md5, silly_coverage, + confused_literals, integer_encoding, override_bif]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [tobias,empty_string,md5,silly_coverage,confused_literals, - integer_encoding, override_bif]. %% diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl index 912f7366dd..6861077c7b 100644 --- a/lib/compiler/test/num_bif_SUITE.erl +++ b/lib/compiler/test/num_bif_SUITE.erl @@ -18,7 +18,7 @@ %% -module(num_bif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Tests optimization of the BIFs: %% abs/1 @@ -30,17 +30,28 @@ %% round/1 %% trunc/1 --export([all/1, t_abs/1, t_float/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, - t_list_to_float/1, t_list_to_float_safe/1, t_list_to_float_risky/1, + t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). -all(suite) -> - test_lib:recompile(?MODULE), - [t_abs, t_float, t_float_to_list, t_integer_to_list, - t_list_to_float, t_list_to_integer, - t_round, t_trunc]. +all() -> +test_lib:recompile(num_bif_SUITE), + [t_abs, t_float, t_float_to_list, t_integer_to_list, + {group, t_list_to_float}, t_list_to_integer, t_round, + t_trunc]. + +groups() -> + [{t_list_to_float, [], + [t_list_to_float_safe, t_list_to_float_risky]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + t_abs(Config) when is_list(Config) -> %% Floats. @@ -142,7 +153,6 @@ t_integer_to_list(Config) when is_list(Config) -> %% Tests list_to_float/1. -t_list_to_float(suite) -> [t_list_to_float_safe, t_list_to_float_risky]. t_list_to_float_safe(Config) when is_list(Config) -> ?line 0.0 = list_to_float("0.0"), diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index fda961346e..087e7c087a 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -18,11 +18,22 @@ %% -module(parteval_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, pe2/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, pe2/1]). + +all() -> +[pe2]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [pe2]. %% (This is more general than needed, since we once compiled the same %% source code with and without a certain option.) diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index a4fd2ecbd9..37cf6ef0ba 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -18,14 +18,24 @@ %% -module(pmod_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1, otp_8447/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(pmod_SUITE), + [basic, otp_8447]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [basic, otp_8447]. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog = test_server:timetrap(?t:minutes(1)), diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 8d53e2b6c0..2cae5aeac0 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -20,10 +20,10 @@ -module(receive_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, recv/1,coverage/1,otp_7980/1,ref_opt/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(test_server:minutes(2)), @@ -34,9 +34,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - test_lib:recompile(?MODULE), - [recv,coverage,otp_7980,ref_opt,export]. +all() -> + test_lib:recompile(receive_SUITE), + [recv, coverage, otp_7980, ref_opt, export]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -record(state, {ena = true}). diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index 122f53ec73..ee7dfda398 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -20,9 +20,9 @@ -module(record_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1, guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]). @@ -35,10 +35,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - test_lib:recompile(?MODULE), - [errors,record_test_2,record_test_3,record_access_in_guards, - guard_opt,eval_once,foobar,missing_test_heap,nested_access]. +all() -> +test_lib:recompile(record_SUITE), + [errors, record_test_2, record_test_3, + record_access_in_guards, guard_opt, eval_once, foobar, + missing_test_heap, nested_access]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -record(foo, {a,b,c,d}). -record(bar, {a,b,c,d}). diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index 351289c1dc..6729b340c3 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -18,21 +18,30 @@ %% -module(trycatch_SUITE). --export([all/1,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1, nested_horrid/1,last_call_optimization/1,bool/1, plain_catch_coverage/1,andalso_orelse/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +test_lib:recompile(trycatch_SUITE), + [basic, lean_throw, try_of, try_after, catch_oops, + after_oops, eclectic, rethrow, nested_of, nested_catch, + nested_after, nested_horrid, last_call_optimization, + bool, plain_catch_coverage, andalso_orelse]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - test_lib:recompile(?MODULE), - [basic,lean_throw,try_of,try_after,%after_bind, - catch_oops,after_oops,eclectic,rethrow, - nested_of,nested_catch,nested_after, - nested_horrid,last_call_optimization, - bool,plain_catch_coverage,andalso_orelse]. basic(Conf) when is_list(Conf) -> diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index e9c381fe8b..0cc395cf51 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -26,12 +26,12 @@ -define(privdir, "warnings_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Conf)). -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([pattern/1,pattern2/1,pattern3/1,pattern4/1, guard/1,bad_arith/1,bool_cases/1,bad_apply/1, @@ -49,11 +49,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - test_lib:recompile(?MODULE), - [pattern,pattern2,pattern3,pattern4, - guard,bad_arith,bool_cases,bad_apply,files,effect, - bin_opt_info,bin_construction]. +all() -> +test_lib:recompile(warnings_SUITE), + [pattern, pattern2, pattern3, pattern4, guard, + bad_arith, bool_cases, bad_apply, files, effect, + bin_opt_info, bin_construction]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + pattern(Config) when is_list(Config) -> %% Test warnings generated by v3_core. -- cgit v1.2.3 From 17637a1353c6be871d4fc4cc17f70b012eebc254 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:47:49 +0200 Subject: Update emulator tests to conform with common_test standard --- erts/emulator/test/a_SUITE.erl | 22 ++-- erts/emulator/test/after_SUITE.erl | 23 +++- erts/emulator/test/alloc_SUITE.erl | 28 +++-- erts/emulator/test/beam_SUITE.erl | 20 +++- erts/emulator/test/beam_literals_SUITE.erl | 32 ++++-- erts/emulator/test/bif_SUITE.erl | 22 +++- erts/emulator/test/big_SUITE.erl | 29 +++-- erts/emulator/test/binary_SUITE.erl | 35 ++++-- erts/emulator/test/bs_bincomp_SUITE.erl | 22 +++- erts/emulator/test/bs_bit_binaries_SUITE.erl | 25 ++-- erts/emulator/test/bs_construct_SUITE.erl | 24 ++-- erts/emulator/test/bs_match_bin_SUITE.erl | 20 +++- erts/emulator/test/bs_match_int_SUITE.erl | 22 +++- erts/emulator/test/bs_match_misc_SUITE.erl | 26 +++-- erts/emulator/test/bs_match_tail_SUITE.erl | 19 ++- erts/emulator/test/bs_utf_SUITE.erl | 24 ++-- erts/emulator/test/busy_port_SUITE.erl | 23 ++-- erts/emulator/test/call_trace_SUITE.erl | 35 ++++-- erts/emulator/test/code_SUITE.erl | 23 +++- erts/emulator/test/crypto_SUITE.erl | 21 +++- erts/emulator/test/crypto_reference.erl | 2 +- erts/emulator/test/ddll_SUITE.erl | 58 +++++----- erts/emulator/test/decode_packet_SUITE.erl | 18 ++- erts/emulator/test/dgawd_handler.erl | 2 +- erts/emulator/test/distribution_SUITE.erl | 76 ++++++------ erts/emulator/test/driver_SUITE.erl | 87 ++++++-------- erts/emulator/test/efile_SUITE.erl | 19 ++- erts/emulator/test/emulator.spec | 2 +- erts/emulator/test/erl_drv_thread_SUITE.erl | 21 +++- erts/emulator/test/erl_link_SUITE.erl | 24 ++-- erts/emulator/test/erts_debug_SUITE.erl | 20 +++- erts/emulator/test/estone_SUITE.erl | 19 ++- erts/emulator/test/evil_SUITE.erl | 35 +++--- erts/emulator/test/exception_SUITE.erl | 24 ++-- erts/emulator/test/float_SUITE.erl | 27 +++-- erts/emulator/test/fun_SUITE.erl | 24 ++-- erts/emulator/test/fun_r12_SUITE.erl | 17 ++- erts/emulator/test/gc_SUITE.erl | 20 +++- erts/emulator/test/guard_SUITE.erl | 19 ++- erts/emulator/test/hash_SUITE.erl | 24 ++-- erts/emulator/test/hibernate_SUITE.erl | 21 +++- erts/emulator/test/ignore_cores.erl | 159 +++++++++++++++++++++++++- erts/emulator/test/list_bif_SUITE.erl | 21 +++- erts/emulator/test/long_timers_test.erl | 2 +- erts/emulator/test/match_spec_SUITE.erl | 35 ++++-- erts/emulator/test/module_info_SUITE.erl | 22 +++- erts/emulator/test/monitor_SUITE.erl | 31 +++-- erts/emulator/test/mtx_SUITE.erl | 40 ++++--- erts/emulator/test/nested_SUITE.erl | 20 +++- erts/emulator/test/nif_SUITE.erl | 28 +++-- erts/emulator/test/node_container_SUITE.erl | 41 +++---- erts/emulator/test/nofrag_SUITE.erl | 23 +++- erts/emulator/test/num_bif_SUITE.erl | 27 +++-- erts/emulator/test/old_mod.erl | 2 +- erts/emulator/test/old_scheduler_SUITE.erl | 36 +++--- erts/emulator/test/op_SUITE.erl | 21 +++- erts/emulator/test/port_SUITE.erl | 55 +++++---- erts/emulator/test/port_bif_SUITE.erl | 31 +++-- erts/emulator/test/process_SUITE.erl | 72 ++++++------ erts/emulator/test/pseudoknot_SUITE.erl | 17 ++- erts/emulator/test/random_iolist.erl | 2 +- erts/emulator/test/receive_SUITE.erl | 18 ++- erts/emulator/test/ref_SUITE.erl | 19 ++- erts/emulator/test/register_SUITE.erl | 21 +++- erts/emulator/test/save_calls_SUITE.erl | 20 +++- erts/emulator/test/scheduler_SUITE.erl | 45 ++++---- erts/emulator/test/send_term_SUITE.erl | 18 ++- erts/emulator/test/sensitive_SUITE.erl | 25 ++-- erts/emulator/test/signal_SUITE.erl | 41 ++++--- erts/emulator/test/statistics_SUITE.erl | 33 ++++-- erts/emulator/test/system_info_SUITE.erl | 19 ++- erts/emulator/test/system_profile_SUITE.erl | 25 ++-- erts/emulator/test/time_SUITE.erl | 27 +++-- erts/emulator/test/timer_bif_SUITE.erl | 27 +++-- erts/emulator/test/trace_SUITE.erl | 35 +++--- erts/emulator/test/trace_bif_SUITE.erl | 32 ++++-- erts/emulator/test/trace_call_count_SUITE.erl | 30 +++-- erts/emulator/test/trace_call_time_SUITE.erl | 29 +++-- erts/emulator/test/trace_local_SUITE.erl | 49 ++++---- erts/emulator/test/trace_meta_SUITE.erl | 31 +++-- erts/emulator/test/trace_nif_SUITE.erl | 36 +++--- erts/emulator/test/trace_port_SUITE.erl | 43 ++++--- erts/emulator/test/tuple_SUITE.erl | 27 +++-- erts/emulator/test/z_SUITE.erl | 26 +++-- 84 files changed, 1603 insertions(+), 812 deletions(-) mode change 120000 => 100644 erts/emulator/test/ignore_cores.erl diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl index e9d653a7c4..c51f70a9e6 100644 --- a/erts/emulator/test/a_SUITE.erl +++ b/erts/emulator/test/a_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,14 +26,22 @@ %%%------------------------------------------------------------------- -module(a_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, long_timers/1, pollset_size/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). + +all() -> +[long_timers, pollset_size]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(doc) -> - []; -all(suite) -> - [long_timers, pollset_size]. long_timers(doc) -> []; diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl index 3e1a871408..cde4a69a30 100644 --- a/erts/emulator/test/after_SUITE.erl +++ b/erts/emulator/test/after_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,9 +21,9 @@ %% Tests receive after. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, t_after/1, receive_after/1, receive_after_big/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, receive_after_errors/1, receive_var_zero/1, receive_zero/1, multi_timeout/1, receive_after_32bit/1]). @@ -33,9 +33,20 @@ -export([timeout_g/0]). -all(suite) -> - [t_after, receive_after, receive_after_big, receive_after_errors, - receive_var_zero, receive_zero, multi_timeout, receive_after_32bit]. +all() -> +[t_after, receive_after, receive_after_big, + receive_after_errors, receive_var_zero, receive_zero, + multi_timeout, receive_after_32bit]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl index 94766dc6e9..6614fb045b 100644 --- a/erts/emulator/test/alloc_SUITE.erl +++ b/erts/emulator/test/alloc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ -module(alloc_SUITE). -author('rickard.green@uab.ericsson.se'). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic/1, coalesce/1, @@ -31,19 +31,23 @@ -export([init_per_testcase/2, fin_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(DEFAULT_TIMETRAP_SECS, 240). -all(doc) -> []; -all(suite) -> [basic, - coalesce, - threads, - realloc_copy, - bucket_index, - bucket_mask, - rbtree, - mseg_clear_cache]. +all() -> +[basic, coalesce, threads, realloc_copy, bucket_index, + bucket_mask, rbtree, mseg_clear_cache]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_list(Config) -> diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 32ac07cb2d..5c5134c99d 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -19,17 +19,27 @@ -module(beam_SUITE). --export([all/1, packed_registers/1, apply_last/1, apply_last_bif/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1, select_val/1]). -export([applied/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[packed_registers, apply_last, apply_last_bif, + buildo_mucho, heap_sizes, big_lists, select_val]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [packed_registers, apply_last, apply_last_bif, buildo_mucho, - heap_sizes, big_lists, select_val]. %% Verify that apply(M, F, A) is really tail recursive. diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 1eda939cf8..1ceb4ef552 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ %% -module(beam_literals_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([putting/1, matching_smalls/1, matching_smalls_jt/1, matching_bigs/1, matching_more_bigs/1, matching_bigs_and_smalls/1, badmatch/1, case_clause/1, @@ -26,14 +26,24 @@ put_list/1, fconv/1, literal_case_expression/1, increment/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[putting, matching_smalls, matching_smalls_jt, + matching_bigs, matching_more_bigs, + matching_bigs_and_smalls, badmatch, case_clause, + receiving, literal_type_tests, put_list, fconv, + literal_case_expression, increment]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [putting, matching_smalls, matching_smalls_jt, - matching_bigs, matching_more_bigs, - matching_bigs_and_smalls, badmatch, case_clause, - receiving, literal_type_tests, - put_list, fconv, literal_case_expression, increment]. putting(doc) -> "Test creating lists and tuples containing big number literals."; putting(Config) when is_list(Config) -> @@ -238,14 +248,14 @@ make_test([{T,L}|Ts]) -> make_test([]) -> []. test(T, L) -> - S = lists:flatten(io_lib:format("begin io:format(\"~~p~~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T, L, T, L])), + S = lists:flatten(io_lib:format("begin io:format(\"~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T, L, T, L])), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), {value,Val,_Bs} = erl_eval:exprs(E, []), {match,0,{atom,0,Val},hd(E)}. test(T, A, L) -> - S = lists:flatten(io_lib:format("begin io:format(\"~~p~~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", + S = lists:flatten(io_lib:format("begin io:format(\"~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L,A,T,L,A])), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index b4ef0e6d5a..03b5e84bfd 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -19,18 +19,28 @@ -module(bif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, types/1, t_list_to_existing_atom/1,os_env/1,otp_7526/1, binary_to_atom/1,binary_to_existing_atom/1, atom_to_binary/1,min_max/1]). -all(suite) -> - [types,t_list_to_existing_atom,os_env,otp_7526, - atom_to_binary,binary_to_atom,binary_to_existing_atom, - min_max]. +all() -> +[types, t_list_to_existing_atom, os_env, otp_7526, + atom_to_binary, binary_to_atom, binary_to_existing_atom, + min_max]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index 6cedd39009..d9c1c5acb3 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,9 @@ -module(big_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([t_div/1, eq_28/1, eq_32/1, eq_big/1, eq_math/1, big_literals/1, - borders/1, negative/1, big_float/1, big_float_1/1, big_float_2/1, + borders/1, negative/1, big_float_1/1, big_float_2/1, shift_limit_1/1, powmod/1, system_limit/1, otp_6692/1]). %% Internal exports. @@ -32,11 +32,22 @@ -export([init_per_testcase/2, fin_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[t_div, eq_28, eq_32, eq_big, eq_math, big_literals, + borders, negative, {group, big_float}, shift_limit_1, + powmod, system_limit, otp_6692]. + +groups() -> + [{big_float, [], [big_float_1, big_float_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [t_div, eq_28, eq_32, eq_big, eq_math, big_literals, borders, - negative, big_float, shift_limit_1, powmod, system_limit, otp_6692]. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), @@ -260,10 +271,6 @@ big_literals(Config) when is_list(Config) -> ?line ok = Mod:t(), ok. -big_float(doc) -> - ["Test cases for mixing bignums and floats"]; -big_float(suite) -> - [big_float_1, big_float_2]. big_float_1(doc) -> ["OTP-2436, part 1"]; diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 77d2579848..92cb70ec63 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -40,9 +40,9 @@ %% phash2(Binary, N) %% --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, copy_terms/1, conversions/1, deep_lists/1, deep_bitstr_lists/1, bad_list_to_binary/1, bad_binary_to_list/1, t_split_binary/1, bad_split/1, t_concat_binary/1, @@ -61,16 +61,27 @@ %% Internal exports. -export([sleeper/0]). -all(suite) -> - [copy_terms,conversions,deep_lists,deep_bitstr_lists, - t_split_binary, bad_split, t_concat_binary, - bad_list_to_binary, bad_binary_to_list, terms, terms_float, - external_size, t_iolist_size, - bad_binary_to_term_2,safe_binary_to_term2, - bad_binary_to_term, bad_terms, t_hash, bad_size, bad_term_to_binary, - more_bad_terms, otp_5484, otp_5933, ordering, unaligned_order, - gc_test, bit_sized_binary_sizes, otp_6817, otp_8117, - deep,obsolete_funs,robustness,otp_8180]. +all() -> +[copy_terms, conversions, deep_lists, deep_bitstr_lists, + t_split_binary, bad_split, t_concat_binary, + bad_list_to_binary, bad_binary_to_list, terms, + terms_float, external_size, t_iolist_size, + bad_binary_to_term_2, safe_binary_to_term2, + bad_binary_to_term, bad_terms, t_hash, bad_size, + bad_term_to_binary, more_bad_terms, otp_5484, otp_5933, + ordering, unaligned_order, gc_test, + bit_sized_binary_sizes, otp_6817, otp_8117, deep, + obsolete_funs, robustness, otp_8180]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(2)), diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl index 4e83d97689..1dee587382 100644 --- a/erts/emulator/test/bs_bincomp_SUITE.erl +++ b/erts/emulator/test/bs_bincomp_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,15 +22,25 @@ -module(bs_bincomp_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,tracing/1]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). + +all() -> +[byte_aligned, bit_aligned, extended_byte_aligned, + extended_bit_aligned, mixed, tracing]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [byte_aligned,bit_aligned,extended_byte_aligned, - extended_bit_aligned,mixed,tracing]. byte_aligned(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl index 52bb925385..40e085342f 100644 --- a/erts/emulator/test/bs_bit_binaries_SUITE.erl +++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,18 +22,29 @@ -module(bs_bit_binaries_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, send_and_receive_alot/1,append/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[misc, horrid_match, test_bitstr, test_bit_size, + asymmetric_tests, big_asymmetric_tests, + binary_to_and_from_list, big_binary_to_and_from_list, + send_and_receive, send_and_receive_alot, append]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [misc,horrid_match,test_bitstr,test_bit_size,asymmetric_tests, - big_asymmetric_tests,binary_to_and_from_list,big_binary_to_and_from_list, - send_and_receive,send_and_receive_alot,append]. misc(Config) when is_list(Config) -> ?line <<1:100>> = id(<<1:100>>), diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 138a19a626..c1ad198df3 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_construct_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, mem_leak/1, coerce_to_float/1, bjorn/1, @@ -29,14 +29,22 @@ copy_writable_binary/1, kostis/1, dynamic/1, bs_add/1, otp_7422/1, zero_width/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -all(suite) -> - [test1, test2, test3, test4, test5, testf, - not_used, in_guard, mem_leak, coerce_to_float, bjorn, - huge_float_field, huge_binary, system_limit, badarg, - copy_writable_binary, kostis, dynamic, bs_add, - otp_7422, zero_width]. +all() -> +[test1, test2, test3, test4, test5, testf, not_used, + in_guard, mem_leak, coerce_to_float, bjorn, + huge_float_field, huge_binary, system_limit, badarg, + copy_writable_binary, kostis, dynamic, bs_add, otp_7422, zero_width]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. big(1) -> 57285702734876389752897683. diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl index 3d054a279f..e770875181 100644 --- a/erts/emulator/test/bs_match_bin_SUITE.erl +++ b/erts/emulator/test/bs_match_bin_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,12 +19,22 @@ -module(bs_match_bin_SUITE). --export([all/1,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[byte_split_binary, bit_split_binary, match_huge_bin]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [byte_split_binary,bit_split_binary,match_huge_bin]. byte_split_binary(doc) -> "Tries to split a binary at all byte-aligned positions."; byte_split_binary(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl index 99dee7c7bc..b688e0ccaa 100644 --- a/erts/emulator/test/bs_match_int_SUITE.erl +++ b/erts/emulator/test/bs_match_int_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,16 +18,26 @@ -module(bs_match_int_SUITE). --export([all/1,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, match_huge_int/1,bignum/1,unaligned_32_bit/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(lists, [seq/2]). -all(suite) -> - [integer,signed_integer,dynamic,more_dynamic,mml,match_huge_int,bignum, - unaligned_32_bit]. +all() -> +[integer, signed_integer, dynamic, more_dynamic, mml, + match_huge_int, bignum, unaligned_32_bit]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + integer(Config) when is_list(Config) -> ?line 0 = get_int(mkbin([])), diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl index 6de2ef67e5..de1664aa04 100644 --- a/erts/emulator/test/bs_match_misc_SUITE.erl +++ b/erts/emulator/test/bs_match_misc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,18 +18,28 @@ %% -module(bs_match_misc_SUITE). --export([all/1,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, kenneth/1,encode_binary/1,native/1,happi/1, size_var/1,wiger/1,x0_context/1,huge_float_field/1, writable_binary_matched/1,otp_7198/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[bound_var, bound_tail, t_float, little_float, sean, + kenneth, encode_binary, native, happi, size_var, wiger, + x0_context, huge_float_field, writable_binary_matched, + otp_7198]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [bound_var,bound_tail,t_float,little_float,sean, - kenneth,encode_binary,native,happi, - size_var,wiger,x0_context,huge_float_field, - writable_binary_matched,otp_7198]. bound_var(doc) -> "Test matching of bound variables."; bound_var(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl index b0b0779b65..6e1d589069 100644 --- a/erts/emulator/test/bs_match_tail_SUITE.erl +++ b/erts/emulator/test/bs_match_tail_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,11 +20,22 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/1,aligned/1,unaligned/1,zero_tail/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[aligned, unaligned, zero_tail]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [aligned,unaligned,zero_tail]. aligned(doc) -> "Test aligned tails."; aligned(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl index 87adc5197b..0e61952916 100644 --- a/erts/emulator/test/bs_utf_SUITE.erl +++ b/erts/emulator/test/bs_utf_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,13 +19,13 @@ -module(bs_utf_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, utf8_roundtrip/1,utf16_roundtrip/1,utf32_roundtrip/1, utf8_illegal_sequences/1,utf16_illegal_sequences/1, utf32_illegal_sequences/1, bad_construction/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(FAIL(Expr), ?line fail_check(catch Expr, ??Expr, [])). @@ -37,10 +37,20 @@ fin_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [utf8_roundtrip,utf16_roundtrip,utf32_roundtrip, - utf8_illegal_sequences,utf16_illegal_sequences, - utf32_illegal_sequences,bad_construction]. +all() -> +[utf8_roundtrip, utf16_roundtrip, utf32_roundtrip, + utf8_illegal_sequences, utf16_illegal_sequences, + utf32_illegal_sequences, bad_construction]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + utf8_roundtrip(Config) when is_list(Config) -> ?line utf8_roundtrip(0, 16#D7FF), diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index 7350aef4ec..e4c7800310 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -19,21 +19,30 @@ -module(busy_port_SUITE). --export([all/1, io_to_busy/1, message_order/1, send_3/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, system_monitor/1, no_trap_exit/1, no_trap_exit_unlinked/1, trap_exit/1, multiple_writers/1, hard_busy_driver/1, soft_busy_driver/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Internal exports. -export([init/2]). -all(suite) -> {req, [dynamic_loading], - [io_to_busy, message_order, send_3, - system_monitor, no_trap_exit, - no_trap_exit_unlinked, trap_exit, multiple_writers, - hard_busy_driver, soft_busy_driver]}. +all() -> +[io_to_busy, message_order, send_3, system_monitor, + no_trap_exit, no_trap_exit_unlinked, trap_exit, + multiple_writers, hard_busy_driver, soft_busy_driver]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Tests I/O operations to a busy port, to make sure a suspended send %% operation is correctly restarted. This used to crash Beam. diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl index e0528955b0..b2b6144ba1 100644 --- a/erts/emulator/test/call_trace_SUITE.erl +++ b/erts/emulator/test/call_trace_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ -module(call_trace_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, hipe/1,process_specs/1,basic/1,flags/1,errors/1,pam/1,change_pam/1, return_trace/1,exception_trace/1,on_load/1,deep_exception/1, exception_nocatch/1,bit_syntax/1]). @@ -35,19 +35,30 @@ -export([abbr/1,abbr/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(P, 20). -all(suite) -> - Common = [errors,on_load], - NotHipe = [process_specs,basic,flags,pam,change_pam,return_trace, - exception_trace,deep_exception,exception_nocatch,bit_syntax], - Hipe = [hipe], - case test_server:is_native(?MODULE) of - true -> Hipe ++ Common; - false -> NotHipe ++ Common - end. +all() -> +Common = [errors, on_load], + NotHipe = [process_specs, basic, flags, pam, change_pam, + return_trace, exception_trace, deep_exception, + exception_nocatch, bit_syntax], + Hipe = [hipe], + case test_server:is_native(call_trace_SUITE) of + true -> Hipe ++ Common; + false -> NotHipe ++ Common +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:seconds(30)), diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 5707de30d3..beebab892f 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -18,18 +18,29 @@ %% -module(code_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, new_binary_types/1,t_check_process_code/1,t_check_process_code_ets/1, external_fun/1,get_chunk/1,module_md5/1,make_stub/1, make_stub_many_funs/1,constant_pools/1, false_dependency/1,coverage/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[new_binary_types, t_check_process_code, + t_check_process_code_ets, external_fun, get_chunk, + module_md5, make_stub, make_stub_many_funs, + constant_pools, false_dependency, coverage]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [new_binary_types,t_check_process_code,t_check_process_code_ets, - external_fun,get_chunk,module_md5,make_stub,make_stub_many_funs, - constant_pools,false_dependency,coverage]. new_binary_types(Config) when is_list(Config) -> ?line Data = ?config(data_dir, Config), diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl index e3d34b923d..a1f6349cf5 100644 --- a/erts/emulator/test/crypto_SUITE.erl +++ b/erts/emulator/test/crypto_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,14 +19,25 @@ -module(crypto_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_md5/1,t_md5_update/1,error/1,unaligned_context/1,random_lists/1, misc_errors/1]). -all(suite) -> - [t_md5,t_md5_update,error,unaligned_context,random_lists,misc_errors]. +all() -> +[t_md5, t_md5_update, error, unaligned_context, + random_lists, misc_errors]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + misc_errors(doc) -> diff --git a/erts/emulator/test/crypto_reference.erl b/erts/emulator/test/crypto_reference.erl index 99107e3b57..b91535a50e 100644 --- a/erts/emulator/test/crypto_reference.erl +++ b/erts/emulator/test/crypto_reference.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl index 79047d7de5..23b6013ff2 100644 --- a/erts/emulator/test/ddll_SUITE.erl +++ b/erts/emulator/test/ddll_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,7 +30,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/1, ddll_test/1, errors/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, ddll_test/1, errors/1, reference_count/1, kill_port/1, dont_kill_port/1]). -export([unload_on_process_exit/1, delayed_unload_with_ports/1, @@ -50,35 +50,31 @@ -import(ordsets, [subtract/2]). --include("test_server.hrl"). - -all(suite) -> - [ddll_test, errors, - reference_count, - kill_port, - dont_kill_port, - properties, - load_and_unload, - unload_on_process_exit, - delayed_unload_with_ports, - unload_due_to_process_exit, - no_unload_due_to_process_exit, - no_unload_due_to_process_exit_2, - unload_reload_thingie, - unload_reload_thingie_2, - unload_reload_thingie_3, - reload_pending, - load_fail_init, - reload_pending_fail_init, - reload_pending_kill, - more_error_codes, - forced_port_killing, - no_trap_exit_and_kill_ports, - monitor_demonitor, - monitor_demonitor_load, - new_interface, - lock_driver - ]. +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[ddll_test, errors, reference_count, kill_port, + dont_kill_port, properties, load_and_unload, + unload_on_process_exit, delayed_unload_with_ports, + unload_due_to_process_exit, + no_unload_due_to_process_exit, + no_unload_due_to_process_exit_2, unload_reload_thingie, + unload_reload_thingie_2, unload_reload_thingie_3, + reload_pending, load_fail_init, + reload_pending_fail_init, reload_pending_kill, + more_error_codes, forced_port_killing, + no_trap_exit_and_kill_ports, monitor_demonitor, + monitor_demonitor_load, new_interface, lock_driver]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + unload_on_process_exit(suite) -> []; diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index d9e961be2f..40bfbc6204 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -21,13 +21,23 @@ -module(decode_packet_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1]). -all(suite) -> - [basic, packet_size, neg, http, line, ssl, otp_8536]. +all() -> +[basic, packet_size, neg, http, line, ssl, otp_8536]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Seed = {S1,S2,S3} = now(), diff --git a/erts/emulator/test/dgawd_handler.erl b/erts/emulator/test/dgawd_handler.erl index 881354b9da..27085b7b7e 100644 --- a/erts/emulator/test/dgawd_handler.erl +++ b/erts/emulator/test/dgawd_handler.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 8213cdcef9..8456bcec0e 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -22,25 +22,23 @@ %% Tests distribution and the tcp driver. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, - ping/1, bulk_send/1, bulk_send_small/1, - bulk_send_big/1, - bulk_send_bigbig/1, - local_send/1, local_send_small/1, local_send_big/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + ping/1, bulk_send_small/1, + bulk_send_big/1, bulk_send_bigbig/1, + local_send_small/1, local_send_big/1, local_send_legal/1, link_to_busy/1, exit_to_busy/1, lost_exit/1, link_to_dead/1, link_to_dead_new_node/1, applied_monitor_node/1, ref_port_roundtrip/1, nil_roundtrip/1, - trap_bif/1, trap_bif_1/1, trap_bif_2/1, trap_bif_3/1, - stop_dist/1, dist_auto_connect/1, + trap_bif_1/1, trap_bif_2/1, trap_bif_3/1, + stop_dist/1, dist_auto_connect_never/1, dist_auto_connect_once/1, dist_parallel_send/1, atom_roundtrip/1, atom_roundtrip_r12b/1, contended_atom_cache_entry/1, bad_dist_structure/1, - bad_dist_ext/1, bad_dist_ext_receive/1, bad_dist_ext_process_info/1, bad_dist_ext_control/1, @@ -55,16 +53,31 @@ dist_evil_parallel_receiver/0, sendersender/4, sendersender2/4]). -all(suite) -> [ - ping, bulk_send, local_send, link_to_busy, exit_to_busy, - lost_exit, link_to_dead, link_to_dead_new_node, - applied_monitor_node, ref_port_roundtrip, nil_roundtrip, - stop_dist, trap_bif, dist_auto_connect, dist_parallel_send, - atom_roundtrip, atom_roundtrip_r12b, - contended_atom_cache_entry, - bad_dist_structure, - bad_dist_ext - ]. +all() -> + [ping, {group, bulk_send}, {group, local_send}, + link_to_busy, exit_to_busy, lost_exit, link_to_dead, + link_to_dead_new_node, applied_monitor_node, + ref_port_roundtrip, nil_roundtrip, stop_dist, + {group, trap_bif}, {group, dist_auto_connect}, + dist_parallel_send, atom_roundtrip, atom_roundtrip_r12b, + contended_atom_cache_entry, bad_dist_structure, {group, bad_dist_ext}]. + +groups() -> + [{bulk_send, [], [bulk_send_small, bulk_send_big, bulk_send_bigbig]}, + {local_send, [], + [local_send_small, local_send_big, local_send_legal]}, + {trap_bif, [], [trap_bif_1, trap_bif_2, trap_bif_3]}, + {dist_auto_connect, [], + [dist_auto_connect_never, dist_auto_connect_once]}, + {bad_dist_ext, [], + [bad_dist_ext_receive, bad_dist_ext_process_info, + bad_dist_ext_control, bad_dist_ext_connection_id]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -define(DEFAULT_TIMETRAP, 4*60*1000). @@ -120,13 +133,6 @@ ping(Config) when is_list(Config) -> ok. -bulk_send(doc) -> - ["Tests sending large amount of data to another node and measure", - "the time. This tests that a process that is suspended on a ", - "busy port will eventually be resumed."]; -bulk_send(suite) -> - [bulk_send_small, bulk_send_big, bulk_send_bigbig]. - bulk_send_small(Config) when is_list(Config) -> ?line bulk_send(64, 32). @@ -257,11 +263,6 @@ receiver(Terms, Size) -> end. -local_send(suite) -> - [local_send_small, local_send_big, local_send_legal]; -local_send(doc) -> - ["Tests sending small and big messages to a non-existing ", - "local registered process."]. local_send_big(doc) -> ["Sends several big message to an non-registered process on ", @@ -755,9 +756,6 @@ stop_dist(Config) when is_list(Config) -> ok. -trap_bif(doc) -> - ["Verifies that BIFs which are traps to Erlang work (OTP-2680)."]; -trap_bif(suite) -> [trap_bif_1, trap_bif_2, trap_bif_3]. trap_bif_1(doc) -> [""]; @@ -794,10 +792,6 @@ tr3() -> -dist_auto_connect(doc) -> - ["Tests the kernel parameter 'dist_auto_connect'."]; -dist_auto_connect(suite) -> - [dist_auto_connect_never, dist_auto_connect_once]. % This has to be done by nodes with differrent cookies, otherwise global % will connect nodes, which is correct, but makes it hard to test. @@ -1440,12 +1434,6 @@ bad_dist_structure(Config) when is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -bad_dist_ext(doc) -> []; -bad_dist_ext(suite) -> - [bad_dist_ext_receive, - bad_dist_ext_process_info, - bad_dist_ext_control, - bad_dist_ext_connection_id]. bad_dist_ext_receive(Config) when is_list(Config) -> diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 39b2ed395f..7f27536ee2 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,12 +27,12 @@ %%% - queueing -module(driver_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, outputv_echo/1, - timer/1, + timer_measure/1, timer_cancel/1, timer_change/1, @@ -51,7 +51,7 @@ 'driver_system_info_ver1.1'/1, driver_system_info_current_ver/1, driver_monitor/1, - ioq_exit/1, + ioq_exit_ready_input/1, ioq_exit_ready_output/1, ioq_exit_timeout/1, @@ -78,7 +78,7 @@ -export([bin_prefix/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % First byte in communication with the timer driver @@ -129,40 +129,37 @@ fin_per_testcase(Case, Config) -> end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). -all(suite) -> - [ - fun_to_port, - outputv_echo, - queue_echo, - timer, - driver_unloaded, - io_ready_exit, - use_fallback_pollset, - bad_fd_in_pollset, - driver_event, - fd_change, - steal_control, - otp_6602, - 'driver_system_info_ver1.0', - 'driver_system_info_ver1.1', - driver_system_info_current_ver, - driver_monitor, - ioq_exit, - zero_extended_marker_garb_drv, - invalid_extended_marker_drv, - larger_major_vsn_drv, - larger_minor_vsn_drv, - smaller_major_vsn_drv, - smaller_minor_vsn_drv, - peek_non_existing_queue, - otp_6879, - caller, - many_events, - missing_callbacks, - smp_select, - driver_select_use, - thread_mseg_alloc_cache_clean - ]. +all() -> +[fun_to_port, outputv_echo, queue_echo, {group, timer}, + driver_unloaded, io_ready_exit, use_fallback_pollset, + bad_fd_in_pollset, driver_event, fd_change, + steal_control, otp_6602, 'driver_system_info_ver1.0', + 'driver_system_info_ver1.1', + driver_system_info_current_ver, driver_monitor, + {group, ioq_exit}, zero_extended_marker_garb_drv, + invalid_extended_marker_drv, larger_major_vsn_drv, + larger_minor_vsn_drv, smaller_major_vsn_drv, + smaller_minor_vsn_drv, peek_non_existing_queue, + otp_6879, caller, many_events, missing_callbacks, + smp_select, driver_select_use, + thread_mseg_alloc_cache_clean]. + +groups() -> + [{timer, [], + [timer_measure, timer_cancel, timer_delay, + timer_change]}, + {ioq_exit, [], + [ioq_exit_ready_input, ioq_exit_ready_output, + ioq_exit_timeout, ioq_exit_ready_async, ioq_exit_event, + ioq_exit_ready_input_async, ioq_exit_ready_output_async, + ioq_exit_timeout_async, ioq_exit_event_async]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + fun_to_port(doc) -> "Test sending a fun to port with an outputv-capable driver."; fun_to_port(Config) when is_list(Config) -> @@ -308,7 +305,6 @@ compare(Got, Expected) -> %% Driver timer test suites %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -timer(suite) -> [timer_measure,timer_cancel,timer_delay,timer_change]. timer_measure(doc) -> ["Check that timers time out in good time."]; timer_measure(Config) when is_list(Config) -> @@ -1299,17 +1295,6 @@ driver_monitor(Config) when is_list(Config) -> ?line stop_driver(Port, Name), ?line ok. -ioq_exit(doc) -> []; -ioq_exit(suite) -> - [ioq_exit_ready_input, - ioq_exit_ready_output, - ioq_exit_timeout, - ioq_exit_ready_async, - ioq_exit_event, - ioq_exit_ready_input_async, - ioq_exit_ready_output_async, - ioq_exit_timeout_async, - ioq_exit_event_async]. -define(IOQ_EXIT_READY_INPUT, 1). -define(IOQ_EXIT_READY_OUTPUT, 2). diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl index 1d66b6ef70..1380f797a4 100644 --- a/erts/emulator/test/efile_SUITE.erl +++ b/erts/emulator/test/efile_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -17,12 +17,23 @@ %% %CopyrightEnd% -module(efile_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([iter_max_files/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[iter_max_files]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [iter_max_files]. %% %% Open as many files as possible. Do this several times and check diff --git a/erts/emulator/test/emulator.spec b/erts/emulator/test/emulator.spec index ed5bd48e84..533252219f 100644 --- a/erts/emulator/test/emulator.spec +++ b/erts/emulator/test/emulator.spec @@ -1 +1 @@ -{topcase, {dir, "../emulator_test"}}. +{suites,"emulator_test",all}. diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl index ea618e9feb..30b32dbcf7 100644 --- a/erts/emulator/test/erl_drv_thread_SUITE.erl +++ b/erts/emulator/test/erl_drv_thread_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,17 +19,26 @@ -module(erl_drv_thread_SUITE). -author('rickard.s.green@ericsson.com'). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic/1, rwlock/1, tsd/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(DEFAULT_TIMETRAP_SECS, 240). -all(doc) -> []; -all(suite) -> - [basic, rwlock, tsd]. +all() -> +[basic, rwlock, tsd]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index 11a7a61586..772c873d0b 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -28,9 +28,9 @@ -author('rickard.green@uab.ericsson.se'). %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). % Test cases -export([links/1, @@ -77,11 +77,21 @@ -all(suite) -> [links, dist_links, monitor_nodes, process_monitors, - dist_process_monitors, busy_dist_port_monitor, - busy_dist_port_link, otp_5772_link, otp_5772_dist_link, - otp_5772_monitor, otp_5772_dist_monitor, - otp_7946]. +all() -> +[links, dist_links, monitor_nodes, process_monitors, + dist_process_monitors, busy_dist_port_monitor, + busy_dist_port_link, otp_5772_link, otp_5772_dist_link, + otp_5772_monitor, otp_5772_dist_monitor, otp_7946]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + links(doc) -> ["Tests node local links"]; links(suite) -> []; diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index 934a1b10a4..741d22f531 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,13 +18,23 @@ %% -module(erts_debug_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, flat_size/1,flat_size_big/1,df/1,instructions/1]). -all(suite) -> - [flat_size,flat_size_big,df,instructions]. +all() -> +[flat_size, flat_size_big, df, instructions]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(2)), diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index 7fb92faf0d..d5e8d78b47 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ -module(estone_SUITE). %% Test functions --export([all/1,estone/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,estone/1]). -export([init_per_testcase/2, fin_per_testcase/2]). %% Internal exports for EStone tests @@ -44,7 +44,7 @@ run_micro/3,p1/1,ppp/3,macro/2,micros/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test suite defines -define(default_timeout, ?t:minutes(10)). @@ -73,7 +73,18 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> [estone]. +all() -> +[estone]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + estone(suite) -> []; diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index a8288584f4..38436c7fb7 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,7 +18,7 @@ -module(evil_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, heap_frag/1, encode_decode_ext/1, decode_integer_ext/1, @@ -30,20 +30,23 @@ decode_pos_neg_zero/1 ]). --include("test_server.hrl"). - -all(suite) -> - [ - heap_frag, - encode_decode_ext, - decode_integer_ext, - decode_small_big_ext, - decode_large_big_ext, - decode_small_big_ext_neg, - decode_large_big_ext_neg, - decode_too_small, - decode_pos_neg_zero - ]. +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[heap_frag, encode_decode_ext, decode_integer_ext, + decode_small_big_ext, decode_large_big_ext, + decode_small_big_ext_neg, decode_large_big_ext_neg, + decode_too_small, decode_pos_neg_zero]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?t:minutes(0.5)), diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl index f1e6e004ad..c501bc95ba 100644 --- a/erts/emulator/test/exception_SUITE.erl +++ b/erts/emulator/test/exception_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,19 +19,29 @@ -module(exception_SUITE). --export([all/1, badmatch/1, pending_errors/1, nil_arith/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, stacktrace/1, nested_stacktrace/1, raise/1, gunilla/1, per/1, exception_with_heap_frag/1]). -export([bad_guy/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -import(lists, [foreach/2]). -all(suite) -> - [badmatch, pending_errors, nil_arith, - stacktrace, nested_stacktrace, raise, gunilla, per, - exception_with_heap_frag]. +all() -> +[badmatch, pending_errors, nil_arith, stacktrace, + nested_stacktrace, raise, gunilla, per, + exception_with_heap_frag]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(try_match(E), catch ?MODULE:bar(), diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl index 99e9457985..3dbc6aa1b5 100644 --- a/erts/emulator/test/float_SUITE.erl +++ b/erts/emulator/test/float_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,9 @@ -module(float_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, fpe/1,fp_drv/1,fp_drv_thread/1,denormalized/1,match/1, bad_float_unpack/1]). -export([otp_7178/1]). @@ -35,14 +35,19 @@ fin_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [fpe, - fp_drv, - fp_drv_thread, - otp_7178, - denormalized, - match, - bad_float_unpack]. +all() -> +[fpe, fp_drv, fp_drv_thread, otp_7178, denormalized, + match, bad_float_unpack]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% %% OTP-7178, list_to_float on very small numbers should give 0.0 diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index a7889dfe90..25d189d906 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -22,7 +22,7 @@ -define(default_timeout, ?t:minutes(1)). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bad_apply/1,bad_fun_call/1,badarity/1,ext_badarity/1, equality/1,ordering/1, fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1, @@ -32,13 +32,23 @@ -export([nothing/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[bad_apply, bad_fun_call, badarity, ext_badarity, + equality, ordering, fun_to_port, t_hash, t_phash, + t_phash2, md5, refc, refc_ets, refc_dist, + const_propagation, t_arity, t_is_function2, t_fun_info]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [bad_apply,bad_fun_call,badarity,ext_badarity,equality,ordering, - fun_to_port,t_hash,t_phash,t_phash2,md5, - refc,refc_ets,refc_dist,const_propagation, - t_arity,t_is_function2,t_fun_info]. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), diff --git a/erts/emulator/test/fun_r12_SUITE.erl b/erts/emulator/test/fun_r12_SUITE.erl index 9262731dcb..bf928329d4 100644 --- a/erts/emulator/test/fun_r12_SUITE.erl +++ b/erts/emulator/test/fun_r12_SUITE.erl @@ -20,12 +20,23 @@ -module(fun_r12_SUITE). -compile(r12). --export([all/1,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). -define(default_timeout, ?t:minutes(1)). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[dist_old_release]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [dist_old_release]. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl index 066aa215b2..1e5c3a67f7 100644 --- a/erts/emulator/test/gc_SUITE.erl +++ b/erts/emulator/test/gc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,15 +21,25 @@ -module(gc_SUITE). --include("test_server.hrl"). --export([all/1]). +-include_lib("test_server/include/test_server.hrl"). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -define(default_timeout, ?t:minutes(10)). -export([grow_heap/1, grow_stack/1, grow_stack_heap/1]). -all(suite) -> - [grow_heap,grow_stack, grow_stack_heap]. +all() -> +[grow_heap, grow_stack, grow_stack_heap]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + grow_heap(doc) -> ["Produce a growing list of elements, ", "for X calls, then drop one item per call", diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl index 8fef36dfaf..81ce24826e 100644 --- a/erts/emulator/test/guard_SUITE.erl +++ b/erts/emulator/test/guard_SUITE.erl @@ -19,16 +19,27 @@ -module(guard_SUITE). --export([all/1, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, type_tests/1,guard_bif_binary_part/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init/3]). -import(lists, [member/2]). -all(suite) -> [bad_arith, bad_tuple, test_heap_guards, guard_bifs, - type_tests, guard_bif_binary_part]. +all() -> +[bad_arith, bad_tuple, test_heap_guards, guard_bifs, + type_tests, guard_bif_binary_part]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + bad_arith(doc) -> "Test that a bad arithmetic operation in a guard works correctly."; bad_arith(Config) when is_list(Config) -> diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl index f5d1871bfb..d5841b9e93 100644 --- a/erts/emulator/test/hash_SUITE.erl +++ b/erts/emulator/test/hash_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -49,7 +49,7 @@ -define(config(A,B),config(A,B)). -export([config/2]). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. -ifdef(debug). @@ -69,7 +69,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/1,test_basic/1,test_cmp/1,test_range/1,test_spread/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, test_phash2/1,otp_5292/1,bit_level_binaries/1,otp_7127/1, fin_per_testcase/2,init_per_testcase/2]). init_per_testcase(_Case, Config) -> @@ -80,11 +80,19 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test erlang:phash"]; -all(suite) -> - [test_basic, test_cmp, test_range, test_spread, test_phash2, otp_5292, - bit_level_binaries, otp_7127]. +all() -> +[test_basic, test_cmp, test_range, test_spread, + test_phash2, otp_5292, bit_level_binaries, otp_7127]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + test_basic(suite) -> []; diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index 4d36076d12..f8c1816998 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,17 +19,28 @@ -module(hibernate_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,min_heap_size/1,bad_args/1, messages_in_queue/1,undefined_mfa/1, no_heap/1]). %% Used by test cases. -export([basic_hibernator/1,messages_in_queue_restart/2, no_heap_loop/0]). -all(suite) -> - [basic,min_heap_size,bad_args,messages_in_queue,undefined_mfa,no_heap]. +all() -> +[basic, min_heap_size, bad_args, messages_in_queue, + undefined_mfa, no_heap]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/ignore_cores.erl b/erts/emulator/test/ignore_cores.erl deleted file mode 120000 index 1d738cbafd..0000000000 --- a/erts/emulator/test/ignore_cores.erl +++ /dev/null @@ -1 +0,0 @@ -../../test/ignore_cores.erl \ No newline at end of file diff --git a/erts/emulator/test/ignore_cores.erl b/erts/emulator/test/ignore_cores.erl new file mode 100644 index 0000000000..8b1ac0fe6c --- /dev/null +++ b/erts/emulator/test/ignore_cores.erl @@ -0,0 +1,158 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------- +%%% File : ignore_cores.erl +%%% Author : Rickard Green +%%% Description : +%%% +%%% Created : 11 Feb 2008 by Rickard Green +%%%------------------------------------------------------------------- + +-module(ignore_cores). + +-include_lib("test_server/include/test_server.hrl"). + +-export([init/1, fini/1, setup/3, setup/4, restore/1, dir/1]). + +-record(ignore_cores, {org_cwd, + org_path, + org_pwd_env, + ign_dir = false, + cores_dir = false}). + +%% +%% Takes a testcase config +%% + +init(Config) -> + {ok, OrgCWD} = file:get_cwd(), + [{ignore_cores, + #ignore_cores{org_cwd = OrgCWD, + org_path = code:get_path(), + org_pwd_env = os:getenv("PWD")}} + | lists:keydelete(ignore_cores, 1, Config)]. + +fini(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD} = ?config(ignore_cores, Config), + ok = file:set_cwd(OrgCWD), + true = code:set_path(OrgPath), + case OrgPWD of + false -> ok; + _ -> true = os:putenv("PWD", OrgPWD) + end, + lists:keydelete(ignore_cores, 1, Config). + +setup(Suite, Testcase, Config) -> + setup(Suite, Testcase, Config, false). + +setup(Suite, Testcase, Config, SetCwd) when is_atom(Suite), + is_atom(Testcase), + is_list(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD} = ?config(ignore_cores, Config), + Path = lists:map(fun (".") -> OrgCWD; (Dir) -> Dir end, OrgPath), + true = code:set_path(Path), + PrivDir = ?config(priv_dir, Config), + IgnDir = filename:join([PrivDir, + atom_to_list(Suite) + ++ "_" + ++ atom_to_list(Testcase) + ++ "_wd"]), + ok = file:make_dir(IgnDir), + case SetCwd of + false -> + ok; + _ -> + ok = file:set_cwd(IgnDir), + OrgPWD = case os:getenv("PWD") of + false -> false; + PWD -> + os:putenv("PWD", IgnDir), + PWD + end + end, + ok = file:write_file(filename:join([IgnDir, "ignore_core_files"]), <<>>), + %% cores are dumped in /cores on MacOS X + CoresDir = case {?t:os_type(), filelib:is_dir("/cores")} of + {{unix,darwin}, true} -> + filelib:fold_files("/cores", + "^core.*$", + false, + fun (C,Cs) -> [C|Cs] end, + []); + _ -> + false + end, + lists:keyreplace(ignore_cores, + 1, + Config, + {ignore_cores, + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD, + ign_dir = IgnDir, + cores_dir = CoresDir}}). + +restore(Config) -> + #ignore_cores{org_cwd = OrgCWD, + org_path = OrgPath, + org_pwd_env = OrgPWD, + ign_dir = IgnDir, + cores_dir = CoresDir} = ?config(ignore_cores, Config), + try + case CoresDir of + false -> + ok; + _ -> + %% Move cores dumped by these testcases in /cores + %% to cwd. + lists:foreach(fun (C) -> + case lists:member(C, CoresDir) of + true -> ok; + _ -> + Dst = filename:join( + [IgnDir, + filename:basename(C)]), + {ok, _} = file:copy(C, Dst), + file:delete(C) + end + end, + filelib:fold_files("/cores", + "^core.*$", + false, + fun (C,Cs) -> [C|Cs] end, + [])) + end + after + catch file:set_cwd(OrgCWD), + catch code:set_path(OrgPath), + case OrgPWD of + false -> ok; + _ -> catch os:putenv("PWD", OrgPWD) + end + end. + + +dir(Config) -> + #ignore_cores{ign_dir = Dir} = ?config(ignore_cores, Config), + Dir. diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 65ea88eb2f..3ecb2e8ba3 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,15 +18,26 @@ %% -module(list_bif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([hd_test/1,tl_test/1,t_length/1,t_list_to_pid/1, t_list_to_float/1,t_list_to_integer/1]). -all(suite) -> - [hd_test,tl_test,t_length,t_list_to_pid,t_list_to_float,t_list_to_integer]. +all() -> +[hd_test, tl_test, t_length, t_list_to_pid, + t_list_to_float, t_list_to_integer]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(test_server:seconds(60)), diff --git a/erts/emulator/test/long_timers_test.erl b/erts/emulator/test/long_timers_test.erl index 28626d26fb..28a4fba9f6 100644 --- a/erts/emulator/test/long_timers_test.erl +++ b/erts/emulator/test/long_timers_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index 69c89f5d2d..6206da7a14 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,7 +19,7 @@ -module(match_spec_SUITE). --export([all/1, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). -export([test_1/1, test_2/1, test_3/1, bad_match_spec_bin/1, trace_control_word/1, silent/1, silent_no_ms/1, ms_trace2/1, ms_trace3/1, boxed_and_small/1, @@ -34,7 +34,7 @@ % This test suite assumes that tracing in general works. What we test is % the match spec functionality. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([init_per_testcase/2, fin_per_testcase/2]). @@ -47,15 +47,26 @@ fin_per_testcase(_Func, Config) -> ?t:timetrap_cancel(Dog). -all(suite) -> - case test_server:is_native(?MODULE) of - false -> [test_1, test_2, test_3, bad_match_spec_bin, - trace_control_word, silent, silent_no_ms, - ms_trace2, ms_trace3, boxed_and_small, - destructive_in_test_bif, guard_exceptions, - unary_plus, unary_minus, fpe, moving_labels]; - true -> [not_run] - end. +all() -> +case test_server:is_native(match_spec_SUITE) of + false -> + [test_1, test_2, test_3, bad_match_spec_bin, + trace_control_word, silent, silent_no_ms, ms_trace2, + ms_trace3, boxed_and_small, destructive_in_test_bif, + guard_exceptions, unary_plus, unary_minus, fpe, + moving_labels]; + true -> [not_run] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped, "Native Code"}. diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index 17e8462cd3..4d87e07937 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -19,9 +19,9 @@ -module(module_info_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, exports/1,functions/1,native/1]). %%-compile(native). @@ -29,11 +29,21 @@ %% Helper. -export([native_proj/1,native_filter/1]). -all(suite) -> - modules(). +all() -> +modules(). -modules() -> - [exports,functions,native]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +modules() -> +[exports, functions, native]. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl index 68e378dfec..3ffa7a4079 100644 --- a/erts/emulator/test/monitor_SUITE.erl +++ b/erts/emulator/test/monitor_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,11 +19,11 @@ -module(monitor_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, case_1/1, case_1a/1, case_2/1, case_2a/1, mon_e_1/1, demon_e_1/1, demon_1/1, - demon_2/1, demon_3/1, demonitor_flush/1, remove_monitor/1, + demon_2/1, demon_3/1, demonitor_flush/1, local_remove_monitor/1, remote_remove_monitor/1, mon_1/1, mon_2/1, large_exit/1, list_cleanup/1, mixer/1, named_down/1, otp_5827/1]). @@ -31,11 +31,22 @@ -export([y2/1, g/1, g0/0, g1/0, large_exit_sub/1]). -all(suite) -> - [case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, demon_1, mon_1, - mon_2, demon_2, demon_3, demonitor_flush, remove_monitor, - large_exit, list_cleanup, mixer, named_down, - otp_5827]. +all() -> +[case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, + demon_1, mon_1, mon_2, demon_2, demon_3, + demonitor_flush, {group, remove_monitor}, large_exit, + list_cleanup, mixer, named_down, otp_5827]. + +groups() -> + [{remove_monitor, [], + [local_remove_monitor, remote_remove_monitor]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(15)), @@ -315,8 +326,6 @@ demonitor_flush_test(Node) -> -define(RM_MON_GROUPS, 100). -define(RM_MON_GPROCS, 100). -remove_monitor(suite) -> - [local_remove_monitor, remote_remove_monitor]. local_remove_monitor(Config) when is_list(Config) -> Gs = generate(fun () -> start_remove_monitor_group(node()) end, diff --git a/erts/emulator/test/mtx_SUITE.erl b/erts/emulator/test/mtx_SUITE.erl index ae77fe4d89..ddeae9103a 100644 --- a/erts/emulator/test/mtx_SUITE.erl +++ b/erts/emulator/test/mtx_SUITE.erl @@ -26,9 +26,11 @@ %%-define(line_trace,true). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). --export([all/1, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0, + init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -export([long_rwlock/1, hammer_ets_rwlock/1, @@ -66,19 +68,14 @@ init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(15)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [ - long_rwlock, - hammer_rwlock_check, - hammer_rwlock, - hammer_tryrwlock_check, - hammer_tryrwlock, - hammer_ets_rwlock, - hammer_sched_long_rwlock_check, +all() -> + [long_rwlock, hammer_rwlock_check, hammer_rwlock, + hammer_tryrwlock_check, hammer_tryrwlock, + hammer_ets_rwlock, hammer_sched_long_rwlock_check, hammer_sched_long_rwlock, hammer_sched_long_freqread_rwlock_check, hammer_sched_long_freqread_rwlock, @@ -86,15 +83,22 @@ all(suite) -> hammer_sched_long_tryrwlock, hammer_sched_long_freqread_tryrwlock_check, hammer_sched_long_freqread_tryrwlock, - hammer_sched_rwlock_check, - hammer_sched_rwlock, + hammer_sched_rwlock_check, hammer_sched_rwlock, hammer_sched_freqread_rwlock_check, hammer_sched_freqread_rwlock, - hammer_sched_tryrwlock_check, - hammer_sched_tryrwlock, + hammer_sched_tryrwlock_check, hammer_sched_tryrwlock, hammer_sched_freqread_tryrwlock_check, - hammer_sched_freqread_tryrwlock - ]. + hammer_sched_freqread_tryrwlock]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + long_rwlock(Config) when is_list(Config) -> statistics(runtime), diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl index 310892424e..f817c18a17 100644 --- a/erts/emulator/test/nested_SUITE.erl +++ b/erts/emulator/test/nested_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,11 +19,23 @@ -module(nested_SUITE). --export([all/1, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[case_in_case, case_in_after, catch_in_catch, + bif_in_bif]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [case_in_case, case_in_after, catch_in_catch, bif_in_bif]. case_in_case(suite) -> []; case_in_case(Config) when is_list(Config) -> diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 42947aa6be..e7f604bde6 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,9 +23,9 @@ -define(CHECK(Exp,Got), check(Exp,Got,?LINE)). %%-define(CHECK(Exp,Got), ?line Exp = Got). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, %%init_per_testcase/2, fin_per_testcase/2, basic/1, reload/1, upgrade/1, heap_frag/1, types/1, many_args/1, binaries/1, get_string/1, get_atom/1, api_macros/1, @@ -48,11 +48,23 @@ -define(nif_stub,nif_stub_error(?LINE)). -all(suite) -> - [basic, reload, upgrade, heap_frag, types, many_args, binaries, get_string, - get_atom, api_macros, from_array, iolist_as_binary, resource, resource_binary, - resource_takeover, threading, send, send2, send3, send_threaded, neg, is_checks, - get_length, make_atom, make_string]. +all() -> +[basic, reload, upgrade, heap_frag, types, many_args, + binaries, get_string, get_atom, api_macros, from_array, + iolist_as_binary, resource, resource_binary, + resource_takeover, threading, send, send2, send3, + send_threaded, neg, is_checks, get_length, make_atom, + make_string]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%init_per_testcase(_Case, Config) -> %% ?line Dog = ?t:timetrap(?t:seconds(60*60*24)), diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index f3d9eb783b..0b3ce6326d 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,10 +29,10 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, node_container_refc_check/1]). -export([term_to_binary_to_term_eq/1, @@ -55,25 +55,22 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). -all(doc) -> []; -all(suite) -> - [term_to_binary_to_term_eq, - round_trip_eq, - cmp, - ref_eq, - node_table_gc, - dist_link_refc, - dist_monitor_refc, - node_controller_refc, - ets_refc, - match_spec_refc, - timer_refc, - otp_4715, - pid_wrap, - port_wrap, - bad_nc, - unique_pid, - iter_max_procs]. +all() -> +[term_to_binary_to_term_eq, round_trip_eq, cmp, ref_eq, + node_table_gc, dist_link_refc, dist_monitor_refc, + node_controller_refc, ets_refc, match_spec_refc, + timer_refc, otp_4715, pid_wrap, port_wrap, bad_nc, + unique_pid, iter_max_procs]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + available_internal_state(Bool) when Bool == true; Bool == false -> case {Bool, diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl index ece55f433c..3ddbc9d3ca 100644 --- a/erts/emulator/test/nofrag_SUITE.erl +++ b/erts/emulator/test/nofrag_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,9 @@ -module(nofrag_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, error_handler/1,error_handler_apply/1, error_handler_fixed_apply/1,error_handler_fun/1, error_handler_tuple_fun/1, @@ -30,9 +30,20 @@ %% Exported functions for an error_handler module. -export([undefined_function/3,undefined_lambda/3,breakpoint/3]). -all(suite) -> - [error_handler,error_handler_apply,error_handler_fixed_apply, - error_handler_fun,error_handler_tuple_fun,debug_breakpoint]. +all() -> +[error_handler, error_handler_apply, + error_handler_fixed_apply, error_handler_fun, + error_handler_tuple_fun, debug_breakpoint]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index d009994e2d..1646ad8261 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,7 +19,7 @@ -module(num_bif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Tests the BIFs: %% abs/1 @@ -31,15 +31,27 @@ %% round/1 %% trunc/1 --export([all/1, t_abs/1, t_float/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, - t_list_to_float/1, t_list_to_float_safe/1, t_list_to_float_risky/1, + t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). -all(suite) -> [t_abs, t_float, t_float_to_list, t_integer_to_list, - t_list_to_float, t_list_to_integer, - t_round, t_trunc]. +all() -> +[t_abs, t_float, t_float_to_list, t_integer_to_list, + {group, t_list_to_float}, t_list_to_integer, t_round, + t_trunc]. + +groups() -> + [{t_list_to_float, [], + [t_list_to_float_safe, t_list_to_float_risky]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + t_abs(Config) when is_list(Config) -> %% Floats. @@ -140,7 +152,6 @@ t_integer_to_list(Config) when is_list(Config) -> %% Tests list_to_float/1. -t_list_to_float(suite) -> [t_list_to_float_safe, t_list_to_float_risky]. t_list_to_float_safe(Config) when is_list(Config) -> ?line 0.0 = list_to_float(id("0.0")), diff --git a/erts/emulator/test/old_mod.erl b/erts/emulator/test/old_mod.erl index 6c47ba6f8f..124842390a 100644 --- a/erts/emulator/test/old_mod.erl +++ b/erts/emulator/test/old_mod.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl index 70348f64db..77cfd39d7f 100644 --- a/erts/emulator/test/old_scheduler_SUITE.erl +++ b/erts/emulator/test/old_scheduler_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,23 +19,33 @@ -module(old_scheduler_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([equal/1, many_low/1, few_low/1, max/1, high/1]). -define(default_timeout, ?t:minutes(11)). -all(suite) -> - case catch erlang:system_info(modified_timing_level) of - Level when is_integer(Level) -> - {skipped, - "Modified timing (level " ++ integer_to_list(Level) - ++ ") is enabled. Testcases gets messed up by modfied " - "timing."}; - _ -> - [equal, many_low, few_low, max, high] - end. +all() -> +case catch erlang:system_info(modified_timing_level) of + Level when is_integer(Level) -> + {skipped, + "Modified timing (level " ++ + integer_to_list(Level) ++ + ") is enabled. Testcases gets messed " + "up by modfied timing."}; + _ -> [equal, many_low, few_low, max, high] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------------------------- %% TEST SUITE DESCRIPTION diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl index 55d8d9ab0f..2a01e42b07 100644 --- a/erts/emulator/test/op_SUITE.erl +++ b/erts/emulator/test/op_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,16 +19,27 @@ -module(op_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bsl_bsr/1,logical/1,t_not/1,relop_simple/1,relop/1,complex_relop/1]). -export([]). -import(lists, [foldl/3,flatmap/2]). -all(suite) -> - [bsl_bsr,logical,t_not,relop_simple,relop,complex_relop]. +all() -> +[bsl_bsr, logical, t_not, relop_simple, relop, + complex_relop]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index 7fe532abd0..125f983b92 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -73,18 +73,18 @@ %% --export([all/1, init_per_testcase/2, fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, init_per_suite/1, end_per_suite/1, - stream/1, stream_small/1, stream_big/1, + stream_small/1, stream_big/1, basic_ping/1, slow_writes/1, bad_packet/1, bad_port_messages/1, - multiple_packets/1, mul_basic/1, mul_slow_writes/1, + mul_basic/1, mul_slow_writes/1, dying_port/1, port_program_with_path/1, open_input_file_port/1, open_output_file_port/1, iter_max_ports/1, eof/1, input_only/1, output_only/1, name1/1, - t_binary/1, options/1, parallell/1, t_exit/1, + t_binary/1, parallell/1, t_exit/1, env/1, bad_env/1, cd/1, exit_status/1, - tps/1, tps_16_bytes/1, tps_1K/1, line/1, stderr_to_stdout/1, + tps_16_bytes/1, tps_1K/1, line/1, stderr_to_stdout/1, otp_3906/1, otp_4389/1, win_massive/1, win_massive_client/1, mix_up_ports/1, otp_5112/1, otp_5119/1, otp_6224/1, exit_status_multi_scheduling_block/1, ports/1, @@ -98,24 +98,33 @@ -export([otp_3906_forker/5, otp_3906_start_forker_starter/4]). -export([env_slave_main/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> - [ - otp_6224, stream, basic_ping, slow_writes, bad_packet, - bad_port_messages, options, multiple_packets, parallell, - dying_port, port_program_with_path, - open_input_file_port, open_output_file_port, - name1, - env, bad_env, cd, exit_status, - iter_max_ports, t_exit, tps, line, stderr_to_stdout, - otp_3906, otp_4389, win_massive, mix_up_ports, - otp_5112, otp_5119, - exit_status_multi_scheduling_block, - ports, spawn_driver, spawn_executable, close_deaf_port, - unregister_name - ]. +all() -> +[otp_6224, {group, stream}, basic_ping, slow_writes, + bad_packet, bad_port_messages, {group, options}, + {group, multiple_packets}, parallell, dying_port, + port_program_with_path, open_input_file_port, + open_output_file_port, name1, env, bad_env, cd, + exit_status, iter_max_ports, t_exit, {group, tps}, line, + stderr_to_stdout, otp_3906, otp_4389, win_massive, + mix_up_ports, otp_5112, otp_5119, + exit_status_multi_scheduling_block, ports, spawn_driver, + spawn_executable, close_deaf_port, unregister_name]. + +groups() -> + [{stream, [], [stream_small, stream_big]}, + {options, [], [t_binary, eof, input_only, output_only]}, + {multiple_packets, [], [mul_basic, mul_slow_writes]}, + {tps, [], [tps_16_bytes, tps_1K]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(DEFAULT_TIMEOUT, ?t:minutes(5)). @@ -191,7 +200,6 @@ win_massive_loop(P,N) -> -stream(suite) -> [stream_small, stream_big]. %% Test that we can send a stream of bytes and get it back. %% We will send only a small amount of data, to avoid deadlock. @@ -304,7 +312,6 @@ bad_message(PortTest, Message) -> %% Tests various options (stream and {packet, Number} are implicitly %% tested in other test cases). -options(suite) -> [t_binary, eof, input_only, output_only]. %% Tests the 'binary' option for a port. @@ -416,7 +423,6 @@ output_and_verify(Config, Filename, Options, Data) -> %% Test that receiving several packages written in the same %% write operation works. -multiple_packets(suite) -> [mul_basic, mul_slow_writes]. %% Basic test of receiving multiple packages, written in %% one operation by the other end. @@ -740,7 +746,6 @@ suicide_port(Config) when is_list(Config) -> ?line exit(Port, die), ?line receive after infinity -> ok end. -tps(suite) -> [tps_16_bytes, tps_1K]. tps_16_bytes(doc) -> ""; tps_16_bytes(suite) -> []; diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl index f4e0bb9fa8..b22f9be3cb 100644 --- a/erts/emulator/test/port_bif_SUITE.erl +++ b/erts/emulator/test/port_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,19 +20,32 @@ -module(port_bif_SUITE). --export([all/1, command/1, command_e/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, command/1, command_e_1/1, command_e_2/1, command_e_3/1, command_e_4/1, - port_info/1, port_info1/1, port_info2/1, + port_info1/1, port_info2/1, connect/1, control/1, echo_to_busy/1]). -export([do_command_e_1/1, do_command_e_2/1, do_command_e_4/1]). -export([init_per_testcase/2, fin_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[command, {group, port_info}, connect, control, + echo_to_busy]. + +groups() -> + [{command_e, [], + [command_e_1, command_e_2, command_e_3, command_e_4]}, + {port_info, [], [port_info1, port_info2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [command, port_info, connect, control, echo_to_busy]. init_per_testcase(_Func, Config) when is_list(Config) -> @@ -69,11 +82,6 @@ do_command(P, Data) -> end. -command_e(suite) -> [command_e_1, - command_e_2, - command_e_3, - command_e_4]; -command_e(doc) -> "Tests port_command/2 with errors". %% port_command/2: badarg 1st arg command_e_1(Config) when is_list(Config) -> @@ -161,7 +169,6 @@ do_command_e_4(Program) -> ?line erlang:port_command(P, Data), exit(survived). -port_info(suite) -> [port_info1, port_info2]. %% Tests the port_info/1 BIF port_info1(Config) when is_list(Config) -> diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index 77f850d0fb..4def835a37 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -25,12 +25,12 @@ %% process_info/1,2 %% register/2 (partially) --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(heap_binary_size, 64). --export([all/1, spawn_with_binaries/1, - t_exit_1/1, t_exit_2/1, t_exit_2_other/1, t_exit_2_other_normal/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, spawn_with_binaries/1, + t_exit_1/1, t_exit_2_other/1, t_exit_2_other_normal/1, self_exit/1, normal_suicide_exit/1, abnormal_suicide_exit/1, t_exit_2_catch/1, trap_exit_badarg/1, trap_exit_badarg_in_bif/1, exit_and_timeout/1, exit_twice/1, @@ -46,8 +46,8 @@ processes_large_tab/1, processes_default_tab/1, processes_small_tab/1, processes_this_tab/1, processes_apply_trap/1, processes_last_call_trap/1, processes_gc_trap/1, - processes_term_proc_list/1, processes_bif/1, - otp_7738/1, otp_7738_waiting/1, otp_7738_suspended/1, + processes_term_proc_list/1, + otp_7738_waiting/1, otp_7738_suspended/1, otp_7738_resume/1]). -export([prio_server/2, prio_client/2]). @@ -56,16 +56,39 @@ -export([hangaround/2, processes_bif_test/0, do_processes/1, processes_term_proc_list_test/1]). -all(suite) -> - [spawn_with_binaries, t_exit_1, t_exit_2, - trap_exit_badarg, trap_exit_badarg_in_bif, - t_process_info, process_info_other_msg, process_info_other_dist_msg, - process_info_2_list, - process_info_lock_reschedule, process_info_lock_reschedule2, - process_status_exiting, - bump_reductions, low_prio, yield, yield2, otp_4725, bad_register, - garbage_collect, process_info_messages, process_flag_badarg, process_flag_heap_size, - spawn_opt_heap_size, otp_6237, processes_bif, otp_7738]. +all() -> +[spawn_with_binaries, t_exit_1, {group, t_exit_2}, + trap_exit_badarg, trap_exit_badarg_in_bif, + t_process_info, process_info_other_msg, + process_info_other_dist_msg, process_info_2_list, + process_info_lock_reschedule, + process_info_lock_reschedule2, process_status_exiting, + bump_reductions, low_prio, yield, yield2, otp_4725, + bad_register, garbage_collect, process_info_messages, + process_flag_badarg, process_flag_heap_size, + spawn_opt_heap_size, otp_6237, {group, processes_bif}, + {group, otp_7738}]. + +groups() -> + [{t_exit_2, [], + [t_exit_2_other, t_exit_2_other_normal, self_exit, + normal_suicide_exit, abnormal_suicide_exit, + t_exit_2_catch, exit_and_timeout, exit_twice]}, + {processes_bif, [], + [processes_large_tab, processes_default_tab, + processes_small_tab, processes_this_tab, + processes_last_call_trap, processes_apply_trap, + processes_gc_trap, processes_term_proc_list]}, + {otp_7738, [], + [otp_7738_waiting, otp_7738_suspended, + otp_7738_resume]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(10)), @@ -117,10 +140,6 @@ t_exit_1() -> {'EXIT', Pid, Garbage} -> ok end. -t_exit_2(suite) -> [t_exit_2_other, t_exit_2_other_normal, - self_exit, normal_suicide_exit, - abnormal_suicide_exit, t_exit_2_catch, - exit_and_timeout, exit_twice]. %% Tests exit/2 with a lot of data in the exit message. t_exit_2_other(Config) when is_list(Config) -> @@ -1227,17 +1246,6 @@ otp_6237_select_loop() -> otp_6237_select_loop(). -processes_bif(doc) -> - []; -processes_bif(suite) -> - [processes_large_tab, - processes_default_tab, - processes_small_tab, - processes_this_tab, - processes_last_call_trap, - processes_apply_trap, - processes_gc_trap, - processes_term_proc_list]. -define(NoTestProcs, 10000). -record(processes_bif_info, {min_start_reds, @@ -1965,10 +1973,6 @@ processes_term_proc_list_test(MustChk) -> ?line erlang:system_flag(multi_scheduling, unblock), ?line as_expected. -otp_7738(doc) -> - []; -otp_7738(suite) -> - [otp_7738_waiting, otp_7738_suspended, otp_7738_resume]. otp_7738_waiting(doc) -> []; diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index 907204cf93..1fc1952278 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,20 @@ -module(pseudoknot_SUITE). --export([all/1,test/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,test/1]). + +all() -> +[test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> [test]. test(Config) when is_list(Config) -> statistics(runtime), diff --git a/erts/emulator/test/random_iolist.erl b/erts/emulator/test/random_iolist.erl index 4bce347d9a..8f21b5a3b3 100644 --- a/erts/emulator/test/random_iolist.erl +++ b/erts/emulator/test/random_iolist.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl index 40ebf2bd21..a64fd8a8c5 100644 --- a/erts/emulator/test/receive_SUITE.erl +++ b/erts/emulator/test/receive_SUITE.erl @@ -21,15 +21,25 @@ %% Tests receive after. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, call_with_huge_message_queue/1,receive_in_between/1]). -export([init_per_testcase/2,fin_per_testcase/2]). -all(suite) -> - [call_with_huge_message_queue,receive_in_between]. +all() -> +[call_with_huge_message_queue, receive_in_between]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl index fa77095efd..79ac5cb860 100644 --- a/erts/emulator/test/ref_SUITE.erl +++ b/erts/emulator/test/ref_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,12 +19,12 @@ -module(ref_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([wrap_1/1]). -export([loop_ref/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_, Config) -> ?line Dog=test_server:timetrap(test_server:minutes(2)), @@ -35,7 +35,18 @@ fin_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> [wrap_1]. +all() -> +[wrap_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + wrap_1(doc) -> "Check that refs don't wrap around easily."; wrap_1(Config) when is_list(Config) -> diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl index c03ee23b2e..781aefea85 100644 --- a/erts/emulator/test/register_SUITE.erl +++ b/erts/emulator/test/register_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,18 +22,27 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([otp_8099/1]). -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -all(doc) -> []; -all(suite) -> - [otp_8099]. +all() -> +[otp_8099]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl index b56c4ad0b0..78ea982419 100644 --- a/erts/emulator/test/save_calls_SUITE.erl +++ b/erts/emulator/test/save_calls_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,16 +19,26 @@ -module(save_calls_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([save_calls_1/1,dont_break_reductions/1]). -export([do_bopp/1, do_bipp/0, do_bepp/0]). -all(suite) -> - [save_calls_1, dont_break_reductions]. +all() -> +[save_calls_1, dont_break_reductions]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + dont_break_reductions(suite) -> []; diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index 06442bfad6..324b08f078 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -30,10 +30,10 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). -export([equal/1, few_low/1, @@ -44,7 +44,7 @@ equal_with_high/1, equal_with_high_max/1, bound_process/1, - scheduler_bind/1, + scheduler_bind_types/1, cpu_topology/1, update_cpu_info/1, @@ -57,20 +57,25 @@ -define(MIN_SCHEDULER_TEST_TIMEOUT, ?t:minutes(1)). -all(doc) -> []; -all(suite) -> - [equal, - few_low, - many_low, - equal_with_part_time_high, - equal_with_part_time_max, - equal_and_high_with_part_time_max, - equal_with_high, - equal_with_high_max, - bound_process, - scheduler_bind, - scheduler_suspend, - reader_groups]. +all() -> +[equal, few_low, many_low, equal_with_part_time_high, + equal_with_part_time_max, + equal_and_high_with_part_time_max, equal_with_high, + equal_with_high_max, bound_process, + {group, scheduler_bind}, scheduler_suspend, + reader_groups]. + +groups() -> + [{scheduler_bind, [], + [scheduler_bind_types, cpu_topology, update_cpu_info, + sct_cmd, sbt_cmd]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), @@ -247,12 +252,6 @@ bound_loop(NS, N, M, Sched) -> Sched = erlang:system_info(scheduler_id), bound_loop(NS, N-1, M, Sched). -scheduler_bind(suite) -> - [scheduler_bind_types, - cpu_topology, - update_cpu_info, - sct_cmd, - sbt_cmd]. -define(TOPOLOGY_A_CMD, "+sct" diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl index 819aa34886..d898646f4b 100644 --- a/erts/emulator/test/send_term_SUITE.erl +++ b/erts/emulator/test/send_term_SUITE.erl @@ -19,12 +19,12 @@ -module(send_term_SUITE). --export([all/1,basic/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,basic/1]). -export([init_per_testcase/2,fin_per_testcase/2]). -export([generate_external_terms_files/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), @@ -34,8 +34,18 @@ fin_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [basic]. +all() -> +[basic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + basic(Config) when is_list(Config) -> Drv = "send_term_drv", diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl index 458275af81..0a8c955361 100644 --- a/erts/emulator/test/sensitive_SUITE.erl +++ b/erts/emulator/test/sensitive_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,9 @@ -module(sensitive_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, stickiness/1,send_trace/1,recv_trace/1,proc_trace/1,call_trace/1, meta_trace/1,running_trace/1,gc_trace/1,seq_trace/1, t_process_info/1,t_process_display/1,save_calls/1]). @@ -38,10 +38,21 @@ fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -all(suite) -> - [stickiness,send_trace,recv_trace,proc_trace,call_trace, - meta_trace,running_trace,gc_trace,seq_trace, - t_process_info,t_process_display,save_calls]. +all() -> +[stickiness, send_trace, recv_trace, proc_trace, + call_trace, meta_trace, running_trace, gc_trace, + seq_trace, t_process_info, t_process_display, + save_calls]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + stickiness(Config) when is_list(Config) -> ?line {Tracer,Mref} = spawn_monitor(fun() -> diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index e9103ca3c1..fa330f8f1c 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,8 +30,8 @@ -define(DEFAULT_TIMEOUT_SECONDS, 120). %-define(line_trace, 1). --include("test_server.hrl"). --export([all/1]). +-include_lib("test_server/include/test_server.hrl"). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). % Test cases -export([xm_sig_order/1, @@ -65,21 +65,26 @@ end_per_suite(_Config) -> erts_debug:set_internal_state(not_running_optimization, true), available_internal_state(false). -all(suite) -> - [xm_sig_order, - pending_exit_unlink_process, - pending_exit_unlink_dist_process, - pending_exit_unlink_port, - pending_exit_trap_exit, - pending_exit_receive, - pending_exit_trap_exit, - pending_exit_gc, - pending_exit_is_process_alive, - pending_exit_process_display, - pending_exit_process_info_1, - pending_exit_process_info_2, - pending_exit_group_leader, - exit_before_pending_exit]. +all() -> +[xm_sig_order, pending_exit_unlink_process, + pending_exit_unlink_dist_process, + pending_exit_unlink_port, pending_exit_trap_exit, + pending_exit_receive, pending_exit_trap_exit, + pending_exit_gc, pending_exit_is_process_alive, + pending_exit_process_display, + pending_exit_process_info_1, + pending_exit_process_info_2, pending_exit_group_leader, + exit_before_pending_exit]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + xm_sig_order(doc) -> ["Test that exit signals and messages are received " "in correct order"]; diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl index 898908c40f..bbe659547b 100644 --- a/erts/emulator/test/statistics_SUITE.erl +++ b/erts/emulator/test/statistics_SUITE.erl @@ -21,13 +21,13 @@ %% Tests the statistics/1 bif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, - wall_clock/1, wall_clock_zero_diff/1, wall_clock_update/1, - runtime/1, runtime_zero_diff/1, + wall_clock_zero_diff/1, wall_clock_update/1, + runtime_zero_diff/1, runtime_update/1, runtime_diff/1, - run_queue/1, run_queue_one/1, + run_queue_one/1, reductions/1, reductions_big/1, garbage_collection/1, io/1, badarg/1]). @@ -35,7 +35,7 @@ -export([hog/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_, Config) -> ?line Dog = test_server:timetrap(test_server:seconds(300)), @@ -46,13 +46,28 @@ fin_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> [wall_clock, runtime, reductions, reductions_big, run_queue, - garbage_collection, io, badarg]. +all() -> +[{group, wall_clock}, {group, runtime}, reductions, + reductions_big, {group, run_queue}, garbage_collection, + io, badarg]. + +groups() -> + [{wall_clock, [], + [wall_clock_zero_diff, wall_clock_update]}, + {runtime, [], + [runtime_zero_diff, runtime_update, runtime_diff]}, + {run_queue, [], [run_queue_one]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%% Testing statistics(wall_clock). -wall_clock(suite) -> [wall_clock_zero_diff, wall_clock_update]. wall_clock_zero_diff(doc) -> @@ -99,7 +114,6 @@ wall_clock_update1(0) -> %%% Test statistics(runtime). -runtime(suite) -> [runtime_zero_diff, runtime_update, runtime_diff]. runtime_zero_diff(doc) -> "Tests that the difference between the times returned from two consectuitive " @@ -225,7 +239,6 @@ reductions_big_loop() -> %%% Tests of statistics(run_queue). -run_queue(suite) -> [run_queue_one]. run_queue_one(doc) -> "Tests that statistics(run_queue) returns 1 if we start a " diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index cd940f3ddf..9cbc46659c 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -30,17 +30,28 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1, wordsize/1]). -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -all(doc) -> []; -all(suite) -> [process_count, system_version, misc_smoke_tests, heap_size, wordsize]. +all() -> +[process_count, system_version, misc_smoke_tests, + heap_size, wordsize]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl index 7b0d6d19fe..d5d15c91eb 100644 --- a/erts/emulator/test/system_profile_SUITE.erl +++ b/erts/emulator/test/system_profile_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,7 +22,7 @@ -module(system_profile_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, system_profile_on_and_off/1, runnable_procs/1, runnable_ports/1, @@ -33,7 +33,7 @@ -export([profiler_process/1, ring_loop/1, port_echo_start/0, list_load/0, run_load/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -45,12 +45,19 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - %% Test specification on test suite level - [system_profile_on_and_off, - runnable_procs, - runnable_ports, - scheduler]. +all() -> +[system_profile_on_and_off, runnable_procs, + runnable_ports, scheduler]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% No specification clause needed for an init function in a conf case!!! diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl index 095e9dd1af..636abd288e 100644 --- a/erts/emulator/test/time_SUITE.erl +++ b/erts/emulator/test/time_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,14 +29,14 @@ %% now/0 %% --export([all/1, univ_to_local/1, local_to_univ/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, bad_univ_to_local/1, bad_local_to_univ/1, consistency/1, - now/1, now_unique/1, now_update/1, timestamp/1]). + now_unique/1, now_update/1, timestamp/1]). -export([local_to_univ_utc/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([linear_time/1]). @@ -54,10 +54,20 @@ -define(dst_timezone, 2). -all(suite) -> [univ_to_local, local_to_univ, - local_to_univ_utc, - bad_univ_to_local, bad_local_to_univ, - consistency, now, timestamp]. +all() -> +[univ_to_local, local_to_univ, local_to_univ_utc, + bad_univ_to_local, bad_local_to_univ, consistency, + {group, now}, timestamp]. + +groups() -> + [{now, [], [now_unique, now_update]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + local_to_univ_utc(suite) -> []; @@ -283,7 +293,6 @@ repeating_timestamp_check(N) -> %% Test now/0. -now(suite) -> [now_unique, now_update]. %% Tests that successive calls to now/0 returns different values. %% Also returns a comment string with the median difference between diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index 9ac5afcc45..157311d381 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,7 +19,7 @@ -module(timer_bif_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). -export([start_timer_1/1, send_after_1/1, send_after_2/1, send_after_3/1, cancel_timer_1/1, start_timer_big/1, send_after_big/1, @@ -27,7 +27,7 @@ read_timer_trivial/1, read_timer/1, cleanup/1, evil_timers/1, registered_process/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:seconds(30)), @@ -45,11 +45,22 @@ fin_per_testcase(_Case, Config) -> end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). -all(suite) -> - [start_timer_1, send_after_1, send_after_2, cancel_timer_1, - start_timer_e, send_after_e, cancel_timer_e, - start_timer_big, send_after_big, read_timer_trivial, read_timer, - cleanup, evil_timers, registered_process]. +all() -> +[start_timer_1, send_after_1, send_after_2, + cancel_timer_1, start_timer_e, send_after_e, + cancel_timer_e, start_timer_big, send_after_big, + read_timer_trivial, read_timer, cleanup, evil_timers, + registered_process]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + start_timer_1(doc) -> ["Basic start_timer/3 functionality"]; start_timer_1(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl index e9713fcf0f..1d453a3639 100644 --- a/erts/emulator/test/trace_SUITE.erl +++ b/erts/emulator/test/trace_SUITE.erl @@ -23,7 +23,7 @@ %%% Tests the trace BIF. %%% --export([all/1, receive_trace/1, self_send/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, timeout_trace/1, send_trace/1, procs_trace/1, dist_procs_trace/1, suspend/1, mutual_suspend/1, suspend_exit/1, suspender_exit/1, @@ -35,22 +35,31 @@ system_monitor_large_heap_1/1, system_monitor_large_heap_2/1, bad_flag/1, trace_delivered/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%% Internal exports -export([process/1]). -all(suite) -> - [cpu_timestamp, receive_trace, self_send, timeout_trace, send_trace, - procs_trace, dist_procs_trace, - suspend, mutual_suspend, suspend_exit, suspender_exit, - suspend_system_limit, suspend_opts, suspend_waiting, - new_clear, existing_clear, - set_on_spawn, set_on_first_spawn, - system_monitor_args, more_system_monitor_args, - system_monitor_long_gc_1, system_monitor_long_gc_2, - system_monitor_large_heap_1, system_monitor_large_heap_2, - bad_flag, trace_delivered]. +all() -> +[cpu_timestamp, receive_trace, self_send, timeout_trace, + send_trace, procs_trace, dist_procs_trace, suspend, + mutual_suspend, suspend_exit, suspender_exit, + suspend_system_limit, suspend_opts, suspend_waiting, + new_clear, existing_clear, set_on_spawn, + set_on_first_spawn, system_monitor_args, + more_system_monitor_args, system_monitor_long_gc_1, + system_monitor_long_gc_2, system_monitor_large_heap_1, + system_monitor_large_heap_2, bad_flag, trace_delivered]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% No longer testing anything, just reporting whether cpu_timestamp diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl index 3f91f8dc08..e2d9589b3b 100644 --- a/erts/emulator/test/trace_bif_SUITE.erl +++ b/erts/emulator/test/trace_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,23 +19,33 @@ -module(trace_bif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([trace_bif/1, trace_bif_timestamp/1, trace_on_and_off/1, trace_bif_local/1, trace_bif_timestamp_local/1, trace_bif_return/1, not_run/1, trace_info_old_code/1]). -export([bif_process/0]). -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> - [trace_bif, trace_bif_timestamp, trace_on_and_off, - trace_bif_local, trace_bif_timestamp_local, - trace_bif_return, trace_info_old_code] - end. +all() -> +case test_server:is_native(trace_bif_SUITE) of + true -> [not_run]; + false -> + [trace_bif, trace_bif_timestamp, trace_on_and_off, + trace_bif_local, trace_bif_timestamp_local, + trace_bif_return, trace_info_old_code] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl index 07aa7c8d8d..d3355a5364 100644 --- a/erts/emulator/test/trace_call_count_SUITE.erl +++ b/erts/emulator/test/trace_call_count_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -42,7 +42,7 @@ -define(config(A,B),config(A,B)). -export([config/2]). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. -ifdef(debug). @@ -62,7 +62,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/1, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, combo/1]). @@ -78,14 +78,22 @@ fin_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test call count tracing of local function calls."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> [basic, on_and_off, info, - pause_and_restart, combo] - end. +all() -> +case test_server:is_native(trace_call_count_SUITE) of + true -> [not_run]; + false -> + [basic, on_and_off, info, pause_and_restart, combo] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 7bc91addde..3b2e619123 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -57,10 +57,10 @@ %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% When run in test server. --export([all/1, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, scheduling/1, called_function/1, combo/1, bif/1, nif/1]). @@ -79,14 +79,23 @@ fin_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test call count tracing of local function calls."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> [basic, on_and_off, info, - pause_and_restart, scheduling, combo, bif, nif, called_function] - end. +all() -> +case test_server:is_native(trace_call_time_SUITE) of + true -> [not_run]; + false -> + [basic, on_and_off, info, pause_and_restart, scheduling, + combo, bif, nif, called_function] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index 24005774ba..a417ca7769 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -45,7 +45,7 @@ -export([config/2]). -define(DEFAULT_RECEIVE_TIMEOUT, 1000). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(DEFAULT_RECEIVE_TIMEOUT, infinity). -endif. @@ -68,7 +68,7 @@ config(priv_dir,_) -> %%% When run in test server %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/1, basic/1, bit_syntax/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, return/1, on_and_off/1, stack_grow/1,info/1, delete/1, exception/1, exception_apply/1, exception_function/1, exception_apply_function/1, @@ -89,23 +89,32 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test tracing of local function calls and return traces."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> [basic, bit_syntax, return, on_and_off, stack_grow, info, delete, - exception, exception_apply, - exception_function, exception_apply_function, - exception_nocatch, exception_nocatch_apply, - exception_nocatch_function, - exception_nocatch_apply_function, - exception_meta, exception_meta_apply, - exception_meta_function, exception_meta_apply_function, - exception_meta_nocatch, exception_meta_nocatch_apply, - exception_meta_nocatch_function, - exception_meta_nocatch_apply_function] - end. +all() -> +case test_server:is_native(trace_local_SUITE) of + true -> [not_run]; + false -> + [basic, bit_syntax, return, on_and_off, stack_grow, + info, delete, exception, exception_apply, + exception_function, exception_apply_function, + exception_nocatch, exception_nocatch_apply, + exception_nocatch_function, + exception_nocatch_apply_function, exception_meta, + exception_meta_apply, exception_meta_function, + exception_meta_apply_function, exception_meta_nocatch, + exception_meta_nocatch_apply, + exception_meta_nocatch_function, + exception_meta_nocatch_apply_function] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index d84cb3cdf2..195696ca49 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -45,7 +45,7 @@ -define(config(A,B),config(A,B)). -export([config/2]). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -endif. -ifdef(debug). @@ -65,7 +65,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/1, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, return/1, on_and_off/1, stack_grow/1, info/1, tracer/1, combo/1, nosilent/1]). @@ -78,14 +78,23 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -all(doc) -> - ["Test meta tracing of local function calls and return trace."]; -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> [basic, return, on_and_off, stack_grow, - info, tracer, combo, nosilent] - end. +all() -> +case test_server:is_native(trace_meta_SUITE) of + true -> [not_run]; + false -> + [basic, return, on_and_off, stack_grow, info, tracer, + combo, nosilent] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 587cc08979..6a989fe295 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -19,9 +19,9 @@ -module(trace_nif_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([trace_nif/1, trace_nif_timestamp/1, trace_nif_local/1, @@ -32,18 +32,24 @@ -export([nif_process/0, nif/0, nif/1]). -all(suite) -> - case test_server:is_native(?MODULE) of - true -> [not_run]; - false -> - [trace_nif, - trace_nif_timestamp, - trace_nif_local, - trace_nif_meta, - trace_nif_timestamp_local, - trace_nif_return - ] - end. +all() -> +case test_server:is_native(trace_nif_SUITE) of + true -> [not_run]; + false -> + [trace_nif, trace_nif_timestamp, trace_nif_local, + trace_nif_meta, trace_nif_timestamp_local, + trace_nif_return] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + not_run(Config) when is_list(Config) -> {skipped,"Native code"}. diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl index 5febe177f9..114f62ccfe 100644 --- a/erts/emulator/test/trace_port_SUITE.erl +++ b/erts/emulator/test/trace_port_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,7 +20,7 @@ -module(trace_port_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, call_trace/1, return_trace/1, send/1, @@ -34,23 +34,28 @@ gc/1, default_tracer/1]). --include("test_server.hrl"). - -test_cases() -> - [call_trace, - return_trace, - send, - receive_trace, - process_events, - schedule, - fake_schedule, - fake_schedule_after_register, - fake_schedule_after_getting_linked, - fake_schedule_after_getting_unlinked, - gc, - default_tracer]. - -all(suite) -> test_cases(). +-include_lib("test_server/include/test_server.hrl"). + +test_cases() -> +[call_trace, return_trace, send, receive_trace, + process_events, schedule, fake_schedule, + fake_schedule_after_register, + fake_schedule_after_getting_linked, + fake_schedule_after_getting_unlinked, gc, + default_tracer]. + +all() -> +test_cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:seconds(30)), diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index c4edb16d68..ac1d94774a 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -17,11 +17,11 @@ %% %CopyrightEnd% %% -module(tuple_SUITE). --export([all/1, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, t_list_to_tuple/1, t_tuple_to_list/1, t_make_tuple_2/1, t_make_tuple_3/1, t_append_element/1, build_and_match/1, tuple_with_case/1, tuple_in_guard/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Tests tuples and the BIFs: %% @@ -33,12 +33,21 @@ %% make_tuple/2 %% -all(suite) -> - [build_and_match, t_size, t_tuple_size, - t_list_to_tuple, t_tuple_to_list, - t_element, t_setelement, t_make_tuple_2, - t_make_tuple_3, t_append_element, - tuple_with_case, tuple_in_guard]. +all() -> +[build_and_match, t_size, t_tuple_size, t_list_to_tuple, + t_tuple_to_list, t_element, t_setelement, + t_make_tuple_2, t_make_tuple_3, t_append_element, + tuple_with_case, tuple_in_guard]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + build_and_match(Config) when is_list(Config) -> ?line {} = id({}), diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl index 67d2b288a2..6dc2a962db 100644 --- a/erts/emulator/test/z_SUITE.erl +++ b/erts/emulator/test/z_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -29,10 +29,10 @@ %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([schedulers_alive/1, node_container_refc_check/1, long_timers/1, pollset_size/1, @@ -40,13 +40,19 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). -all(doc) -> []; -all(suite) -> - [schedulers_alive, - node_container_refc_check, - long_timers, - pollset_size, - check_io_debug]. +all() -> +[schedulers_alive, node_container_refc_check, + long_timers, pollset_size, check_io_debug]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), -- cgit v1.2.3 From cbd5fd9daadf1f46c718774732a65cf830b64f94 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:50:23 +0200 Subject: Update epmd tests to conform with common_test standard --- erts/epmd/test/epmd.spec | 2 +- erts/epmd/test/epmd_SUITE.erl | 67 +++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/erts/epmd/test/epmd.spec b/erts/epmd/test/epmd.spec index 0e2496bc72..d77bc4afb9 100644 --- a/erts/epmd/test/epmd.spec +++ b/erts/epmd/test/epmd.spec @@ -1 +1 @@ -{topcase, {dir, "../epmd_test"}}. +{suites,"epmd_test",all}. diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index da69412e12..e45d574ac0 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(epmd_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). @@ -35,7 +35,7 @@ -record(node_info, {port, node_type, prot, lvsn, hvsn, node_name, extra}). % Test server specific exports --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export( [ @@ -64,7 +64,7 @@ returns_valid_empty_extra/1, returns_valid_populated_extra_with_nulls/1, - buffer_overrun/1, + buffer_overrun_1/1, buffer_overrun_2/1, no_nonlocal_register/1, @@ -101,42 +101,29 @@ %% all/1 %% -all(suite) -> - [ - register_name, - register_names_1, - register_names_2, - register_duplicate_name, - get_port_nr, - slow_get_port_nr, - unregister_others_name_1, - unregister_others_name_2, - register_overflow, - name_with_null_inside, - name_null_terminated, - stupid_names_req, - - no_data, - one_byte, - two_bytes, - partial_packet, - zero_length, - too_large, - alive_req_too_small_1, - alive_req_too_small_2, - alive_req_too_large, - - returns_valid_empty_extra, - returns_valid_populated_extra_with_nulls, - - buffer_overrun, - %buffer_overrun_1, - %buffer_overrun_2, - - no_nonlocal_register, - no_nonlocal_kill, - no_live_killing - ]. +all() -> +[register_name, register_names_1, register_names_2, + register_duplicate_name, get_port_nr, slow_get_port_nr, + unregister_others_name_1, unregister_others_name_2, + register_overflow, name_with_null_inside, + name_null_terminated, stupid_names_req, no_data, + one_byte, two_bytes, partial_packet, zero_length, + too_large, alive_req_too_small_1, alive_req_too_small_2, + alive_req_too_large, returns_valid_empty_extra, + returns_valid_populated_extra_with_nulls, + {group, buffer_overrun}, no_nonlocal_register, + no_nonlocal_kill, no_live_killing]. + +groups() -> + [{buffer_overrun, [], + [buffer_overrun_1, buffer_overrun_2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% %% Run before and after each test case @@ -725,8 +712,6 @@ returns_valid_populated_extra_with_nulls(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -buffer_overrun(suite) -> - [buffer_overrun_1,buffer_overrun_2]. buffer_overrun_1(suite) -> []; -- cgit v1.2.3 From afda520a493cfc6dda951d0881d28190f564ec08 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:51:22 +0200 Subject: Update system tests to conform with common_test standard --- erts/test/autoimport_SUITE.erl | 15 ++++++++++++-- erts/test/erl_print_SUITE.erl | 27 ++++++++++++++----------- erts/test/erlc_SUITE.erl | 14 +++++++++++-- erts/test/erlexec_SUITE.erl | 17 +++++++++++----- erts/test/ethread_SUITE.erl | 34 +++++++++++++++---------------- erts/test/install_SUITE.erl | 45 ++++++++++++++++++++++-------------------- erts/test/nt_SUITE.erl | 28 +++++++++++++++++--------- erts/test/otp_SUITE.erl | 20 ++++++++++++++----- erts/test/run_erl_SUITE.erl | 16 ++++++++++++--- erts/test/system.spec | 2 +- erts/test/z_SUITE.erl | 19 +++++++++++++----- 11 files changed, 155 insertions(+), 82 deletions(-) diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl index 2430dac78d..cd37ef1374 100644 --- a/erts/test/autoimport_SUITE.erl +++ b/erts/test/autoimport_SUITE.erl @@ -20,10 +20,21 @@ -module(autoimport_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). -define(TEST_TIMEOUT, ?t:seconds(180)). -all(suite) -> [autoimports]. +all() -> +[autoimports]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(?TEST_TIMEOUT), diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl index 3bb7d4d016..5fd2bb5790 100644 --- a/erts/test/erl_print_SUITE.erl +++ b/erts/test/erl_print_SUITE.erl @@ -32,14 +32,24 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([erlang_display/1, integer/1, float/1, string/1, character/1, snprintf/1, quote/1]). -include_lib("test_server/include/test_server.hrl"). -all(doc) -> []; -all(suite) -> test_cases(). +all() -> +test_cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% %% @@ -47,14 +57,9 @@ all(suite) -> test_cases(). %% %% -test_cases() -> - [erlang_display, - integer, - float, - string, - character, - snprintf, - quote]. +test_cases() -> +[erlang_display, integer, float, string, character, + snprintf, quote]. erlang_display(doc) -> []; erlang_display(suite) -> []; diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index 4797f78be2..efa9c84208 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -20,15 +20,25 @@ %% Tests the erlc command by compiling various types of files. --export([all/1, compile_erl/1, compile_yecc/1, compile_script/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, compile_erl/1, + compile_yecc/1, compile_script/1, compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]). -include_lib("test_server/include/test_server.hrl"). -all(suite) -> +all() -> [compile_erl, compile_yecc, compile_script, compile_mib, good_citizen, deep_cwd, arg_overflow]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Copy from erlc_SUITE_data/include/erl_test.hrl. -record(person, {name, shoe_size}). diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl index 6adb865f6d..255caca4df 100644 --- a/erts/test/erlexec_SUITE.erl +++ b/erts/test/erlexec_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(1)). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([args_file/1, evil_args_file/1, env/1, args_file_env/1, otp_7461/1, otp_7461_remote/1, otp_8209/1, zdbbl_dist_buf_busy_limit/1]). @@ -51,11 +51,18 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(doc) -> []; -all(suite) -> - [args_file, evil_args_file, env, args_file_env, otp_7461, otp_8209, - zdbbl_dist_buf_busy_limit]. +all() -> + [args_file, evil_args_file, env, args_file_env, + otp_7461, otp_8209, zdbbl_dist_buf_busy_limit]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. otp_8209(doc) -> ["Test that plain first argument does not " diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl index 69e5af802f..5e6d677c66 100644 --- a/erts/test/ethread_SUITE.erl +++ b/erts/test/ethread_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([create_join_thread/1, equal_tids/1, @@ -49,24 +49,22 @@ -include_lib("test_server/include/test_server.hrl"). -tests() -> - [create_join_thread, - equal_tids, - mutex, - try_lock_mutex, - cond_wait, - broadcast, - detached_thread, - max_threads, - tsd, - spinlock, - rwspinlock, - rwmutex, - atomic]. - -all(doc) -> []; -all(suite) -> tests(). +tests() -> +[create_join_thread, equal_tids, mutex, try_lock_mutex, + cond_wait, broadcast, detached_thread, + max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic]. +all() -> +tests(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %% %% diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl index e14790bc1b..84892384aa 100644 --- a/erts/test/install_SUITE.erl +++ b/erts/test/install_SUITE.erl @@ -29,7 +29,7 @@ %-define(line_trace, 1). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2]). -export([bin_default/1, @@ -64,26 +64,29 @@ erlang_bindir = "", bindir_symlinks = ""}). -need_symlink_cases() -> - [bin_unreachable_absolute, - bin_unreachable_relative, - bin_same_dir, - bin_ok_symlink, - bin_dirname_fail, - bin_no_use_dirname_fail]. - -dont_need_symlink_cases() -> - [bin_default, - bin_default_dirty, - bin_outside_eprfx, - bin_outside_eprfx_dirty, - bin_not_abs, - bin_unreasonable_path, - 'bin white space', - bin_no_srcfile]. - -all(suite) -> - dont_need_symlink_cases() ++ need_symlink_cases(). +need_symlink_cases() -> +[bin_unreachable_absolute, bin_unreachable_relative, + bin_same_dir, bin_ok_symlink, bin_dirname_fail, + bin_no_use_dirname_fail]. + +dont_need_symlink_cases() -> +[bin_default, bin_default_dirty, bin_outside_eprfx, + bin_outside_eprfx_dirty, bin_not_abs, + bin_unreasonable_path, 'bin white space', + bin_no_srcfile]. + +all() -> +dont_need_symlink_cases() ++ need_symlink_cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% %% The test cases diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl index 530fb55270..981a1c55f4 100644 --- a/erts/test/nt_SUITE.erl +++ b/erts/test/nt_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/1,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, middleman/1,service_basic/1, service_env/1, user_env/1, synced/1, service_prio/1, logout/1, debug/1, restart/1, restart_always/1,stopaction/1, @@ -31,14 +31,24 @@ -define(TEST_SERVICES, [1,2,3,4,5,6,7,8,9,10,11]). -all(suite) -> - case os:type() of - {win32,nt} -> - [nt, service_basic, service_env, user_env, synced, service_prio, - logout, debug, - restart, restart_always, stopaction]; - _ -> [nt] %%% Just to give a little hint why they are skipped... - end. +all() -> +case os:type() of + {win32, nt} -> + [nt, service_basic, service_env, user_env, synced, + service_prio, logout, debug, restart, restart_always, + stopaction]; + _ -> [nt] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(?TEST_TIMEOUT), diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index 425ad31782..15c56fd6ea 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -19,7 +19,7 @@ -module(otp_SUITE). --export([all/1,init_per_suite/1,end_per_suite/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1]). -export([undefined_functions/1,deprecated_not_in_obsolete/1, obsolete_but_not_deprecated/1,call_to_deprecated/1, call_to_size_1/1,strong_components/1]). @@ -28,10 +28,20 @@ -import(lists, [filter/2,foldl/3,foreach/2]). -all(suite) -> - [undefined_functions,deprecated_not_in_obsolete, - obsolete_but_not_deprecated,call_to_deprecated, - call_to_size_1,strong_components]. +all() -> +[undefined_functions, deprecated_not_in_obsolete, + obsolete_but_not_deprecated, call_to_deprecated, + call_to_size_1, strong_components]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) -> Dog = test_server:timetrap(?t:minutes(10)), diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index efeafbad8c..e4efd3075d 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -19,7 +19,7 @@ -module(run_erl_SUITE). --export([all/1,init_per_testcase/2,fin_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,heavy/1,heavier/1,defunct/1]). -export([ping_me_back/1]). @@ -34,8 +34,18 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [basic,heavy,heavier,defunct]. +all() -> +[basic, heavy, heavier, defunct]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + basic(Config) when is_list(Config) -> case os:type() of diff --git a/erts/test/system.spec b/erts/test/system.spec index 9bfe2dbcf8..7da3cfc64a 100644 --- a/erts/test/system.spec +++ b/erts/test/system.spec @@ -1 +1 @@ -{topcase, {dir, "../system_test"}}. +{suites,"system_test",all}. diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index 9f13a7083d..8126acb18d 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -35,11 +35,11 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). --export([all/1, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([search_for_core_files/1, core_files/1]). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). init_per_testcase(Case, Config) -> @@ -51,9 +51,18 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(doc) -> []; -all(suite) -> - [core_files]. +all() -> +[core_files]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + core_files(doc) -> -- cgit v1.2.3 From a7cf522a129b3d707141bb681fc5c074bdca5e69 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:51:46 +0200 Subject: Update common_test tests to conform with common_test standard --- lib/asn1/test/asn1_SUITE.erl | 2479 ++++++++++++++++++++ lib/asn1/test/asn1_bin_SUITE.erl | 2374 +++++++++++++++++++ lib/asn1/test/asn1_bin_v2_SUITE.erl | 2467 +++++++++++++++++++ lib/common_test/test/ct_config_SUITE.erl | 29 +- lib/common_test/test/ct_error_SUITE.erl | 25 +- lib/common_test/test/ct_event_handler_SUITE.erl | 17 +- lib/common_test/test/ct_groups_test_1_SUITE.erl | 19 +- lib/common_test/test/ct_groups_test_2_SUITE.erl | 17 +- lib/common_test/test/ct_master_SUITE.erl | 20 +- lib/common_test/test/ct_misc_1_SUITE.erl | 18 +- lib/common_test/test/ct_repeat_1_SUITE.erl | 36 +- lib/common_test/test/ct_sequence_1_SUITE.erl | 23 +- lib/common_test/test/ct_skip_SUITE.erl | 20 +- lib/common_test/test/ct_smoke_test_SUITE.erl | 20 +- lib/common_test/test/ct_test_server_if_1_SUITE.erl | 19 +- lib/common_test/test/ct_testspec_1_SUITE.erl | 40 +- lib/cosTime/test/time_SUITE.erl | 2 +- lib/public_key/test/pkits_SUITE.erl | 4 +- lib/public_key/test/public_key_SUITE.erl | 2 +- 19 files changed, 7503 insertions(+), 128 deletions(-) create mode 100644 lib/asn1/test/asn1_SUITE.erl create mode 100644 lib/asn1/test/asn1_bin_SUITE.erl create mode 100644 lib/asn1/test/asn1_bin_v2_SUITE.erl diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl new file mode 100644 index 0000000000..1f4e532e91 --- /dev/null +++ b/lib/asn1/test/asn1_SUITE.erl @@ -0,0 +1,2479 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%% Purpose : Test suite for the ASN.1 application + +-module(asn1_SUITE). +-define(PER,'per'). +-define(BER,'ber'). +-define(ber_driver(Erule,Func), + case Erule of + ber_bin_v2 -> + Func; + _ -> ok + end). +-define(per_optimize(Erule), + case Erule of + ber_bin_v2 ->[optimize]; + _ -> [] + end). +-define(per_bit_opt(FuncCall), + case ?BER of + ber_bin_v2 -> FuncCall; +% _ -> {skip,"only for bit optimized per_bin"} + _ -> ok + end). +-define(uper_bin(FuncCall), + case ?PER of + per -> FuncCall; + _ -> ok + end). + +-compile(export_all). +%%-export([Function/Arity, ...]). + +-include_lib("test_server/include/test_server.hrl"). + +%% records used by test-case default +-record('Def1',{ +bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). + +%-record('Def2',{ +%bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}). + +%-record('Def3',{ +%bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}). + + + +all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, + ber,testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, + testChoTypeRefSet, testDef, testOpt, testSeqDefault, + testSeqExtension, testSeqExternal, testSeqOptional, + testSeqPrim, testSeqTag, testSeqTypeRefCho, + testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, + testSeqOf, testSeqOfIndefinite, testSeqOfCho, + testSeqOfExternal, testSetDefault, testSetExtension, + testExtensionAdditionGroup, + testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, + testSetTag, testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, + testSetOfExternal, testSetOfTag, testEnumExt, value_test, + testSeq2738, constructed, ber_decode_error, + h323test, testSeqIndefinite, testSetIndefinite, + testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, + testInvokeMod, testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, + testINSTANCE_OF,testTCAP,testDER,specialized_decodes, + special_decode_performance,test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel,test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options,testDoubleEllipses, test_modified_x420, + testX420, test_x691,ticket_6143, testExtensionAdditionGroup + ] ++ common() ++ particular(). + +%all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. + +option_tests(suite) -> + [test_compile_options,ticket_6143]. + +infobj(suite) -> + [testInfObjectClass, testParameterizedInfObj, testMergeCompile, + testobj, testDeepTConstr]. + +performance(suite) -> + [testTimer_ber, testTimer_ber_opt_driver, + testTimer_per, testTimer_per_opt, testTimer_uper_bin]. + +bugs(suite) -> + [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. + +init_per_testcase(Func,Config) -> + %%?line test_server:format("Func: ~p~n",[Func]), + ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), + ?line code:add_patha(?config(priv_dir,Config)), + Dog= + case Func of + testX420 -> + test_server:timetrap({minutes,60}); % 60 minutes + _ -> + test_server:timetrap({minutes,30}) % 60 minutes + end, +%% Dog=test_server:timetrap(1800000), % 30 minutes + [{watchdog, Dog}|Config]. + +end_per_testcase(_Func,Config) -> + Dog=?config(watchdog, Config), + test_server:timetrap_cancel(Dog). + + +testPrim(suite) -> []; +testPrim(Config) -> + ?line testPrim:compile(Config,?BER,[]), + ?line testPrim_cases(?BER), + ?line ?ber_driver(?BER,testPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrim_cases(?BER)), + ?line testPrim:compile(Config,?PER,[]), + ?line testPrim_cases(?PER), + ?line ?per_bit_opt(testPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrim_cases(?PER)), + ?line ?uper_bin(testPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrim_cases(uper_bin)), + ?line testPrim:compile(Config,?PER,[optimize]), + ?line testPrim_cases(?PER). + +testPrim_cases(Rules) -> + ?line testPrim:bool(Rules), + ?line testPrim:int(Rules), + ?line testPrim:enum(Rules), + ?line testPrim:obj_id(Rules), + ?line testPrim:rel_oid(Rules), + ?line testPrim:null(Rules), + ?line testPrim:real(Rules). + + +testCompactBitString(suite) -> []; +testCompactBitString(Config) -> + + ?line testCompactBitString:compile(Config,?BER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?BER), + + ?line ?ber_driver(?BER,testCompactBitString:compile(Config,?BER,[compact_bit_string,driver])), + ?line ?ber_driver(?BER,testCompactBitString:compact_bit_string(?BER)), + + ?line testCompactBitString:compile(Config,?PER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line ?per_bit_opt(testCompactBitString:compile(Config,?PER, + [compact_bit_string,optimize])), + ?line ?per_bit_opt(testCompactBitString:compact_bit_string(?PER)), + ?line ?per_bit_opt(testCompactBitString:bit_string_unnamed(?PER)), + ?line ?per_bit_opt(testCompactBitString:ticket_7734(?PER)), + + ?line ?uper_bin(testCompactBitString:compile(Config,uper_bin, + [compact_bit_string])), + ?line ?uper_bin(testCompactBitString:compact_bit_string(uper_bin)), + ?line ?uper_bin(testCompactBitString:bit_string_unnamed(uper_bin)), + + ?line testCompactBitString:compile(Config,?PER,[optimize,compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line testCompactBitString:otp_4869(?PER). + + +testPrimStrings(suite) -> []; +testPrimStrings(Config) -> + + ?line testPrimStrings:compile(Config,?BER,[]), + ?line testPrimStrings_cases(?BER), + ?line testPrimStrings:more_strings(?BER), %% these are not implemented in per yet + ?line ?ber_driver(?BER,testPrimStrings:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimStrings_cases(?BER)), + ?line ?ber_driver(?BER,testPrimStrings:more_strings(?BER)), + + ?line testPrimStrings:compile(Config,?PER,[]), + ?line testPrimStrings_cases(?PER), + + ?line ?per_bit_opt(testPrimStrings:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimStrings_cases(?PER)), + + ?line ?uper_bin(testPrimStrings:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimStrings_cases(uper_bin)), + + ?line testPrimStrings:compile(Config,?PER,[optimize]), + ?line testPrimStrings_cases(?PER). + +testPrimStrings_cases(Rules) -> + ?line testPrimStrings:bit_string(Rules), + ?line testPrimStrings:bit_string_unnamed(Rules), + ?line testPrimStrings:octet_string(Rules), + ?line testPrimStrings:numeric_string(Rules), + ?line testPrimStrings:other_strings(Rules), + ?line testPrimStrings:universal_string(Rules), + ?line testPrimStrings:bmp_string(Rules), + ?line testPrimStrings:times(Rules), + ?line testPrimStrings:utf8_string(Rules). + + + +testPrimExternal(suite) -> []; +testPrimExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testPrimExternal:compile(Config,?BER,[]), + ?line testPrimExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testPrimExternal:compile(Config,?PER,[]), + ?line testPrimExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal_cases(?PER). + +testPrimExternal_cases(Rules) -> + ?line testPrimExternal:external(Rules). + + + + +testChoPrim(suite) -> []; +testChoPrim(Config) -> + + ?line testChoPrim:compile(Config,?BER,[]), + ?line testChoPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoPrim_cases(?BER)), + + ?line testChoPrim:compile(Config,?PER,[]), + ?line testChoPrim_cases(?PER), + + ?line ?per_bit_opt(testChoPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoPrim_cases(?PER)), + + ?line ?uper_bin(testChoPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoPrim_cases(uper_bin)), + + ?line testChoPrim:compile(Config,?PER,[optimize]), + ?line testChoPrim_cases(?PER). + +testChoPrim_cases(Rules) -> + ?line testChoPrim:bool(Rules), + ?line testChoPrim:int(Rules). + + + +testChoExtension(suite) -> []; +testChoExtension(Config) -> + + ?line testChoExtension:compile(Config,?BER,[]), + ?line testChoExtension_cases(?BER), + + ?line ?ber_driver(?BER,testChoExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExtension_cases(?BER)), + + ?line testChoExtension:compile(Config,?PER,[]), + ?line testChoExtension_cases(?PER), + + ?line ?per_bit_opt(testChoExtension:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExtension_cases(?PER)), + + ?line ?uper_bin(testChoExtension:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExtension_cases(uper_bin)), + + ?line testChoExtension:compile(Config,?PER,[optimize]), + ?line testChoExtension_cases(?PER). + +testChoExtension_cases(Rules) -> + ?line testChoExtension:extension(Rules). + + + +testChoExternal(suite) -> []; +testChoExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testChoExternal:compile(Config,?BER,[]), + ?line testChoExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testChoExternal:compile(Config,?PER,[]), + ?line testChoExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal_cases(?PER). + + +testChoExternal_cases(Rules) -> + ?line testChoExternal:external(Rules). + + + +testChoOptional(suite) -> []; +testChoOptional(Config) -> + + ?line testChoOptional:compile(Config,?BER,[]), + ?line testChoOptional_cases(?BER), + + ?line ?ber_driver(?BER,testChoOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoOptional_cases(?BER)), + + ?line testChoOptional:compile(Config,?PER,[]), + ?line testChoOptional_cases(?PER), + + ?line ?per_bit_opt(testChoOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoOptional_cases(?PER)), + + ?line ?uper_bin(testChoOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoOptional_cases(uper_bin)), + + ?line testChoOptional:compile(Config,?PER,[optimize]), + ?line testChoOptional_cases(?PER). + +testChoOptional_cases(Rules) -> + ?line testChoOptional:optional(Rules). + +testChoOptionalImplicitTag(suite) -> []; +testChoOptionalImplicitTag(Config) -> + %% Only meaningful for ?BER + ?line testChoOptionalImplicitTag:compile(Config,?BER), + ?line testChoOptionalImplicitTag:optional(?BER). + + +testChoRecursive(suite) -> []; +testChoRecursive(Config) -> + + ?line testChoRecursive:compile(Config,?BER,[]), + ?line testChoRecursive_cases(?BER), + + ?line ?ber_driver(?BER,testChoRecursive:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoRecursive_cases(?BER)), + + ?line testChoRecursive:compile(Config,?PER,[]), + ?line testChoRecursive_cases(?PER), + + ?line ?per_bit_opt(testChoRecursive:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoRecursive_cases(?PER)), + + ?line ?uper_bin(testChoRecursive:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoRecursive_cases(uper_bin)), + + ?line testChoRecursive:compile(Config,?PER,[optimize]), + ?line testChoRecursive_cases(?PER). + +testChoRecursive_cases(Rules) -> + ?line testChoRecursive:recursive(Rules). + + + +testChoTypeRefCho(suite) -> []; +testChoTypeRefCho(Config) -> + + ?line testChoTypeRefCho:compile(Config,?BER,[]), + ?line testChoTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefCho_cases(?BER)), + + ?line testChoTypeRefCho:compile(Config,?PER,[]), + ?line testChoTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefCho_cases(uper_bin)), + + ?line testChoTypeRefCho:compile(Config,?PER,[optimize]), + ?line testChoTypeRefCho_cases(?PER). + +testChoTypeRefCho_cases(Rules) -> + ?line testChoTypeRefCho:choice(Rules). + + + +testChoTypeRefPrim(suite) -> []; +testChoTypeRefPrim(Config) -> + + ?line testChoTypeRefPrim:compile(Config,?BER,[]), + ?line testChoTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefPrim_cases(?BER)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[]), + ?line testChoTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefPrim_cases(uper_bin)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testChoTypeRefPrim_cases(?PER). + +testChoTypeRefPrim_cases(Rules) -> + ?line testChoTypeRefPrim:prim(Rules). + + + +testChoTypeRefSeq(suite) -> []; +testChoTypeRefSeq(Config) -> + + ?line testChoTypeRefSeq:compile(Config,?BER,[]), + ?line testChoTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSeq_cases(?BER)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[]), + ?line testChoTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSeq_cases(uper_bin)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSeq_cases(?PER). + +testChoTypeRefSeq_cases(Rules) -> + ?line testChoTypeRefSeq:seq(Rules). + + + +testChoTypeRefSet(suite) -> []; +testChoTypeRefSet(Config) -> + + ?line testChoTypeRefSet:compile(Config,?BER,[]), + ?line testChoTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSet_cases(?BER)), + + ?line testChoTypeRefSet:compile(Config,?PER,[]), + ?line testChoTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSet_cases(uper_bin)), + + ?line testChoTypeRefSet:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSet_cases(?PER). + +testChoTypeRefSet_cases(Rules) -> + ?line testChoTypeRefSet:set(Rules). + + + +testDef(suite) -> []; +testDef(Config) -> + + ?line testDef:compile(Config,?BER,[]), + ?line testDef_cases(?BER), + + ?line ?ber_driver(?BER,testDef:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDef_cases(?BER)), + + ?line testDef:compile(Config,?PER,[]), + ?line testDef_cases(?PER), + + ?line ?per_bit_opt(testDef:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDef_cases(?PER)), + + ?line ?uper_bin(testDef:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDef_cases(uper_bin)), + + ?line testDef:compile(Config,?PER,[optimize]), + ?line testDef_cases(?PER). + +testDef_cases(Rules) -> + ?line testDef:main(Rules). + + + +testOpt(suite) -> []; +testOpt(Config) -> + + ?line testOpt:compile(Config,?BER), + ?line testOpt_cases(?BER), + + ?line testOpt:compile(Config,?PER), + ?line testOpt_cases(?PER). + +testOpt_cases(Rules) -> + ?line testOpt:main(Rules). + + +testEnumExt(suite) -> []; +testEnumExt(Config) -> + + ?line testEnumExt:compile(Config,?BER,[]), + ?line testEnumExt:main(?BER), + + ?line ?ber_driver(?BER,testEnumExt:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testEnumExt:main(?BER)), + + ?line testEnumExt:compile(Config,?PER,[]), + ?line testEnumExt:main(?PER), + + ?line ?per_bit_opt(testEnumExt:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testEnumExt:main(?PER)), + + ?line ?uper_bin(testEnumExt:compile(Config,uper_bin,[])), + ?line ?uper_bin(testEnumExt:main(uper_bin)), + + ?line testEnumExt:compile(Config,?PER,[optimize]), + ?line testEnumExt:main(?PER). + +testSeqDefault(doc) -> ["Test of OTP-2523 ENUMERATED with extensionmark."]; +testSeqDefault(suite) -> []; +testSeqDefault(Config) -> + + ?line testSeqDefault:compile(Config,?BER,[]), + ?line testSeqDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSeqDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqDefault_cases(?BER)), + + ?line testSeqDefault:compile(Config,?PER,[]), + ?line testSeqDefault_cases(?PER), + + ?line ?per_bit_opt(testSeqDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqDefault_cases(?PER)), + + ?line ?uper_bin(testSeqDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqDefault_cases(uper_bin)), + + ?line testSeqDefault:compile(Config,?PER,[optimize]), + ?line testSeqDefault_cases(?PER). + +testSeqDefault_cases(Rules) -> + ?line testSeqDefault:main(Rules). + + + +testSeqExtension(suite) -> []; +testSeqExtension(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExtension:compile(Config,?BER,[]), + ?line testSeqExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension_cases(?BER)). + +testSeqExtension_cases(Rules) -> + ?line testSeqExtension:main(Rules). + + + +testSeqExternal(suite) -> []; +testSeqExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExternal:compile(Config,?BER,[]), + ?line testSeqExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal_cases(?BER)). + +testSeqExternal_cases(Rules) -> + ?line testSeqExternal:main(Rules). + + +testSeqOptional(suite) -> []; +testSeqOptional(Config) -> + + ?line testSeqOptional:compile(Config,?BER,[]), + ?line testSeqOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOptional_cases(?BER)), + + ?line testSeqOptional:compile(Config,?PER,[]), + ?line testSeqOptional_cases(?PER), + + ?line ?per_bit_opt(testSeqOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOptional_cases(?PER)), + + ?line ?uper_bin(testSeqOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOptional_cases(uper_bin)), + + ?line testSeqOptional:compile(Config,?PER,[optimize]), + ?line testSeqOptional_cases(?PER). + +testSeqOptional_cases(Rules) -> + ?line testSeqOptional:main(Rules). + + + +testSeqPrim(suite) -> []; +testSeqPrim(Config) -> + + ?line testSeqPrim:compile(Config,?BER,[]), + ?line testSeqPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqPrim_cases(?BER)), + + ?line testSeqPrim:compile(Config,?PER,[]), + ?line testSeqPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqPrim_cases(?PER)), + + ?line ?uper_bin(testSeqPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqPrim_cases(uper_bin)), + + ?line testSeqPrim:compile(Config,?PER,[optimize]), + ?line testSeqPrim_cases(?PER). + +testSeqPrim_cases(Rules) -> + ?line testSeqPrim:main(Rules). + + +testSeq2738(doc) -> ["Test of OTP-2738 Detect corrupt optional component."]; +testSeq2738(suite) -> []; +testSeq2738(Config) -> + + ?line testSeq2738:compile(Config,?BER,[]), + ?line testSeq2738_cases(?BER), + + ?line ?ber_driver(?BER,testSeq2738:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeq2738_cases(?BER)), + + ?line testSeq2738:compile(Config,?PER,[]), + ?line testSeq2738_cases(?PER), + + ?line ?per_bit_opt(testSeq2738:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeq2738_cases(?PER)), + + ?line ?uper_bin(testSeq2738:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeq2738_cases(uper_bin)), + + ?line testSeq2738:compile(Config,?PER,[optimize]), + ?line testSeq2738_cases(?PER). + +testSeq2738_cases(Rules) -> + ?line testSeq2738:main(Rules). + + +testSeqTag(suite) -> []; +testSeqTag(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqTag:compile(Config,?BER,[]), + ?line testSeqTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqTag:compile(Config,?PER,[]), + ?line testSeqTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqTag:compile(Config,?PER,[optimize]), + ?line testSeqTag_cases(?PER). + +testSeqTag_cases(Rules) -> + ?line testSeqTag:main(Rules). + + + + +testSeqTypeRefCho(suite) -> []; +testSeqTypeRefCho(Config) -> + + ?line testSeqTypeRefCho:compile(Config,?BER,[]), + ?line testSeqTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefCho_cases(?BER)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[]), + ?line testSeqTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefCho_cases(uper_bin)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefCho_cases(?PER). + +testSeqTypeRefCho_cases(Rules) -> + ?line testSeqTypeRefCho:main(Rules). + + + +testSeqTypeRefPrim(suite) -> []; +testSeqTypeRefPrim(Config) -> + + ?line testSeqTypeRefPrim:compile(Config,?BER,[]), + ?line testSeqTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefPrim_cases(?BER)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[]), + ?line testSeqTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefPrim_cases(uper_bin)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefPrim_cases(?PER). + +testSeqTypeRefPrim_cases(Rules) -> + ?line testSeqTypeRefPrim:main(Rules). + + + +testSeqTypeRefSeq(suite) -> []; +testSeqTypeRefSeq(Config) -> + + ?line testSeqTypeRefSeq:compile(Config,?BER,[]), + ?line testSeqTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSeq_cases(?BER)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[]), + ?line testSeqTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSeq_cases(uper_bin)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSeq_cases(?PER). + +testSeqTypeRefSeq_cases(Rules) -> + ?line testSeqTypeRefSeq:main(Rules). + + + +testSeqTypeRefSet(suite) -> []; +testSeqTypeRefSet(Config) -> + + ?line testSeqTypeRefSet:compile(Config,?BER,[]), + ?line testSeqTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSet_cases(?BER)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[]), + ?line testSeqTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSet_cases(uper_bin)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSet_cases(?PER). + +testSeqTypeRefSet_cases(Rules) -> + ?line testSeqTypeRefSet:main(Rules). + + + + +testSeqOf(suite) -> []; +testSeqOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOf:compile(Config,?BER,[]), + ?line testSeqOf_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOf_cases(?BER)), + + ?line testSeqOf:compile(Config,?PER,[]), + ?line testSeqOf_cases(?PER), + + ?line ?per_bit_opt(testSeqOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOf_cases(?PER)), + + ?line ?uper_bin(testSeqOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOf_cases(uper_bin)), + + ?line testSeqOf:compile(Config,?PER,[optimize]), + ?line testSeqOf_cases(?PER). + +testSeqOf_cases(Rules) -> + ?line testSeqOf:main(Rules). + + + + +testSeqOfCho(suite) -> []; +testSeqOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfCho:compile(Config,?BER,[]), + ?line testSeqOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfCho_cases(?BER)), + + ?line testSeqOfCho:compile(Config,?PER,[]), + ?line testSeqOfCho_cases(?PER), + + ?line ?per_bit_opt(testSeqOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfCho_cases(?PER)), + + ?line ?uper_bin(testSeqOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfCho_cases(uper_bin)), + + ?line testSeqOfCho:compile(Config,?PER,[optimize]), + ?line testSeqOfCho_cases(?PER). + +testSeqOfIndefinite(suite) -> []; +testSeqOfIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfIndefinite:compile(Config,?BER,[]), + ?line testSeqOfIndefinite:main(), + + ?line ?ber_driver(?BER,testSeqOfIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfIndefinite:main()). + +testSeqOfCho_cases(Rules) -> + ?line testSeqOfCho:main(Rules). + + +testSeqOfExternal(suite) -> []; +testSeqOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal_cases(?PER). + +testSeqOfExternal_cases(Rules) -> + ?line testSeqOfExternal:main(Rules). + + + +testSeqOfTag(suite) -> []; +testSeqOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfTag:compile(Config,?BER,[]), + ?line testSeqOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfTag:compile(Config,?PER,[]), + ?line testSeqOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfTag:compile(Config,?PER,[optimize]), + ?line testSeqOfTag_cases(?PER). + +testSeqOfTag_cases(Rules) -> + ?line testSeqOfTag:main(Rules). + + + + +testSetDefault(suite) -> []; +testSetDefault(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetDefault:compile(Config,?BER,[]), + ?line testSetDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSetDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetDefault_cases(?BER)), + + ?line testSetDefault:compile(Config,?PER,[]), + ?line testSetDefault_cases(?PER), + + ?line ?per_bit_opt(testSetDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetDefault_cases(?PER)), + + ?line ?uper_bin(testSetDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetDefault_cases(uper_bin)), + + ?line testSetDefault:compile(Config,?PER,[optimize]), + ?line testSetDefault_cases(?PER). + +testSetDefault_cases(Rules) -> + ?line testSetDefault:main(Rules). + + +testParamBasic(suite) -> []; +testParamBasic(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParamBasic:compile(Config,?BER,[]), + ?line testParamBasic_cases(?BER), + + ?line ?ber_driver(?BER,testParamBasic:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParamBasic_cases(?BER)), + + ?line testParamBasic:compile(Config,?PER,[]), + ?line testParamBasic_cases(?PER), + + ?line ?per_bit_opt(testParamBasic:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParamBasic_cases(?PER)), + + ?line ?uper_bin(testParamBasic:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParamBasic_cases(uper_bin)), + + ?line testParamBasic:compile(Config,?PER,[optimize]), + ?line testParamBasic_cases(?PER). + + +testParamBasic_cases(Rules) -> + ?line testParamBasic:main(Rules). + +testSetExtension(suite) -> []; +testSetExtension(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExtension:compile(Config,?BER,[]), + ?line testSetExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension_cases(?BER)). + +testSetExtension_cases(Rules) -> + ?line testSetExtension:main(Rules). + + +testSetExternal(suite) -> []; +testSetExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExternal:compile(Config,?BER,[]), + ?line testSetExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal_cases(?BER)). + +testSetExternal_cases(Rules) -> + ?line testSetExternal:main(Rules). + + +testSetOptional(suite) -> []; +testSetOptional(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOptional:compile(Config,?BER,[]), + ?line testSetOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSetOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOptional_cases(?BER)), + + ?line testSetOptional:compile(Config,?PER,[]), + ?line testSetOptional_cases(?PER), + + ?line ?per_bit_opt(testSetOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOptional_cases(?PER)), + + ?line ?uper_bin(testSetOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOptional_cases(uper_bin)), + + ?line testSetOptional:compile(Config,?PER,[optimize]), + ?line testSetOptional_cases(?PER). + +testSetOptional_cases(Rules) -> + ?line ok = testSetOptional:ticket_7533(Rules), + ?line ok = testSetOptional:main(Rules). + + + + +testSetPrim(suite) -> []; +testSetPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetPrim:compile(Config,?BER,[]), + ?line testSetPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetPrim_cases(?BER)), + + ?line testSetPrim:compile(Config,?PER,[]), + ?line testSetPrim_cases(?PER), + + ?line ?per_bit_opt(testSetPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetPrim_cases(?PER)), + + ?line ?uper_bin(testSetPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetPrim_cases(uper_bin)), + + ?line testSetPrim:compile(Config,?PER,[optimize]), + ?line testSetPrim_cases(?PER). + +testSetPrim_cases(Rules) -> + ?line testSetPrim:main(Rules). + + + +testSetTag(suite) -> []; +testSetTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetTag:compile(Config,?BER,[]), + ?line testSetTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetTag:compile(Config,?PER,[]), + ?line testSetTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetTag:compile(Config,?PER,[optimize]), + ?line testSetTag_cases(?PER). + +testSetTag_cases(Rules) -> + ?line testSetTag:main(Rules). + + + +testSetTypeRefCho(suite) -> []; +testSetTypeRefCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefCho:compile(Config,?BER,[]), + ?line testSetTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefCho_cases(?BER)), + + ?line testSetTypeRefCho:compile(Config,?PER,[]), + ?line testSetTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefCho_cases(uper_bin)), + + ?line testSetTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSetTypeRefCho_cases(?PER). + +testSetTypeRefCho_cases(Rules) -> + ?line testSetTypeRefCho:main(Rules). + + + +testSetTypeRefPrim(suite) -> []; +testSetTypeRefPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefPrim:compile(Config,?BER,[]), + ?line testSetTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefPrim_cases(?BER)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[]), + ?line testSetTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefPrim_cases(uper_bin)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSetTypeRefPrim_cases(?PER). + +testSetTypeRefPrim_cases(Rules) -> + ?line testSetTypeRefPrim:main(Rules). + + + +testSetTypeRefSeq(suite) -> []; +testSetTypeRefSeq(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSeq:compile(Config,?BER,[]), + ?line testSetTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSeq_cases(?BER)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[]), + ?line testSetTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSeq_cases(uper_bin)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSeq_cases(?PER). + +testSetTypeRefSeq_cases(Rules) -> + ?line testSetTypeRefSeq:main(Rules). + + + +testSetTypeRefSet(suite) -> []; +testSetTypeRefSet(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSet:compile(Config,?BER,[]), + ?line testSetTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSet_cases(?BER)), + + ?line testSetTypeRefSet:compile(Config,?PER,[]), + ?line testSetTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSet_cases(uper_bin)), + + ?line testSetTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSet_cases(?PER). + +testSetTypeRefSet_cases(Rules) -> + ?line testSetTypeRefSet:main(Rules). + + + +testSetOf(suite) -> []; +testSetOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOf:compile(Config,?BER,[]), + ?line testSetOf_cases(?BER), + + ?line ?ber_driver(?BER,testSetOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOf_cases(?BER)), + + ?line testSetOf:compile(Config,?PER,[]), + ?line testSetOf_cases(?PER), + + ?line ?per_bit_opt(testSetOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOf_cases(?PER)), + + ?line ?uper_bin(testSetOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOf_cases(uper_bin)), + + ?line testSetOf:compile(Config,?PER,[optimize]), + ?line testSetOf_cases(?PER). + +testSetOf_cases(Rules) -> + ?line testSetOf:main(Rules). + + + +testSetOfCho(suite) -> []; +testSetOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOfCho:compile(Config,?BER,[]), + ?line testSetOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfCho_cases(?BER)), + + ?line testSetOfCho:compile(Config,?PER,[]), + ?line testSetOfCho_cases(?PER), + + ?line ?per_bit_opt(testSetOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfCho_cases(?PER)), + + ?line ?uper_bin(testSetOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfCho_cases(uper_bin)), + + ?line testSetOfCho:compile(Config,?PER,[optimize]), + ?line testSetOfCho_cases(?PER). + +testSetOfCho_cases(Rules) -> + ?line testSetOfCho:main(Rules). + + +testSetOfExternal(suite) -> []; +testSetOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfExternal:compile(Config,?BER,[]), + ?line testSetOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfExternal:compile(Config,?PER,[]), + ?line testSetOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal_cases(?PER). + +testSetOfExternal_cases(Rules) -> + ?line testSetOfExternal:main(Rules). + + + + +testSetOfTag(suite) -> []; +testSetOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfTag:compile(Config,?BER,[]), + ?line testSetOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfTag:compile(Config,?PER,[]), + ?line testSetOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfTag:compile(Config,?PER,[optimize]), + ?line testSetOfTag_cases(?PER). + +testSetOfTag_cases(Rules) -> + ?line testSetOfTag:main(Rules). + +compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; +compile(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line True = lists:member(TempDir,code:get_path()), + ?line test_server:format("~p~n",[True]), + ?line test_server:format("~p~n",[code:get_path()]), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), + test_server:format("first String ok~n"), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), + ok. + +c_syntax(suite) -> []; +c_syntax(Config) -> + ?line DataDir% ?line testExternal:compile(Config,?PER), +% ?line testPrimExternal:compile(Config,?PER), +% ?line testPrimExternal_cases(?PER). + = ?config(data_dir,Config), + ?line _TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"BadTypeEnding")), + ?line {error,_R3} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment1")), + ?line {error,_R4} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment2")), + ?line {error,_R5} = asn1ct:compile(filename:join(DataDir, + "BadValueSet")), + ?line {error,_R6} = asn1ct:compile(filename:join(DataDir, + "ChoiceBadExtension")), + ?line {error,_R7} = asn1ct:compile(filename:join(DataDir, + "EnumerationBadExtension")), + ?line {error,_R8} = asn1ct:compile(filename:join(DataDir, + "Example")), + ?line {error,_R9} = asn1ct:compile(filename:join(DataDir, + "Export1")), + ?line {error,_R10} = asn1ct:compile(filename:join(DataDir, + "MissingEnd")), + ?line {error,_R11} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComma")), + ?line {error,_R12} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentName")), + ?line {error,_R13} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentType")), + ?line {error,_R14} = asn1ct:compile(filename:join(DataDir, + "SeqBadComma")). + + +c_string_per(suite) -> []; +c_string_per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]). + +c_string_ber(suite) -> []; +c_string_ber(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]). + + +c_implicit_before_choice(suite) -> []; +c_implicit_before_choice(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]). + +parse(suite) -> []; +parse(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + M1 = test_modules(), +% M2 = parse_modules(), + ?line ok = parse1(M1,DataDir,OutDir). + +parse1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[abs,{outdir,OutDir}]), + parse1(T,DataDir,OutDir); +parse1([],_,_) -> + ok. + +per(suite) -> []; +per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = per1(per_modules(),DataDir,OutDir), + ?line ?per_bit_opt(per1_bit_opt(per_modules(),DataDir,OutDir)), + ?line ok = per1_opt(per_modules(),DataDir,OutDir). + + +per1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1(T,DataDir,OutDir); +per1([],_,_) -> + ok. + +per1_bit_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimize,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_bit_opt(T,DataDir,OutDir); +per1_bit_opt([],_,_) -> + ok. + +per1_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimized,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_opt(T,DataDir,OutDir); +per1_opt([],_,_) -> + ok. + +ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. + +ber_choiceinseq(suite) ->[]; +ber_choiceinseq(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"ChoiceInSeq"),[?BER,{outdir,OutDir}]). + +ber_optional(suite) ->[]; +ber_optional(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"),[?BER,{outdir,OutDir}]), + ?line V = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(V,element(2,V2)). + +ber_optional_keyed_list(suite) ->[]; +ber_optional_keyed_list(Config) -> + case ?BER of + ber_bin_v2 -> ok; + _ -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"), + [?BER,keyed_list,{outdir,OutDir}]), + ?line Vrecord = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line V = [ {a,[{scriptKey,10}]}, + {b,[]}, + {c,[{callingPartysCategory,111}]} ], + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(Vrecord,element(2,V2)) + end. + + +eq(V,V) -> + ok. + + +ber_other(suite) ->[]; +ber_other(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = ber1(ber_modules(),DataDir,OutDir). + + +ber1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?BER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + ber1(T,DataDir,OutDir); +ber1([],_,_) -> + ok. + +default_per(suite) ->[]; +default_per(Config) -> + default1(?PER,Config,[]). + +default_per_opt(suite) -> []; +default_per_opt(Config) -> + ?per_bit_opt(default1(?PER,Config,[optimize])), + default1(?PER,Config,[optimize]). + +default_ber(suite) ->[]; +default_ber(Config) -> + default1(?BER,Config,[]). + +default1(Rule,Config,Options) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Def",[Rule,{outdir,OutDir}]++Options), + ?line {ok,Bytes1} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true, + bool1 = true, + bool2 = true, + bool3 = true}), + ?line {ok,{'Def1',true,true,true,true}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes1)), + + ?line {ok,Bytes2} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes2)), + + ?line {ok,Bytes3} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,bool2=false}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes3)). + + +value_test(suite) ->[]; +value_test(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?BER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?PER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = test_bad_values:tests(Config), + ok. + + +constructed(suite) -> + []; +constructed(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Constructed",[?BER,{outdir,OutDir}]), + ?line {ok,B} = asn1_wrapper:encode('Constructed','S',{'S',false}), + ?line [40,3,1,1,0] = lists:flatten(B), + ?line {ok,B1} = asn1_wrapper:encode('Constructed','S2',{'S2',false}), + ?line [40,5,48,3,1,1,0] = lists:flatten(B1), + ?line {ok,B2} = asn1_wrapper:encode('Constructed','I',10), + ?line [136,1,10] = lists:flatten(B2), + ok. + +ber_decode_error(suite) -> []; +ber_decode_error(Config) -> + ?line ok = ber_decode_error:compile(Config,?BER,[]), + ?line ok = ber_decode_error:run([]), + + ?line ok = ?ber_driver(?BER,ber_decode_error:compile(Config,?BER,[driver])), + ?line ok = ?ber_driver(?BER,ber_decode_error:run([driver])), + ok. + +h323test(suite) -> + []; +h323test(Config) -> + ?line ok = h323test:compile(Config,?PER,[]), + ?line ok = h323test:run(?PER), + ?line ?per_bit_opt(h323test:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(h323test:run(?PER)), + ?line ?uper_bin(h323test:compile(Config,uper_bin,[])), + ?line ?uper_bin(h323test:run(uper_bin)), + ?line ok = h323test:compile(Config,?PER,[optimize]), + ?line ok = h323test:run(?PER), + ok. + +per_GeneralString(suite) -> + []; +per_GeneralString(Config) -> + case erlang:module_loaded('MULTIMEDIA-SYSTEM-CONTROL') of + true -> + ok; + false -> + h323test:compile(Config,?PER,[]) + end, + UI = [109,64,1,57], + ?line {ok,_V} = asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL', + 'MultimediaSystemControlMessage',UI). + +per_open_type(suite) -> + []; +per_open_type(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line ok = asn1ct:compile(DataDir ++ "OpenType",[?PER,{outdir,OutDir}]), + Stype = {'Stype',10,true}, + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes), + + ?line ?per_bit_opt(ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}])), + ?line ?per_bit_opt({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?per_bit_opt({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ?uper_bin(ok = asn1ct:compile(DataDir ++ "OpenType", + [uper_bin,{outdir,OutDir}])), + ?line ?uper_bin({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?uper_bin({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}]), + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes). + +testConstraints(suite) -> + []; +testConstraints(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testConstraints:compile(Config,?BER,[]), + ?line testConstraints:int_constraints(?BER), + + ?line ?ber_driver(?BER,testConstraints:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testConstraints:int_constraints(?BER)), + + ?line testConstraints:compile(Config,?PER,[]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER), + + ?line ?per_bit_opt(testConstraints:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testConstraints:int_constraints(?PER)), + ?line ?per_bit_opt(testConstraints:refed_NNL_name(?PER)), + + ?line ?uper_bin(testConstraints:compile(Config,uper_bin,[])), + ?line ?uper_bin(testConstraints:int_constraints(uper_bin)), + ?line ?uper_bin(testConstraints:refed_NNL_name(uper_bin)), + + ?line testConstraints:compile(Config,?PER,[optimize]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER). + +testSeqIndefinite(suite) -> []; +testSeqIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqIndefinite:compile(Config,?BER,[]), + ?line testSeqIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSeqIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqIndefinite:main(?BER)). + +testSetIndefinite(suite) -> []; +testSetIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetIndefinite:compile(Config,?BER,[]), + ?line testSetIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSetIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetIndefinite:main(?BER)). + +testChoiceIndefinite(suite) -> []; +testChoiceIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testChoiceIndefinite:compile(Config,?BER,[]), + ?line testChoiceIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testChoiceIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoiceIndefinite:main(?BER)). + +testInfObjectClass(suite) -> + []; +testInfObjectClass(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testInfObjectClass:compile(Config,?PER,[]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[]), + ?line testInfObj:main(?PER), + + ?line ?per_bit_opt(testInfObjectClass:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObjectClass:main(?PER)), + ?line ?per_bit_opt(testInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObj:main(?PER)), + + ?line ?uper_bin(testInfObjectClass:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObjectClass:main(uper_bin)), + ?line ?uper_bin(testInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObj:main(uper_bin)), + + ?line testInfObjectClass:compile(Config,?PER,[optimize]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[optimize]), + ?line testInfObj:main(?PER), + + ?line testInfObjectClass:compile(Config,?BER,[]), + ?line testInfObjectClass:main(?BER), + ?line testInfObj:compile(Config,?BER,[]), + ?line testInfObj:main(?BER), + + ?line ?ber_driver(?BER,testInfObjectClass:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObjectClass:main(?BER)), + ?line ?ber_driver(?BER,testInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObj:main(?BER)), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[]), + + ?line ?per_bit_opt(testInfObj:compile_RANAPfiles(Config,?PER,[optimize])), + + ?line ?uper_bin(testInfObj:compile_RANAPfiles(Config,uper_bin,[])), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[optimize]), + + ?line testInfObj:compile_RANAPfiles(Config,?BER,[]). + +testParameterizedInfObj(suite) -> + []; +testParameterizedInfObj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParameterizedInfObj:compile(Config,?PER,[]), + ?line testParameterizedInfObj:main(?PER), + + ?line ?per_bit_opt(testParameterizedInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParameterizedInfObj:main(?PER)), + + ?line ?uper_bin(testParameterizedInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParameterizedInfObj:main(uper_bin)), + + ?line testParameterizedInfObj:compile(Config,?PER,[optimize]), + ?line testParameterizedInfObj:main(?PER), + + ?line testParameterizedInfObj:compile(Config,?BER,[]), + ?line testParameterizedInfObj:main(?BER), + + ?line ?ber_driver(?BER,testParameterizedInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParameterizedInfObj:main(?BER)). + +testMergeCompile(suite) -> + []; +testMergeCompile(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMergeCompile:compile(Config,?PER,[]), + ?line testMergeCompile:main(?PER), + ?line testMergeCompile:mvrasn(?PER), + + ?line ?per_bit_opt(testMergeCompile:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testMergeCompile:main(?PER)), + ?line ?per_bit_opt(testMergeCompile:mvrasn(?PER)), + + ?line ?uper_bin(testMergeCompile:compile(Config,uper_bin,[])), + ?line ?uper_bin(testMergeCompile:main(uper_bin)), + ?line ?uper_bin(testMergeCompile:mvrasn(uper_bin)), + + ?line testMergeCompile:compile(Config,?BER,[]), + ?line testMergeCompile:main(?BER), + ?line testMergeCompile:mvrasn(?BER), + + ?line ?ber_driver(?BER,testMergeCompile:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testMergeCompile:main(?BER)), + ?line ?ber_driver(?BER,testMergeCompile:mvrasn(?BER)). + +testobj(suite) -> + []; +testobj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = testRANAP:compile(Config,?PER,[]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ?per_bit_opt(ok = testRANAP:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testRANAP:testobj(?PER)), + ?line ?per_bit_opt(ok = testParameterizedInfObj:ranap(?PER)), + + ?line ?uper_bin(ok = testRANAP:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testRANAP:testobj(uper_bin)), + ?line ?uper_bin(ok = testParameterizedInfObj:ranap(uper_bin)), + + ?line ok = testRANAP:compile(Config,?PER,[optimize]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ok = testRANAP:compile(Config,?BER,[]), + ?line ok = testRANAP:testobj(?BER), + ?line ok = testParameterizedInfObj:ranap(?BER), + + ?line ?ber_driver(?BER,testRANAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testRANAP:testobj(?BER)), + ?line ?ber_driver(?BER,testParameterizedInfObj:ranap(?BER)). + + +testDeepTConstr(suite) -> + []; +testDeepTConstr(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDeepTConstr:compile(Config,?PER,[]), + ?line testDeepTConstr:main(?PER), + + ?line ?per_bit_opt(testDeepTConstr:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDeepTConstr:main(?PER)), + + ?line ?uper_bin(testDeepTConstr:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDeepTConstr:main(uper_bin)), + + ?line testDeepTConstr:compile(Config,?PER,[optimize]), + ?line testDeepTConstr:main(?PER), + + ?line testDeepTConstr:compile(Config,?BER,[]), + ?line testDeepTConstr:main(?BER), + + ?line ?ber_driver(?BER,testDeepTConstr:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDeepTConstr:main(?BER)). + +testInvokeMod(suite) -> + []; +testInvokeMod(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[{outdir,OutDir}]), + ?line {ok,_Result1} = 'PrimStrings':encode('Bs1',[1,0,1,0]), + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[?PER,{outdir,OutDir}]), + ?line {ok,_Result2} = 'PrimStrings':encode('Bs1',[1,0,1,0]). + +testExport(suite) -> + []; +testExport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line {error,{asn1,_Reason}} = asn1ct:compile(filename:join(DataDir,"IllegalExport"),[{outdir,OutDir}]). + +testImport(suite) -> + []; +testImport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line _OutDir = ?config(priv_dir,Config), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER]), + ok. + +testMegaco(suite) -> + []; +testMegaco(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + io:format("Config: ~p~n",[Config]), + ?line {ok,ModuleName1,ModuleName2} = testMegaco:compile(Config,?BER,[]), + ?line ok = testMegaco:main(ModuleName1,Config), + ?line ok = testMegaco:main(ModuleName2,Config), + + case ?BER of + ber_bin_v2 -> + ?line {ok,ModuleName3,ModuleName4} = testMegaco:compile(Config,?BER,[driver]), + ?line ok = testMegaco:main(ModuleName3,Config), + ?line ok = testMegaco:main(ModuleName4,Config); + _-> ok + end, + + ?line {ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[]), + ?line ok = testMegaco:main(ModuleName5,Config), + ?line ok = testMegaco:main(ModuleName6,Config), + + ?line ?per_bit_opt({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName5,Config)), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName6,Config)), + + ?line ?uper_bin({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testMegaco:main(ModuleName5,Config)), + ?line ?uper_bin(ok = testMegaco:main(ModuleName6,Config)), + + ?line {ok,ModuleName7,ModuleName8} = testMegaco:compile(Config,?PER,[optimize]), + ?line ok = testMegaco:main(ModuleName7,Config), + ?line ok = testMegaco:main(ModuleName8,Config). + + +testMvrasn6(suite) -> []; +testMvrasn6(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMvrasn6:compile(Config,?BER), + ?line testMvrasn6:main(). + +testContextSwitchingTypes(suite) -> []; +testContextSwitchingTypes(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testContextSwitchingTypes:compile(Config,?BER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?ber_driver(?BER,testContextSwitchingTypes:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?per_bit_opt(testContextSwitchingTypes:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testContextSwitchingTypes:test()), + + ?line ?uper_bin(testContextSwitchingTypes:compile(Config,uper_bin,[])), + ?line ?uper_bin(testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[optimize]), + ?line testContextSwitchingTypes:test(). + +testTypeValueNotation(suite) -> []; +testTypeValueNotation(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + case ?BER of + Ber when Ber == ber; Ber == ber_bin -> + ?line testTypeValueNotation:compile(Config,?BER,[]), + ?line testTypeValueNotation:main(?BER,dummy); + _ -> + ok + end, + + ?line ?ber_driver(?BER,testTypeValueNotation:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTypeValueNotation:main(?BER,optimize)), + + case ?BER of + Ber2 when Ber2 == ber; Ber2 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[]), + ?line testTypeValueNotation:main(?PER,dummy); + _ -> + ok + end, + + ?line ?per_bit_opt(testTypeValueNotation:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testTypeValueNotation:main(?PER,optimize)), + + ?line ?uper_bin(testTypeValueNotation:compile(Config,uper_bin,[])), + ?line ?uper_bin(testTypeValueNotation:main(uper_bin,optimize)), + case ?BER of + Ber3 when Ber3 == ber; Ber3 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[optimize]), + ?line testTypeValueNotation:main(?PER,optimize); + _ -> + ok + end. + +testOpenTypeImplicitTag(suite) -> []; +testOpenTypeImplicitTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testOpenTypeImplicitTag:compile(Config,?BER,[]), + ?line testOpenTypeImplicitTag:main(?BER), + + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:main(?BER)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[]), + ?line testOpenTypeImplicitTag:main(?PER), + + ?line ?per_bit_opt(testOpenTypeImplicitTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testOpenTypeImplicitTag:main(?PER)), + + ?line ?uper_bin(testOpenTypeImplicitTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testOpenTypeImplicitTag:main(uper_bin)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[optimize]), + ?line testOpenTypeImplicitTag:main(?PER). + +duplicate_tags(suite) -> []; +duplicate_tags(Config) -> + ?line DataDir = ?config(data_dir,Config), + {error,{asn1,[{error,{type,_,_,'SeqOpt1Imp',{asn1,{duplicates_of_the_tags,_}}}}]}} = + asn1ct:compile(filename:join(DataDir,"SeqOptional2"),[abs]), + ok. + +rtUI(suite) -> []; +rtUI(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?BER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?PER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:unload_driver(). + +testROSE(suite) -> []; +testROSE(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testROSE:compile(Config,?BER,[]), + + ?line testROSE:compile(Config,?PER,[]), + ?line ?per_bit_opt(testROSE:compile(Config,?PER,[optimize])), + ?line ?uper_bin(testROSE:compile(Config,uper_bin,[])), + ?line testROSE:compile(Config,?PER,[optimize]). + +testINSTANCE_OF(suite) -> []; +testINSTANCE_OF(Config) -> + ?line testINSTANCE_OF:compile(Config,?BER,[]), + ?line testINSTANCE_OF:main(?BER), + + ?line ?ber_driver(?BER,testINSTANCE_OF:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testINSTANCE_OF:main(?BER)), + + ?line testINSTANCE_OF:compile(Config,?PER,[]), + ?line testINSTANCE_OF:main(?PER), + + ?line ?per_bit_opt(testINSTANCE_OF:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testINSTANCE_OF:main(?PER)), + + ?line ?uper_bin(testINSTANCE_OF:compile(Config,uper_bin,[])), + ?line ?uper_bin(testINSTANCE_OF:main(uper_bin)), + + ?line testINSTANCE_OF:compile(Config,?PER,[optimize]), + ?line testINSTANCE_OF:main(?PER). + +testTCAP(suite) -> []; +testTCAP(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testTCAP:compile(Config,?BER,[]), + ?line testTCAP:test(?BER,Config), + + ?line ?ber_driver(?BER,testTCAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTCAP:test(?BER,Config)), + + ?line ?ber_driver(?BER,testTCAP:compile_asn1config(Config,?BER,[asn1config])), + ?line ?ber_driver(?BER,testTCAP:test_asn1config()). + +testDER(suite) ->[]; +testDER(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDER:compile(Config,?BER,[]), + ?line testDER:test(), + + ?line ?ber_driver(?BER,testDER:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDER:test()), + + ?line testParamBasic:compile_der(Config,?BER), + ?line testParamBasic_cases(der), + + + ?line testSeqSetDefaultVal:compile(Config,?BER), + ?line testSeqSetDefaultVal_cases(?BER). + +testSeqSetDefaultVal_cases(?BER) -> + ?line testSeqSetDefaultVal:main(?BER). + + +specialized_decodes(suite) -> []; +specialized_decodes(Config) -> + ?line test_partial_incomplete_decode:compile(Config,?BER,[optimize]), + ?line test_partial_incomplete_decode:test(?BER,Config), + ?line test_selective_decode:test(?BER,Config). + +special_decode_performance(suite) ->[]; +special_decode_performance(Config) -> + ?line ?ber_driver(?BER,test_special_decode_performance:compile(Config,?BER)), + ?line ?ber_driver(?BER,test_special_decode_performance:go(all)). + + +test_driver_load(suite) -> []; +test_driver_load(Config) -> + ?line test_driver_load:compile(Config,?PER), + ?line test_driver_load:test(?PER,5). + +test_ParamTypeInfObj(suite) -> []; +test_ParamTypeInfObj(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"IN-CS-1-Datatypes"),[ber_bin]). + +test_WS_ParamClass(suite) -> []; +test_WS_ParamClass(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"InformationFramework"), + [ber_bin]). + +test_Defed_ObjectIdentifier(suite) -> []; +test_Defed_ObjectIdentifier(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"UsefulDefinitions"), + [ber_bin]). + +testSelectionType(suite) -> []; +testSelectionType(Config) -> + + ?line ok = testSelectionTypes:compile(Config,?BER,[]), + ?line {ok,_} = testSelectionTypes:test(), + + ?line ok = testSelectionTypes:compile(Config,?PER,[]), + ?line {ok,_} = testSelectionTypes:test(). + +testSSLspecs(suite) -> []; +testSSLspecs(Config) -> + + ?line ok = testSSLspecs:compile(Config,?BER, + [optimize,compact_bit_string,der]), + ?line testSSLspecs:run(?BER), + + case code:which(asn1ct) of + cover_compiled -> + ok; + _ -> + ?line ok = testSSLspecs:compile_inline(Config,?BER), + ?line ok = testSSLspecs:run_inline(?BER) + end. + +testNortel(suite) -> []; +testNortel(Config) -> + ?line DataDir = ?config(data_dir,Config), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?BER]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize,driver]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?PER]), + ?line ?per_bit_opt(ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize])), + ?line ?uper_bin(ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[uper_bin])), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize]). +test_undecoded_rest(suite) -> []; +test_undecoded_rest(Config) -> + + ?line ok = test_undecoded_rest:compile(Config,?BER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ok = test_undecoded_rest:compile(Config,?BER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ?per_bit_opt(ok = test_undecoded_rest:compile(Config,?PER,[optimize,undec_rest])), + ?line ?per_bit_opt(ok = test_undecoded_rest:test(undec_rest)), + + ?line ?uper_bin(ok = test_undecoded_rest:compile(Config,uper_bin,[undec_rest])), + ?line ?uper_bin(ok = test_undecoded_rest:test(undec_rest)), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest). + +test_inline(suite) -> []; +test_inline(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok=test_inline:compile(Config,?BER,[]), + ?line test_inline:main(?BER), + ?line test_inline:inline1(Config,?BER,[]), + ?line test_inline:performance2() + end. + +%test_inline_prf(suite) -> []; +%test_inline_prf(Config) -> +% ?line test_inline:performance(Config). + +testTcapsystem(suite) -> []; +testTcapsystem(Config) -> + ?line ok=testTcapsystem:compile(Config,?BER,[]). + +testNBAPsystem(suite) -> []; +testNBAPsystem(Config) -> + ?line ok=testNBAPsystem:compile(Config,?PER,?per_optimize(?BER)), + ?line ok=testNBAPsystem:test(?PER,Config). + +test_compile_options(suite) -> []; +test_compile_options(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok = test_compile_options:wrong_path(Config), + ?line ok = test_compile_options:path(Config), + ?line ok = test_compile_options:noobj(Config), + ?line ok = test_compile_options:record_name_prefix(Config), + ?line ok = test_compile_options:verbose(Config) + end. +testDoubleEllipses(suite) -> []; +testDoubleEllipses(Config) -> + ?line testDoubleEllipses:compile(Config,?BER,[]), + ?line testDoubleEllipses:main(?BER), + ?line ?ber_driver(?BER,testDoubleEllipses:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDoubleEllipses:main(?BER)), + ?line ?per_bit_opt(testDoubleEllipses:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDoubleEllipses:main(?PER)), + ?line ?uper_bin(testDoubleEllipses:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDoubleEllipses:main(uper_bin)), + ?line testDoubleEllipses:compile(Config,?PER,?per_optimize(?BER)), + ?line testDoubleEllipses:main(?PER). + +test_modified_x420(suite) -> []; +test_modified_x420(Config) -> + ?line test_modified_x420:compile(Config), + ?line test_modified_x420:test_io(Config). + +testX420(suite) -> []; +testX420(Config) -> + ?line testX420:compile(?BER,[der],Config), + ?line ok = testX420:ticket7759(?BER,Config), + ?line testX420:compile(?PER,[],Config). + +test_x691(suite) -> []; +test_x691(Config) -> + case ?PER of + per -> + ?line ok = test_x691:compile(Config,uper_bin,[]), + ?line true = test_x691:cases(uper_bin,unaligned), + ?line ok = test_x691:compile(Config,?PER,[]), + ?line true = test_x691:cases(?PER,aligned), +%% ?line ok = asn1_test_lib:ticket_7678(Config,[]), + ?line ok = asn1_test_lib:ticket_7708(Config,[]), + ?line ok = asn1_test_lib:ticket_7763(Config); + _ -> + ?line ok = test_x691:compile(Config,?PER,?per_optimize(?BER)), + ?line true = test_x691:cases(?PER,aligned) + end. +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[compact_bit_string]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize,compact_bit_string]). + + +ticket_6143(suite) -> []; +ticket_6143(Config) -> + ?line ok = test_compile_options:ticket_6143(Config). + +testExtensionAdditionGroup(suite) -> []; +testExtensionAdditionGroup(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line PrivDir = ?config(priv_dir,Config), + ?line Path = code:get_path(), + ?line code:add_patha(PrivDir), + DoIt = fun(Erule) -> + ?line ok = asn1ct:compile(filename:join(DataDir,"Extension-Addition-Group"),[Erule,{outdir,PrivDir}]), + ?line {ok,_M} = compile:file(filename:join(DataDir,"extensionAdditionGroup"),[{i,PrivDir},{outdir,PrivDir},debug_info]), + ?line ok = extensionAdditionGroup:run(Erule) + end, + ?line [DoIt(Rule)|| Rule <- [per_bin,uper_bin,ber_bin]], + ?line code:set_path(Path). + + + +% parse_modules() -> +% ["ImportsFrom"]. + +per_modules() -> + [X || X <- test_modules()]. +ber_modules() -> + [X || X <- test_modules(), + X =/= "CommonDataTypes", + X =/= "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + X =/= "H323-MESSAGES", + X =/= "H235-SECURITY-MESSAGES", + X =/= "MULTIMEDIA-SYSTEM-CONTROL"]. +test_modules() -> + _Modules = [ + "BitStr", + "CommonDataTypes", + "Constraints", + "ContextSwitchingTypes", + "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + "Enum", + "From", + "H235-SECURITY-MESSAGES", + "H323-MESSAGES", + %%"MULTIMEDIA-SYSTEM-CONTROL", recursive type , problem for asn1ct:value + "Import", + "Int", + "MAP-commonDataTypes", +% ambigous tags "MAP-insertSubscriberData-def", + "Null", + "Octetstr", + "One", + "P-Record", + "P", +% "PDUs", + "Person", + "PrimStrings", + "Real", + "XSeq", + "XSeqOf", + "XSet", + "XSetOf", + "String", + "SwCDR", +% "Syntax", + "Time" +% ANY "Tst", +% "Two", +% errors that should be detected "UndefType" +] ++ + [ + "SeqSetLib", % must be compiled before Seq and Set + "Seq", + "Set", + "SetOf", + "SeqOf", + "Prim", + "Cho", + "Def", + "Opt", + "ELDAPv3", + "LDAP" + ]. + + +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% + +common() -> [app_test, appup_test,testTimer_ber,testTimer_ber_bin, + testTimer_ber_bin_opt, testTimer_ber_bin_opt_driver, testTimer_per, + testTimer_per_bin, testTimer_per_bin_opt, testTimer_uper_bin, + testComment,testName2Number]. + + +app_test(suite) -> [{asn1_app_test,all}]. +appup_test(suite) -> [{asn1_appup_test,all}]. + +testTimer_ber(suite) -> []; +testTimer_ber(Config) -> + ?line testTimer:compile(Config,ber,[]), + ?line testTimer:go(Config,ber). + +testTimer_ber_bin(suite) -> []; +testTimer_ber_bin(Config) -> + ?line testTimer:compile(Config,ber_bin,[]), + ?line testTimer:go(Config,ber_bin). + +testTimer_ber_bin_opt(suite) -> []; +testTimer_ber_bin_opt(Config) -> + ?line testTimer:compile(Config,ber_bin,[optimize]), + ?line testTimer:go(Config,ber_bin). + +testTimer_ber_bin_opt_driver(suite) -> []; +testTimer_ber_bin_opt_driver(Config) -> + ?line testTimer:compile(Config,ber_bin,[optimize,driver]), + ?line testTimer:go(Config,ber_bin). + +testTimer_per(suite) -> []; +testTimer_per(Config) -> + ?line testTimer:compile(Config,per,[]), + ?line testTimer:go(Config,per). + +testTimer_per_bin(suite) -> []; +testTimer_per_bin(Config) -> + ?line testTimer:compile(Config,per_bin,[]), + ?line testTimer:go(Config,per_bin). + +testTimer_per_bin_opt(suite) -> []; +testTimer_per_bin_opt(Config) -> + ?line testTimer:compile(Config,per_bin,[optimize]), + ?line testTimer:go(Config,per_bin). + + +testTimer_uper_bin(suite) -> []; +testTimer_uper_bin(Config) -> + ?line ok=testTimer:compile(Config,uper_bin,[]), + ?line {comment,_} = testTimer:go(Config,uper_bin). + +%% Test of multiple-line comment, OTP-8043 +testComment(suite) -> []; +testComment(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + + ?line ok = asn1ct:compile(DataDir ++ "Comment",[{outdir,OutDir}]), + + ?line {ok,Enc} = asn1_wrapper:encode('Comment','Seq',{'Seq',12,true}), + ?line {ok,{'Seq',12,true}} = asn1_wrapper:decode('Comment','Seq',Enc), + ok. + +testName2Number(suite) -> []; +testName2Number(Config) -> + DataDir = ?config(data_dir,Config), + OutDir = ?config(priv_dir,Config), + N2NOptions = [{n2n,Type}|| Type <- + ['CauseMisc','CauseProtocol', + %% 'CauseNetwork', + 'CauseRadioNetwork', + 'CauseTransport','CauseNas']], + ?line ok = asn1ct:compile(DataDir ++ "S1AP-IEs",[{outdir,OutDir}]++N2NOptions), + ?line true = code:add_patha(OutDir), + + ?line 0 = 'S1AP-IEs':name2num_CauseMisc('control-processing-overload'), + ?line 'unknown-PLMN' = 'S1AP-IEs':num2name_CauseMisc(5), + ok. + + +particular() -> [ticket_7407]. + +ticket_7407(suite) -> []; +ticket_7407(Config) -> + ?line ok = asn1_test_lib:ticket_7407_compile(Config,[]), + ?line ok = asn1_test_lib:ticket_7407_code(true), + + ?line ok = asn1_test_lib:ticket_7407_compile(Config,[no_final_padding]), + ?line ok = asn1_test_lib:ticket_7407_code(false). diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl new file mode 100644 index 0000000000..034d998e4d --- /dev/null +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -0,0 +1,2374 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%% Purpose : Test suite for the ASN.1 application + +-module(asn1_bin_SUITE). +-define(PER,'per_bin'). +-define(BER,'ber_bin'). +-define(ber_driver(Erule,Func), + case Erule of + ber_bin_v2 -> + Func; + _ -> ok + end). +-define(per_optimize(Erule), + case Erule of + ber_bin_v2 ->[optimize]; + _ -> [] + end). +-define(per_bit_opt(FuncCall), + case ?BER of + ber_bin_v2 -> FuncCall; +% _ -> {skip,"only for bit optimized per_bin"} + _ -> ok + end). +-define(uper_bin(FuncCall), + case ?PER of + per -> FuncCall; + _ -> ok + end). + +-compile(export_all). +%%-export([Function/Arity, ...]). + +-include_lib("test_server/include/test_server.hrl"). + +%% records used by test-case default +-record('Def1',{ +bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). + +%-record('Def2',{ +%bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}). + +%-record('Def3',{ +%bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}). + + + +all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, + ber,testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, + testChoTypeRefSet, testDef, testOpt, testSeqDefault, + testSeqExtension, testSeqExternal, testSeqOptional, + testSeqPrim, testSeqTag, testSeqTypeRefCho, + testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, + testSeqOf, testSeqOfIndefinite, testSeqOfCho, + testSeqOfExternal, testSetDefault, testSetExtension, + testExtensionAdditionGroup, + testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, + testSetTag, testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, + testSetOfExternal, testSetOfTag, testEnumExt, value_test, + testSeq2738, constructed, ber_decode_error, + h323test, testSeqIndefinite, testSetIndefinite, + testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, + testInvokeMod, testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, + testINSTANCE_OF,testTCAP,testDER,specialized_decodes, + special_decode_performance,test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel,test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options,testDoubleEllipses, test_modified_x420, + testX420, test_x691,ticket_6143, testExtensionAdditionGroup + ] ++ common() ++ particular(). + +%all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. + +option_tests(suite) -> + [test_compile_options,ticket_6143]. + +infobj(suite) -> + [testInfObjectClass, testParameterizedInfObj, testMergeCompile, + testobj, testDeepTConstr]. + +performance(suite) -> + [testTimer_ber, testTimer_ber_opt_driver, + testTimer_per, testTimer_per_opt, testTimer_uper_bin]. + +bugs(suite) -> + [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. + +init_per_testcase(Func,Config) -> + %%?line test_server:format("Func: ~p~n",[Func]), + ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), + ?line code:add_patha(?config(priv_dir,Config)), + Dog= + case Func of + testX420 -> + test_server:timetrap({minutes,60}); % 60 minutes + _ -> + test_server:timetrap({minutes,30}) % 60 minutes + end, +%% Dog=test_server:timetrap(1800000), % 30 minutes + [{watchdog, Dog}|Config]. + +end_per_testcase(_Func,Config) -> + Dog=?config(watchdog, Config), + test_server:timetrap_cancel(Dog). + + +testPrim(suite) -> []; +testPrim(Config) -> + ?line testPrim:compile(Config,?BER,[]), + ?line testPrim_cases(?BER), + ?line ?ber_driver(?BER,testPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrim_cases(?BER)), + ?line testPrim:compile(Config,?PER,[]), + ?line testPrim_cases(?PER), + ?line ?per_bit_opt(testPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrim_cases(?PER)), + ?line ?uper_bin(testPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrim_cases(uper_bin)), + ?line testPrim:compile(Config,?PER,[optimize]), + ?line testPrim_cases(?PER). + +testPrim_cases(Rules) -> + ?line testPrim:bool(Rules), + ?line testPrim:int(Rules), + ?line testPrim:enum(Rules), + ?line testPrim:obj_id(Rules), + ?line testPrim:rel_oid(Rules), + ?line testPrim:null(Rules), + ?line testPrim:real(Rules). + + +testCompactBitString(suite) -> []; +testCompactBitString(Config) -> + + ?line testCompactBitString:compile(Config,?BER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?BER), + + ?line ?ber_driver(?BER,testCompactBitString:compile(Config,?BER,[compact_bit_string,driver])), + ?line ?ber_driver(?BER,testCompactBitString:compact_bit_string(?BER)), + + ?line testCompactBitString:compile(Config,?PER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line ?per_bit_opt(testCompactBitString:compile(Config,?PER, + [compact_bit_string,optimize])), + ?line ?per_bit_opt(testCompactBitString:compact_bit_string(?PER)), + ?line ?per_bit_opt(testCompactBitString:bit_string_unnamed(?PER)), + ?line ?per_bit_opt(testCompactBitString:ticket_7734(?PER)), + + ?line ?uper_bin(testCompactBitString:compile(Config,uper_bin, + [compact_bit_string])), + ?line ?uper_bin(testCompactBitString:compact_bit_string(uper_bin)), + ?line ?uper_bin(testCompactBitString:bit_string_unnamed(uper_bin)), + + ?line testCompactBitString:compile(Config,?PER,[optimize,compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line testCompactBitString:otp_4869(?PER). + + +testPrimStrings(suite) -> []; +testPrimStrings(Config) -> + + ?line testPrimStrings:compile(Config,?BER,[]), + ?line testPrimStrings_cases(?BER), + ?line testPrimStrings:more_strings(?BER), %% these are not implemented in per yet + ?line ?ber_driver(?BER,testPrimStrings:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimStrings_cases(?BER)), + ?line ?ber_driver(?BER,testPrimStrings:more_strings(?BER)), + + ?line testPrimStrings:compile(Config,?PER,[]), + ?line testPrimStrings_cases(?PER), + + ?line ?per_bit_opt(testPrimStrings:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimStrings_cases(?PER)), + + ?line ?uper_bin(testPrimStrings:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimStrings_cases(uper_bin)), + + ?line testPrimStrings:compile(Config,?PER,[optimize]), + ?line testPrimStrings_cases(?PER). + +testPrimStrings_cases(Rules) -> + ?line testPrimStrings:bit_string(Rules), + ?line testPrimStrings:bit_string_unnamed(Rules), + ?line testPrimStrings:octet_string(Rules), + ?line testPrimStrings:numeric_string(Rules), + ?line testPrimStrings:other_strings(Rules), + ?line testPrimStrings:universal_string(Rules), + ?line testPrimStrings:bmp_string(Rules), + ?line testPrimStrings:times(Rules), + ?line testPrimStrings:utf8_string(Rules). + + + +testPrimExternal(suite) -> []; +testPrimExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testPrimExternal:compile(Config,?BER,[]), + ?line testPrimExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testPrimExternal:compile(Config,?PER,[]), + ?line testPrimExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal_cases(?PER). + +testPrimExternal_cases(Rules) -> + ?line testPrimExternal:external(Rules). + + + + +testChoPrim(suite) -> []; +testChoPrim(Config) -> + + ?line testChoPrim:compile(Config,?BER,[]), + ?line testChoPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoPrim_cases(?BER)), + + ?line testChoPrim:compile(Config,?PER,[]), + ?line testChoPrim_cases(?PER), + + ?line ?per_bit_opt(testChoPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoPrim_cases(?PER)), + + ?line ?uper_bin(testChoPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoPrim_cases(uper_bin)), + + ?line testChoPrim:compile(Config,?PER,[optimize]), + ?line testChoPrim_cases(?PER). + +testChoPrim_cases(Rules) -> + ?line testChoPrim:bool(Rules), + ?line testChoPrim:int(Rules). + + + +testChoExtension(suite) -> []; +testChoExtension(Config) -> + + ?line testChoExtension:compile(Config,?BER,[]), + ?line testChoExtension_cases(?BER), + + ?line ?ber_driver(?BER,testChoExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExtension_cases(?BER)), + + ?line testChoExtension:compile(Config,?PER,[]), + ?line testChoExtension_cases(?PER), + + ?line ?per_bit_opt(testChoExtension:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExtension_cases(?PER)), + + ?line ?uper_bin(testChoExtension:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExtension_cases(uper_bin)), + + ?line testChoExtension:compile(Config,?PER,[optimize]), + ?line testChoExtension_cases(?PER). + +testChoExtension_cases(Rules) -> + ?line testChoExtension:extension(Rules). + + + +testChoExternal(suite) -> []; +testChoExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testChoExternal:compile(Config,?BER,[]), + ?line testChoExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testChoExternal:compile(Config,?PER,[]), + ?line testChoExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal_cases(?PER). + + +testChoExternal_cases(Rules) -> + ?line testChoExternal:external(Rules). + + + +testChoOptional(suite) -> []; +testChoOptional(Config) -> + + ?line testChoOptional:compile(Config,?BER,[]), + ?line testChoOptional_cases(?BER), + + ?line ?ber_driver(?BER,testChoOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoOptional_cases(?BER)), + + ?line testChoOptional:compile(Config,?PER,[]), + ?line testChoOptional_cases(?PER), + + ?line ?per_bit_opt(testChoOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoOptional_cases(?PER)), + + ?line ?uper_bin(testChoOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoOptional_cases(uper_bin)), + + ?line testChoOptional:compile(Config,?PER,[optimize]), + ?line testChoOptional_cases(?PER). + +testChoOptional_cases(Rules) -> + ?line testChoOptional:optional(Rules). + +testChoOptionalImplicitTag(suite) -> []; +testChoOptionalImplicitTag(Config) -> + %% Only meaningful for ?BER + ?line testChoOptionalImplicitTag:compile(Config,?BER), + ?line testChoOptionalImplicitTag:optional(?BER). + + +testChoRecursive(suite) -> []; +testChoRecursive(Config) -> + + ?line testChoRecursive:compile(Config,?BER,[]), + ?line testChoRecursive_cases(?BER), + + ?line ?ber_driver(?BER,testChoRecursive:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoRecursive_cases(?BER)), + + ?line testChoRecursive:compile(Config,?PER,[]), + ?line testChoRecursive_cases(?PER), + + ?line ?per_bit_opt(testChoRecursive:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoRecursive_cases(?PER)), + + ?line ?uper_bin(testChoRecursive:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoRecursive_cases(uper_bin)), + + ?line testChoRecursive:compile(Config,?PER,[optimize]), + ?line testChoRecursive_cases(?PER). + +testChoRecursive_cases(Rules) -> + ?line testChoRecursive:recursive(Rules). + + + +testChoTypeRefCho(suite) -> []; +testChoTypeRefCho(Config) -> + + ?line testChoTypeRefCho:compile(Config,?BER,[]), + ?line testChoTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefCho_cases(?BER)), + + ?line testChoTypeRefCho:compile(Config,?PER,[]), + ?line testChoTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefCho_cases(uper_bin)), + + ?line testChoTypeRefCho:compile(Config,?PER,[optimize]), + ?line testChoTypeRefCho_cases(?PER). + +testChoTypeRefCho_cases(Rules) -> + ?line testChoTypeRefCho:choice(Rules). + + + +testChoTypeRefPrim(suite) -> []; +testChoTypeRefPrim(Config) -> + + ?line testChoTypeRefPrim:compile(Config,?BER,[]), + ?line testChoTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefPrim_cases(?BER)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[]), + ?line testChoTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefPrim_cases(uper_bin)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testChoTypeRefPrim_cases(?PER). + +testChoTypeRefPrim_cases(Rules) -> + ?line testChoTypeRefPrim:prim(Rules). + + + +testChoTypeRefSeq(suite) -> []; +testChoTypeRefSeq(Config) -> + + ?line testChoTypeRefSeq:compile(Config,?BER,[]), + ?line testChoTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSeq_cases(?BER)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[]), + ?line testChoTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSeq_cases(uper_bin)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSeq_cases(?PER). + +testChoTypeRefSeq_cases(Rules) -> + ?line testChoTypeRefSeq:seq(Rules). + + + +testChoTypeRefSet(suite) -> []; +testChoTypeRefSet(Config) -> + + ?line testChoTypeRefSet:compile(Config,?BER,[]), + ?line testChoTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSet_cases(?BER)), + + ?line testChoTypeRefSet:compile(Config,?PER,[]), + ?line testChoTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSet_cases(uper_bin)), + + ?line testChoTypeRefSet:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSet_cases(?PER). + +testChoTypeRefSet_cases(Rules) -> + ?line testChoTypeRefSet:set(Rules). + + + +testDef(suite) -> []; +testDef(Config) -> + + ?line testDef:compile(Config,?BER,[]), + ?line testDef_cases(?BER), + + ?line ?ber_driver(?BER,testDef:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDef_cases(?BER)), + + ?line testDef:compile(Config,?PER,[]), + ?line testDef_cases(?PER), + + ?line ?per_bit_opt(testDef:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDef_cases(?PER)), + + ?line ?uper_bin(testDef:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDef_cases(uper_bin)), + + ?line testDef:compile(Config,?PER,[optimize]), + ?line testDef_cases(?PER). + +testDef_cases(Rules) -> + ?line testDef:main(Rules). + + + +testOpt(suite) -> []; +testOpt(Config) -> + + ?line testOpt:compile(Config,?BER), + ?line testOpt_cases(?BER), + + ?line testOpt:compile(Config,?PER), + ?line testOpt_cases(?PER). + +testOpt_cases(Rules) -> + ?line testOpt:main(Rules). + + +testEnumExt(suite) -> []; +testEnumExt(Config) -> + + ?line testEnumExt:compile(Config,?BER,[]), + ?line testEnumExt:main(?BER), + + ?line ?ber_driver(?BER,testEnumExt:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testEnumExt:main(?BER)), + + ?line testEnumExt:compile(Config,?PER,[]), + ?line testEnumExt:main(?PER), + + ?line ?per_bit_opt(testEnumExt:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testEnumExt:main(?PER)), + + ?line ?uper_bin(testEnumExt:compile(Config,uper_bin,[])), + ?line ?uper_bin(testEnumExt:main(uper_bin)), + + ?line testEnumExt:compile(Config,?PER,[optimize]), + ?line testEnumExt:main(?PER). + +testSeqDefault(doc) -> ["Test of OTP-2523 ENUMERATED with extensionmark."]; +testSeqDefault(suite) -> []; +testSeqDefault(Config) -> + + ?line testSeqDefault:compile(Config,?BER,[]), + ?line testSeqDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSeqDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqDefault_cases(?BER)), + + ?line testSeqDefault:compile(Config,?PER,[]), + ?line testSeqDefault_cases(?PER), + + ?line ?per_bit_opt(testSeqDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqDefault_cases(?PER)), + + ?line ?uper_bin(testSeqDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqDefault_cases(uper_bin)), + + ?line testSeqDefault:compile(Config,?PER,[optimize]), + ?line testSeqDefault_cases(?PER). + +testSeqDefault_cases(Rules) -> + ?line testSeqDefault:main(Rules). + + + +testSeqExtension(suite) -> []; +testSeqExtension(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExtension:compile(Config,?BER,[]), + ?line testSeqExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension_cases(?BER)). + +testSeqExtension_cases(Rules) -> + ?line testSeqExtension:main(Rules). + + + +testSeqExternal(suite) -> []; +testSeqExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExternal:compile(Config,?BER,[]), + ?line testSeqExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal_cases(?BER)). + +testSeqExternal_cases(Rules) -> + ?line testSeqExternal:main(Rules). + + +testSeqOptional(suite) -> []; +testSeqOptional(Config) -> + + ?line testSeqOptional:compile(Config,?BER,[]), + ?line testSeqOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOptional_cases(?BER)), + + ?line testSeqOptional:compile(Config,?PER,[]), + ?line testSeqOptional_cases(?PER), + + ?line ?per_bit_opt(testSeqOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOptional_cases(?PER)), + + ?line ?uper_bin(testSeqOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOptional_cases(uper_bin)), + + ?line testSeqOptional:compile(Config,?PER,[optimize]), + ?line testSeqOptional_cases(?PER). + +testSeqOptional_cases(Rules) -> + ?line testSeqOptional:main(Rules). + + + +testSeqPrim(suite) -> []; +testSeqPrim(Config) -> + + ?line testSeqPrim:compile(Config,?BER,[]), + ?line testSeqPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqPrim_cases(?BER)), + + ?line testSeqPrim:compile(Config,?PER,[]), + ?line testSeqPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqPrim_cases(?PER)), + + ?line ?uper_bin(testSeqPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqPrim_cases(uper_bin)), + + ?line testSeqPrim:compile(Config,?PER,[optimize]), + ?line testSeqPrim_cases(?PER). + +testSeqPrim_cases(Rules) -> + ?line testSeqPrim:main(Rules). + + +testSeq2738(doc) -> ["Test of OTP-2738 Detect corrupt optional component."]; +testSeq2738(suite) -> []; +testSeq2738(Config) -> + + ?line testSeq2738:compile(Config,?BER,[]), + ?line testSeq2738_cases(?BER), + + ?line ?ber_driver(?BER,testSeq2738:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeq2738_cases(?BER)), + + ?line testSeq2738:compile(Config,?PER,[]), + ?line testSeq2738_cases(?PER), + + ?line ?per_bit_opt(testSeq2738:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeq2738_cases(?PER)), + + ?line ?uper_bin(testSeq2738:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeq2738_cases(uper_bin)), + + ?line testSeq2738:compile(Config,?PER,[optimize]), + ?line testSeq2738_cases(?PER). + +testSeq2738_cases(Rules) -> + ?line testSeq2738:main(Rules). + + +testSeqTag(suite) -> []; +testSeqTag(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqTag:compile(Config,?BER,[]), + ?line testSeqTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqTag:compile(Config,?PER,[]), + ?line testSeqTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqTag:compile(Config,?PER,[optimize]), + ?line testSeqTag_cases(?PER). + +testSeqTag_cases(Rules) -> + ?line testSeqTag:main(Rules). + + + + +testSeqTypeRefCho(suite) -> []; +testSeqTypeRefCho(Config) -> + + ?line testSeqTypeRefCho:compile(Config,?BER,[]), + ?line testSeqTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefCho_cases(?BER)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[]), + ?line testSeqTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefCho_cases(uper_bin)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefCho_cases(?PER). + +testSeqTypeRefCho_cases(Rules) -> + ?line testSeqTypeRefCho:main(Rules). + + + +testSeqTypeRefPrim(suite) -> []; +testSeqTypeRefPrim(Config) -> + + ?line testSeqTypeRefPrim:compile(Config,?BER,[]), + ?line testSeqTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefPrim_cases(?BER)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[]), + ?line testSeqTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefPrim_cases(uper_bin)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefPrim_cases(?PER). + +testSeqTypeRefPrim_cases(Rules) -> + ?line testSeqTypeRefPrim:main(Rules). + + + +testSeqTypeRefSeq(suite) -> []; +testSeqTypeRefSeq(Config) -> + + ?line testSeqTypeRefSeq:compile(Config,?BER,[]), + ?line testSeqTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSeq_cases(?BER)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[]), + ?line testSeqTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSeq_cases(uper_bin)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSeq_cases(?PER). + +testSeqTypeRefSeq_cases(Rules) -> + ?line testSeqTypeRefSeq:main(Rules). + + + +testSeqTypeRefSet(suite) -> []; +testSeqTypeRefSet(Config) -> + + ?line testSeqTypeRefSet:compile(Config,?BER,[]), + ?line testSeqTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSet_cases(?BER)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[]), + ?line testSeqTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSet_cases(uper_bin)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSet_cases(?PER). + +testSeqTypeRefSet_cases(Rules) -> + ?line testSeqTypeRefSet:main(Rules). + + + + +testSeqOf(suite) -> []; +testSeqOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOf:compile(Config,?BER,[]), + ?line testSeqOf_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOf_cases(?BER)), + + ?line testSeqOf:compile(Config,?PER,[]), + ?line testSeqOf_cases(?PER), + + ?line ?per_bit_opt(testSeqOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOf_cases(?PER)), + + ?line ?uper_bin(testSeqOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOf_cases(uper_bin)), + + ?line testSeqOf:compile(Config,?PER,[optimize]), + ?line testSeqOf_cases(?PER). + +testSeqOf_cases(Rules) -> + ?line testSeqOf:main(Rules). + + + + +testSeqOfCho(suite) -> []; +testSeqOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfCho:compile(Config,?BER,[]), + ?line testSeqOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfCho_cases(?BER)), + + ?line testSeqOfCho:compile(Config,?PER,[]), + ?line testSeqOfCho_cases(?PER), + + ?line ?per_bit_opt(testSeqOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfCho_cases(?PER)), + + ?line ?uper_bin(testSeqOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfCho_cases(uper_bin)), + + ?line testSeqOfCho:compile(Config,?PER,[optimize]), + ?line testSeqOfCho_cases(?PER). + +testSeqOfIndefinite(suite) -> []; +testSeqOfIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfIndefinite:compile(Config,?BER,[]), + ?line testSeqOfIndefinite:main(), + + ?line ?ber_driver(?BER,testSeqOfIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfIndefinite:main()). + +testSeqOfCho_cases(Rules) -> + ?line testSeqOfCho:main(Rules). + + +testSeqOfExternal(suite) -> []; +testSeqOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal_cases(?PER). + +testSeqOfExternal_cases(Rules) -> + ?line testSeqOfExternal:main(Rules). + + + +testSeqOfTag(suite) -> []; +testSeqOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfTag:compile(Config,?BER,[]), + ?line testSeqOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfTag:compile(Config,?PER,[]), + ?line testSeqOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfTag:compile(Config,?PER,[optimize]), + ?line testSeqOfTag_cases(?PER). + +testSeqOfTag_cases(Rules) -> + ?line testSeqOfTag:main(Rules). + + + + +testSetDefault(suite) -> []; +testSetDefault(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetDefault:compile(Config,?BER,[]), + ?line testSetDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSetDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetDefault_cases(?BER)), + + ?line testSetDefault:compile(Config,?PER,[]), + ?line testSetDefault_cases(?PER), + + ?line ?per_bit_opt(testSetDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetDefault_cases(?PER)), + + ?line ?uper_bin(testSetDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetDefault_cases(uper_bin)), + + ?line testSetDefault:compile(Config,?PER,[optimize]), + ?line testSetDefault_cases(?PER). + +testSetDefault_cases(Rules) -> + ?line testSetDefault:main(Rules). + + +testParamBasic(suite) -> []; +testParamBasic(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParamBasic:compile(Config,?BER,[]), + ?line testParamBasic_cases(?BER), + + ?line ?ber_driver(?BER,testParamBasic:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParamBasic_cases(?BER)), + + ?line testParamBasic:compile(Config,?PER,[]), + ?line testParamBasic_cases(?PER), + + ?line ?per_bit_opt(testParamBasic:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParamBasic_cases(?PER)), + + ?line ?uper_bin(testParamBasic:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParamBasic_cases(uper_bin)), + + ?line testParamBasic:compile(Config,?PER,[optimize]), + ?line testParamBasic_cases(?PER). + + +testParamBasic_cases(Rules) -> + ?line testParamBasic:main(Rules). + +testSetExtension(suite) -> []; +testSetExtension(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExtension:compile(Config,?BER,[]), + ?line testSetExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension_cases(?BER)). + +testSetExtension_cases(Rules) -> + ?line testSetExtension:main(Rules). + + +testSetExternal(suite) -> []; +testSetExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExternal:compile(Config,?BER,[]), + ?line testSetExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal_cases(?BER)). + +testSetExternal_cases(Rules) -> + ?line testSetExternal:main(Rules). + + +testSetOptional(suite) -> []; +testSetOptional(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOptional:compile(Config,?BER,[]), + ?line testSetOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSetOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOptional_cases(?BER)), + + ?line testSetOptional:compile(Config,?PER,[]), + ?line testSetOptional_cases(?PER), + + ?line ?per_bit_opt(testSetOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOptional_cases(?PER)), + + ?line ?uper_bin(testSetOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOptional_cases(uper_bin)), + + ?line testSetOptional:compile(Config,?PER,[optimize]), + ?line testSetOptional_cases(?PER). + +testSetOptional_cases(Rules) -> + ?line ok = testSetOptional:ticket_7533(Rules), + ?line ok = testSetOptional:main(Rules). + + + + +testSetPrim(suite) -> []; +testSetPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetPrim:compile(Config,?BER,[]), + ?line testSetPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetPrim_cases(?BER)), + + ?line testSetPrim:compile(Config,?PER,[]), + ?line testSetPrim_cases(?PER), + + ?line ?per_bit_opt(testSetPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetPrim_cases(?PER)), + + ?line ?uper_bin(testSetPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetPrim_cases(uper_bin)), + + ?line testSetPrim:compile(Config,?PER,[optimize]), + ?line testSetPrim_cases(?PER). + +testSetPrim_cases(Rules) -> + ?line testSetPrim:main(Rules). + + + +testSetTag(suite) -> []; +testSetTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetTag:compile(Config,?BER,[]), + ?line testSetTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetTag:compile(Config,?PER,[]), + ?line testSetTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetTag:compile(Config,?PER,[optimize]), + ?line testSetTag_cases(?PER). + +testSetTag_cases(Rules) -> + ?line testSetTag:main(Rules). + + + +testSetTypeRefCho(suite) -> []; +testSetTypeRefCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefCho:compile(Config,?BER,[]), + ?line testSetTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefCho_cases(?BER)), + + ?line testSetTypeRefCho:compile(Config,?PER,[]), + ?line testSetTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefCho_cases(uper_bin)), + + ?line testSetTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSetTypeRefCho_cases(?PER). + +testSetTypeRefCho_cases(Rules) -> + ?line testSetTypeRefCho:main(Rules). + + + +testSetTypeRefPrim(suite) -> []; +testSetTypeRefPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefPrim:compile(Config,?BER,[]), + ?line testSetTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefPrim_cases(?BER)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[]), + ?line testSetTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefPrim_cases(uper_bin)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSetTypeRefPrim_cases(?PER). + +testSetTypeRefPrim_cases(Rules) -> + ?line testSetTypeRefPrim:main(Rules). + + + +testSetTypeRefSeq(suite) -> []; +testSetTypeRefSeq(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSeq:compile(Config,?BER,[]), + ?line testSetTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSeq_cases(?BER)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[]), + ?line testSetTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSeq_cases(uper_bin)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSeq_cases(?PER). + +testSetTypeRefSeq_cases(Rules) -> + ?line testSetTypeRefSeq:main(Rules). + + + +testSetTypeRefSet(suite) -> []; +testSetTypeRefSet(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSet:compile(Config,?BER,[]), + ?line testSetTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSet_cases(?BER)), + + ?line testSetTypeRefSet:compile(Config,?PER,[]), + ?line testSetTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSet_cases(uper_bin)), + + ?line testSetTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSet_cases(?PER). + +testSetTypeRefSet_cases(Rules) -> + ?line testSetTypeRefSet:main(Rules). + + + +testSetOf(suite) -> []; +testSetOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOf:compile(Config,?BER,[]), + ?line testSetOf_cases(?BER), + + ?line ?ber_driver(?BER,testSetOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOf_cases(?BER)), + + ?line testSetOf:compile(Config,?PER,[]), + ?line testSetOf_cases(?PER), + + ?line ?per_bit_opt(testSetOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOf_cases(?PER)), + + ?line ?uper_bin(testSetOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOf_cases(uper_bin)), + + ?line testSetOf:compile(Config,?PER,[optimize]), + ?line testSetOf_cases(?PER). + +testSetOf_cases(Rules) -> + ?line testSetOf:main(Rules). + + + +testSetOfCho(suite) -> []; +testSetOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOfCho:compile(Config,?BER,[]), + ?line testSetOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfCho_cases(?BER)), + + ?line testSetOfCho:compile(Config,?PER,[]), + ?line testSetOfCho_cases(?PER), + + ?line ?per_bit_opt(testSetOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfCho_cases(?PER)), + + ?line ?uper_bin(testSetOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfCho_cases(uper_bin)), + + ?line testSetOfCho:compile(Config,?PER,[optimize]), + ?line testSetOfCho_cases(?PER). + +testSetOfCho_cases(Rules) -> + ?line testSetOfCho:main(Rules). + + +testSetOfExternal(suite) -> []; +testSetOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfExternal:compile(Config,?BER,[]), + ?line testSetOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfExternal:compile(Config,?PER,[]), + ?line testSetOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal_cases(?PER). + +testSetOfExternal_cases(Rules) -> + ?line testSetOfExternal:main(Rules). + + + + +testSetOfTag(suite) -> []; +testSetOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfTag:compile(Config,?BER,[]), + ?line testSetOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfTag:compile(Config,?PER,[]), + ?line testSetOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfTag:compile(Config,?PER,[optimize]), + ?line testSetOfTag_cases(?PER). + +testSetOfTag_cases(Rules) -> + ?line testSetOfTag:main(Rules). + +compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; +compile(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line True = lists:member(TempDir,code:get_path()), + ?line test_server:format("~p~n",[True]), + ?line test_server:format("~p~n",[code:get_path()]), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), + test_server:format("first String ok~n"), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), + ok. + +c_syntax(suite) -> []; +c_syntax(Config) -> + ?line DataDir% ?line testExternal:compile(Config,?PER), +% ?line testPrimExternal:compile(Config,?PER), +% ?line testPrimExternal_cases(?PER). + = ?config(data_dir,Config), + ?line _TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"BadTypeEnding")), + ?line {error,_R3} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment1")), + ?line {error,_R4} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment2")), + ?line {error,_R5} = asn1ct:compile(filename:join(DataDir, + "BadValueSet")), + ?line {error,_R6} = asn1ct:compile(filename:join(DataDir, + "ChoiceBadExtension")), + ?line {error,_R7} = asn1ct:compile(filename:join(DataDir, + "EnumerationBadExtension")), + ?line {error,_R8} = asn1ct:compile(filename:join(DataDir, + "Example")), + ?line {error,_R9} = asn1ct:compile(filename:join(DataDir, + "Export1")), + ?line {error,_R10} = asn1ct:compile(filename:join(DataDir, + "MissingEnd")), + ?line {error,_R11} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComma")), + ?line {error,_R12} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentName")), + ?line {error,_R13} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentType")), + ?line {error,_R14} = asn1ct:compile(filename:join(DataDir, + "SeqBadComma")). + + +c_string_per(suite) -> []; +c_string_per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]). + +c_string_ber(suite) -> []; +c_string_ber(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]). + + +c_implicit_before_choice(suite) -> []; +c_implicit_before_choice(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]). + +parse(suite) -> []; +parse(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + M1 = test_modules(), +% M2 = parse_modules(), + ?line ok = parse1(M1,DataDir,OutDir). + +parse1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[abs,{outdir,OutDir}]), + parse1(T,DataDir,OutDir); +parse1([],_,_) -> + ok. + +per(suite) -> []; +per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = per1(per_modules(),DataDir,OutDir), + ?line ?per_bit_opt(per1_bit_opt(per_modules(),DataDir,OutDir)), + ?line ok = per1_opt(per_modules(),DataDir,OutDir). + + +per1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1(T,DataDir,OutDir); +per1([],_,_) -> + ok. + +per1_bit_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimize,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_bit_opt(T,DataDir,OutDir); +per1_bit_opt([],_,_) -> + ok. + +per1_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimized,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_opt(T,DataDir,OutDir); +per1_opt([],_,_) -> + ok. + +ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. + +ber_choiceinseq(suite) ->[]; +ber_choiceinseq(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"ChoiceInSeq"),[?BER,{outdir,OutDir}]). + +ber_optional(suite) ->[]; +ber_optional(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"),[?BER,{outdir,OutDir}]), + ?line V = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(V,element(2,V2)). + +ber_optional_keyed_list(suite) ->[]; +ber_optional_keyed_list(Config) -> + case ?BER of + ber_bin_v2 -> ok; + _ -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"), + [?BER,keyed_list,{outdir,OutDir}]), + ?line Vrecord = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line V = [ {a,[{scriptKey,10}]}, + {b,[]}, + {c,[{callingPartysCategory,111}]} ], + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(Vrecord,element(2,V2)) + end. + + +eq(V,V) -> + ok. + + +ber_other(suite) ->[]; +ber_other(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = ber1(ber_modules(),DataDir,OutDir). + + +ber1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?BER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + ber1(T,DataDir,OutDir); +ber1([],_,_) -> + ok. + +default_per(suite) ->[]; +default_per(Config) -> + default1(?PER,Config,[]). + +default_per_opt(suite) -> []; +default_per_opt(Config) -> + ?per_bit_opt(default1(?PER,Config,[optimize])), + default1(?PER,Config,[optimize]). + +default_ber(suite) ->[]; +default_ber(Config) -> + default1(?BER,Config,[]). + +default1(Rule,Config,Options) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Def",[Rule,{outdir,OutDir}]++Options), + ?line {ok,Bytes1} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true, + bool1 = true, + bool2 = true, + bool3 = true}), + ?line {ok,{'Def1',true,true,true,true}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes1)), + + ?line {ok,Bytes2} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes2)), + + ?line {ok,Bytes3} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,bool2=false}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes3)). + + +value_test(suite) ->[]; +value_test(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?BER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?PER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = test_bad_values:tests(Config), + ok. + + +constructed(suite) -> + []; +constructed(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Constructed",[?BER,{outdir,OutDir}]), + ?line {ok,B} = asn1_wrapper:encode('Constructed','S',{'S',false}), + ?line [40,3,1,1,0] = lists:flatten(B), + ?line {ok,B1} = asn1_wrapper:encode('Constructed','S2',{'S2',false}), + ?line [40,5,48,3,1,1,0] = lists:flatten(B1), + ?line {ok,B2} = asn1_wrapper:encode('Constructed','I',10), + ?line [136,1,10] = lists:flatten(B2), + ok. + +ber_decode_error(suite) -> []; +ber_decode_error(Config) -> + ?line ok = ber_decode_error:compile(Config,?BER,[]), + ?line ok = ber_decode_error:run([]), + + ?line ok = ?ber_driver(?BER,ber_decode_error:compile(Config,?BER,[driver])), + ?line ok = ?ber_driver(?BER,ber_decode_error:run([driver])), + ok. + +h323test(suite) -> + []; +h323test(Config) -> + ?line ok = h323test:compile(Config,?PER,[]), + ?line ok = h323test:run(?PER), + ?line ?per_bit_opt(h323test:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(h323test:run(?PER)), + ?line ?uper_bin(h323test:compile(Config,uper_bin,[])), + ?line ?uper_bin(h323test:run(uper_bin)), + ?line ok = h323test:compile(Config,?PER,[optimize]), + ?line ok = h323test:run(?PER), + ok. + +per_GeneralString(suite) -> + []; +per_GeneralString(Config) -> + case erlang:module_loaded('MULTIMEDIA-SYSTEM-CONTROL') of + true -> + ok; + false -> + h323test:compile(Config,?PER,[]) + end, + UI = [109,64,1,57], + ?line {ok,_V} = asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL', + 'MultimediaSystemControlMessage',UI). + +per_open_type(suite) -> + []; +per_open_type(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line ok = asn1ct:compile(DataDir ++ "OpenType",[?PER,{outdir,OutDir}]), + Stype = {'Stype',10,true}, + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes), + + ?line ?per_bit_opt(ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}])), + ?line ?per_bit_opt({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?per_bit_opt({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ?uper_bin(ok = asn1ct:compile(DataDir ++ "OpenType", + [uper_bin,{outdir,OutDir}])), + ?line ?uper_bin({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?uper_bin({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}]), + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes). + +testConstraints(suite) -> + []; +testConstraints(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testConstraints:compile(Config,?BER,[]), + ?line testConstraints:int_constraints(?BER), + + ?line ?ber_driver(?BER,testConstraints:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testConstraints:int_constraints(?BER)), + + ?line testConstraints:compile(Config,?PER,[]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER), + + ?line ?per_bit_opt(testConstraints:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testConstraints:int_constraints(?PER)), + ?line ?per_bit_opt(testConstraints:refed_NNL_name(?PER)), + + ?line ?uper_bin(testConstraints:compile(Config,uper_bin,[])), + ?line ?uper_bin(testConstraints:int_constraints(uper_bin)), + ?line ?uper_bin(testConstraints:refed_NNL_name(uper_bin)), + + ?line testConstraints:compile(Config,?PER,[optimize]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER). + +testSeqIndefinite(suite) -> []; +testSeqIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqIndefinite:compile(Config,?BER,[]), + ?line testSeqIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSeqIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqIndefinite:main(?BER)). + +testSetIndefinite(suite) -> []; +testSetIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetIndefinite:compile(Config,?BER,[]), + ?line testSetIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSetIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetIndefinite:main(?BER)). + +testChoiceIndefinite(suite) -> []; +testChoiceIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testChoiceIndefinite:compile(Config,?BER,[]), + ?line testChoiceIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testChoiceIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoiceIndefinite:main(?BER)). + +testInfObjectClass(suite) -> + []; +testInfObjectClass(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testInfObjectClass:compile(Config,?PER,[]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[]), + ?line testInfObj:main(?PER), + + ?line ?per_bit_opt(testInfObjectClass:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObjectClass:main(?PER)), + ?line ?per_bit_opt(testInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObj:main(?PER)), + + ?line ?uper_bin(testInfObjectClass:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObjectClass:main(uper_bin)), + ?line ?uper_bin(testInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObj:main(uper_bin)), + + ?line testInfObjectClass:compile(Config,?PER,[optimize]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[optimize]), + ?line testInfObj:main(?PER), + + ?line testInfObjectClass:compile(Config,?BER,[]), + ?line testInfObjectClass:main(?BER), + ?line testInfObj:compile(Config,?BER,[]), + ?line testInfObj:main(?BER), + + ?line ?ber_driver(?BER,testInfObjectClass:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObjectClass:main(?BER)), + ?line ?ber_driver(?BER,testInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObj:main(?BER)), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[]), + + ?line ?per_bit_opt(testInfObj:compile_RANAPfiles(Config,?PER,[optimize])), + + ?line ?uper_bin(testInfObj:compile_RANAPfiles(Config,uper_bin,[])), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[optimize]), + + ?line testInfObj:compile_RANAPfiles(Config,?BER,[]). + +testParameterizedInfObj(suite) -> + []; +testParameterizedInfObj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParameterizedInfObj:compile(Config,?PER,[]), + ?line testParameterizedInfObj:main(?PER), + + ?line ?per_bit_opt(testParameterizedInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParameterizedInfObj:main(?PER)), + + ?line ?uper_bin(testParameterizedInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParameterizedInfObj:main(uper_bin)), + + ?line testParameterizedInfObj:compile(Config,?PER,[optimize]), + ?line testParameterizedInfObj:main(?PER), + + ?line testParameterizedInfObj:compile(Config,?BER,[]), + ?line testParameterizedInfObj:main(?BER), + + ?line ?ber_driver(?BER,testParameterizedInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParameterizedInfObj:main(?BER)). + +testMergeCompile(suite) -> + []; +testMergeCompile(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMergeCompile:compile(Config,?PER,[]), + ?line testMergeCompile:main(?PER), + ?line testMergeCompile:mvrasn(?PER), + + ?line ?per_bit_opt(testMergeCompile:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testMergeCompile:main(?PER)), + ?line ?per_bit_opt(testMergeCompile:mvrasn(?PER)), + + ?line ?uper_bin(testMergeCompile:compile(Config,uper_bin,[])), + ?line ?uper_bin(testMergeCompile:main(uper_bin)), + ?line ?uper_bin(testMergeCompile:mvrasn(uper_bin)), + + ?line testMergeCompile:compile(Config,?BER,[]), + ?line testMergeCompile:main(?BER), + ?line testMergeCompile:mvrasn(?BER), + + ?line ?ber_driver(?BER,testMergeCompile:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testMergeCompile:main(?BER)), + ?line ?ber_driver(?BER,testMergeCompile:mvrasn(?BER)). + +testobj(suite) -> + []; +testobj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = testRANAP:compile(Config,?PER,[]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ?per_bit_opt(ok = testRANAP:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testRANAP:testobj(?PER)), + ?line ?per_bit_opt(ok = testParameterizedInfObj:ranap(?PER)), + + ?line ?uper_bin(ok = testRANAP:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testRANAP:testobj(uper_bin)), + ?line ?uper_bin(ok = testParameterizedInfObj:ranap(uper_bin)), + + ?line ok = testRANAP:compile(Config,?PER,[optimize]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ok = testRANAP:compile(Config,?BER,[]), + ?line ok = testRANAP:testobj(?BER), + ?line ok = testParameterizedInfObj:ranap(?BER), + + ?line ?ber_driver(?BER,testRANAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testRANAP:testobj(?BER)), + ?line ?ber_driver(?BER,testParameterizedInfObj:ranap(?BER)). + + +testDeepTConstr(suite) -> + []; +testDeepTConstr(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDeepTConstr:compile(Config,?PER,[]), + ?line testDeepTConstr:main(?PER), + + ?line ?per_bit_opt(testDeepTConstr:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDeepTConstr:main(?PER)), + + ?line ?uper_bin(testDeepTConstr:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDeepTConstr:main(uper_bin)), + + ?line testDeepTConstr:compile(Config,?PER,[optimize]), + ?line testDeepTConstr:main(?PER), + + ?line testDeepTConstr:compile(Config,?BER,[]), + ?line testDeepTConstr:main(?BER), + + ?line ?ber_driver(?BER,testDeepTConstr:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDeepTConstr:main(?BER)). + +testInvokeMod(suite) -> + []; +testInvokeMod(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[{outdir,OutDir}]), + ?line {ok,_Result1} = 'PrimStrings':encode('Bs1',[1,0,1,0]), + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[?PER,{outdir,OutDir}]), + ?line {ok,_Result2} = 'PrimStrings':encode('Bs1',[1,0,1,0]). + +testExport(suite) -> + []; +testExport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line {error,{asn1,_Reason}} = asn1ct:compile(filename:join(DataDir,"IllegalExport"),[{outdir,OutDir}]). + +testImport(suite) -> + []; +testImport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line _OutDir = ?config(priv_dir,Config), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER]), + ok. + +testMegaco(suite) -> + []; +testMegaco(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + io:format("Config: ~p~n",[Config]), + ?line {ok,ModuleName1,ModuleName2} = testMegaco:compile(Config,?BER,[]), + ?line ok = testMegaco:main(ModuleName1,Config), + ?line ok = testMegaco:main(ModuleName2,Config), + + case ?BER of + ber_bin_v2 -> + ?line {ok,ModuleName3,ModuleName4} = testMegaco:compile(Config,?BER,[driver]), + ?line ok = testMegaco:main(ModuleName3,Config), + ?line ok = testMegaco:main(ModuleName4,Config); + _-> ok + end, + + ?line {ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[]), + ?line ok = testMegaco:main(ModuleName5,Config), + ?line ok = testMegaco:main(ModuleName6,Config), + + ?line ?per_bit_opt({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName5,Config)), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName6,Config)), + + ?line ?uper_bin({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testMegaco:main(ModuleName5,Config)), + ?line ?uper_bin(ok = testMegaco:main(ModuleName6,Config)), + + ?line {ok,ModuleName7,ModuleName8} = testMegaco:compile(Config,?PER,[optimize]), + ?line ok = testMegaco:main(ModuleName7,Config), + ?line ok = testMegaco:main(ModuleName8,Config). + + +testMvrasn6(suite) -> []; +testMvrasn6(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMvrasn6:compile(Config,?BER), + ?line testMvrasn6:main(). + +testContextSwitchingTypes(suite) -> []; +testContextSwitchingTypes(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testContextSwitchingTypes:compile(Config,?BER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?ber_driver(?BER,testContextSwitchingTypes:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?per_bit_opt(testContextSwitchingTypes:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testContextSwitchingTypes:test()), + + ?line ?uper_bin(testContextSwitchingTypes:compile(Config,uper_bin,[])), + ?line ?uper_bin(testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[optimize]), + ?line testContextSwitchingTypes:test(). + +testTypeValueNotation(suite) -> []; +testTypeValueNotation(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + case ?BER of + Ber when Ber == ber; Ber == ber_bin -> + ?line testTypeValueNotation:compile(Config,?BER,[]), + ?line testTypeValueNotation:main(?BER,dummy); + _ -> + ok + end, + + ?line ?ber_driver(?BER,testTypeValueNotation:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTypeValueNotation:main(?BER,optimize)), + + case ?BER of + Ber2 when Ber2 == ber; Ber2 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[]), + ?line testTypeValueNotation:main(?PER,dummy); + _ -> + ok + end, + + ?line ?per_bit_opt(testTypeValueNotation:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testTypeValueNotation:main(?PER,optimize)), + + ?line ?uper_bin(testTypeValueNotation:compile(Config,uper_bin,[])), + ?line ?uper_bin(testTypeValueNotation:main(uper_bin,optimize)), + case ?BER of + Ber3 when Ber3 == ber; Ber3 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[optimize]), + ?line testTypeValueNotation:main(?PER,optimize); + _ -> + ok + end. + +testOpenTypeImplicitTag(suite) -> []; +testOpenTypeImplicitTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testOpenTypeImplicitTag:compile(Config,?BER,[]), + ?line testOpenTypeImplicitTag:main(?BER), + + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:main(?BER)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[]), + ?line testOpenTypeImplicitTag:main(?PER), + + ?line ?per_bit_opt(testOpenTypeImplicitTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testOpenTypeImplicitTag:main(?PER)), + + ?line ?uper_bin(testOpenTypeImplicitTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testOpenTypeImplicitTag:main(uper_bin)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[optimize]), + ?line testOpenTypeImplicitTag:main(?PER). + +duplicate_tags(suite) -> []; +duplicate_tags(Config) -> + ?line DataDir = ?config(data_dir,Config), + {error,{asn1,[{error,{type,_,_,'SeqOpt1Imp',{asn1,{duplicates_of_the_tags,_}}}}]}} = + asn1ct:compile(filename:join(DataDir,"SeqOptional2"),[abs]), + ok. + +rtUI(suite) -> []; +rtUI(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?BER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?PER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:unload_driver(). + +testROSE(suite) -> []; +testROSE(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testROSE:compile(Config,?BER,[]), + + ?line testROSE:compile(Config,?PER,[]), + ?line ?per_bit_opt(testROSE:compile(Config,?PER,[optimize])), + ?line ?uper_bin(testROSE:compile(Config,uper_bin,[])), + ?line testROSE:compile(Config,?PER,[optimize]). + +testINSTANCE_OF(suite) -> []; +testINSTANCE_OF(Config) -> + ?line testINSTANCE_OF:compile(Config,?BER,[]), + ?line testINSTANCE_OF:main(?BER), + + ?line ?ber_driver(?BER,testINSTANCE_OF:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testINSTANCE_OF:main(?BER)), + + ?line testINSTANCE_OF:compile(Config,?PER,[]), + ?line testINSTANCE_OF:main(?PER), + + ?line ?per_bit_opt(testINSTANCE_OF:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testINSTANCE_OF:main(?PER)), + + ?line ?uper_bin(testINSTANCE_OF:compile(Config,uper_bin,[])), + ?line ?uper_bin(testINSTANCE_OF:main(uper_bin)), + + ?line testINSTANCE_OF:compile(Config,?PER,[optimize]), + ?line testINSTANCE_OF:main(?PER). + +testTCAP(suite) -> []; +testTCAP(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testTCAP:compile(Config,?BER,[]), + ?line testTCAP:test(?BER,Config), + + ?line ?ber_driver(?BER,testTCAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTCAP:test(?BER,Config)), + + ?line ?ber_driver(?BER,testTCAP:compile_asn1config(Config,?BER,[asn1config])), + ?line ?ber_driver(?BER,testTCAP:test_asn1config()). + +testDER(suite) ->[]; +testDER(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDER:compile(Config,?BER,[]), + ?line testDER:test(), + + ?line ?ber_driver(?BER,testDER:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDER:test()), + + ?line testParamBasic:compile_der(Config,?BER), + ?line testParamBasic_cases(der), + + + ?line testSeqSetDefaultVal:compile(Config,?BER), + ?line testSeqSetDefaultVal_cases(?BER). + +testSeqSetDefaultVal_cases(?BER) -> + ?line testSeqSetDefaultVal:main(?BER). + + +specialized_decodes(suite) -> []; +specialized_decodes(Config) -> + ?line test_partial_incomplete_decode:compile(Config,?BER,[optimize]), + ?line test_partial_incomplete_decode:test(?BER,Config), + ?line test_selective_decode:test(?BER,Config). + +special_decode_performance(suite) ->[]; +special_decode_performance(Config) -> + ?line ?ber_driver(?BER,test_special_decode_performance:compile(Config,?BER)), + ?line ?ber_driver(?BER,test_special_decode_performance:go(all)). + + +test_driver_load(suite) -> []; +test_driver_load(Config) -> + ?line test_driver_load:compile(Config,?PER), + ?line test_driver_load:test(?PER,5). + +test_ParamTypeInfObj(suite) -> []; +test_ParamTypeInfObj(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"IN-CS-1-Datatypes"),[ber_bin]). + +test_WS_ParamClass(suite) -> []; +test_WS_ParamClass(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"InformationFramework"), + [ber_bin]). + +test_Defed_ObjectIdentifier(suite) -> []; +test_Defed_ObjectIdentifier(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"UsefulDefinitions"), + [ber_bin]). + +testSelectionType(suite) -> []; +testSelectionType(Config) -> + + ?line ok = testSelectionTypes:compile(Config,?BER,[]), + ?line {ok,_} = testSelectionTypes:test(), + + ?line ok = testSelectionTypes:compile(Config,?PER,[]), + ?line {ok,_} = testSelectionTypes:test(). + +testSSLspecs(suite) -> []; +testSSLspecs(Config) -> + + ?line ok = testSSLspecs:compile(Config,?BER, + [optimize,compact_bit_string,der]), + ?line testSSLspecs:run(?BER), + + case code:which(asn1ct) of + cover_compiled -> + ok; + _ -> + ?line ok = testSSLspecs:compile_inline(Config,?BER), + ?line ok = testSSLspecs:run_inline(?BER) + end. + +testNortel(suite) -> []; +testNortel(Config) -> + ?line DataDir = ?config(data_dir,Config), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?BER]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize,driver]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?PER]), + ?line ?per_bit_opt(ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize])), + ?line ?uper_bin(ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[uper_bin])), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize]). +test_undecoded_rest(suite) -> []; +test_undecoded_rest(Config) -> + + ?line ok = test_undecoded_rest:compile(Config,?BER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ok = test_undecoded_rest:compile(Config,?BER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ?per_bit_opt(ok = test_undecoded_rest:compile(Config,?PER,[optimize,undec_rest])), + ?line ?per_bit_opt(ok = test_undecoded_rest:test(undec_rest)), + + ?line ?uper_bin(ok = test_undecoded_rest:compile(Config,uper_bin,[undec_rest])), + ?line ?uper_bin(ok = test_undecoded_rest:test(undec_rest)), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest). + +test_inline(suite) -> []; +test_inline(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok=test_inline:compile(Config,?BER,[]), + ?line test_inline:main(?BER), + ?line test_inline:inline1(Config,?BER,[]), + ?line test_inline:performance2() + end. + +%test_inline_prf(suite) -> []; +%test_inline_prf(Config) -> +% ?line test_inline:performance(Config). + +testTcapsystem(suite) -> []; +testTcapsystem(Config) -> + ?line ok=testTcapsystem:compile(Config,?BER,[]). + +testNBAPsystem(suite) -> []; +testNBAPsystem(Config) -> + ?line ok=testNBAPsystem:compile(Config,?PER,?per_optimize(?BER)), + ?line ok=testNBAPsystem:test(?PER,Config). + +test_compile_options(suite) -> []; +test_compile_options(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok = test_compile_options:wrong_path(Config), + ?line ok = test_compile_options:path(Config), + ?line ok = test_compile_options:noobj(Config), + ?line ok = test_compile_options:record_name_prefix(Config), + ?line ok = test_compile_options:verbose(Config) + end. +testDoubleEllipses(suite) -> []; +testDoubleEllipses(Config) -> + ?line testDoubleEllipses:compile(Config,?BER,[]), + ?line testDoubleEllipses:main(?BER), + ?line ?ber_driver(?BER,testDoubleEllipses:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDoubleEllipses:main(?BER)), + ?line ?per_bit_opt(testDoubleEllipses:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDoubleEllipses:main(?PER)), + ?line ?uper_bin(testDoubleEllipses:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDoubleEllipses:main(uper_bin)), + ?line testDoubleEllipses:compile(Config,?PER,?per_optimize(?BER)), + ?line testDoubleEllipses:main(?PER). + +test_modified_x420(suite) -> []; +test_modified_x420(Config) -> + ?line test_modified_x420:compile(Config), + ?line test_modified_x420:test_io(Config). + +testX420(suite) -> []; +testX420(Config) -> + ?line testX420:compile(?BER,[der],Config), + ?line ok = testX420:ticket7759(?BER,Config), + ?line testX420:compile(?PER,[],Config). + +test_x691(suite) -> []; +test_x691(Config) -> + case ?PER of + per -> + ?line ok = test_x691:compile(Config,uper_bin,[]), + ?line true = test_x691:cases(uper_bin,unaligned), + ?line ok = test_x691:compile(Config,?PER,[]), + ?line true = test_x691:cases(?PER,aligned), +%% ?line ok = asn1_test_lib:ticket_7678(Config,[]), + ?line ok = asn1_test_lib:ticket_7708(Config,[]), + ?line ok = asn1_test_lib:ticket_7763(Config); + _ -> + ?line ok = test_x691:compile(Config,?PER,?per_optimize(?BER)), + ?line true = test_x691:cases(?PER,aligned) + end. +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[compact_bit_string]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize,compact_bit_string]). + + +ticket_6143(suite) -> []; +ticket_6143(Config) -> + ?line ok = test_compile_options:ticket_6143(Config). + +testExtensionAdditionGroup(suite) -> []; +testExtensionAdditionGroup(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line PrivDir = ?config(priv_dir,Config), + ?line Path = code:get_path(), + ?line code:add_patha(PrivDir), + DoIt = fun(Erule) -> + ?line ok = asn1ct:compile(filename:join(DataDir,"Extension-Addition-Group"),[Erule,{outdir,PrivDir}]), + ?line {ok,_M} = compile:file(filename:join(DataDir,"extensionAdditionGroup"),[{i,PrivDir},{outdir,PrivDir},debug_info]), + ?line ok = extensionAdditionGroup:run(Erule) + end, + ?line [DoIt(Rule)|| Rule <- [per_bin,uper_bin,ber_bin]], + ?line code:set_path(Path). + + + +% parse_modules() -> +% ["ImportsFrom"]. + +per_modules() -> + [X || X <- test_modules()]. +ber_modules() -> + [X || X <- test_modules(), + X =/= "CommonDataTypes", + X =/= "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + X =/= "H323-MESSAGES", + X =/= "H235-SECURITY-MESSAGES", + X =/= "MULTIMEDIA-SYSTEM-CONTROL"]. +test_modules() -> + _Modules = [ + "BitStr", + "CommonDataTypes", + "Constraints", + "ContextSwitchingTypes", + "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + "Enum", + "From", + "H235-SECURITY-MESSAGES", + "H323-MESSAGES", + %%"MULTIMEDIA-SYSTEM-CONTROL", recursive type , problem for asn1ct:value + "Import", + "Int", + "MAP-commonDataTypes", +% ambigous tags "MAP-insertSubscriberData-def", + "Null", + "Octetstr", + "One", + "P-Record", + "P", +% "PDUs", + "Person", + "PrimStrings", + "Real", + "XSeq", + "XSeqOf", + "XSet", + "XSetOf", + "String", + "SwCDR", +% "Syntax", + "Time" +% ANY "Tst", +% "Two", +% errors that should be detected "UndefType" +] ++ + [ + "SeqSetLib", % must be compiled before Seq and Set + "Seq", + "Set", + "SetOf", + "SeqOf", + "Prim", + "Cho", + "Def", + "Opt", + "ELDAPv3", + "LDAP" + ]. + + +common() -> []. + +particular() -> []. diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl new file mode 100644 index 0000000000..caa6d4dcdd --- /dev/null +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -0,0 +1,2467 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%% Purpose : Test suite for the ASN.1 application + +-module(asn1_bin_v2_SUITE). +-define(PER,'per_bin'). +-define(BER,'ber_bin_v2'). +-define(ber_driver(Erule,Func), + case Erule of + ber_bin_v2 -> + Func; + _ -> ok + end). +-define(per_optimize(Erule), + case Erule of + ber_bin_v2 ->[optimize]; + _ -> [] + end). +-define(per_bit_opt(FuncCall), + case ?BER of + ber_bin_v2 -> FuncCall; +% _ -> {skip,"only for bit optimized per_bin"} + _ -> ok + end). +-define(uper_bin(FuncCall), + case ?PER of + per -> FuncCall; + _ -> ok + end). + +-compile(export_all). +%%-export([Function/Arity, ...]). + +-include_lib("test_server/include/test_server.hrl"). + +%% records used by test-case default +-record('Def1',{ +bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). + +%-record('Def2',{ +%bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}). + +%-record('Def3',{ +%bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}). + + + +all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, + ber,testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, + testChoTypeRefSet, testDef, testOpt, testSeqDefault, + testSeqExtension, testSeqExternal, testSeqOptional, + testSeqPrim, testSeqTag, testSeqTypeRefCho, + testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, + testSeqOf, testSeqOfIndefinite, testSeqOfCho, + testSeqOfExternal, testSetDefault, testSetExtension, + testExtensionAdditionGroup, + testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, + testSetTag, testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, + testSetOfExternal, testSetOfTag, testEnumExt, value_test, + testSeq2738, constructed, ber_decode_error, + h323test, testSeqIndefinite, testSetIndefinite, + testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, + testInvokeMod, testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, + testINSTANCE_OF,testTCAP,testDER,specialized_decodes, + special_decode_performance,test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel,test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options,testDoubleEllipses, test_modified_x420, + testX420, test_x691,ticket_6143, testExtensionAdditionGroup + ] ++ common() ++ particular(). + +%all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. + +option_tests(suite) -> + [test_compile_options,ticket_6143]. + +infobj(suite) -> + [testInfObjectClass, testParameterizedInfObj, testMergeCompile, + testobj, testDeepTConstr]. + +performance(suite) -> + [testTimer_ber, testTimer_ber_opt_driver, + testTimer_per, testTimer_per_opt, testTimer_uper_bin]. + +bugs(suite) -> + [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. + +init_per_testcase(Func,Config) -> + %%?line test_server:format("Func: ~p~n",[Func]), + ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), + ?line code:add_patha(?config(priv_dir,Config)), + Dog= + case Func of + testX420 -> + test_server:timetrap({minutes,60}); % 60 minutes + _ -> + test_server:timetrap({minutes,30}) % 60 minutes + end, +%% Dog=test_server:timetrap(1800000), % 30 minutes + [{watchdog, Dog}|Config]. + +end_per_testcase(_Func,Config) -> + Dog=?config(watchdog, Config), + test_server:timetrap_cancel(Dog). + + +testPrim(suite) -> []; +testPrim(Config) -> + ?line testPrim:compile(Config,?BER,[]), + ?line testPrim_cases(?BER), + ?line ?ber_driver(?BER,testPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrim_cases(?BER)), + ?line testPrim:compile(Config,?PER,[]), + ?line testPrim_cases(?PER), + ?line ?per_bit_opt(testPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrim_cases(?PER)), + ?line ?uper_bin(testPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrim_cases(uper_bin)), + ?line testPrim:compile(Config,?PER,[optimize]), + ?line testPrim_cases(?PER). + +testPrim_cases(Rules) -> + ?line testPrim:bool(Rules), + ?line testPrim:int(Rules), + ?line testPrim:enum(Rules), + ?line testPrim:obj_id(Rules), + ?line testPrim:rel_oid(Rules), + ?line testPrim:null(Rules), + ?line testPrim:real(Rules). + + +testCompactBitString(suite) -> []; +testCompactBitString(Config) -> + + ?line testCompactBitString:compile(Config,?BER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?BER), + + ?line ?ber_driver(?BER,testCompactBitString:compile(Config,?BER,[compact_bit_string,driver])), + ?line ?ber_driver(?BER,testCompactBitString:compact_bit_string(?BER)), + + ?line testCompactBitString:compile(Config,?PER,[compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line ?per_bit_opt(testCompactBitString:compile(Config,?PER, + [compact_bit_string,optimize])), + ?line ?per_bit_opt(testCompactBitString:compact_bit_string(?PER)), + ?line ?per_bit_opt(testCompactBitString:bit_string_unnamed(?PER)), + ?line ?per_bit_opt(testCompactBitString:ticket_7734(?PER)), + + ?line ?uper_bin(testCompactBitString:compile(Config,uper_bin, + [compact_bit_string])), + ?line ?uper_bin(testCompactBitString:compact_bit_string(uper_bin)), + ?line ?uper_bin(testCompactBitString:bit_string_unnamed(uper_bin)), + + ?line testCompactBitString:compile(Config,?PER,[optimize,compact_bit_string]), + ?line testCompactBitString:compact_bit_string(?PER), + ?line testCompactBitString:bit_string_unnamed(?PER), + + ?line testCompactBitString:otp_4869(?PER). + + +testPrimStrings(suite) -> []; +testPrimStrings(Config) -> + + ?line testPrimStrings:compile(Config,?BER,[]), + ?line testPrimStrings_cases(?BER), + ?line testPrimStrings:more_strings(?BER), %% these are not implemented in per yet + ?line ?ber_driver(?BER,testPrimStrings:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimStrings_cases(?BER)), + ?line ?ber_driver(?BER,testPrimStrings:more_strings(?BER)), + + ?line testPrimStrings:compile(Config,?PER,[]), + ?line testPrimStrings_cases(?PER), + + ?line ?per_bit_opt(testPrimStrings:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimStrings_cases(?PER)), + + ?line ?uper_bin(testPrimStrings:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimStrings_cases(uper_bin)), + + ?line testPrimStrings:compile(Config,?PER,[optimize]), + ?line testPrimStrings_cases(?PER). + +testPrimStrings_cases(Rules) -> + ?line testPrimStrings:bit_string(Rules), + ?line testPrimStrings:bit_string_unnamed(Rules), + ?line testPrimStrings:octet_string(Rules), + ?line testPrimStrings:numeric_string(Rules), + ?line testPrimStrings:other_strings(Rules), + ?line testPrimStrings:universal_string(Rules), + ?line testPrimStrings:bmp_string(Rules), + ?line testPrimStrings:times(Rules), + ?line testPrimStrings:utf8_string(Rules). + + + +testPrimExternal(suite) -> []; +testPrimExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testPrimExternal:compile(Config,?BER,[]), + ?line testPrimExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testPrimExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testPrimExternal:compile(Config,?PER,[]), + ?line testPrimExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testPrimExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testPrimExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal:compile(Config,?PER,[optimize]), + ?line testPrimExternal_cases(?PER). + +testPrimExternal_cases(Rules) -> + ?line testPrimExternal:external(Rules). + + + + +testChoPrim(suite) -> []; +testChoPrim(Config) -> + + ?line testChoPrim:compile(Config,?BER,[]), + ?line testChoPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoPrim_cases(?BER)), + + ?line testChoPrim:compile(Config,?PER,[]), + ?line testChoPrim_cases(?PER), + + ?line ?per_bit_opt(testChoPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoPrim_cases(?PER)), + + ?line ?uper_bin(testChoPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoPrim_cases(uper_bin)), + + ?line testChoPrim:compile(Config,?PER,[optimize]), + ?line testChoPrim_cases(?PER). + +testChoPrim_cases(Rules) -> + ?line testChoPrim:bool(Rules), + ?line testChoPrim:int(Rules). + + + +testChoExtension(suite) -> []; +testChoExtension(Config) -> + + ?line testChoExtension:compile(Config,?BER,[]), + ?line testChoExtension_cases(?BER), + + ?line ?ber_driver(?BER,testChoExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExtension_cases(?BER)), + + ?line testChoExtension:compile(Config,?PER,[]), + ?line testChoExtension_cases(?PER), + + ?line ?per_bit_opt(testChoExtension:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExtension_cases(?PER)), + + ?line ?uper_bin(testChoExtension:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExtension_cases(uper_bin)), + + ?line testChoExtension:compile(Config,?PER,[optimize]), + ?line testChoExtension_cases(?PER). + +testChoExtension_cases(Rules) -> + ?line testChoExtension:extension(Rules). + + + +testChoExternal(suite) -> []; +testChoExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testChoExternal:compile(Config,?BER,[]), + ?line testChoExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testChoExternal:compile(Config,?PER,[]), + ?line testChoExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal:compile(Config,?PER,[optimize]), + ?line testChoExternal_cases(?PER). + + +testChoExternal_cases(Rules) -> + ?line testChoExternal:external(Rules). + + + +testChoOptional(suite) -> []; +testChoOptional(Config) -> + + ?line testChoOptional:compile(Config,?BER,[]), + ?line testChoOptional_cases(?BER), + + ?line ?ber_driver(?BER,testChoOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoOptional_cases(?BER)), + + ?line testChoOptional:compile(Config,?PER,[]), + ?line testChoOptional_cases(?PER), + + ?line ?per_bit_opt(testChoOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoOptional_cases(?PER)), + + ?line ?uper_bin(testChoOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoOptional_cases(uper_bin)), + + ?line testChoOptional:compile(Config,?PER,[optimize]), + ?line testChoOptional_cases(?PER). + +testChoOptional_cases(Rules) -> + ?line testChoOptional:optional(Rules). + +testChoOptionalImplicitTag(suite) -> []; +testChoOptionalImplicitTag(Config) -> + %% Only meaningful for ?BER + ?line testChoOptionalImplicitTag:compile(Config,?BER), + ?line testChoOptionalImplicitTag:optional(?BER). + + +testChoRecursive(suite) -> []; +testChoRecursive(Config) -> + + ?line testChoRecursive:compile(Config,?BER,[]), + ?line testChoRecursive_cases(?BER), + + ?line ?ber_driver(?BER,testChoRecursive:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoRecursive_cases(?BER)), + + ?line testChoRecursive:compile(Config,?PER,[]), + ?line testChoRecursive_cases(?PER), + + ?line ?per_bit_opt(testChoRecursive:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoRecursive_cases(?PER)), + + ?line ?uper_bin(testChoRecursive:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoRecursive_cases(uper_bin)), + + ?line testChoRecursive:compile(Config,?PER,[optimize]), + ?line testChoRecursive_cases(?PER). + +testChoRecursive_cases(Rules) -> + ?line testChoRecursive:recursive(Rules). + + + +testChoTypeRefCho(suite) -> []; +testChoTypeRefCho(Config) -> + + ?line testChoTypeRefCho:compile(Config,?BER,[]), + ?line testChoTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefCho_cases(?BER)), + + ?line testChoTypeRefCho:compile(Config,?PER,[]), + ?line testChoTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefCho_cases(uper_bin)), + + ?line testChoTypeRefCho:compile(Config,?PER,[optimize]), + ?line testChoTypeRefCho_cases(?PER). + +testChoTypeRefCho_cases(Rules) -> + ?line testChoTypeRefCho:choice(Rules). + + + +testChoTypeRefPrim(suite) -> []; +testChoTypeRefPrim(Config) -> + + ?line testChoTypeRefPrim:compile(Config,?BER,[]), + ?line testChoTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefPrim_cases(?BER)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[]), + ?line testChoTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefPrim_cases(uper_bin)), + + ?line testChoTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testChoTypeRefPrim_cases(?PER). + +testChoTypeRefPrim_cases(Rules) -> + ?line testChoTypeRefPrim:prim(Rules). + + + +testChoTypeRefSeq(suite) -> []; +testChoTypeRefSeq(Config) -> + + ?line testChoTypeRefSeq:compile(Config,?BER,[]), + ?line testChoTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSeq_cases(?BER)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[]), + ?line testChoTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSeq_cases(uper_bin)), + + ?line testChoTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSeq_cases(?PER). + +testChoTypeRefSeq_cases(Rules) -> + ?line testChoTypeRefSeq:seq(Rules). + + + +testChoTypeRefSet(suite) -> []; +testChoTypeRefSet(Config) -> + + ?line testChoTypeRefSet:compile(Config,?BER,[]), + ?line testChoTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testChoTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoTypeRefSet_cases(?BER)), + + ?line testChoTypeRefSet:compile(Config,?PER,[]), + ?line testChoTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testChoTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testChoTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testChoTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testChoTypeRefSet_cases(uper_bin)), + + ?line testChoTypeRefSet:compile(Config,?PER,[optimize]), + ?line testChoTypeRefSet_cases(?PER). + +testChoTypeRefSet_cases(Rules) -> + ?line testChoTypeRefSet:set(Rules). + + + +testDef(suite) -> []; +testDef(Config) -> + + ?line testDef:compile(Config,?BER,[]), + ?line testDef_cases(?BER), + + ?line ?ber_driver(?BER,testDef:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDef_cases(?BER)), + + ?line testDef:compile(Config,?PER,[]), + ?line testDef_cases(?PER), + + ?line ?per_bit_opt(testDef:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDef_cases(?PER)), + + ?line ?uper_bin(testDef:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDef_cases(uper_bin)), + + ?line testDef:compile(Config,?PER,[optimize]), + ?line testDef_cases(?PER). + +testDef_cases(Rules) -> + ?line testDef:main(Rules). + + + +testOpt(suite) -> []; +testOpt(Config) -> + + ?line testOpt:compile(Config,?BER), + ?line testOpt_cases(?BER), + + ?line testOpt:compile(Config,?PER), + ?line testOpt_cases(?PER). + +testOpt_cases(Rules) -> + ?line testOpt:main(Rules). + + +testEnumExt(suite) -> []; +testEnumExt(Config) -> + + ?line testEnumExt:compile(Config,?BER,[]), + ?line testEnumExt:main(?BER), + + ?line ?ber_driver(?BER,testEnumExt:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testEnumExt:main(?BER)), + + ?line testEnumExt:compile(Config,?PER,[]), + ?line testEnumExt:main(?PER), + + ?line ?per_bit_opt(testEnumExt:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testEnumExt:main(?PER)), + + ?line ?uper_bin(testEnumExt:compile(Config,uper_bin,[])), + ?line ?uper_bin(testEnumExt:main(uper_bin)), + + ?line testEnumExt:compile(Config,?PER,[optimize]), + ?line testEnumExt:main(?PER). + +testSeqDefault(doc) -> ["Test of OTP-2523 ENUMERATED with extensionmark."]; +testSeqDefault(suite) -> []; +testSeqDefault(Config) -> + + ?line testSeqDefault:compile(Config,?BER,[]), + ?line testSeqDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSeqDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqDefault_cases(?BER)), + + ?line testSeqDefault:compile(Config,?PER,[]), + ?line testSeqDefault_cases(?PER), + + ?line ?per_bit_opt(testSeqDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqDefault_cases(?PER)), + + ?line ?uper_bin(testSeqDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqDefault_cases(uper_bin)), + + ?line testSeqDefault:compile(Config,?PER,[optimize]), + ?line testSeqDefault_cases(?PER). + +testSeqDefault_cases(Rules) -> + ?line testSeqDefault:main(Rules). + + + +testSeqExtension(suite) -> []; +testSeqExtension(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExtension:compile(Config,?BER,[]), + ?line testSeqExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExtension_cases(?BER)). + +testSeqExtension_cases(Rules) -> + ?line testSeqExtension:main(Rules). + + + +testSeqExternal(suite) -> []; +testSeqExternal(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqExternal:compile(Config,?BER,[]), + ?line testSeqExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqExternal_cases(?BER)). + +testSeqExternal_cases(Rules) -> + ?line testSeqExternal:main(Rules). + + +testSeqOptional(suite) -> []; +testSeqOptional(Config) -> + + ?line testSeqOptional:compile(Config,?BER,[]), + ?line testSeqOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOptional_cases(?BER)), + + ?line testSeqOptional:compile(Config,?PER,[]), + ?line testSeqOptional_cases(?PER), + + ?line ?per_bit_opt(testSeqOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOptional_cases(?PER)), + + ?line ?uper_bin(testSeqOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOptional_cases(uper_bin)), + + ?line testSeqOptional:compile(Config,?PER,[optimize]), + ?line testSeqOptional_cases(?PER). + +testSeqOptional_cases(Rules) -> + ?line testSeqOptional:main(Rules). + + + +testSeqPrim(suite) -> []; +testSeqPrim(Config) -> + + ?line testSeqPrim:compile(Config,?BER,[]), + ?line testSeqPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqPrim_cases(?BER)), + + ?line testSeqPrim:compile(Config,?PER,[]), + ?line testSeqPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqPrim_cases(?PER)), + + ?line ?uper_bin(testSeqPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqPrim_cases(uper_bin)), + + ?line testSeqPrim:compile(Config,?PER,[optimize]), + ?line testSeqPrim_cases(?PER). + +testSeqPrim_cases(Rules) -> + ?line testSeqPrim:main(Rules). + + +testSeq2738(doc) -> ["Test of OTP-2738 Detect corrupt optional component."]; +testSeq2738(suite) -> []; +testSeq2738(Config) -> + + ?line testSeq2738:compile(Config,?BER,[]), + ?line testSeq2738_cases(?BER), + + ?line ?ber_driver(?BER,testSeq2738:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeq2738_cases(?BER)), + + ?line testSeq2738:compile(Config,?PER,[]), + ?line testSeq2738_cases(?PER), + + ?line ?per_bit_opt(testSeq2738:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeq2738_cases(?PER)), + + ?line ?uper_bin(testSeq2738:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeq2738_cases(uper_bin)), + + ?line testSeq2738:compile(Config,?PER,[optimize]), + ?line testSeq2738_cases(?PER). + +testSeq2738_cases(Rules) -> + ?line testSeq2738:main(Rules). + + +testSeqTag(suite) -> []; +testSeqTag(Config) -> + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqTag:compile(Config,?BER,[]), + ?line testSeqTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqTag:compile(Config,?PER,[]), + ?line testSeqTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqTag:compile(Config,?PER,[optimize]), + ?line testSeqTag_cases(?PER). + +testSeqTag_cases(Rules) -> + ?line testSeqTag:main(Rules). + + + + +testSeqTypeRefCho(suite) -> []; +testSeqTypeRefCho(Config) -> + + ?line testSeqTypeRefCho:compile(Config,?BER,[]), + ?line testSeqTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefCho_cases(?BER)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[]), + ?line testSeqTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefCho_cases(uper_bin)), + + ?line testSeqTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefCho_cases(?PER). + +testSeqTypeRefCho_cases(Rules) -> + ?line testSeqTypeRefCho:main(Rules). + + + +testSeqTypeRefPrim(suite) -> []; +testSeqTypeRefPrim(Config) -> + + ?line testSeqTypeRefPrim:compile(Config,?BER,[]), + ?line testSeqTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefPrim_cases(?BER)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[]), + ?line testSeqTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefPrim_cases(uper_bin)), + + ?line testSeqTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefPrim_cases(?PER). + +testSeqTypeRefPrim_cases(Rules) -> + ?line testSeqTypeRefPrim:main(Rules). + + + +testSeqTypeRefSeq(suite) -> []; +testSeqTypeRefSeq(Config) -> + + ?line testSeqTypeRefSeq:compile(Config,?BER,[]), + ?line testSeqTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSeq_cases(?BER)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[]), + ?line testSeqTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSeq_cases(uper_bin)), + + ?line testSeqTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSeq_cases(?PER). + +testSeqTypeRefSeq_cases(Rules) -> + ?line testSeqTypeRefSeq:main(Rules). + + + +testSeqTypeRefSet(suite) -> []; +testSeqTypeRefSet(Config) -> + + ?line testSeqTypeRefSet:compile(Config,?BER,[]), + ?line testSeqTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSeqTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqTypeRefSet_cases(?BER)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[]), + ?line testSeqTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSeqTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSeqTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqTypeRefSet_cases(uper_bin)), + + ?line testSeqTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSeqTypeRefSet_cases(?PER). + +testSeqTypeRefSet_cases(Rules) -> + ?line testSeqTypeRefSet:main(Rules). + + + + +testSeqOf(suite) -> []; +testSeqOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOf:compile(Config,?BER,[]), + ?line testSeqOf_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOf_cases(?BER)), + + ?line testSeqOf:compile(Config,?PER,[]), + ?line testSeqOf_cases(?PER), + + ?line ?per_bit_opt(testSeqOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOf_cases(?PER)), + + ?line ?uper_bin(testSeqOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOf_cases(uper_bin)), + + ?line testSeqOf:compile(Config,?PER,[optimize]), + ?line testSeqOf_cases(?PER). + +testSeqOf_cases(Rules) -> + ?line testSeqOf:main(Rules). + + + + +testSeqOfCho(suite) -> []; +testSeqOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfCho:compile(Config,?BER,[]), + ?line testSeqOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSeqOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfCho_cases(?BER)), + + ?line testSeqOfCho:compile(Config,?PER,[]), + ?line testSeqOfCho_cases(?PER), + + ?line ?per_bit_opt(testSeqOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfCho_cases(?PER)), + + ?line ?uper_bin(testSeqOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfCho_cases(uper_bin)), + + ?line testSeqOfCho:compile(Config,?PER,[optimize]), + ?line testSeqOfCho_cases(?PER). + +testSeqOfIndefinite(suite) -> []; +testSeqOfIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqOfIndefinite:compile(Config,?BER,[]), + ?line testSeqOfIndefinite:main(), + + ?line ?ber_driver(?BER,testSeqOfIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfIndefinite:main()). + +testSeqOfCho_cases(Rules) -> + ?line testSeqOfCho:main(Rules). + + +testSeqOfExternal(suite) -> []; +testSeqOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal:compile(Config,?BER,[]), + ?line testSeqOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal:compile(Config,?PER,[]), + ?line testSeqOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfExternal_cases(?PER). + +testSeqOfExternal_cases(Rules) -> + ?line testSeqOfExternal:main(Rules). + + + +testSeqOfTag(suite) -> []; +testSeqOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSeqOfTag:compile(Config,?BER,[]), + ?line testSeqOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSeqOfTag:compile(Config,?PER,[]), + ?line testSeqOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSeqOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSeqOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSeqOfTag:compile(Config,?PER,[optimize]), + ?line testSeqOfTag_cases(?PER). + +testSeqOfTag_cases(Rules) -> + ?line testSeqOfTag:main(Rules). + + + + +testSetDefault(suite) -> []; +testSetDefault(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetDefault:compile(Config,?BER,[]), + ?line testSetDefault_cases(?BER), + + ?line ?ber_driver(?BER,testSetDefault:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetDefault_cases(?BER)), + + ?line testSetDefault:compile(Config,?PER,[]), + ?line testSetDefault_cases(?PER), + + ?line ?per_bit_opt(testSetDefault:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetDefault_cases(?PER)), + + ?line ?uper_bin(testSetDefault:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetDefault_cases(uper_bin)), + + ?line testSetDefault:compile(Config,?PER,[optimize]), + ?line testSetDefault_cases(?PER). + +testSetDefault_cases(Rules) -> + ?line testSetDefault:main(Rules). + + +testParamBasic(suite) -> []; +testParamBasic(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParamBasic:compile(Config,?BER,[]), + ?line testParamBasic_cases(?BER), + + ?line ?ber_driver(?BER,testParamBasic:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParamBasic_cases(?BER)), + + ?line testParamBasic:compile(Config,?PER,[]), + ?line testParamBasic_cases(?PER), + + ?line ?per_bit_opt(testParamBasic:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParamBasic_cases(?PER)), + + ?line ?uper_bin(testParamBasic:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParamBasic_cases(uper_bin)), + + ?line testParamBasic:compile(Config,?PER,[optimize]), + ?line testParamBasic_cases(?PER). + + +testParamBasic_cases(Rules) -> + ?line testParamBasic:main(Rules). + +testSetExtension(suite) -> []; +testSetExtension(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExtension:compile(Config,?BER,[]), + ?line testSetExtension_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExtension_cases(?BER)). + +testSetExtension_cases(Rules) -> + ?line testSetExtension:main(Rules). + + +testSetExternal(suite) -> []; +testSetExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetExternal:compile(Config,?BER,[]), + ?line testSetExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetExternal_cases(?BER)). + +testSetExternal_cases(Rules) -> + ?line testSetExternal:main(Rules). + + +testSetOptional(suite) -> []; +testSetOptional(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOptional:compile(Config,?BER,[]), + ?line testSetOptional_cases(?BER), + + ?line ?ber_driver(?BER,testSetOptional:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOptional_cases(?BER)), + + ?line testSetOptional:compile(Config,?PER,[]), + ?line testSetOptional_cases(?PER), + + ?line ?per_bit_opt(testSetOptional:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOptional_cases(?PER)), + + ?line ?uper_bin(testSetOptional:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOptional_cases(uper_bin)), + + ?line testSetOptional:compile(Config,?PER,[optimize]), + ?line testSetOptional_cases(?PER). + +testSetOptional_cases(Rules) -> + ?line ok = testSetOptional:ticket_7533(Rules), + ?line ok = testSetOptional:main(Rules). + + + + +testSetPrim(suite) -> []; +testSetPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetPrim:compile(Config,?BER,[]), + ?line testSetPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetPrim_cases(?BER)), + + ?line testSetPrim:compile(Config,?PER,[]), + ?line testSetPrim_cases(?PER), + + ?line ?per_bit_opt(testSetPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetPrim_cases(?PER)), + + ?line ?uper_bin(testSetPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetPrim_cases(uper_bin)), + + ?line testSetPrim:compile(Config,?PER,[optimize]), + ?line testSetPrim_cases(?PER). + +testSetPrim_cases(Rules) -> + ?line testSetPrim:main(Rules). + + + +testSetTag(suite) -> []; +testSetTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetTag:compile(Config,?BER,[]), + ?line testSetTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetTag:compile(Config,?PER,[]), + ?line testSetTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetTag:compile(Config,?PER,[optimize]), + ?line testSetTag_cases(?PER). + +testSetTag_cases(Rules) -> + ?line testSetTag:main(Rules). + + + +testSetTypeRefCho(suite) -> []; +testSetTypeRefCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefCho:compile(Config,?BER,[]), + ?line testSetTypeRefCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefCho_cases(?BER)), + + ?line testSetTypeRefCho:compile(Config,?PER,[]), + ?line testSetTypeRefCho_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefCho_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefCho_cases(uper_bin)), + + ?line testSetTypeRefCho:compile(Config,?PER,[optimize]), + ?line testSetTypeRefCho_cases(?PER). + +testSetTypeRefCho_cases(Rules) -> + ?line testSetTypeRefCho:main(Rules). + + + +testSetTypeRefPrim(suite) -> []; +testSetTypeRefPrim(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefPrim:compile(Config,?BER,[]), + ?line testSetTypeRefPrim_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefPrim:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefPrim_cases(?BER)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[]), + ?line testSetTypeRefPrim_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefPrim:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefPrim_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefPrim:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefPrim_cases(uper_bin)), + + ?line testSetTypeRefPrim:compile(Config,?PER,[optimize]), + ?line testSetTypeRefPrim_cases(?PER). + +testSetTypeRefPrim_cases(Rules) -> + ?line testSetTypeRefPrim:main(Rules). + + + +testSetTypeRefSeq(suite) -> []; +testSetTypeRefSeq(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSeq:compile(Config,?BER,[]), + ?line testSetTypeRefSeq_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSeq:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSeq_cases(?BER)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[]), + ?line testSetTypeRefSeq_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSeq:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSeq_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSeq:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSeq_cases(uper_bin)), + + ?line testSetTypeRefSeq:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSeq_cases(?PER). + +testSetTypeRefSeq_cases(Rules) -> + ?line testSetTypeRefSeq:main(Rules). + + + +testSetTypeRefSet(suite) -> []; +testSetTypeRefSet(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetTypeRefSet:compile(Config,?BER,[]), + ?line testSetTypeRefSet_cases(?BER), + + ?line ?ber_driver(?BER,testSetTypeRefSet:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetTypeRefSet_cases(?BER)), + + ?line testSetTypeRefSet:compile(Config,?PER,[]), + ?line testSetTypeRefSet_cases(?PER), + + ?line ?per_bit_opt(testSetTypeRefSet:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetTypeRefSet_cases(?PER)), + + ?line ?uper_bin(testSetTypeRefSet:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetTypeRefSet_cases(uper_bin)), + + ?line testSetTypeRefSet:compile(Config,?PER,[optimize]), + ?line testSetTypeRefSet_cases(?PER). + +testSetTypeRefSet_cases(Rules) -> + ?line testSetTypeRefSet:main(Rules). + + + +testSetOf(suite) -> []; +testSetOf(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOf:compile(Config,?BER,[]), + ?line testSetOf_cases(?BER), + + ?line ?ber_driver(?BER,testSetOf:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOf_cases(?BER)), + + ?line testSetOf:compile(Config,?PER,[]), + ?line testSetOf_cases(?PER), + + ?line ?per_bit_opt(testSetOf:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOf_cases(?PER)), + + ?line ?uper_bin(testSetOf:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOf_cases(uper_bin)), + + ?line testSetOf:compile(Config,?PER,[optimize]), + ?line testSetOf_cases(?PER). + +testSetOf_cases(Rules) -> + ?line testSetOf:main(Rules). + + + +testSetOfCho(suite) -> []; +testSetOfCho(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetOfCho:compile(Config,?BER,[]), + ?line testSetOfCho_cases(?BER), + + ?line ?ber_driver(?BER,testSetOfCho:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfCho_cases(?BER)), + + ?line testSetOfCho:compile(Config,?PER,[]), + ?line testSetOfCho_cases(?PER), + + ?line ?per_bit_opt(testSetOfCho:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfCho_cases(?PER)), + + ?line ?uper_bin(testSetOfCho:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfCho_cases(uper_bin)), + + ?line testSetOfCho:compile(Config,?PER,[optimize]), + ?line testSetOfCho_cases(?PER). + +testSetOfCho_cases(Rules) -> + ?line testSetOfCho:main(Rules). + + +testSetOfExternal(suite) -> []; +testSetOfExternal(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfExternal:compile(Config,?BER,[]), + ?line testSetOfExternal_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfExternal_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfExternal:compile(Config,?PER,[]), + ?line testSetOfExternal_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfExternal_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfExternal_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal:compile(Config,?PER,[optimize]), + ?line testSetOfExternal_cases(?PER). + +testSetOfExternal_cases(Rules) -> + ?line testSetOfExternal:main(Rules). + + + + +testSetOfTag(suite) -> []; +testSetOfTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testExternal:compile(Config,?BER,[]), + ?line testSetOfTag:compile(Config,?BER,[]), + ?line testSetOfTag_cases(?BER), + + ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetOfTag_cases(?BER)), + + ?line testExternal:compile(Config,?PER,[]), + ?line testSetOfTag:compile(Config,?PER,[]), + ?line testSetOfTag_cases(?PER), + + ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testSetOfTag_cases(?PER)), + + ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testSetOfTag_cases(uper_bin)), + + ?line testExternal:compile(Config,?PER,[optimize]), + ?line testSetOfTag:compile(Config,?PER,[optimize]), + ?line testSetOfTag_cases(?PER). + +testSetOfTag_cases(Rules) -> + ?line testSetOfTag:main(Rules). + +compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; +compile(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line True = lists:member(TempDir,code:get_path()), + ?line test_server:format("~p~n",[True]), + ?line test_server:format("~p~n",[code:get_path()]), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), + test_server:format("first String ok~n"), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), + ok. + +c_syntax(suite) -> []; +c_syntax(Config) -> + ?line DataDir% ?line testExternal:compile(Config,?PER), +% ?line testPrimExternal:compile(Config,?PER), +% ?line testPrimExternal_cases(?PER). + = ?config(data_dir,Config), + ?line _TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"BadTypeEnding")), + ?line {error,_R3} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment1")), + ?line {error,_R4} = asn1ct:compile(filename:join(DataDir, + "BadValueAssignment2")), + ?line {error,_R5} = asn1ct:compile(filename:join(DataDir, + "BadValueSet")), + ?line {error,_R6} = asn1ct:compile(filename:join(DataDir, + "ChoiceBadExtension")), + ?line {error,_R7} = asn1ct:compile(filename:join(DataDir, + "EnumerationBadExtension")), + ?line {error,_R8} = asn1ct:compile(filename:join(DataDir, + "Example")), + ?line {error,_R9} = asn1ct:compile(filename:join(DataDir, + "Export1")), + ?line {error,_R10} = asn1ct:compile(filename:join(DataDir, + "MissingEnd")), + ?line {error,_R11} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComma")), + ?line {error,_R12} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentName")), + ?line {error,_R13} = asn1ct:compile(filename:join(DataDir, + "SequenceBadComponentType")), + ?line {error,_R14} = asn1ct:compile(filename:join(DataDir, + "SeqBadComma")). + + +c_string_per(suite) -> []; +c_string_per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]). + +c_string_ber(suite) -> []; +c_string_ber(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]). + + +c_implicit_before_choice(suite) -> []; +c_implicit_before_choice(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line TempDir = ?config(priv_dir,Config), + ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]). + +parse(suite) -> []; +parse(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + M1 = test_modules(), +% M2 = parse_modules(), + ?line ok = parse1(M1,DataDir,OutDir). + +parse1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[abs,{outdir,OutDir}]), + parse1(T,DataDir,OutDir); +parse1([],_,_) -> + ok. + +per(suite) -> []; +per(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = per1(per_modules(),DataDir,OutDir), + ?line ?per_bit_opt(per1_bit_opt(per_modules(),DataDir,OutDir)), + ?line ok = per1_opt(per_modules(),DataDir,OutDir). + + +per1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1(T,DataDir,OutDir); +per1([],_,_) -> + ok. + +per1_bit_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimize,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_bit_opt(T,DataDir,OutDir); +per1_bit_opt([],_,_) -> + ok. + +per1_opt([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimized,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + per1_opt(T,DataDir,OutDir); +per1_opt([],_,_) -> + ok. + +ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. + +ber_choiceinseq(suite) ->[]; +ber_choiceinseq(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"ChoiceInSeq"),[?BER,{outdir,OutDir}]). + +ber_optional(suite) ->[]; +ber_optional(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"),[?BER,{outdir,OutDir}]), + ?line V = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(V,element(2,V2)). + +ber_optional_keyed_list(suite) ->[]; +ber_optional_keyed_list(Config) -> + case ?BER of + ber_bin_v2 -> ok; + _ -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"), + [?BER,keyed_list,{outdir,OutDir}]), + ?line Vrecord = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE}, + {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE}, + {'C',asn1_NOVALUE,111,asn1_NOVALUE}}, + ?line V = [ {a,[{scriptKey,10}]}, + {b,[]}, + {c,[{callingPartysCategory,111}]} ], + ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V), + ?line Bytes = lists:flatten(B), + ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes), + ?line ok = eq(Vrecord,element(2,V2)) + end. + + +eq(V,V) -> + ok. + + +ber_other(suite) ->[]; +ber_other(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = ber1(ber_modules(),DataDir,OutDir). + + +ber1([M|T],DataDir,OutDir) -> + ?line ok = asn1ct:compile(DataDir ++ M,[?BER,{outdir,OutDir}]), + ?line ok = asn1ct:test(list_to_atom(M)), + ber1(T,DataDir,OutDir); +ber1([],_,_) -> + ok. + +default_per(suite) ->[]; +default_per(Config) -> + default1(?PER,Config,[]). + +default_per_opt(suite) -> []; +default_per_opt(Config) -> + ?per_bit_opt(default1(?PER,Config,[optimize])), + default1(?PER,Config,[optimize]). + +default_ber(suite) ->[]; +default_ber(Config) -> + default1(?BER,Config,[]). + +default1(Rule,Config,Options) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Def",[Rule,{outdir,OutDir}]++Options), + ?line {ok,Bytes1} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true, + bool1 = true, + bool2 = true, + bool3 = true}), + ?line {ok,{'Def1',true,true,true,true}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes1)), + + ?line {ok,Bytes2} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes2)), + + ?line {ok,Bytes3} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,bool2=false}), + ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes3)). + + +value_test(suite) ->[]; +value_test(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?BER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?PER,{outdir,OutDir}]), + ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()), + ?line ok = test_bad_values:tests(Config), + ok. + + +constructed(suite) -> + []; +constructed(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + ?line ok = asn1ct:compile(DataDir ++ "Constructed",[?BER,{outdir,OutDir}]), + ?line {ok,B} = asn1_wrapper:encode('Constructed','S',{'S',false}), + ?line [40,3,1,1,0] = lists:flatten(B), + ?line {ok,B1} = asn1_wrapper:encode('Constructed','S2',{'S2',false}), + ?line [40,5,48,3,1,1,0] = lists:flatten(B1), + ?line {ok,B2} = asn1_wrapper:encode('Constructed','I',10), + ?line [136,1,10] = lists:flatten(B2), + ok. + +ber_decode_error(suite) -> []; +ber_decode_error(Config) -> + ?line ok = ber_decode_error:compile(Config,?BER,[]), + ?line ok = ber_decode_error:run([]), + + ?line ok = ?ber_driver(?BER,ber_decode_error:compile(Config,?BER,[driver])), + ?line ok = ?ber_driver(?BER,ber_decode_error:run([driver])), + ok. + +h323test(suite) -> + []; +h323test(Config) -> + ?line ok = h323test:compile(Config,?PER,[]), + ?line ok = h323test:run(?PER), + ?line ?per_bit_opt(h323test:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(h323test:run(?PER)), + ?line ?uper_bin(h323test:compile(Config,uper_bin,[])), + ?line ?uper_bin(h323test:run(uper_bin)), + ?line ok = h323test:compile(Config,?PER,[optimize]), + ?line ok = h323test:run(?PER), + ok. + +per_GeneralString(suite) -> + []; +per_GeneralString(Config) -> + case erlang:module_loaded('MULTIMEDIA-SYSTEM-CONTROL') of + true -> + ok; + false -> + h323test:compile(Config,?PER,[]) + end, + UI = [109,64,1,57], + ?line {ok,_V} = asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL', + 'MultimediaSystemControlMessage',UI). + +per_open_type(suite) -> + []; +per_open_type(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line ok = asn1ct:compile(DataDir ++ "OpenType",[?PER,{outdir,OutDir}]), + Stype = {'Stype',10,true}, + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes), + + ?line ?per_bit_opt(ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}])), + ?line ?per_bit_opt({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?per_bit_opt({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ?uper_bin(ok = asn1ct:compile(DataDir ++ "OpenType", + [uper_bin,{outdir,OutDir}])), + ?line ?uper_bin({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)), + ?line ?uper_bin({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)), + + ?line ok = asn1ct:compile(DataDir ++ "OpenType", + [?PER,optimize,{outdir,OutDir}]), + ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype), + ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes). + +testConstraints(suite) -> + []; +testConstraints(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testConstraints:compile(Config,?BER,[]), + ?line testConstraints:int_constraints(?BER), + + ?line ?ber_driver(?BER,testConstraints:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testConstraints:int_constraints(?BER)), + + ?line testConstraints:compile(Config,?PER,[]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER), + + ?line ?per_bit_opt(testConstraints:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testConstraints:int_constraints(?PER)), + ?line ?per_bit_opt(testConstraints:refed_NNL_name(?PER)), + + ?line ?uper_bin(testConstraints:compile(Config,uper_bin,[])), + ?line ?uper_bin(testConstraints:int_constraints(uper_bin)), + ?line ?uper_bin(testConstraints:refed_NNL_name(uper_bin)), + + ?line testConstraints:compile(Config,?PER,[optimize]), + ?line testConstraints:int_constraints(?PER), + ?line testConstraints:refed_NNL_name(?PER). + +testSeqIndefinite(suite) -> []; +testSeqIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSeqIndefinite:compile(Config,?BER,[]), + ?line testSeqIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSeqIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSeqIndefinite:main(?BER)). + +testSetIndefinite(suite) -> []; +testSetIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testSetIndefinite:compile(Config,?BER,[]), + ?line testSetIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testSetIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testSetIndefinite:main(?BER)). + +testChoiceIndefinite(suite) -> []; +testChoiceIndefinite(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testChoiceIndefinite:compile(Config,?BER,[]), + ?line testChoiceIndefinite:main(?BER), + + ?line ?ber_driver(?BER,testChoiceIndefinite:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testChoiceIndefinite:main(?BER)). + +testInfObjectClass(suite) -> + []; +testInfObjectClass(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testInfObjectClass:compile(Config,?PER,[]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[]), + ?line testInfObj:main(?PER), + + ?line ?per_bit_opt(testInfObjectClass:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObjectClass:main(?PER)), + ?line ?per_bit_opt(testInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testInfObj:main(?PER)), + + ?line ?uper_bin(testInfObjectClass:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObjectClass:main(uper_bin)), + ?line ?uper_bin(testInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testInfObj:main(uper_bin)), + + ?line testInfObjectClass:compile(Config,?PER,[optimize]), + ?line testInfObjectClass:main(?PER), + ?line testInfObj:compile(Config,?PER,[optimize]), + ?line testInfObj:main(?PER), + + ?line testInfObjectClass:compile(Config,?BER,[]), + ?line testInfObjectClass:main(?BER), + ?line testInfObj:compile(Config,?BER,[]), + ?line testInfObj:main(?BER), + + ?line ?ber_driver(?BER,testInfObjectClass:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObjectClass:main(?BER)), + ?line ?ber_driver(?BER,testInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testInfObj:main(?BER)), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[]), + + ?line ?per_bit_opt(testInfObj:compile_RANAPfiles(Config,?PER,[optimize])), + + ?line ?uper_bin(testInfObj:compile_RANAPfiles(Config,uper_bin,[])), + + ?line testInfObj:compile_RANAPfiles(Config,?PER,[optimize]), + + ?line testInfObj:compile_RANAPfiles(Config,?BER,[]). + +testParameterizedInfObj(suite) -> + []; +testParameterizedInfObj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testParameterizedInfObj:compile(Config,?PER,[]), + ?line testParameterizedInfObj:main(?PER), + + ?line ?per_bit_opt(testParameterizedInfObj:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testParameterizedInfObj:main(?PER)), + + ?line ?uper_bin(testParameterizedInfObj:compile(Config,uper_bin,[])), + ?line ?uper_bin(testParameterizedInfObj:main(uper_bin)), + + ?line testParameterizedInfObj:compile(Config,?PER,[optimize]), + ?line testParameterizedInfObj:main(?PER), + + ?line testParameterizedInfObj:compile(Config,?BER,[]), + ?line testParameterizedInfObj:main(?BER), + + ?line ?ber_driver(?BER,testParameterizedInfObj:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testParameterizedInfObj:main(?BER)). + +testMergeCompile(suite) -> + []; +testMergeCompile(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMergeCompile:compile(Config,?PER,[]), + ?line testMergeCompile:main(?PER), + ?line testMergeCompile:mvrasn(?PER), + + ?line ?per_bit_opt(testMergeCompile:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testMergeCompile:main(?PER)), + ?line ?per_bit_opt(testMergeCompile:mvrasn(?PER)), + + ?line ?uper_bin(testMergeCompile:compile(Config,uper_bin,[])), + ?line ?uper_bin(testMergeCompile:main(uper_bin)), + ?line ?uper_bin(testMergeCompile:mvrasn(uper_bin)), + + ?line testMergeCompile:compile(Config,?BER,[]), + ?line testMergeCompile:main(?BER), + ?line testMergeCompile:mvrasn(?BER), + + ?line ?ber_driver(?BER,testMergeCompile:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testMergeCompile:main(?BER)), + ?line ?ber_driver(?BER,testMergeCompile:mvrasn(?BER)). + +testobj(suite) -> + []; +testobj(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = testRANAP:compile(Config,?PER,[]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ?per_bit_opt(ok = testRANAP:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testRANAP:testobj(?PER)), + ?line ?per_bit_opt(ok = testParameterizedInfObj:ranap(?PER)), + + ?line ?uper_bin(ok = testRANAP:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testRANAP:testobj(uper_bin)), + ?line ?uper_bin(ok = testParameterizedInfObj:ranap(uper_bin)), + + ?line ok = testRANAP:compile(Config,?PER,[optimize]), + ?line ok = testRANAP:testobj(?PER), + ?line ok = testParameterizedInfObj:ranap(?PER), + + ?line ok = testRANAP:compile(Config,?BER,[]), + ?line ok = testRANAP:testobj(?BER), + ?line ok = testParameterizedInfObj:ranap(?BER), + + ?line ?ber_driver(?BER,testRANAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testRANAP:testobj(?BER)), + ?line ?ber_driver(?BER,testParameterizedInfObj:ranap(?BER)). + + +testDeepTConstr(suite) -> + []; +testDeepTConstr(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDeepTConstr:compile(Config,?PER,[]), + ?line testDeepTConstr:main(?PER), + + ?line ?per_bit_opt(testDeepTConstr:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDeepTConstr:main(?PER)), + + ?line ?uper_bin(testDeepTConstr:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDeepTConstr:main(uper_bin)), + + ?line testDeepTConstr:compile(Config,?PER,[optimize]), + ?line testDeepTConstr:main(?PER), + + ?line testDeepTConstr:compile(Config,?BER,[]), + ?line testDeepTConstr:main(?BER), + + ?line ?ber_driver(?BER,testDeepTConstr:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDeepTConstr:main(?BER)). + +testInvokeMod(suite) -> + []; +testInvokeMod(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[{outdir,OutDir}]), + ?line {ok,_Result1} = 'PrimStrings':encode('Bs1',[1,0,1,0]), + ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[?PER,{outdir,OutDir}]), + ?line {ok,_Result2} = 'PrimStrings':encode('Bs1',[1,0,1,0]). + +testExport(suite) -> + []; +testExport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line {error,{asn1,_Reason}} = asn1ct:compile(filename:join(DataDir,"IllegalExport"),[{outdir,OutDir}]). + +testImport(suite) -> + []; +testImport(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line _OutDir = ?config(priv_dir,Config), + ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER]), + ok. + +testMegaco(suite) -> + []; +testMegaco(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + io:format("Config: ~p~n",[Config]), + ?line {ok,ModuleName1,ModuleName2} = testMegaco:compile(Config,?BER,[]), + ?line ok = testMegaco:main(ModuleName1,Config), + ?line ok = testMegaco:main(ModuleName2,Config), + + case ?BER of + ber_bin_v2 -> + ?line {ok,ModuleName3,ModuleName4} = testMegaco:compile(Config,?BER,[driver]), + ?line ok = testMegaco:main(ModuleName3,Config), + ?line ok = testMegaco:main(ModuleName4,Config); + _-> ok + end, + + ?line {ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[]), + ?line ok = testMegaco:main(ModuleName5,Config), + ?line ok = testMegaco:main(ModuleName6,Config), + + ?line ?per_bit_opt({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName5,Config)), + ?line ?per_bit_opt(ok = testMegaco:main(ModuleName6,Config)), + + ?line ?uper_bin({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,uper_bin,[])), + ?line ?uper_bin(ok = testMegaco:main(ModuleName5,Config)), + ?line ?uper_bin(ok = testMegaco:main(ModuleName6,Config)), + + ?line {ok,ModuleName7,ModuleName8} = testMegaco:compile(Config,?PER,[optimize]), + ?line ok = testMegaco:main(ModuleName7,Config), + ?line ok = testMegaco:main(ModuleName8,Config). + + +testMvrasn6(suite) -> []; +testMvrasn6(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testMvrasn6:compile(Config,?BER), + ?line testMvrasn6:main(). + +testContextSwitchingTypes(suite) -> []; +testContextSwitchingTypes(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testContextSwitchingTypes:compile(Config,?BER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?ber_driver(?BER,testContextSwitchingTypes:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[]), + ?line testContextSwitchingTypes:test(), + + ?line ?per_bit_opt(testContextSwitchingTypes:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testContextSwitchingTypes:test()), + + ?line ?uper_bin(testContextSwitchingTypes:compile(Config,uper_bin,[])), + ?line ?uper_bin(testContextSwitchingTypes:test()), + + ?line testContextSwitchingTypes:compile(Config,?PER,[optimize]), + ?line testContextSwitchingTypes:test(). + +testTypeValueNotation(suite) -> []; +testTypeValueNotation(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + case ?BER of + Ber when Ber == ber; Ber == ber_bin -> + ?line testTypeValueNotation:compile(Config,?BER,[]), + ?line testTypeValueNotation:main(?BER,dummy); + _ -> + ok + end, + + ?line ?ber_driver(?BER,testTypeValueNotation:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTypeValueNotation:main(?BER,optimize)), + + case ?BER of + Ber2 when Ber2 == ber; Ber2 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[]), + ?line testTypeValueNotation:main(?PER,dummy); + _ -> + ok + end, + + ?line ?per_bit_opt(testTypeValueNotation:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testTypeValueNotation:main(?PER,optimize)), + + ?line ?uper_bin(testTypeValueNotation:compile(Config,uper_bin,[])), + ?line ?uper_bin(testTypeValueNotation:main(uper_bin,optimize)), + case ?BER of + Ber3 when Ber3 == ber; Ber3 == ber_bin -> + ?line testTypeValueNotation:compile(Config,?PER,[optimize]), + ?line testTypeValueNotation:main(?PER,optimize); + _ -> + ok + end. + +testOpenTypeImplicitTag(suite) -> []; +testOpenTypeImplicitTag(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testOpenTypeImplicitTag:compile(Config,?BER,[]), + ?line testOpenTypeImplicitTag:main(?BER), + + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testOpenTypeImplicitTag:main(?BER)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[]), + ?line testOpenTypeImplicitTag:main(?PER), + + ?line ?per_bit_opt(testOpenTypeImplicitTag:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testOpenTypeImplicitTag:main(?PER)), + + ?line ?uper_bin(testOpenTypeImplicitTag:compile(Config,uper_bin,[])), + ?line ?uper_bin(testOpenTypeImplicitTag:main(uper_bin)), + + ?line testOpenTypeImplicitTag:compile(Config,?PER,[optimize]), + ?line testOpenTypeImplicitTag:main(?PER). + +duplicate_tags(suite) -> []; +duplicate_tags(Config) -> + ?line DataDir = ?config(data_dir,Config), + {error,{asn1,[{error,{type,_,_,'SeqOpt1Imp',{asn1,{duplicates_of_the_tags,_}}}}]}} = + asn1ct:compile(filename:join(DataDir,"SeqOptional2"),[abs]), + ok. + +rtUI(suite) -> []; +rtUI(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?BER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?PER]), + ?line {ok,_} = asn1rt:info('Prim'), + + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:load_driver(), + ?line ok = asn1rt:unload_driver(). + +testROSE(suite) -> []; +testROSE(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testROSE:compile(Config,?BER,[]), + + ?line testROSE:compile(Config,?PER,[]), + ?line ?per_bit_opt(testROSE:compile(Config,?PER,[optimize])), + ?line ?uper_bin(testROSE:compile(Config,uper_bin,[])), + ?line testROSE:compile(Config,?PER,[optimize]). + +testINSTANCE_OF(suite) -> []; +testINSTANCE_OF(Config) -> + ?line testINSTANCE_OF:compile(Config,?BER,[]), + ?line testINSTANCE_OF:main(?BER), + + ?line ?ber_driver(?BER,testINSTANCE_OF:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testINSTANCE_OF:main(?BER)), + + ?line testINSTANCE_OF:compile(Config,?PER,[]), + ?line testINSTANCE_OF:main(?PER), + + ?line ?per_bit_opt(testINSTANCE_OF:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testINSTANCE_OF:main(?PER)), + + ?line ?uper_bin(testINSTANCE_OF:compile(Config,uper_bin,[])), + ?line ?uper_bin(testINSTANCE_OF:main(uper_bin)), + + ?line testINSTANCE_OF:compile(Config,?PER,[optimize]), + ?line testINSTANCE_OF:main(?PER). + +testTCAP(suite) -> []; +testTCAP(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testTCAP:compile(Config,?BER,[]), + ?line testTCAP:test(?BER,Config), + + ?line ?ber_driver(?BER,testTCAP:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testTCAP:test(?BER,Config)), + + ?line ?ber_driver(?BER,testTCAP:compile_asn1config(Config,?BER,[asn1config])), + ?line ?ber_driver(?BER,testTCAP:test_asn1config()). + +testDER(suite) ->[]; +testDER(Config) -> + ?line true = code:add_patha(?config(priv_dir,Config)), + + ?line testDER:compile(Config,?BER,[]), + ?line testDER:test(), + + ?line ?ber_driver(?BER,testDER:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDER:test()), + + ?line testParamBasic:compile_der(Config,?BER), + ?line testParamBasic_cases(der), + + + ?line testSeqSetDefaultVal:compile(Config,?BER), + ?line testSeqSetDefaultVal_cases(?BER). + +testSeqSetDefaultVal_cases(?BER) -> + ?line testSeqSetDefaultVal:main(?BER). + + +specialized_decodes(suite) -> []; +specialized_decodes(Config) -> + ?line test_partial_incomplete_decode:compile(Config,?BER,[optimize]), + ?line test_partial_incomplete_decode:test(?BER,Config), + ?line test_selective_decode:test(?BER,Config). + +special_decode_performance(suite) ->[]; +special_decode_performance(Config) -> + ?line ?ber_driver(?BER,test_special_decode_performance:compile(Config,?BER)), + ?line ?ber_driver(?BER,test_special_decode_performance:go(all)). + + +test_driver_load(suite) -> []; +test_driver_load(Config) -> + ?line test_driver_load:compile(Config,?PER), + ?line test_driver_load:test(?PER,5). + +test_ParamTypeInfObj(suite) -> []; +test_ParamTypeInfObj(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"IN-CS-1-Datatypes"),[ber_bin]). + +test_WS_ParamClass(suite) -> []; +test_WS_ParamClass(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"InformationFramework"), + [ber_bin]). + +test_Defed_ObjectIdentifier(suite) -> []; +test_Defed_ObjectIdentifier(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line ok = asn1ct:compile(filename:join(DataDir,"UsefulDefinitions"), + [ber_bin]). + +testSelectionType(suite) -> []; +testSelectionType(Config) -> + + ?line ok = testSelectionTypes:compile(Config,?BER,[]), + ?line {ok,_} = testSelectionTypes:test(), + + ?line ok = testSelectionTypes:compile(Config,?PER,[]), + ?line {ok,_} = testSelectionTypes:test(). + +testSSLspecs(suite) -> []; +testSSLspecs(Config) -> + + ?line ok = testSSLspecs:compile(Config,?BER, + [optimize,compact_bit_string,der]), + ?line testSSLspecs:run(?BER), + + case code:which(asn1ct) of + cover_compiled -> + ok; + _ -> + ?line ok = testSSLspecs:compile_inline(Config,?BER), + ?line ok = testSSLspecs:run_inline(?BER) + end. + +testNortel(suite) -> []; +testNortel(Config) -> + ?line DataDir = ?config(data_dir,Config), + + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?BER]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?BER,optimize,driver]), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?PER]), + ?line ?per_bit_opt(ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize])), + ?line ?uper_bin(ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[uper_bin])), + ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"), + [?PER,optimize]). +test_undecoded_rest(suite) -> []; +test_undecoded_rest(Config) -> + + ?line ok = test_undecoded_rest:compile(Config,?BER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ok = test_undecoded_rest:compile(Config,?BER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[]), + ?line ok = test_undecoded_rest:test([]), + + ?line ?per_bit_opt(ok = test_undecoded_rest:compile(Config,?PER,[optimize,undec_rest])), + ?line ?per_bit_opt(ok = test_undecoded_rest:test(undec_rest)), + + ?line ?uper_bin(ok = test_undecoded_rest:compile(Config,uper_bin,[undec_rest])), + ?line ?uper_bin(ok = test_undecoded_rest:test(undec_rest)), + + ?line ok = test_undecoded_rest:compile(Config,?PER,[undec_rest]), + ?line ok = test_undecoded_rest:test(undec_rest). + +test_inline(suite) -> []; +test_inline(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok=test_inline:compile(Config,?BER,[]), + ?line test_inline:main(?BER), + ?line test_inline:inline1(Config,?BER,[]), + ?line test_inline:performance2() + end. + +%test_inline_prf(suite) -> []; +%test_inline_prf(Config) -> +% ?line test_inline:performance(Config). + +testTcapsystem(suite) -> []; +testTcapsystem(Config) -> + ?line ok=testTcapsystem:compile(Config,?BER,[]). + +testNBAPsystem(suite) -> []; +testNBAPsystem(Config) -> + ?line ok=testNBAPsystem:compile(Config,?PER,?per_optimize(?BER)), + ?line ok=testNBAPsystem:test(?PER,Config). + +test_compile_options(suite) -> []; +test_compile_options(Config) -> + case code:which(asn1ct) of + cover_compiled -> + {skip,"Not runnable when cover compiled"}; + _ -> + ?line ok = test_compile_options:wrong_path(Config), + ?line ok = test_compile_options:path(Config), + ?line ok = test_compile_options:noobj(Config), + ?line ok = test_compile_options:record_name_prefix(Config), + ?line ok = test_compile_options:verbose(Config) + end. +testDoubleEllipses(suite) -> []; +testDoubleEllipses(Config) -> + ?line testDoubleEllipses:compile(Config,?BER,[]), + ?line testDoubleEllipses:main(?BER), + ?line ?ber_driver(?BER,testDoubleEllipses:compile(Config,?BER,[driver])), + ?line ?ber_driver(?BER,testDoubleEllipses:main(?BER)), + ?line ?per_bit_opt(testDoubleEllipses:compile(Config,?PER,[optimize])), + ?line ?per_bit_opt(testDoubleEllipses:main(?PER)), + ?line ?uper_bin(testDoubleEllipses:compile(Config,uper_bin,[])), + ?line ?uper_bin(testDoubleEllipses:main(uper_bin)), + ?line testDoubleEllipses:compile(Config,?PER,?per_optimize(?BER)), + ?line testDoubleEllipses:main(?PER). + +test_modified_x420(suite) -> []; +test_modified_x420(Config) -> + ?line test_modified_x420:compile(Config), + ?line test_modified_x420:test_io(Config). + +testX420(suite) -> []; +testX420(Config) -> + ?line testX420:compile(?BER,[der],Config), + ?line ok = testX420:ticket7759(?BER,Config), + ?line testX420:compile(?PER,[],Config). + +test_x691(suite) -> []; +test_x691(Config) -> + case ?PER of + per -> + ?line ok = test_x691:compile(Config,uper_bin,[]), + ?line true = test_x691:cases(uper_bin,unaligned), + ?line ok = test_x691:compile(Config,?PER,[]), + ?line true = test_x691:cases(?PER,aligned), +%% ?line ok = asn1_test_lib:ticket_7678(Config,[]), + ?line ok = asn1_test_lib:ticket_7708(Config,[]), + ?line ok = asn1_test_lib:ticket_7763(Config); + _ -> + ?line ok = test_x691:compile(Config,?PER,?per_optimize(?BER)), + ?line true = test_x691:cases(?PER,aligned) + end. +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[compact_bit_string]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize]), +%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize,compact_bit_string]). + + +ticket_6143(suite) -> []; +ticket_6143(Config) -> + ?line ok = test_compile_options:ticket_6143(Config). + +testExtensionAdditionGroup(suite) -> []; +testExtensionAdditionGroup(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line PrivDir = ?config(priv_dir,Config), + ?line Path = code:get_path(), + ?line code:add_patha(PrivDir), + DoIt = fun(Erule) -> + ?line ok = asn1ct:compile(filename:join(DataDir,"Extension-Addition-Group"),[Erule,{outdir,PrivDir}]), + ?line {ok,_M} = compile:file(filename:join(DataDir,"extensionAdditionGroup"),[{i,PrivDir},{outdir,PrivDir},debug_info]), + ?line ok = extensionAdditionGroup:run(Erule) + end, + ?line [DoIt(Rule)|| Rule <- [per_bin,uper_bin,ber_bin]], + ?line code:set_path(Path). + + + +% parse_modules() -> +% ["ImportsFrom"]. + +per_modules() -> + [X || X <- test_modules()]. +ber_modules() -> + [X || X <- test_modules(), + X =/= "CommonDataTypes", + X =/= "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + X =/= "H323-MESSAGES", + X =/= "H235-SECURITY-MESSAGES", + X =/= "MULTIMEDIA-SYSTEM-CONTROL"]. +test_modules() -> + _Modules = [ + "BitStr", + "CommonDataTypes", + "Constraints", + "ContextSwitchingTypes", + "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath", + "Enum", + "From", + "H235-SECURITY-MESSAGES", + "H323-MESSAGES", + %%"MULTIMEDIA-SYSTEM-CONTROL", recursive type , problem for asn1ct:value + "Import", + "Int", + "MAP-commonDataTypes", +% ambigous tags "MAP-insertSubscriberData-def", + "Null", + "Octetstr", + "One", + "P-Record", + "P", +% "PDUs", + "Person", + "PrimStrings", + "Real", + "XSeq", + "XSeqOf", + "XSet", + "XSetOf", + "String", + "SwCDR", +% "Syntax", + "Time" +% ANY "Tst", +% "Two", +% errors that should be detected "UndefType" +] ++ + [ + "SeqSetLib", % must be compiled before Seq and Set + "Seq", + "Set", + "SetOf", + "SeqOf", + "Prim", + "Cho", + "Def", + "Opt", + "ELDAPv3", + "LDAP" + ]. + + +common() -> []. + +particular() -> [smp, ticket7904]. + + +smp(suite) -> []; +smp(Config) -> + case erlang:system_info(smp_support) of + true -> + NumOfProcs = erlang:system_info(schedulers), + io:format("smp starting ~p workers\n",[NumOfProcs]), + + ?line Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()}, + ?line ok = testNBAPsystem:compile(Config,per_bin,[optimize]), + + Parent = self(), + + ?line ok = asn1rt:load_driver(), + + smp2(Parent,NumOfProcs,Msg,2), + + N = 10000, + + ?line {Time1,ok} = timer:tc(?MODULE,smp2,[Parent,NumOfProcs,Msg, N]), + ?line {Time1S,ok} = timer:tc(?MODULE,sequential,[NumOfProcs * N,Msg]), + + ?line ok = testNBAPsystem:compile(Config,ber_bin,[optimize,driver]), + ?line {Time2,ok} = timer:tc(?MODULE,smp2,[Parent,NumOfProcs,Msg, N]), + + ?line {Time2S,ok} = timer:tc(?MODULE,sequential,[NumOfProcs * N,Msg]), + + {comment,lists:flatten(io_lib:format("Encode/decode time parallell with ~p cores: ~p [microsecs]~nEncode/decode time sequential: ~p [microsecs]",[NumOfProcs,Time1+Time2,Time1S+Time2S]))}; + false -> + {skipped,"No smp support"} + end. + +smp2(Parent,NumOfProcs,Msg, N) -> + Pids = [spawn_link(fun() -> worker(Msg,Parent, N) end) + || _ <- lists:seq(1,NumOfProcs)], + ?line ok = wait_pids(Pids). + +worker(Msg, Parent, N) -> + %% io:format("smp worker ~p with ~p worker loops.~n",[self(), N]), + worker_loop(N, Msg), + Parent ! self(). + +worker_loop(0, _Msg) -> + ok; +worker_loop(N, Msg) -> + ?line {ok,B}=asn1_wrapper:encode('NBAP-PDU-Discriptions', + 'NBAP-PDU', + Msg), + ?line {ok,_Msg}=asn1_wrapper:decode('NBAP-PDU-Discriptions', + 'NBAP-PDU', + B), + worker_loop(N - 1, Msg). + + +wait_pids([]) -> + ok; +wait_pids(Pids) -> + receive + Pid when is_pid(Pid) -> + ?line true = lists:member(Pid,Pids), + Others = lists:delete(Pid,Pids), + io:format("wait_pid got ~p, still waiting for ~p\n",[Pid,Others]), + wait_pids(Others); + Err -> + io:format("Err: ~p~n",[Err]), + ?line exit(Err) + end. + +sequential(N,Msg) -> + %%io:format("sequential encode/decode with N = ~p~n",[N]), + worker_loop(N,Msg). + +-record('InitiatingMessage',{procedureCode,criticality,value}). +-record('Iu-ReleaseCommand',{first,second}). + +ticket7904(suite) -> []; +ticket7904(Config) -> + ?line DataDir = ?config(data_dir,Config), + ?line OutDir = ?config(priv_dir,Config), + + ?line ok = asn1ct:compile(DataDir ++ + "RANAPextract1",[per_bin,optimize,{outdir,OutDir}]), + + Val1 = #'InitiatingMessage'{procedureCode=1, + criticality=ignore, + value=#'Iu-ReleaseCommand'{ + first=13, + second=true}}, + + ?line {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1), + asn1rt:unload_driver(), + ?line {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1). diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl index fc15abc5bc..c4639ee9d6 100644 --- a/lib/common_test/test/ct_config_SUITE.erl +++ b/lib/common_test/test/ct_config_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -64,19 +64,20 @@ end_per_testcase(install_config = TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - [""]; - -all(suite) -> - [ - require, - install_config, - userconfig_static, - userconfig_dynamic, - testspec_legacy, - testspec_static, - testspec_dynamic - ]. +all() -> +[require, install_config, userconfig_static, + userconfig_dynamic, testspec_legacy, testspec_static, + testspec_dynamic]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index 2fa031b884..4eae281da3 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,18 +56,19 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - [""]; +all() -> +[cfg_error, lib_error, no_compile, timetrap_end_conf, + timetrap_normal, timetrap_extended]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [ - cfg_error, - lib_error, - no_compile, - timetrap_end_conf, - timetrap_normal, - timetrap_extended - ]. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_event_handler_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE.erl index 00a4c4ded3..7eac46586a 100644 --- a/lib/common_test/test/ct_event_handler_SUITE.erl +++ b/lib/common_test/test/ct_event_handler_SUITE.erl @@ -28,7 +28,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). %-include_lib("common_test/include/ct_event.hrl"). @@ -56,11 +56,18 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - []; +all() -> +[start_stop, results]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [start_stop, results]. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_groups_test_1_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE.erl index 64d61fc104..6703caf2fe 100644 --- a/lib/common_test/test/ct_groups_test_1_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,12 +56,19 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - ["Run smoke tests of Common Test."]; +all() -> +[groups_suite_1, groups_suite_2, groups_suites_1, + groups_dir_1, groups_dirs_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [groups_suite_1, groups_suite_2, - groups_suites_1, groups_dir_1, groups_dirs_1]. %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_groups_test_2_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE.erl index c4371501b3..9b27825d7c 100644 --- a/lib/common_test/test/ct_groups_test_2_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,11 +56,18 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - ["Run smoke tests of Common Test."]; +all() -> +[missing_conf, repeat_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [missing_conf, repeat_1]. %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl index 5ac2866227..9ccff6d959 100644 --- a/lib/common_test/test/ct_master_SUITE.erl +++ b/lib/common_test/test/ct_master_SUITE.erl @@ -28,7 +28,7 @@ -module(ct_master_SUITE). -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -81,15 +81,17 @@ end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all() -> - all(suite). -all(doc) -> - [""]; +all() -> + [ct_master_test]. -all(suite) -> - [ - ct_master_test - ]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl index 8c8b2d0d41..420a258420 100644 --- a/lib/common_test/test/ct_misc_1_SUITE.erl +++ b/lib/common_test/test/ct_misc_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("test_server/include/test_server_line.hrl"). -include_lib("common_test/include/ct_event.hrl"). @@ -57,13 +57,17 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - [""]; +all() -> +[beam_me_up, parse_table]. -all(suite) -> - [ - beam_me_up, parse_table - ]. +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl index 1b4cafc9d3..5f85a6b61d 100644 --- a/lib/common_test/test/ct_repeat_1_SUITE.erl +++ b/lib/common_test/test/ct_repeat_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,24 +56,24 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - []; +all() -> +[repeat_cs, repeat_cs_and_grs, repeat_seq, + repeat_cs_until_any_ok, repeat_gr_until_any_ok, + repeat_cs_until_any_fail, repeat_gr_until_any_fail, + repeat_cs_until_all_ok, repeat_gr_until_all_ok, + repeat_cs_until_all_fail, repeat_gr_until_all_fail, + repeat_seq_until_any_fail, + repeat_shuffled_seq_until_any_fail]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [repeat_cs, - repeat_cs_and_grs, - repeat_seq, - repeat_cs_until_any_ok, - repeat_gr_until_any_ok, - repeat_cs_until_any_fail, - repeat_gr_until_any_fail, - repeat_cs_until_all_ok, - repeat_gr_until_all_ok, - repeat_cs_until_all_fail, - repeat_gr_until_all_fail, - repeat_seq_until_any_fail, - repeat_shuffled_seq_until_any_fail - ]. %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl index 0cf40f106a..b32d4ddf78 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,12 +56,21 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(suite) -> - [subgroup_return_fail, - subgroup_init_fail, - subgroup_after_failed_case, - case_after_subgroup_return_fail, - case_after_subgroup_fail_init]. +all() -> +[subgroup_return_fail, subgroup_init_fail, + subgroup_after_failed_case, + case_after_subgroup_return_fail, + case_after_subgroup_fail_init]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/common_test/test/ct_skip_SUITE.erl b/lib/common_test/test/ct_skip_SUITE.erl index 2e02061dec..dee525d4fb 100644 --- a/lib/common_test/test/ct_skip_SUITE.erl +++ b/lib/common_test/test/ct_skip_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,14 +56,18 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - [""]; +all() -> +[auto_skip, user_skip]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [ - auto_skip, - user_skip - ]. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_smoke_test_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE.erl index 05a2c20695..6536ead27f 100644 --- a/lib/common_test/test/ct_smoke_test_SUITE.erl +++ b/lib/common_test/test/ct_smoke_test_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -112,13 +112,19 @@ end_per_testcase(TestCase, Config) -> %% Description: Returns a description of the test suite (doc) and a %% list of all test cases in the suite (suite). %%-------------------------------------------------------------------- -all(doc) -> - ["Run smoke tests of Common Test."]; +all() -> +[dir1, dir2, dir1_2, suite11, suite21, suite11_21, + tc111, tc211, tc111_112]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [dir1, dir2, dir1_2, - suite11, suite21, suite11_21, - tc111, tc211, tc111_112]. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE.erl index eb85409073..3d76cf20f1 100644 --- a/lib/common_test/test/ct_test_server_if_1_SUITE.erl +++ b/lib/common_test/test/ct_test_server_if_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,13 +56,18 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - [""]; +all() -> +[ts_if_1]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [ - ts_if_1 - ]. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index dc399bfb4c..452e826b4f 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -29,7 +29,7 @@ -compile(export_all). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("common_test/include/ct_event.hrl"). -define(eh, ct_test_support_eh). @@ -56,24 +56,26 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -all(doc) -> - ["Run smoke tests of Common Test."]; - -all(suite) -> - [all_suites, skip_all_suites, - suite, skip_suite, - all_testcases, skip_all_testcases, - testcase, skip_testcase, - all_groups, skip_all_groups, - group, skip_group, - group_all_testcases, skip_group_all_testcases, - group_testcase, skip_group_testcase, - topgroup, - subgroup, skip_subgroup, - subgroup_all_testcases, skip_subgroup_all_testcases, - subgroup_testcase, skip_subgroup_testcase, - sub_skipped_by_top, - testcase_in_multiple_groups]. +all() -> +[all_suites, skip_all_suites, suite, skip_suite, + all_testcases, skip_all_testcases, testcase, + skip_testcase, all_groups, skip_all_groups, group, + skip_group, group_all_testcases, + skip_group_all_testcases, group_testcase, + skip_group_testcase, topgroup, subgroup, skip_subgroup, + subgroup_all_testcases, skip_subgroup_all_testcases, + subgroup_testcase, skip_subgroup_testcase, + sub_skipped_by_top, testcase_in_multiple_groups]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% TEST CASES diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index 2459fffc22..7bf39c8ab8 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -27,7 +27,7 @@ %%--------------- INCLUDES ----------------------------------- --include("../src/cosTimeApp.hrl"). +-include_lib("cosTime/src/cosTimeApp.hrl"). -include("test_server.hrl"). diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index a113caee2b..b734caef12 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -25,8 +25,8 @@ -compile(export_all). -%%-include_lib("public_key/include/public_key.hrl"). --include("public_key.hrl"). +-include_lib("public_key/include/public_key.hrl"). +%%-include("public_key.hrl"). -define(error(Format,Args), error(Format,Args,?FILE,?LINE)). -define(warning(Format,Args), warning(Format,Args,?FILE,?LINE)). diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 469bd5eaaf..7fdf39395b 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("test_server/include/test_server_line.hrl"). --include("public_key.hrl"). +-include_lib("public_key/include/public_key.hrl"). -define(TIMEOUT, 120000). % 2 min -- cgit v1.2.3 From 60c006def535e129f73d3834dba9f8b2bfa74813 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:52:14 +0200 Subject: Update os_mon tests to conform with common_test standard --- lib/os_mon/test/cpu_sup_SUITE.erl | 36 ++++++++++++--------- lib/os_mon/test/disksup_SUITE.erl | 36 ++++++++++++--------- lib/os_mon/test/memsup_SUITE.erl | 37 +++++++++++++--------- lib/os_mon/test/os_mon.spec | 2 +- lib/os_mon/test/os_mon_SUITE.erl | 24 +++++++++----- lib/os_mon/test/os_mon_mib_SUITE.erl | 61 ++++++++++++++++-------------------- lib/os_mon/test/os_sup_SUITE.erl | 33 ++++++++++++------- 7 files changed, 131 insertions(+), 98 deletions(-) diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 45f9d981d1..7c51b9b54b 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(cpu_sup_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -50,19 +50,25 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - case ?t:os_type() of - {unix, sunos} -> - [load_api, util_api, util_values, port, - {conf, terminate, [unavailable], restart}]; - {unix, linux} -> - [load_api, util_api, util_values, port, - {conf, terminate, [unavailable], restart}]; - {unix, _OSname} -> - [load_api]; - _OS -> - [unavailable] - end. +all() -> +case test_server:os_type() of + {unix, sunos} -> + [load_api, util_api, util_values, port, unavailable]; + {unix, linux} -> + [load_api, util_api, util_values, port, unavailable]; + {unix, _OSname} -> [load_api]; + _OS -> [unavailable] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + load_api(suite) -> []; diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index 987d631c36..f21b8db2ae 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(disksup_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -50,19 +50,25 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - Bugs = [otp_5910], - case ?t:os_type() of - {unix, sunos} -> - [api, config, alarm, port, - {conf, terminate, [unavailable], restart}] ++ Bugs; - {unix, _OSname} -> - [api, alarm] ++ Bugs; - {win32, _OSname} -> - [api, alarm] ++ Bugs; - _OS -> - [unavailable] - end. +all() -> +Bugs = [otp_5910], + case test_server:os_type() of + {unix, sunos} -> + [api, config, alarm, port, unavailable] ++ Bugs; + {unix, _OSname} -> [api, alarm] ++ Bugs; + {win32, _OSname} -> [api, alarm] ++ Bugs; + _OS -> [unavailable] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + api(suite) -> []; diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index 01a7f6c7f2..dc7af32746 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(memsup_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -49,18 +49,27 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), Config. -all(suite) -> - All = case ?t:os_type() of - {unix, sunos} -> - [api, alarm1, alarm2, process, - config, timeout, unavailable, port]; - {unix, linux} -> - [api, alarm1, alarm2, process, timeout]; - _OS -> - [api, alarm1, alarm2, process] - end, - Bugs = [otp_5910], - All ++ Bugs. +all() -> +All = case test_server:os_type() of + {unix, sunos} -> + [api, alarm1, alarm2, process, config, timeout, + unavailable, port]; + {unix, linux} -> + [api, alarm1, alarm2, process, timeout]; + _OS -> [api, alarm1, alarm2, process] + end, + Bugs = [otp_5910], + All ++ Bugs. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + api(suite) -> []; diff --git a/lib/os_mon/test/os_mon.spec b/lib/os_mon/test/os_mon.spec index bdae523795..859859c587 100644 --- a/lib/os_mon/test/os_mon.spec +++ b/lib/os_mon/test/os_mon.spec @@ -1 +1 @@ -{topcase, {dir, "../os_mon_test"}}. +{suites,"os_mon_test",all}. diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index 033c61e3c8..f5dea6a92d 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(os_mon_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -38,11 +38,21 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - case ?t:os_type() of - {unix, sunos} -> [app_file, config]; - _OS -> [app_file] - end. +all() -> +case test_server:os_type() of + {unix, sunos} -> [app_file, config]; + _OS -> [app_file] +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + app_file(suite) -> []; diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl index a1d463030a..d784b636ff 100644 --- a/lib/os_mon/test/os_mon_mib_SUITE.erl +++ b/lib/os_mon/test/os_mon_mib_SUITE.erl @@ -24,13 +24,13 @@ -define(line,erlang:display({line,?LINE}),). -define(config(A,B), config(A,B)). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("os_mon/include/OTP-OS-MON-MIB.hrl"). -include_lib("snmp/include/snmp_types.hrl"). -endif. % Test server specific exports --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). @@ -38,8 +38,8 @@ -export([update_load_table/1]). -export([get_mem_sys_mark/1, get_mem_proc_mark/1, get_disk_threshold/1, - get_load_table/1, get_next_load_table/1, get_disk_table/1, - get_next_disk_table/1, real_snmp_request/1, load_unload/1]). + get_load_table/1, get_disk_table/1, + real_snmp_request/1, load_unload/1]). -export([sys_tot_mem/1, sys_used_mem/1, large_erl_process/1, large_erl_process_mem/1, cpu_load/1, cpu_load5/1, cpu_load15/1, @@ -47,7 +47,7 @@ large_erl_process_mem64/1, disk_descr/1, disk_kbytes/1, disk_capacity/1]). --export([tickets/1]). +-export([]). -export([otp_6351/1, otp_7441/1]). -define(TRAP_UDP, 5000). @@ -77,17 +77,30 @@ end_per_testcase(_Case, Config) when is_list(Config) -> test_server:timetrap_cancel(Dog), Config. -all(doc) -> - ["Test os_mon mibs and provided instrumentation functions."]; +all() -> +[load_unload, get_mem_sys_mark, get_mem_proc_mark, + get_disk_threshold, get_load_table, + {group, get_next_load_table}, get_disk_table, + {group, get_next_disk_table}, real_snmp_request, + update_load_table, {group, tickets}]. + +groups() -> + [{tickets, [], [otp_6351, otp_7441]}, + {get_next_load_table, [], + [sys_tot_mem, sys_used_mem, large_erl_process, + large_erl_process_mem, cpu_load, cpu_load5, cpu_load15, + os_wordsize, sys_tot_mem64, sys_used_mem64, + large_erl_process_mem64]}, + {get_next_disk_table, [], + [disk_descr, disk_kbytes, disk_capacity]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [load_unload, get_mem_sys_mark, get_mem_proc_mark, - get_disk_threshold, get_load_table, get_next_load_table, - get_disk_table, get_next_disk_table, real_snmp_request, - update_load_table, tickets]. -tickets(suite) -> - [otp_6351, otp_7441]. -endif. %%--------------------------------------------------------------------- @@ -338,21 +351,6 @@ get_load_table(Config) when is_list(Config) -> ok. %%--------------------------------------------------------------------- -get_next_load_table(doc) -> - ["Simulates get_next calls to test the instrumentation function " - "for the loadTable"]; -get_next_load_table(suite) -> - [ sys_tot_mem, - sys_used_mem, - large_erl_process, - large_erl_process_mem, - cpu_load, - cpu_load5, - cpu_load15, - os_wordsize, - sys_tot_mem64, - sys_used_mem64, - large_erl_process_mem64]. sys_tot_mem(doc) -> []; @@ -592,11 +590,6 @@ get_disk_table(Config) when is_list(Config) -> ok. %%--------------------------------------------------------------------- -get_next_disk_table(doc) -> - ["Simulates get_next calls to test the instrumentation function " - "for the diskTable."]; -get_next_disk_table(suite) -> - [disk_descr, disk_kbytes, disk_capacity]. disk_descr(doc) -> []; diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index 25041f968d..02e1acf1b7 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -17,10 +17,10 @@ %% %CopyrightEnd% %% -module(os_sup_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -63,16 +63,25 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - case ?t:os_type() of - {unix, sunos} -> - [message, config, port]; - {win32, _OSname} -> - [message]; - OS -> - Str = io_lib:format("os_sup not available for ~p", [OS]), - {skip, lists:flatten(Str)} - end. +all() -> +case test_server:os_type() of + {unix, sunos} -> [message, config, port]; + {win32, _OSname} -> [message]; + OS -> + Str = io_lib:format("os_sup not available for ~p", + [OS]), + {skip, lists:flatten(Str)} +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + message(suite) -> []; -- cgit v1.2.3 From 15c54232dd4c0026c47bfbff8fde7b5bacd29bae Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:56:20 +0200 Subject: Update asn1 tests to conform with common_test standard --- lib/asn1/test/asn1.spec | 4 +- lib/asn1/test/asn1_SUITE.erl | 144 +++++++++++++++++++----------------- lib/asn1/test/asn1_app_test.erl | 22 +++--- lib/asn1/test/asn1_appup_test.erl | 19 +++-- lib/asn1/test/asn1_bin_SUITE.erl | 133 +++++++++++++++++---------------- lib/asn1/test/asn1_bin_v2_SUITE.erl | 133 +++++++++++++++++---------------- 6 files changed, 240 insertions(+), 215 deletions(-) diff --git a/lib/asn1/test/asn1.spec b/lib/asn1/test/asn1.spec index 6d9ae924fa..2a29db10ff 100644 --- a/lib/asn1/test/asn1.spec +++ b/lib/asn1/test/asn1.spec @@ -1,3 +1 @@ -{topcase, {dir, "../asn1_test"}}. - - +{suites,"asn1_test",all}. diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 1f4e532e91..3c2c79d416 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -62,58 +62,79 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). -all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, - ber,testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, - testChoTypeRefSet, testDef, testOpt, testSeqDefault, - testSeqExtension, testSeqExternal, testSeqOptional, - testSeqPrim, testSeqTag, testSeqTypeRefCho, - testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, - testSeqOf, testSeqOfIndefinite, testSeqOfCho, - testSeqOfExternal, testSetDefault, testSetExtension, - testExtensionAdditionGroup, - testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, - testSetTag, testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, - testSetOfExternal, testSetOfTag, testEnumExt, value_test, - testSeq2738, constructed, ber_decode_error, - h323test, testSeqIndefinite, testSetIndefinite, - testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, - testInvokeMod, testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, - testINSTANCE_OF,testTCAP,testDER,specialized_decodes, - special_decode_performance,test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel,test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options,testDoubleEllipses, test_modified_x420, - testX420, test_x691,ticket_6143, testExtensionAdditionGroup - ] ++ common() ++ particular(). +all() -> +[{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] + ++ common() ++ particular(). + +groups() -> + [{option_tests, [], + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}, + {app_test, [], [{asn1_app_test, all}]}, + {appup_test, [], [{asn1_appup_test, all}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. -option_tests(suite) -> - [test_compile_options,ticket_6143]. -infobj(suite) -> - [testInfObjectClass, testParameterizedInfObj, testMergeCompile, - testobj, testDeepTConstr]. -performance(suite) -> - [testTimer_ber, testTimer_ber_opt_driver, - testTimer_per, testTimer_per_opt, testTimer_uper_bin]. -bugs(suite) -> - [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), @@ -1368,21 +1389,6 @@ testSetOfTag(Config) -> testSetOfTag_cases(Rules) -> ?line testSetOfTag:main(Rules). -compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; -compile(Config) -> - ?line DataDir = ?config(data_dir,Config), - ?line TempDir = ?config(priv_dir,Config), - ?line True = lists:member(TempDir,code:get_path()), - ?line test_server:format("~p~n",[True]), - ?line test_server:format("~p~n",[code:get_path()]), - ?line true = code:add_patha(?config(priv_dir,Config)), - ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), - test_server:format("first String ok~n"), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), - ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), - ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), - ok. c_syntax(suite) -> []; c_syntax(Config) -> @@ -1487,7 +1493,6 @@ per1_opt([M|T],DataDir,OutDir) -> per1_opt([],_,_) -> ok. -ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. ber_choiceinseq(suite) ->[]; ber_choiceinseq(Config) -> @@ -2389,14 +2394,14 @@ test_modules() -> %% %% -common() -> [app_test, appup_test,testTimer_ber,testTimer_ber_bin, - testTimer_ber_bin_opt, testTimer_ber_bin_opt_driver, testTimer_per, - testTimer_per_bin, testTimer_per_bin_opt, testTimer_uper_bin, - testComment,testName2Number]. +common() -> +[{group, app_test}, {group, appup_test}, testTimer_ber, + testTimer_ber_bin, testTimer_ber_bin_opt, + testTimer_ber_bin_opt_driver, testTimer_per, + testTimer_per_bin, testTimer_per_bin_opt, + testTimer_uper_bin, testComment, testName2Number]. -app_test(suite) -> [{asn1_app_test,all}]. -appup_test(suite) -> [{asn1_appup_test,all}]. testTimer_ber(suite) -> []; testTimer_ber(Config) -> @@ -2468,7 +2473,8 @@ testName2Number(Config) -> ok. -particular() -> [ticket_7407]. +particular() -> +[ticket_7407]. ticket_7407(suite) -> []; ticket_7407(Config) -> diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl index 8002f5b78f..75ff6ffc22 100644 --- a/lib/asn1/test/asn1_app_test.erl +++ b/lib/asn1/test/asn1_app_test.erl @@ -26,15 +26,19 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend - ], - {req, [], {conf, init_per_suite, Cases, end_per_suite}}. +all() -> +Cases = [fields, modules, exportall, app_depend], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl index 43fd425b6e..a50b2e2c87 100644 --- a/lib/asn1/test/asn1_appup_test.erl +++ b/lib/asn1/test/asn1_appup_test.erl @@ -26,12 +26,19 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup - ], - {req, [], {conf, init_per_suite, Cases, end_per_suite}}. +all() -> +Cases = [appup], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl index 034d998e4d..e5a9442bc6 100644 --- a/lib/asn1/test/asn1_bin_SUITE.erl +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -62,58 +62,77 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). -all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, - ber,testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, - testChoTypeRefSet, testDef, testOpt, testSeqDefault, - testSeqExtension, testSeqExternal, testSeqOptional, - testSeqPrim, testSeqTag, testSeqTypeRefCho, - testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, - testSeqOf, testSeqOfIndefinite, testSeqOfCho, - testSeqOfExternal, testSetDefault, testSetExtension, - testExtensionAdditionGroup, - testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, - testSetTag, testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, - testSetOfExternal, testSetOfTag, testEnumExt, value_test, - testSeq2738, constructed, ber_decode_error, - h323test, testSeqIndefinite, testSetIndefinite, - testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, - testInvokeMod, testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, - testINSTANCE_OF,testTCAP,testDER,specialized_decodes, - special_decode_performance,test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel,test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options,testDoubleEllipses, test_modified_x420, - testX420, test_x691,ticket_6143, testExtensionAdditionGroup - ] ++ common() ++ particular(). +all() -> +[{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] + ++ common() ++ particular(). + +groups() -> + [{option_tests, [], + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. -option_tests(suite) -> - [test_compile_options,ticket_6143]. -infobj(suite) -> - [testInfObjectClass, testParameterizedInfObj, testMergeCompile, - testobj, testDeepTConstr]. -performance(suite) -> - [testTimer_ber, testTimer_ber_opt_driver, - testTimer_per, testTimer_per_opt, testTimer_uper_bin]. -bugs(suite) -> - [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), @@ -1368,21 +1387,6 @@ testSetOfTag(Config) -> testSetOfTag_cases(Rules) -> ?line testSetOfTag:main(Rules). -compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; -compile(Config) -> - ?line DataDir = ?config(data_dir,Config), - ?line TempDir = ?config(priv_dir,Config), - ?line True = lists:member(TempDir,code:get_path()), - ?line test_server:format("~p~n",[True]), - ?line test_server:format("~p~n",[code:get_path()]), - ?line true = code:add_patha(?config(priv_dir,Config)), - ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), - test_server:format("first String ok~n"), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), - ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), - ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), - ok. c_syntax(suite) -> []; c_syntax(Config) -> @@ -1487,7 +1491,6 @@ per1_opt([M|T],DataDir,OutDir) -> per1_opt([],_,_) -> ok. -ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. ber_choiceinseq(suite) ->[]; ber_choiceinseq(Config) -> @@ -2369,6 +2372,8 @@ test_modules() -> ]. -common() -> []. +common() -> +[]. -particular() -> []. +particular() -> +[]. diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl index caa6d4dcdd..8459e6a005 100644 --- a/lib/asn1/test/asn1_bin_v2_SUITE.erl +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -62,58 +62,77 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). -all(suite) -> [compile,parse,default_per,default_ber,default_per_opt,per, - ber,testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq, - testChoTypeRefSet, testDef, testOpt, testSeqDefault, - testSeqExtension, testSeqExternal, testSeqOptional, - testSeqPrim, testSeqTag, testSeqTypeRefCho, - testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet, - testSeqOf, testSeqOfIndefinite, testSeqOfCho, - testSeqOfExternal, testSetDefault, testSetExtension, - testExtensionAdditionGroup, - testSetExternal, testSeqOfTag, testSetOptional, testSetPrim, - testSetTag, testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho, - testSetOfExternal, testSetOfTag, testEnumExt, value_test, - testSeq2738, constructed, ber_decode_error, - h323test, testSeqIndefinite, testSetIndefinite, - testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, - testInvokeMod, testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE, - testINSTANCE_OF,testTCAP,testDER,specialized_decodes, - special_decode_performance,test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel,test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options,testDoubleEllipses, test_modified_x420, - testX420, test_x691,ticket_6143, testExtensionAdditionGroup - ] ++ common() ++ particular(). +all() -> +[{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] + ++ common() ++ particular(). + +groups() -> + [{option_tests, [], + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. -option_tests(suite) -> - [test_compile_options,ticket_6143]. -infobj(suite) -> - [testInfObjectClass, testParameterizedInfObj, testMergeCompile, - testobj, testDeepTConstr]. -performance(suite) -> - [testTimer_ber, testTimer_ber_opt_driver, - testTimer_per, testTimer_per_opt, testTimer_uper_bin]. -bugs(suite) -> - [test_ParamTypeInfObj, test_WS_ParamClass,test_Defed_ObjectIdentifier]. init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), @@ -1368,21 +1387,6 @@ testSetOfTag(Config) -> testSetOfTag_cases(Rules) -> ?line testSetOfTag:main(Rules). -compile(suite) -> [c_syntax,c_string_per,c_string_ber,c_implicit_before_choice]; -compile(Config) -> - ?line DataDir = ?config(data_dir,Config), - ?line TempDir = ?config(priv_dir,Config), - ?line True = lists:member(TempDir,code:get_path()), - ?line test_server:format("~p~n",[True]), - ?line test_server:format("~p~n",[code:get_path()]), - ?line true = code:add_patha(?config(priv_dir,Config)), - ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]), - test_server:format("first String ok~n"), - ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]), - ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]), - ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER,{outdir,TempDir}]), - ok. c_syntax(suite) -> []; c_syntax(Config) -> @@ -1487,7 +1491,6 @@ per1_opt([M|T],DataDir,OutDir) -> per1_opt([],_,_) -> ok. -ber(suite) -> [ber_choiceinseq,ber_optional,ber_optional_keyed_list,ber_other]. ber_choiceinseq(suite) ->[]; ber_choiceinseq(Config) -> @@ -2369,9 +2372,11 @@ test_modules() -> ]. -common() -> []. +common() -> +[]. -particular() -> [smp, ticket7904]. +particular() -> +[smp, ticket7904]. smp(suite) -> []; -- cgit v1.2.3 From 894aad197d4d996ea18713ec9354dc3c674886b9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:56:43 +0200 Subject: Update observer tests to conform with common_test standard --- lib/observer/test/crashdump_viewer_SUITE.erl | 20 +++++++++++++++----- lib/observer/test/etop_SUITE.erl | 17 ++++++++++++++--- lib/observer/test/observer.spec | 3 +-- lib/observer/test/observer_SUITE.erl | 18 ++++++++++++++---- lib/observer/test/ttb_SUITE.erl | 23 +++++++++++++++++------ 5 files changed, 61 insertions(+), 20 deletions(-) diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index fcf383dc2e..4e23061b44 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -20,12 +20,12 @@ -module(crashdump_viewer_SUITE). %% Test functions --export([all/1,translate/1,start/1,fini/1,load_file/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,translate/1,start/1,fini/1,load_file/1, non_existing/1,not_a_crashdump/1,old_crashdump/1]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/file.hrl"). @@ -46,9 +46,19 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [translate,{conf,start,[load_file,non_existing,not_a_crashdump, - old_crashdump],fini}]. +all() -> +[translate, load_file, non_existing, not_a_crashdump, + old_crashdump]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(doc) -> ["Create a lot of crashdumps which can be used in the testcases below"]; diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index 883ba02b91..bacc390a77 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -20,10 +20,10 @@ -module(etop_SUITE). %% Test functions --export([all/1,text/1,text_tracing_off/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -35,7 +35,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> [text,text_tracing_off]. +all() -> +[text, text_tracing_off]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + text(suite) -> []; diff --git a/lib/observer/test/observer.spec b/lib/observer/test/observer.spec index 801eb80607..065be46fef 100644 --- a/lib/observer/test/observer.spec +++ b/lib/observer/test/observer.spec @@ -1,2 +1 @@ -{topcase, {dir, "../observer_test"}}. - +{suites,"observer_test",all}. diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index 3e9522c7a4..626a0125db 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -18,10 +18,10 @@ %% -module(observer_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -39,8 +39,18 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [app_file]. +all() -> +[app_file]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + app_file(suite) -> []; diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 4192e21568..9ac3714603 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -21,14 +21,14 @@ -compile(export_all). %% Test functions --export([all/1,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([foo/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -41,10 +41,21 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> [file,file_no_pi,file_fetch,wrap,wrap_merge, - wrap_merge_fetch_format,write_config1,write_config2, - write_config3,history,write_trace_info,seq_trace,diskless, - otp_4967_1,otp_4967_2]. +all() -> +[file, file_no_pi, file_fetch, wrap, wrap_merge, + wrap_merge_fetch_format, write_config1, write_config2, + write_config3, history, write_trace_info, seq_trace, + diskless, otp_4967_1, otp_4967_2]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + file(suite) -> []; -- cgit v1.2.3 From e34723fafb6801dda5ad9e9b34d7bb06ac901216 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:57:12 +0200 Subject: Update cosNotifications tests to conform with common_test standard --- lib/cosNotification/test/cosNotification.spec | 20 +--- lib/cosNotification/test/eventDB_SUITE.erl | 32 ++++-- lib/cosNotification/test/generated_SUITE.erl | 144 ++++++++++++++++-------- lib/cosNotification/test/grammar_SUITE.erl | 30 +++-- lib/cosNotification/test/notification_SUITE.erl | 36 +++--- 5 files changed, 160 insertions(+), 102 deletions(-) diff --git a/lib/cosNotification/test/cosNotification.spec b/lib/cosNotification/test/cosNotification.spec index 8df89e7908..01c245cec2 100644 --- a/lib/cosNotification/test/cosNotification.spec +++ b/lib/cosNotification/test/cosNotification.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosNotification_test"}}. +{suites,"cosNotification_test",all}. diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl index ded1261a1c..40c50ccedc 100644 --- a/lib/cosNotification/test/eventDB_SUITE.erl +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -41,7 +41,7 @@ -include("idl_output/notify_test.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -259,7 +259,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, reorder_api/1, lookup_api/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, reorder_api/1, lookup_api/1, discard_api/1, max_events_api/1, gc_api/1, auto_gc_api/1, start_stop_time_api/1, mapping_filter_api/1, persisten_event_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -269,15 +269,23 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosNotification interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [persisten_event_api, start_stop_time_api, mapping_filter_api, - max_events_api, discard_api, reorder_api, lookup_api, gc_api, - auto_gc_api]. +cases() -> +[persisten_event_api, start_stop_time_api, + mapping_filter_api, max_events_api, discard_api, + reorder_api, lookup_api, gc_api, auto_gc_api]. @@ -295,7 +303,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), orber:jump_start(), @@ -308,7 +316,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), cosTime:stop(), diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index dc5cfe0da6..e924351556 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,51 +84,101 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['CosNotification', 'CosNotification_AdminPropertiesAdmin', - 'CosNotification_EventHeader', 'CosNotification_EventType', - 'CosNotification_FixedEventHeader', 'CosNotification_NamedPropertyRange', - 'CosNotification_Property', 'CosNotification_PropertyError', - 'CosNotification_PropertyRange', 'CosNotification_QoSAdmin', - 'CosNotification_StructuredEvent', 'CosNotification_UnsupportedAdmin', - 'CosNotification_UnsupportedQoS', 'CosNotification_EventBatch', - 'CosNotification_EventTypeSeq', 'CosNotification_NamedPropertyRangeSeq', - 'CosNotification_PropertyErrorSeq', 'CosNotifyChannelAdmin_AdminLimit', - 'CosNotifyChannelAdmin_AdminNotFound', 'CosNotifyChannelAdmin_ChannelNotFound', - 'CosNotifyChannelAdmin_ConnectionAlreadyActive', 'CosNotifyChannelAdmin_ConnectionAlreadyInactive', - 'CosNotifyChannelAdmin_NotConnected', 'CosNotifyChannelAdmin_AdminIDSeq', - 'CosNotifyChannelAdmin_ChannelIDSeq', 'CosNotifyChannelAdmin_ProxyIDSeq', - 'CosNotifyFilter_CallbackNotFound', 'CosNotifyFilter_ConstraintExp', - 'CosNotifyFilter_ConstraintInfo', 'CosNotifyFilter_ConstraintNotFound', - 'CosNotifyFilter_DuplicateConstraintID', 'CosNotifyFilter_FilterNotFound', - 'CosNotifyFilter_InvalidConstraint', 'CosNotifyFilter_InvalidGrammar', - 'CosNotifyFilter_InvalidValue', 'CosNotifyFilter_MappingConstraintInfo', - 'CosNotifyFilter_MappingConstraintPair', 'CosNotifyFilter_UnsupportedFilterableData', - 'CosNotifyFilter_CallbackIDSeq', 'CosNotifyFilter_ConstraintExpSeq', - 'CosNotifyFilter_ConstraintIDSeq', 'CosNotifyFilter_ConstraintInfoSeq', - 'CosNotifyFilter_FilterIDSeq', 'CosNotifyFilter_MappingConstraintInfoSeq', - 'CosNotifyFilter_MappingConstraintPairSeq', 'CosNotifyComm_InvalidEventType', - 'CosNotifyChannelAdmin_ConsumerAdmin', 'CosNotifyChannelAdmin_EventChannel', - 'CosNotifyChannelAdmin_EventChannelFactory', 'CosNotifyChannelAdmin_ProxyConsumer', - 'CosNotifyChannelAdmin_ProxyNotFound', 'CosNotifyChannelAdmin_ProxyPullConsumer', - 'CosNotifyChannelAdmin_ProxyPullSupplier', 'CosNotifyChannelAdmin_ProxyPushConsumer', - 'CosNotifyChannelAdmin_ProxyPushSupplier', 'CosNotifyChannelAdmin_ProxySupplier', - 'CosNotifyChannelAdmin_SequenceProxyPullConsumer', 'CosNotifyChannelAdmin_SequenceProxyPullSupplier', - 'CosNotifyChannelAdmin_SequenceProxyPushConsumer', 'CosNotifyChannelAdmin_SequenceProxyPushSupplier', - 'CosNotifyChannelAdmin_StructuredProxyPullConsumer', 'CosNotifyChannelAdmin_StructuredProxyPullSupplier', - 'CosNotifyChannelAdmin_StructuredProxyPushConsumer', 'CosNotifyChannelAdmin_StructuredProxyPushSupplier', - 'CosNotifyChannelAdmin_SupplierAdmin', 'CosNotifyFilter_Filter', - 'CosNotifyFilter_FilterAdmin', 'CosNotifyFilter_FilterFactory', - 'CosNotifyFilter_MappingFilter', 'CosNotifyComm_NotifyPublish', - 'CosNotifyComm_NotifySubscribe', 'CosNotifyComm_PullConsumer', - 'CosNotifyComm_PullSupplier', 'CosNotifyComm_PushConsumer', - 'CosNotifyComm_PushSupplier', 'CosNotifyComm_SequencePullConsumer', - 'CosNotifyComm_SequencePullSupplier', 'CosNotifyComm_SequencePushConsumer', - 'CosNotifyComm_SequencePushSupplier', 'CosNotifyComm_StructuredPullConsumer', - 'CosNotifyComm_StructuredPullSupplier', 'CosNotifyComm_StructuredPushConsumer', - 'CosNotifyComm_StructuredPushSupplier', 'oe_CosNotificationComm_Event', - 'CosNotification_PropertySeq']. +all() -> +['CosNotification', + 'CosNotification_AdminPropertiesAdmin', + 'CosNotification_EventHeader', + 'CosNotification_EventType', + 'CosNotification_FixedEventHeader', + 'CosNotification_NamedPropertyRange', + 'CosNotification_Property', + 'CosNotification_PropertyError', + 'CosNotification_PropertyRange', + 'CosNotification_QoSAdmin', + 'CosNotification_StructuredEvent', + 'CosNotification_UnsupportedAdmin', + 'CosNotification_UnsupportedQoS', + 'CosNotification_EventBatch', + 'CosNotification_EventTypeSeq', + 'CosNotification_NamedPropertyRangeSeq', + 'CosNotification_PropertyErrorSeq', + 'CosNotifyChannelAdmin_AdminLimit', + 'CosNotifyChannelAdmin_AdminNotFound', + 'CosNotifyChannelAdmin_ChannelNotFound', + 'CosNotifyChannelAdmin_ConnectionAlreadyActive', + 'CosNotifyChannelAdmin_ConnectionAlreadyInactive', + 'CosNotifyChannelAdmin_NotConnected', + 'CosNotifyChannelAdmin_AdminIDSeq', + 'CosNotifyChannelAdmin_ChannelIDSeq', + 'CosNotifyChannelAdmin_ProxyIDSeq', + 'CosNotifyFilter_CallbackNotFound', + 'CosNotifyFilter_ConstraintExp', + 'CosNotifyFilter_ConstraintInfo', + 'CosNotifyFilter_ConstraintNotFound', + 'CosNotifyFilter_DuplicateConstraintID', + 'CosNotifyFilter_FilterNotFound', + 'CosNotifyFilter_InvalidConstraint', + 'CosNotifyFilter_InvalidGrammar', + 'CosNotifyFilter_InvalidValue', + 'CosNotifyFilter_MappingConstraintInfo', + 'CosNotifyFilter_MappingConstraintPair', + 'CosNotifyFilter_UnsupportedFilterableData', + 'CosNotifyFilter_CallbackIDSeq', + 'CosNotifyFilter_ConstraintExpSeq', + 'CosNotifyFilter_ConstraintIDSeq', + 'CosNotifyFilter_ConstraintInfoSeq', + 'CosNotifyFilter_FilterIDSeq', + 'CosNotifyFilter_MappingConstraintInfoSeq', + 'CosNotifyFilter_MappingConstraintPairSeq', + 'CosNotifyComm_InvalidEventType', + 'CosNotifyChannelAdmin_ConsumerAdmin', + 'CosNotifyChannelAdmin_EventChannel', + 'CosNotifyChannelAdmin_EventChannelFactory', + 'CosNotifyChannelAdmin_ProxyConsumer', + 'CosNotifyChannelAdmin_ProxyNotFound', + 'CosNotifyChannelAdmin_ProxyPullConsumer', + 'CosNotifyChannelAdmin_ProxyPullSupplier', + 'CosNotifyChannelAdmin_ProxyPushConsumer', + 'CosNotifyChannelAdmin_ProxyPushSupplier', + 'CosNotifyChannelAdmin_ProxySupplier', + 'CosNotifyChannelAdmin_SequenceProxyPullConsumer', + 'CosNotifyChannelAdmin_SequenceProxyPullSupplier', + 'CosNotifyChannelAdmin_SequenceProxyPushConsumer', + 'CosNotifyChannelAdmin_SequenceProxyPushSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPullConsumer', + 'CosNotifyChannelAdmin_StructuredProxyPullSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPushConsumer', + 'CosNotifyChannelAdmin_StructuredProxyPushSupplier', + 'CosNotifyChannelAdmin_SupplierAdmin', + 'CosNotifyFilter_Filter', 'CosNotifyFilter_FilterAdmin', + 'CosNotifyFilter_FilterFactory', + 'CosNotifyFilter_MappingFilter', + 'CosNotifyComm_NotifyPublish', + 'CosNotifyComm_NotifySubscribe', + 'CosNotifyComm_PullConsumer', + 'CosNotifyComm_PullSupplier', + 'CosNotifyComm_PushConsumer', + 'CosNotifyComm_PushSupplier', + 'CosNotifyComm_SequencePullConsumer', + 'CosNotifyComm_SequencePullSupplier', + 'CosNotifyComm_SequencePushConsumer', + 'CosNotifyComm_SequencePushSupplier', + 'CosNotifyComm_StructuredPullConsumer', + 'CosNotifyComm_StructuredPullSupplier', + 'CosNotifyComm_StructuredPushConsumer', + 'CosNotifyComm_StructuredPushSupplier', + oe_CosNotificationComm_Event, + 'CosNotification_PropertySeq']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl index 43ee80ee22..48a2eeee67 100644 --- a/lib/cosNotification/test/grammar_SUITE.erl +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -42,7 +42,7 @@ -include("idl_output/notify_test.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -64,7 +64,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, union_api/1, enum_api/1, simple_types_api/1, components_api/1, positional_api/1, variable_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -76,14 +76,22 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosNotification interfaces", ""]; -all(suite) -> {req, - [], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [variable_api, union_api, enum_api, simple_types_api, components_api, - positional_api]. +cases() -> +[variable_api, union_api, enum_api, simple_types_api, + components_api, positional_api]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -103,7 +111,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), if @@ -113,7 +121,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), Config. diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl index 9542f1283b..c506e11b2a 100644 --- a/lib/cosNotification/test/notification_SUITE.erl +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -40,7 +40,7 @@ -include("idl_output/notify_test.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -123,7 +123,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, qos_api/1, adm_api/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, qos_api/1, adm_api/1, cosevent_api/1, filter_adm_api/1, events_api/1, events2_api/1, event_qos_api/1, filter_api/1, mapping_filter_api/1, subscription_api/1, init_per_testcase/2, end_per_testcase/2, persistent_max_events_api/1, @@ -137,16 +137,26 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosNotification interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [persistent_max_events_api, persistent_timeout_events_api, - persistent_recover_events_api, mapping_filter_api, filter_api, filter_adm_api, - event_qos_api, qos_api, adm_api, cosevent_api, subscription_api, - events_api, events2_api, app_test]. +cases() -> +[persistent_max_events_api, + persistent_timeout_events_api, + persistent_recover_events_api, mapping_filter_api, + filter_api, filter_adm_api, event_qos_api, qos_api, + adm_api, cosevent_api, subscription_api, events_api, + events2_api, app_test]. @@ -168,7 +178,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), ok = corba:orb_init([{flags, 16#02}, {orber_debug_level, 10}]), @@ -184,7 +194,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> cosNotificationApp:stop(), Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), -- cgit v1.2.3 From b9143600d99578d49c5610c2eaa87dea653b72e0 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:57:30 +0200 Subject: Update cosEvent tests to conform with common_test standard --- lib/cosEvent/test/cosEvent.spec | 20 +------------- lib/cosEvent/test/event_channel_SUITE.erl | 31 ++++++++++++++-------- lib/cosEvent/test/generated_SUITE.erl | 43 +++++++++++++++++++++---------- 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/lib/cosEvent/test/cosEvent.spec b/lib/cosEvent/test/cosEvent.spec index 910f7a7c28..202cba887f 100644 --- a/lib/cosEvent/test/cosEvent.spec +++ b/lib/cosEvent/test/cosEvent.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosEvent_test"}}. +{suites,"cosEvent_test",all}. diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl index a83783bce7..d93884e3b4 100644 --- a/lib/cosEvent/test/event_channel_SUITE.erl +++ b/lib/cosEvent/test/event_channel_SUITE.erl @@ -22,7 +22,7 @@ -module(event_channel_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("orber/COSS/CosNaming/CosNaming.hrl"). -include_lib("orber/src/orber_iiop.hrl"). @@ -53,21 +53,30 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, event_objects_api/1, events_api/1, events_sync_api/1, - cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, event_objects_api/1, events_api/1, events_sync_api/1, + cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosEvent interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [events_api, events_sync_api, event_objects_api, app_test]. +cases() -> +[events_api, events_sync_api, event_objects_api, + app_test]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -83,7 +92,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), mnesia:delete_schema([node()]), @@ -96,7 +105,7 @@ init_all(Config) when is_list(Config) -> oe_event_test_server:oe_register(), Config. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> oe_event_test_server:oe_unregister(), cosEventApp:stop(), cosEventApp:uninstall(), diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index 2880b922ed..8ca08fe1fa 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,18 +84,33 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['CosEventChannelAdmin_AlreadyConnected', 'CosEventChannelAdmin_TypeError', - 'CosEventComm_Disconnected', - 'CosEventChannelAdmin_ConsumerAdmin', 'CosEventChannelAdmin_EventChannel', - 'CosEventChannelAdmin_ProxyPullConsumer', 'CosEventChannelAdmin_ProxyPullSupplier', - 'CosEventChannelAdmin_ProxyPushConsumer', 'CosEventChannelAdmin_ProxyPushSupplier', - 'CosEventChannelAdmin_SupplierAdmin', oe_CosEventComm_CAdmin, - oe_CosEventComm_Channel, oe_CosEventComm_Event, oe_CosEventComm_PullerS, - oe_CosEventComm_PusherS, 'CosEventComm_PullConsumer', - 'CosEventComm_PullSupplier', 'CosEventComm_PushConsumer', - 'CosEventComm_PushSupplier']. +all() -> +['CosEventChannelAdmin_AlreadyConnected', + 'CosEventChannelAdmin_TypeError', + 'CosEventComm_Disconnected', + 'CosEventChannelAdmin_ConsumerAdmin', + 'CosEventChannelAdmin_EventChannel', + 'CosEventChannelAdmin_ProxyPullConsumer', + 'CosEventChannelAdmin_ProxyPullSupplier', + 'CosEventChannelAdmin_ProxyPushConsumer', + 'CosEventChannelAdmin_ProxyPushSupplier', + 'CosEventChannelAdmin_SupplierAdmin', + oe_CosEventComm_CAdmin, oe_CosEventComm_Channel, + oe_CosEventComm_Event, oe_CosEventComm_PullerS, + oe_CosEventComm_PusherS, 'CosEventComm_PullConsumer', + 'CosEventComm_PullSupplier', + 'CosEventComm_PushConsumer', + 'CosEventComm_PushSupplier']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. -- cgit v1.2.3 From 186fd1fab5ddc7959e4dd422228abb49f2314b42 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:57:51 +0200 Subject: Update cosProperty tests to conform with common_test standard --- lib/cosProperty/test/cosProperty.spec | 21 +----------- lib/cosProperty/test/generated_SUITE.erl | 56 ++++++++++++++++++++++---------- lib/cosProperty/test/property_SUITE.erl | 31 +++++++++++------- 3 files changed, 60 insertions(+), 48 deletions(-) diff --git a/lib/cosProperty/test/cosProperty.spec b/lib/cosProperty/test/cosProperty.spec index d3e0001eef..662150fb86 100644 --- a/lib/cosProperty/test/cosProperty.spec +++ b/lib/cosProperty/test/cosProperty.spec @@ -1,20 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosProperty_test"}}. - +{suites,"cosProperty_test",all}. diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 65508403b4..593791fa57 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,21 +84,43 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['CosPropertyService_ConflictingProperty', 'CosPropertyService_ConstraintNotSupported', - 'CosPropertyService_FixedProperty', 'CosPropertyService_InvalidPropertyName', - 'CosPropertyService_MultipleExceptions', 'CosPropertyService_Properties', - 'CosPropertyService_Property', 'CosPropertyService_PropertyDef', - 'CosPropertyService_PropertyDefs', 'CosPropertyService_PropertyException', - 'CosPropertyService_PropertyExceptions', 'CosPropertyService_PropertyMode', - 'CosPropertyService_PropertyModes', 'CosPropertyService_PropertyNames', - 'CosPropertyService_PropertyNotFound', 'CosPropertyService_PropertyTypes', - 'CosPropertyService_ReadOnlyProperty', 'CosPropertyService_UnsupportedMode', - 'CosPropertyService_UnsupportedProperty', 'CosPropertyService_UnsupportedTypeCode', - 'CosPropertyService_PropertyNamesIterator', 'CosPropertyService_PropertiesIterator', - 'CosPropertyService_PropertySet', 'CosPropertyService_PropertySetDef', - 'CosPropertyService_PropertySetDefFactory', 'CosPropertyService_PropertySetFactory']. +all() -> +['CosPropertyService_ConflictingProperty', + 'CosPropertyService_ConstraintNotSupported', + 'CosPropertyService_FixedProperty', + 'CosPropertyService_InvalidPropertyName', + 'CosPropertyService_MultipleExceptions', + 'CosPropertyService_Properties', + 'CosPropertyService_Property', + 'CosPropertyService_PropertyDef', + 'CosPropertyService_PropertyDefs', + 'CosPropertyService_PropertyException', + 'CosPropertyService_PropertyExceptions', + 'CosPropertyService_PropertyMode', + 'CosPropertyService_PropertyModes', + 'CosPropertyService_PropertyNames', + 'CosPropertyService_PropertyNotFound', + 'CosPropertyService_PropertyTypes', + 'CosPropertyService_ReadOnlyProperty', + 'CosPropertyService_UnsupportedMode', + 'CosPropertyService_UnsupportedProperty', + 'CosPropertyService_UnsupportedTypeCode', + 'CosPropertyService_PropertyNamesIterator', + 'CosPropertyService_PropertiesIterator', + 'CosPropertyService_PropertySet', + 'CosPropertyService_PropertySetDef', + 'CosPropertyService_PropertySetDefFactory', + 'CosPropertyService_PropertySetFactory']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl index 999f37c62c..8f3ce3e8c1 100644 --- a/lib/cosProperty/test/property_SUITE.erl +++ b/lib/cosProperty/test/property_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("cosProperty/src/cosProperty.hrl"). -include_lib("cosProperty/include/CosPropertyService.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -86,7 +86,7 @@ %% External exports %%----------------------------------------------------------------- %% Fixed exports --export([all/1, cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). %% Test cases -export([create_setdef_api/1, create_set_api/1, define_with_mode_api/1, @@ -98,14 +98,23 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosProperty interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [create_setdef_api, create_set_api, define_with_mode_api, define_api, - names_iterator_api, properties_iterator_api, app_test]. +cases() -> +[create_setdef_api, create_set_api, + define_with_mode_api, define_api, names_iterator_api, + properties_iterator_api, app_test]. @@ -127,7 +136,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), orber:jump_start(), @@ -141,7 +150,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), application:stop(cosProperty), -- cgit v1.2.3 From a31f11aa72f04c65d66836e40611dbd2910922c9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:58:21 +0200 Subject: Update cosEventDomain tests to conform with common_test standard --- lib/cosEventDomain/test/cosEventDomain.spec | 20 +------------ lib/cosEventDomain/test/event_domain_SUITE.erl | 30 ++++++++++++------- lib/cosEventDomain/test/generated_SUITE.erl | 40 ++++++++++++++++++-------- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/lib/cosEventDomain/test/cosEventDomain.spec b/lib/cosEventDomain/test/cosEventDomain.spec index 0d3e307071..0d31e32419 100644 --- a/lib/cosEventDomain/test/cosEventDomain.spec +++ b/lib/cosEventDomain/test/cosEventDomain.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosEventDomain_test"}}. +{suites,"cosEventDomain_test",all}. diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl index 06c194b44e..33a62be801 100644 --- a/lib/cosEventDomain/test/event_domain_SUITE.erl +++ b/lib/cosEventDomain/test/event_domain_SUITE.erl @@ -22,7 +22,7 @@ -module(event_domain_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -include_lib("cosNotification/include/CosNotifyChannelAdmin.hrl"). -include_lib("cosNotification/include/CosNotification.hrl"). @@ -56,21 +56,29 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, event_domain_api/1, event_domain_factory_api/1, - cases/0, init_all/1, finish_all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, event_domain_api/1, event_domain_factory_api/1, + cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosEventDomain interfaces", ""]; -all(suite) -> {req, - [mnesia, orber, cosNotification], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [event_domain_api, event_domain_factory_api, app_test]. +cases() -> +[event_domain_api, event_domain_factory_api, app_test]. %%----------------------------------------------------------------- %% Init and cleanup functions. @@ -86,7 +94,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> mnesia:delete_schema([node()]), mnesia:create_schema([node()]), ok = corba:orb_init([{flags, 16#02}, @@ -102,7 +110,7 @@ init_all(Config) when is_list(Config) -> cosEventDomainApp:start(), Config. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> cosEventDomainApp:stop(), cosEventDomainApp:uninstall(), cosNotificationApp:stop(), diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index c74779d47c..6a8f005588 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,16 +84,32 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['CosEventDomainAdmin', 'CosEventDomainAdmin_DiamondSeq', - 'CosEventDomainAdmin_AlreadyExists', 'CosEventDomainAdmin_DomainIDSeq', - 'CosEventDomainAdmin_Connection', 'CosEventDomainAdmin_ConnectionIDSeq', - 'CosEventDomainAdmin_ConnectionNotFound', 'CosEventDomainAdmin_CycleCreationForbidden', - 'CosEventDomainAdmin_CycleSeq', 'CosEventDomainAdmin_DiamondCreationForbidden', - 'CosEventDomainAdmin_DomainNotFound', 'CosEventDomainAdmin_MemberIDSeq', - 'CosEventDomainAdmin_RouteSeq', 'CosEventDomainAdmin_EventDomainFactory', - 'CosEventDomainAdmin_EventDomain']. +all() -> +['CosEventDomainAdmin', + 'CosEventDomainAdmin_DiamondSeq', + 'CosEventDomainAdmin_AlreadyExists', + 'CosEventDomainAdmin_DomainIDSeq', + 'CosEventDomainAdmin_Connection', + 'CosEventDomainAdmin_ConnectionIDSeq', + 'CosEventDomainAdmin_ConnectionNotFound', + 'CosEventDomainAdmin_CycleCreationForbidden', + 'CosEventDomainAdmin_CycleSeq', + 'CosEventDomainAdmin_DiamondCreationForbidden', + 'CosEventDomainAdmin_DomainNotFound', + 'CosEventDomainAdmin_MemberIDSeq', + 'CosEventDomainAdmin_RouteSeq', + 'CosEventDomainAdmin_EventDomainFactory', + 'CosEventDomainAdmin_EventDomain']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. -- cgit v1.2.3 From e86f656f35f511d12174a539411a3c183fd0be0a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:58:40 +0200 Subject: Update cosTime tests to conform with common_test standard --- lib/cosTime/test/cosTime.spec | 20 +------------------- lib/cosTime/test/generated_SUITE.erl | 26 ++++++++++++++++++-------- lib/cosTime/test/time_SUITE.erl | 28 ++++++++++++++++++---------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/cosTime/test/cosTime.spec b/lib/cosTime/test/cosTime.spec index 3f50946043..66af3e7941 100644 --- a/lib/cosTime/test/cosTime.spec +++ b/lib/cosTime/test/cosTime.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosTime_test"}}. +{suites,"cosTime_test",all}. diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index d8fcc7c890..dd6d4ea354 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -25,7 +25,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,12 +84,22 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['TimeBase_IntervalT', 'TimeBase_UtcT', 'CosTime_TimeUnavailable', - 'CosTimerEvent_TimerEventT', 'CosTime_TIO', 'CosTime_TimeService', - 'CosTime_UTO', 'CosTimerEvent_TimerEventHandler', - 'CosTimerEvent_TimerEventService']. +all() -> +['TimeBase_IntervalT', 'TimeBase_UtcT', + 'CosTime_TimeUnavailable', 'CosTimerEvent_TimerEventT', + 'CosTime_TIO', 'CosTime_TimeService', 'CosTime_UTO', + 'CosTimerEvent_TimerEventHandler', + 'CosTimerEvent_TimerEventService']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index 7bf39c8ab8..cdfb4dabf8 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -29,7 +29,7 @@ %%--------------- INCLUDES ----------------------------------- -include_lib("cosTime/src/cosTimeApp.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -67,7 +67,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, time_api/1, timerevent_api/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, time_api/1, timerevent_api/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -76,13 +76,21 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosTime interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [time_api, timerevent_api, app_test]. +cases() -> +[time_api, timerevent_api, app_test]. @@ -104,7 +112,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), mnesia:delete_schema([node()]), @@ -123,7 +131,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), cosTime:uninstall_time(), -- cgit v1.2.3 From 357687bd39fcedff912a0b6a95f1b60038eebd01 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:58:55 +0200 Subject: Update cosTransaction tests to conform with common_test standard --- lib/cosTransactions/test/cosTransactions.spec | 20 +--------- lib/cosTransactions/test/generated_SUITE.erl | 52 +++++++++++++++++-------- lib/cosTransactions/test/transactions_SUITE.erl | 31 +++++++++------ 3 files changed, 57 insertions(+), 46 deletions(-) diff --git a/lib/cosTransactions/test/cosTransactions.spec b/lib/cosTransactions/test/cosTransactions.spec index 8ad9259964..da226271c3 100644 --- a/lib/cosTransactions/test/cosTransactions.spec +++ b/lib/cosTransactions/test/cosTransactions.spec @@ -1,19 +1 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -{topcase, {dir, "../cosTransactions_test"}}. +{suites,"cosTransactions_test",all}. diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index e3db56a991..e72751ad34 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -26,7 +26,7 @@ -module(generated_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("orber/include/corba.hrl"). -define(default_timeout, ?t:minutes(3)). @@ -72,7 +72,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -85,20 +85,40 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["This suite is for testing IC generated files"]; -all(suite) -> - ['CosTransactions_Control', 'CosTransactions_Coordinator', - 'CosTransactions_HeuristicCommit', 'CosTransactions_HeuristicHazard', - 'CosTransactions_HeuristicMixed', 'CosTransactions_HeuristicRollback', - 'CosTransactions_Inactive', 'CosTransactions_InvalidControl', - 'CosTransactions_NoTransaction', 'CosTransactions_NotPrepared', - 'CosTransactions_NotSubtransaction', 'CosTransactions_RecoveryCoordinator', - 'CosTransactions_Resource', 'CosTransactions_SubtransactionAwareResource', - 'CosTransactions_SubtransactionsUnavailable', 'CosTransactions_Terminator', - 'CosTransactions_TransactionFactory', 'CosTransactions_Unavailable', - 'CosTransactions_SynchronizationUnavailable', 'CosTransactions_TransIdentity', - 'CosTransactions_PropagationContext', 'CosTransactions_otid_t', - 'CosTransactions_WrongTransaction', 'ETraP_Server']. +all() -> +['CosTransactions_Control', + 'CosTransactions_Coordinator', + 'CosTransactions_HeuristicCommit', + 'CosTransactions_HeuristicHazard', + 'CosTransactions_HeuristicMixed', + 'CosTransactions_HeuristicRollback', + 'CosTransactions_Inactive', + 'CosTransactions_InvalidControl', + 'CosTransactions_NoTransaction', + 'CosTransactions_NotPrepared', + 'CosTransactions_NotSubtransaction', + 'CosTransactions_RecoveryCoordinator', + 'CosTransactions_Resource', + 'CosTransactions_SubtransactionAwareResource', + 'CosTransactions_SubtransactionsUnavailable', + 'CosTransactions_Terminator', + 'CosTransactions_TransactionFactory', + 'CosTransactions_Unavailable', + 'CosTransactions_SynchronizationUnavailable', + 'CosTransactions_TransIdentity', + 'CosTransactions_PropagationContext', + 'CosTransactions_otid_t', + 'CosTransactions_WrongTransaction', 'ETraP_Server']. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl index da6ef86e82..9a8aa8981a 100644 --- a/lib/cosTransactions/test/transactions_SUITE.erl +++ b/lib/cosTransactions/test/transactions_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("cosTransactions/include/CosTransactions.hrl"). -include("etrap_test_lib.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(20)). @@ -36,21 +36,30 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, cases/0, init_all/1, finish_all/1, resource_api/1, etrap_api/1, - init_per_testcase/2, end_per_testcase/2, app_test/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, resource_api/1, etrap_api/1, + init_per_testcase/2, end_per_testcase/2, app_test/1]). %%----------------------------------------------------------------- %% Func: all/1 %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosTransactions interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. +all() -> +cases(). + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [etrap_api, resource_api, app_test]. +cases() -> +[etrap_api, resource_api, app_test]. @@ -76,7 +85,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> mnesia:delete_schema([node()]), mnesia:create_schema([node()]), orber:install([node()]), @@ -89,7 +98,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> application:stop(orber), application:stop(mnesia), mnesia:delete_schema([node()]), -- cgit v1.2.3 From f6b19ef8603b46c64f3722ede3915dd1ac67bae8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:59:21 +0200 Subject: Update crypto tests to conform with common_test standard --- lib/crypto/test/blowfish_SUITE.erl | 23 +++++++------- lib/crypto/test/crypto.spec | 3 +- lib/crypto/test/crypto_SUITE.erl | 61 ++++++++++++++------------------------ 3 files changed, 36 insertions(+), 51 deletions(-) diff --git a/lib/crypto/test/blowfish_SUITE.erl b/lib/crypto/test/blowfish_SUITE.erl index d117e7cc3d..ae7712479f 100644 --- a/lib/crypto/test/blowfish_SUITE.erl +++ b/lib/crypto/test/blowfish_SUITE.erl @@ -23,7 +23,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("test_server_line.hrl"). -define(TIMEOUT, 120000). % 2 min @@ -100,15 +100,18 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test Blowfish functionality"]; - -all(suite) -> - [ecb, - cbc, - cfb64, - ofb64 - ]. +all() -> +[ecb, cbc, cfb64, ofb64]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Test cases start here. %%-------------------------------------------------------------------- diff --git a/lib/crypto/test/crypto.spec b/lib/crypto/test/crypto.spec index 7ba5696189..52fb4c1c98 100644 --- a/lib/crypto/test/crypto.spec +++ b/lib/crypto/test/crypto.spec @@ -1,2 +1 @@ -{topcase, {dir, "../crypto_test"}}. - +{suites,"crypto_test",all}. diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index cc6db9a460..7df0d662f4 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -18,10 +18,9 @@ %% -module(crypto_SUITE). --include("test_server.hrl"). --include("test_server_line.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, info/1, @@ -44,7 +43,7 @@ aes_cfb/1, aes_cbc/1, aes_cbc_iter/1, - aes_ctr/1, + aes_ctr/1, mod_exp_test/1, rand_uniform_test/1, rsa_verify_test/1, @@ -62,41 +61,25 @@ -export([hexstr2bin/1]). -all(suite) -> - [link_test, - {conf,info,[md5, - md5_update, - md4, - md4_update, - md5_mac, - md5_mac_io, - sha, - sha_update, -%% sha256, -%% sha256_update, -%% sha512, -%% sha512_update, - des_cbc, - aes_cfb, - aes_cbc, - aes_cbc_iter, - aes_ctr, - des_cbc_iter, - des_ecb, - rand_uniform_test, - rsa_verify_test, - dsa_verify_test, - rsa_sign_test, - dsa_sign_test, - rsa_encrypt_decrypt, - dh, - exor_test, - rc4_test, - rc4_stream_test, - mod_exp_test, - blowfish_cfb64, - smp], - cleanup}]. +all() -> + [link_test, md5, md5_update, md4, md4_update, md5_mac, + md5_mac_io, sha, sha_update, + %% sha256, sha256_update, sha512,sha512_update, + des_cbc, aes_cfb, aes_cbc, + aes_cbc_iter, aes_ctr, des_cbc_iter, des_ecb, rand_uniform_test, + rsa_verify_test, dsa_verify_test, rsa_sign_test, + dsa_sign_test, rsa_encrypt_decrypt, dh, exor_test, + rc4_test, rc4_stream_test, mod_exp_test, blowfish_cfb64, + smp]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. init_per_testcase(_Name,Config) -> io:format("init_per_testcase\n"), -- cgit v1.2.3 From 8f7e33f5865168c737dc90b9e2e29e4da3a2edc1 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 10:59:47 +0200 Subject: Update docbuilder tests to conform with common_test standard --- lib/docbuilder/test/docb_SUITE.erl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/docbuilder/test/docb_SUITE.erl b/lib/docbuilder/test/docb_SUITE.erl index c871130521..2d368af23d 100644 --- a/lib/docbuilder/test/docb_SUITE.erl +++ b/lib/docbuilder/test/docb_SUITE.erl @@ -17,13 +17,24 @@ %% -module(docb_SUITE). --export([all/1,html/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,html/1]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> [html]. +all() -> +[html]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + html(suite) -> []; html(Config) when is_list(Config) -> -- cgit v1.2.3 From 663982e3e8d2dc34353e342240fa80aca25a8923 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:00:08 +0200 Subject: Update edoc tests to conform with common_test standard --- lib/edoc/test/edoc.spec | 2 +- lib/edoc/test/edoc_SUITE.erl | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/edoc/test/edoc.spec b/lib/edoc/test/edoc.spec index 8443a28028..02e3eca8fe 100644 --- a/lib/edoc/test/edoc.spec +++ b/lib/edoc/test/edoc.spec @@ -1 +1 @@ -{topcase, {dir, "../edoc_test"}}. +{suites,"edoc_test",all}. diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl index ea833f89b2..e095913dc7 100644 --- a/lib/edoc/test/edoc_SUITE.erl +++ b/lib/edoc/test/edoc_SUITE.erl @@ -17,16 +17,26 @@ %% -module(edoc_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). %% Test cases -export([build_std/1]). -all(suite) -> - [build_std]. +all() -> +[build_std]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + build_std(suite) -> []; -- cgit v1.2.3 From ba5a2a41565e994ffff087f918133688775f1943 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:00:23 +0200 Subject: Update et tests to conform with common_test standard --- lib/et/test/et.spec | 3 +-- lib/et/test/et_test_lib.erl | 2 +- lib/et/test/et_wx_SUITE.erl | 22 ++++++++++++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/et/test/et.spec b/lib/et/test/et.spec index 69cd8d7582..f363993ab7 100644 --- a/lib/et/test/et.spec +++ b/lib/et/test/et.spec @@ -1,2 +1 @@ -{topcase, {dir, "../et_test"}}. - +{suites,"et_test",all}. diff --git a/lib/et/test/et_test_lib.erl b/lib/et/test/et_test_lib.erl index 084e1de03b..c1bfeb9fc0 100644 --- a/lib/et/test/et_test_lib.erl +++ b/lib/et/test/et_test_lib.erl @@ -95,7 +95,7 @@ wx_init_per_suite(Config) -> exit({skipped, "Can not test on MacOSX"}); {unix, _} -> io:format("DISPLAY ~s~n", [os:getenv("DISPLAY")]), - case proplists:get_value(xserver, Config, none) of + case ct:get_config(xserver, none) of none -> ignore; Server -> os:putenv("DISPLAY", Server) end; diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 91b1cb72a2..85926619fa 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -18,8 +18,8 @@ -module(et_wx_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, end_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,14 +36,20 @@ init_per_testcase(Func,Config) -> et_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> et_test_lib:end_per_testcase(Func,Config). -end_per_testcase(Func,Config) -> %% For test_server - et_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all(suite) -> - [ - start_all_windows - ]. +all() -> +[start_all_windows]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases -- cgit v1.2.3 From 261a5886d168b451a169f6b30e29fefad38fb332 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:00:39 +0200 Subject: Update inviso tests to conform with common_test standard --- lib/inviso/test/inviso.spec | 2 +- lib/inviso/test/inviso_tool_SUITE.erl | 37 +++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/lib/inviso/test/inviso.spec b/lib/inviso/test/inviso.spec index d655771d64..49b3f67096 100644 --- a/lib/inviso/test/inviso.spec +++ b/lib/inviso/test/inviso.spec @@ -1 +1 @@ -{topcase, {dir, "../inviso_test"}}. +{suites,"inviso_test",all}. diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl index 29d1c8f539..839cd0dd26 100644 --- a/lib/inviso/test/inviso_tool_SUITE.erl +++ b/lib/inviso/test/inviso_tool_SUITE.erl @@ -28,20 +28,25 @@ -module(inviso_tool_SUITE). -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("kernel/include/file.hrl"). -define(l,?line). -all(suite) -> - [ - dist_basic_1, - dist_rtc, - dist_reconnect, - dist_adopt, - dist_history, - dist_start_session_special - ]. +all() -> +[dist_basic_1, dist_rtc, dist_reconnect, dist_adopt, + dist_history, dist_start_session_special]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %% ----------------------------------------------------------------------------- init_per_suite(Config) -> @@ -222,6 +227,10 @@ dist_basic_1(Config) when list(Config) -> Nodes), %% Start a test process at every node with a runtime component. ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes), + + %% Let the processes start + timer:sleep(100), + %% Find the pids of the test processes. ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end, Nodes), @@ -502,6 +511,10 @@ dist_rtc(Config) when is_list(Config) -> Nodes), %% Start a test process at every node with a runtime component. ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes), + + %% Let the processes start + timer:sleep(100), + %% Find the pids of the test processes. ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end, Nodes), @@ -555,6 +568,10 @@ dist_reconnect(Config) when list(Config) -> ?l start_inviso_tool_session(CNode,[],1,Nodes), %% Start a test process at every node with a runtime component. ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes), + + %% Let the processes start + timer:sleep(100), + %% Find the pids of the test processes. ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end, Nodes), -- cgit v1.2.3 From 4ca6c1a49d6c06e01eac06dd5df996def23fb253 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:01:24 +0200 Subject: Update jinterface tests to conform with common_test standard --- lib/jinterface/test/jinterface_SUITE.erl | 98 +++++++------------------------- lib/jinterface/test/nc_SUITE.erl | 39 +++++++------ 2 files changed, 38 insertions(+), 99 deletions(-) diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index ea097680dd..5c31469849 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -18,7 +18,7 @@ %% -module(jinterface_SUITE). --export([all/1, init_per_suite/1, end_per_suite/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -export([nodename/1, register_and_whereis/1, get_names/1, boolean_atom/1, @@ -31,13 +31,13 @@ erl_link_java_exit/1, java_link_erl_exit/1, internal_link_linking_exits/1, internal_link_linked_exits/1, internal_unlink_linking_exits/1, internal_unlink_linked_exits/1, - normal_exit/1, kill_mbox/1, kill_erl_proc_from_java/1, - kill_mbox_from_erlang/1, erl_exit_with_reason_any_term/1, + normal_exit/1, kill_erl_proc_from_java/1, + erl_exit_with_reason_any_term/1, java_exit_with_reason_any_term/1, status_handler_localStatus/1, status_handler_remoteStatus/1, status_handler_connAttempt/1]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -define(debug,true). @@ -80,14 +80,21 @@ %%%----------------------------------------------------------------- %%% INIT/END %%%----------------------------------------------------------------- -all(suite) -> - lists:append([ - fundamental(), - ping(), - send_receive(), - link_unlink(), - status_handler() - ]). +all() -> +lists:append([fundamental(), ping(), send_receive(), + link_unlink(), status_handler()]). + +groups() -> + [{kill_mbox, [], {skip, "Not yet implemented"}}, + {kill_mbox_from_erlang, [], + {skip, "Not yet implemented"}}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + fundamental() -> [ @@ -476,59 +483,6 @@ normal_exit(Config) when is_list(Config) -> %%%----------------------------------------------------------------- -kill_mbox(doc) -> - ["MboxLinkUnlink.java: " - "Test that mbox.exit(new OtpErlangAtom(\"kill\") causes linked " - "processes to exit with reason 'killed', which can be trapped."]; -kill_mbox(suite) -> - {skip, "Not yet implemented"}; -kill_mbox(Config) when is_list(Config) -> - Fun = - fun() -> - register(erl_link_server,self()), - process_flag(trap_exit,true), - receive - {Main,Mbox} when is_pid(Main), is_pid(Mbox) -> - ?dbg("Erlang sending \"~p\"",[kill_mbox]), - Pid = spawn_link(fun() -> - process_flag(trap_exit,true), - link(Mbox), - Mbox ! {?kill_mbox}, - receive - {'EXIT',Mbox,killed} -> - exit(correct_reason); - {'EXIT',Mbox,R} -> - exit({faulty_reason,R}) - end - end), - receive - {'EXIT',Pid,{faulty_reason,Reason}} -> - receive done -> Main ! done end, - exit({faulty_reason,Reason}); - {'EXIT',Pid,im_killed} -> - receive done -> Main ! done end - after 1000 -> - receive - Other -> - ?dbg("Got garbage when waiting for exit:" - " ~p", [Other]), - Main ! done, - exit({got_unexpected,Other}) - after 0 -> - ok - end - end; - Other -> - ?dbg("Got garbage: ~p",[Other]), - exit(Other) - end - end, - - spawn_link(Fun), - ok = jitu:java(?config(java, Config), - ?config(data_dir, Config), - "MboxLinkUnlink", - [erlang:get_cookie(),node()]). %%%----------------------------------------------------------------- kill_erl_proc_from_java(doc) -> @@ -547,20 +501,6 @@ kill_erl_proc_from_java(Config) when is_list(Config) -> erl_java_link(LinkFun,kill_erl_proc_from_java,killed,Config). %%%----------------------------------------------------------------- -kill_mbox_from_erlang(doc) -> - ["MboxLinkUnlink.java: " - "Test that exit(Mbox,kill) causes linked the Mbox to be killed, and" - "linked processes to exit with reason 'killed', even if trapping exits"]; -kill_mbox_from_erlang(suite) -> - {skip, "Not yet implemented"}; -kill_mbox_from_erlang(Config) when is_list(Config) -> - LinkFun = fun(Mbox) -> - link(Mbox), - Mbox ! {?kill_mbox_from_erlang}, - exit(Mbox,kill), - receive after infinity -> ok end - end, - erl_java_link(LinkFun,kill_mbox_from_erlang,killed,Config). %%%----------------------------------------------------------------- erl_exit_with_reason_any_term(doc) -> diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index 82dd3c2535..a96b3495aa 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -19,11 +19,11 @@ -module(nc_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, @@ -50,24 +50,23 @@ %% Top of cases -all(doc) -> []; -all(suite) -> [pid_roundtrip, - port_roundtrip, - ref_roundtrip, - new_float, - old_stuff, - binary_roundtrip, - decompress_roundtrip, - compress_roundtrip, - integer_roundtrip, - fun_roundtrip, - lists_roundtrip, - lists_roundtrip_2, - lists_iterator, - unicode, - unicode_list_to_string, - unicode_string_to_list, - connect]. +all() -> +[pid_roundtrip, port_roundtrip, ref_roundtrip, + new_float, old_stuff, binary_roundtrip, + decompress_roundtrip, compress_roundtrip, + integer_roundtrip, fun_roundtrip, lists_roundtrip, + lists_roundtrip_2, lists_iterator, unicode, + unicode_list_to_string, unicode_string_to_list, connect]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -- cgit v1.2.3 From 9447ff6854785cec4fc051560c36560d0b7155cc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:01:41 +0200 Subject: Update eunit tests to conform with common_test standard --- lib/eunit/test/eunit_SUITE.erl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index 406ff9d499..0fc409b62e 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -18,12 +18,22 @@ %% -module(eunit_SUITE). --export([all/1,eunit_test/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,eunit_test/1]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). + +all() -> +[eunit_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [eunit_test]. eunit_test(Config) when is_list(Config) -> ok = file:set_cwd(code:lib_dir(eunit)), -- cgit v1.2.3 From 0c640f2de05c1a540d4b398de0f1891dfad29cc3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:02:18 +0200 Subject: Update odbc tests to conform with common_test standard --- lib/odbc/test/odbc.spec | 34 +++++++++++---- lib/odbc/test/odbc_connect_SUITE.erl | 41 +++++++++-------- lib/odbc/test/odbc_data_type_SUITE.erl | 80 +++++++++++++++++----------------- lib/odbc/test/odbc_query_SUITE.erl | 76 +++++++++++++++++--------------- lib/odbc/test/odbc_start_SUITE.erl | 24 ++++++---- 5 files changed, 146 insertions(+), 109 deletions(-) diff --git a/lib/odbc/test/odbc.spec b/lib/odbc/test/odbc.spec index acba9f8d98..2151406901 100644 --- a/lib/odbc/test/odbc.spec +++ b/lib/odbc/test/odbc.spec @@ -1,9 +1,25 @@ -{topcase, {dir, "../odbc_test"}}. -{skip, {odbc_data_type_SUITE, varchar_upper_limit, "Known bug in database"}}. -{skip, {odbc_data_type_SUITE, text_upper_limit, "Consumes too much resources"}}. -{skip, {odbc_data_type_SUITE, bit_true , "Not supported by driver"}}. -{skip, {odbc_data_type_SUITE, bit_false, "Not supported by driver"}}. -{skip, {odbc_query_SUITE, multiple_select_result_sets,"Not supported by driver"}}. -{skip, {odbc_query_SUITE, multiple_mix_result_sets, "Not supported by driver"}}. -{skip, {odbc_query_SUITE, multiple_result_sets_error, "Not supported by driver"}}. -{skip, {odbc_query_SUITE, param_insert_tiny_int, "Not supported by driver"}}. \ No newline at end of file +{suites,"odbc_test",all}. +{skip_cases,"odbc_test",odbc_data_type_SUITE, + [varchar_upper_limit], + "Known bug in database"}. +{skip_cases,"odbc_test",odbc_data_type_SUITE, + [text_upper_limit], + "Consumes too much resources"}. +{skip_cases,"odbc_test",odbc_data_type_SUITE, + [bit_true], + "Not supported by driver"}. +{skip_cases,"odbc_test",odbc_data_type_SUITE, + [bit_false], + "Not supported by driver"}. +{skip_cases,"odbc_test",odbc_query_SUITE, + [multiple_select_result_sets], + "Not supported by driver"}. +{skip_cases,"odbc_test",odbc_query_SUITE, + [multiple_mix_result_sets], + "Not supported by driver"}. +{skip_cases,"odbc_test",odbc_query_SUITE, + [multiple_result_sets_error], + "Not supported by driver"}. +{skip_cases,"odbc_test",odbc_query_SUITE, + [param_insert_tiny_int], + "Not supported by driver"}. diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index 093b675fd5..3854e5e144 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("odbc_test.hrl"). @@ -41,17 +41,29 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(suite) -> - case odbc_test_lib:odbc_check() of - ok -> - [not_exist_db, commit, rollback, not_explicit_commit, - no_c_node, port_dies, control_process_dies, client_dies, - connect_timeout, timeout, many_timeouts, timeout_reset, - disconnect_on_timeout, connection_closed, - disable_scrollable_cursors, return_rows_as_lists, api_missuse]; - Other -> - {skip, Other} - end. +all() -> +case odbc_test_lib:odbc_check() of + ok -> + [not_exist_db, commit, rollback, not_explicit_commit, + no_c_node, port_dies, control_process_dies, + {group, client_dies}, connect_timeout, timeout, + many_timeouts, timeout_reset, disconnect_on_timeout, + connection_closed, disable_scrollable_cursors, + return_rows_as_lists, api_missuse]; + Other -> {skip, Other} +end. + +groups() -> + [{client_dies, [], + [client_dies_normal, client_dies_timeout, + client_dies_error]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config @@ -281,11 +293,6 @@ control_process_dies(_Config) -> ok. %%------------------------------------------------------------------------- -client_dies(doc) -> - ["Test that the odbc process is terminated when the client process " - "dies"]; -client_dies(suite) -> - [client_dies_normal, client_dies_timeout, client_dies_error]. %%------------------------------------------------------------------------- client_dies_normal(doc) -> diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl index f0e35edbb2..d4c133fb8b 100644 --- a/lib/odbc/test/odbc_data_type_SUITE.erl +++ b/lib/odbc/test/odbc_data_type_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include_lib("stdlib/include/ms_transform.hrl"). -include("test_server_line.hrl"). -include("odbc_test.hrl"). @@ -39,13 +39,46 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Tests data types"]; -all(suite) -> - case odbc_test_lib:odbc_check() of - ok -> [char, int, floats, dec_and_num, timestamp]; - Other -> {skip,Other} - end. +all() -> +case odbc_test_lib:odbc_check() of + ok -> + [{group, char}, {group, int}, {group, floats}, + {group, dec_and_num}, timestamp]; + Other -> {skip, Other} +end. + +groups() -> + [{char, [], + [char_fixed_lower_limit, char_fixed_upper_limit, + char_fixed_padding, varchar_lower_limit, + varchar_upper_limit, varchar_no_padding, + text_lower_limit, text_upper_limit, unicode]}, + {binary_char, [], + [binary_char_fixed_lower_limit, + binary_char_fixed_upper_limit, + binary_char_fixed_padding, binary_varchar_lower_limit, + binary_varchar_upper_limit, binary_varchar_no_padding, + binary_text_lower_limit, binary_text_upper_limit, + unicode]}, + {int, [], + [tiny_int_lower_limit, tiny_int_upper_limit, + small_int_lower_limit, small_int_upper_limit, + int_lower_limit, int_upper_limit, big_int_lower_limit, + big_int_upper_limit, bit_false, bit_true]}, + {floats, [], + [float_lower_limit, float_upper_limit, float_zero, + real_zero]}, + {dec_and_num, [], + [dec_long, dec_double, dec_bignum, num_long, num_double, + num_bignum]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config @@ -121,14 +154,6 @@ end_per_testcase(_TestCase, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -char(doc) -> - ["Tests char data types"]; - -char(suite) -> - [char_fixed_lower_limit, char_fixed_upper_limit, - char_fixed_padding, varchar_lower_limit, varchar_upper_limit, - varchar_no_padding, text_lower_limit, text_upper_limit, unicode - ]. char_fixed_lower_limit(doc) -> ["Tests fixed length char data type lower boundaries."]; @@ -421,14 +446,6 @@ text_upper_limit(Config) when is_list(Config) -> %% ok. %%------------------------------------------------------------------------- -binary_char(doc) -> - ["Tests char data types returned as erlang binaries"]; - -binary_char(suite) -> - [binary_char_fixed_lower_limit, binary_char_fixed_upper_limit, - binary_char_fixed_padding, binary_varchar_lower_limit, binary_varchar_upper_limit, - binary_varchar_no_padding, binary_text_lower_limit, binary_text_upper_limit, unicode - ]. binary_char_fixed_lower_limit(doc) -> ["Tests fixed length char data type lower boundaries."]; @@ -723,13 +740,6 @@ binary_text_upper_limit(Config) when is_list(Config) -> %%------------------------------------------------------------------------- -int(doc) -> - ["Tests integer data types"]; - -int(suite) -> - [tiny_int_lower_limit, tiny_int_upper_limit, small_int_lower_limit, - small_int_upper_limit, int_lower_limit, int_upper_limit, - big_int_lower_limit, big_int_upper_limit, bit_false, bit_true]. %%------------------------------------------------------------------------- @@ -1050,10 +1060,6 @@ bit_true(Config) when is_list(Config) -> %%------------------------------------------------------------------------- -floats(doc) -> - ["Test the datatype float."]; -floats(suite) -> - [float_lower_limit, float_upper_limit, float_zero, real_zero]. %%------------------------------------------------------------------------- float_lower_limit(doc) -> @@ -1181,10 +1187,6 @@ real_zero(Config) when is_list(Config) -> ok end. %%------------------------------------------------------------------------- -dec_and_num(doc) -> - ["Tests decimal and numeric datatypes."]; -dec_and_num(suite) -> - [dec_long, dec_double, dec_bignum, num_long, num_double, num_bignum]. %%------------------------------------------------------------------------ dec_long(doc) -> [""]; diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index 96a3e3fa80..fd04125dbe 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("odbc_test.hrl"). @@ -38,20 +38,45 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -all(doc) -> - ["Tests SQL queries"]; -all(suite) -> - case odbc_test_lib:odbc_check() of - ok -> - [sql_query, first, last, next, prev, select_count,select_next, - select_relative, select_absolute, create_table_twice, - delete_table_twice, duplicate_key, not_connection_owner, - no_result_set, query_error, multiple_select_result_sets, - multiple_mix_result_sets, multiple_result_sets_error, - parameterized_queries, describe_table, - delete_nonexisting_row]; - Other -> {skip, Other} - end. +all() -> +case odbc_test_lib:odbc_check() of + ok -> + [sql_query, first, last, next, prev, select_count, + select_next, select_relative, select_absolute, + create_table_twice, delete_table_twice, duplicate_key, + not_connection_owner, no_result_set, query_error, + multiple_select_result_sets, multiple_mix_result_sets, + multiple_result_sets_error, + {group, parameterized_queries}, {group, describe_table}, + delete_nonexisting_row]; + Other -> {skip, Other} +end. + +groups() -> + [{parameterized_queries, [], + [{group, param_integers}, param_insert_decimal, + param_insert_numeric, {group, param_insert_string}, + param_insert_float, param_insert_real, + param_insert_double, param_insert_mix, param_update, + param_delete, param_select]}, + {param_integers, [], + [param_insert_tiny_int, param_insert_small_int, + param_insert_int, param_insert_integer]}, + {param_insert_string, [], + [param_insert_char, param_insert_character, + param_insert_char_varying, + param_insert_character_varying]}, + {describe_table, [], + [describe_integer, describe_string, describe_floating, + describe_dec_num, describe_no_such_table]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%-------------------------------------------------------------------- @@ -636,19 +661,8 @@ multiple_result_sets_error(Config) when is_list(Config) -> end. %%------------------------------------------------------------------------- -parameterized_queries(suite) -> - [param_integers, - param_insert_decimal, param_insert_numeric, - param_insert_string, - param_insert_float, param_insert_real, param_insert_double, - param_insert_mix, param_update, param_delete, param_select]. %%------------------------------------------------------------------------- -param_integers(doc)-> - ["Test insertion of integers by parameterized queries."]; -param_integers(suite) -> - [param_insert_tiny_int, - param_insert_small_int, param_insert_int, param_insert_integer]. %%------------------------------------------------------------------------- param_insert_tiny_int(doc)-> ["Test insertion of tiny ints by parameterized queries."]; @@ -885,11 +899,6 @@ param_insert_numeric(Config) when is_list(Config) -> ok. %%------------------------------------------------------------------------- -param_insert_string(doc) -> - ["Test insertion of strings by parameterized queries."]; -param_insert_string(suite) -> - [param_insert_char, param_insert_character, param_insert_char_varying, - param_insert_character_varying]. %%------------------------------------------------------------------------- param_insert_char(doc)-> @@ -1314,11 +1323,6 @@ param_select(Config) when is_list(Config) -> ok. %%------------------------------------------------------------------------- -describe_table(doc) -> - ["Test describe_table/[2,3]"]; -describe_table(suite) -> - [describe_integer, describe_string, describe_floating, describe_dec_num, - describe_no_such_table]. %%------------------------------------------------------------------------- describe_integer(doc) -> diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl index 07cda38c04..168e5452a5 100644 --- a/lib/odbc/test/odbc_start_SUITE.erl +++ b/lib/odbc/test/odbc_start_SUITE.erl @@ -24,7 +24,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include("odbc_test.hrl"). @@ -98,14 +98,22 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -all(doc) -> - ["Test start/stop of odbc"]; +all() -> +case odbc_test_lib:odbc_check() of + ok -> [start]; + Other -> {skip, Other} +end. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - case odbc_test_lib:odbc_check() of - ok -> [start]; - Other -> {skip, Other} - end. + %% Test cases starts here. %%-------------------------------------------------------------------- -- cgit v1.2.3 From c61a61372c62183f7f75811fd77734b618ee929b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 12 Oct 2010 11:02:43 +0200 Subject: Update parsetools tests to conform with common_test standard --- lib/parsetools/test/leex_SUITE.erl | 26 +++++++++++++++-------- lib/parsetools/test/parsetools.spec | 2 +- lib/parsetools/test/yecc_SUITE.erl | 41 ++++++++++++++++++++++--------------- 3 files changed, 43 insertions(+), 26 deletions(-) diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 5e210cc8eb..8b2cf1e4f3 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -30,16 +30,16 @@ -define(privdir, "leex_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([checks/1, +-export([ file/1, compile/1, syntax/1, - examples/1, + pt/1, man/1, ex/1, ex2/1, not_yet/1]). % Default timetrap timeout (set in init_per_testcase). @@ -54,10 +54,20 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> [checks, examples]. +all() -> +[{group, checks}, {group, examples}]. + +groups() -> + [{checks, [], [file, compile, syntax]}, + {examples, [], [pt, man, ex, ex2, not_yet]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -checks(suite) -> - [file, compile, syntax]. file(doc) -> "Bad files and options."; @@ -330,8 +340,6 @@ syntax(Config) when is_list(Config) -> leex:file(Filename, Ret), ok. -examples(suite) -> - [pt,man,ex,ex2,not_yet]. pt(doc) -> "Pushing back characters."; diff --git a/lib/parsetools/test/parsetools.spec b/lib/parsetools/test/parsetools.spec index 5b34633378..97dfe58f97 100644 --- a/lib/parsetools/test/parsetools.spec +++ b/lib/parsetools/test/parsetools.spec @@ -1 +1 @@ -{topcase, {dir, "../parsetools_test"}}. +{suites,"parsetools_test",all}. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index f691249e65..b504498b79 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -29,23 +29,23 @@ -define(privdir, "yecc_SUITE_priv"). -define(t, test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([app_test/1, - checks/1, + file/1, syntax/1, compile/1, rules/1, expect/1, conflicts/1, - examples/1, + empty/1, prec/1, yeccpre/1, lalr/1, old_yecc/1, other_examples/1, - bugs/1, + otp_5369/1, otp_6362/1, otp_7945/1, otp_8483/1, otp_8486/1, - improvements/1, + otp_7292/1, otp_7969/1, otp_8919/1]). % Default timetrap timeout (set in init_per_testcase). @@ -60,7 +60,25 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> [app_test, checks, examples, bugs, improvements]. +all() -> +[app_test, {group, checks}, {group, examples}, + {group, bugs}, {group, improvements}]. + +groups() -> + [{checks, [], + [file, syntax, compile, rules, expect, conflicts]}, + {examples, [], + [empty, prec, yeccpre, lalr, old_yecc, other_examples]}, + {bugs, [], + [otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]}, + {improvements, [], [otp_7292, otp_7969]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + app_test(doc) -> ["Tests the applications consistency."]; @@ -70,8 +88,6 @@ app_test(Config) when is_list(Config) -> ?line ok=?t:app_test(parsetools), ok. -checks(suite) -> - [file, syntax, compile, rules, expect, conflicts]. file(doc) -> "Bad files and options."; @@ -730,8 +746,6 @@ rules(Config) when is_list(Config) -> ?line run(Config, Ts), ok. -examples(suite) -> - [empty, prec, yeccpre, lalr, old_yecc, other_examples]. expect(doc) -> "Check of expect."; @@ -1283,8 +1297,6 @@ other_examples(Config) when is_list(Config) -> ?line run(Config, Ts), ok. -bugs(suite) -> - [otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]. otp_5369(doc) -> "OTP-5369. A bug in parse_and_scan reported on erlang questions."; @@ -1540,9 +1552,6 @@ otp_8486(Config) when is_list(Config) -> ?line run(Config, Ts), ok. -improvements(suite) -> - [otp_7292, otp_7969, otp_8919]. - otp_7292(doc) -> "OTP-7292. Header declarations for edoc."; otp_7292(suite) -> []; -- cgit v1.2.3 From 19d5a0e59f9897361d18b3c8987561620a212f04 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 14:43:25 +0100 Subject: Update cosFileTransfer tests to conform with common_test standard --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 45 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index f877e3ceda..b45cc65cd0 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -30,7 +30,7 @@ %%--------------- INCLUDES ----------------------------------- -include_lib("cosFileTransfer/src/cosFileTransferApp.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%--------------- DEFINES ------------------------------------ -define(default_timeout, ?t:minutes(20)). @@ -70,10 +70,11 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/1, +-export([all/0,groups/0, + init_per_group/2,end_per_group/2, cases/0, - init_all/1, - finish_all/1, + init_per_suite/1, + end_per_suite/1, fileIterator_api/1, fts_ftp_file_api/1, fts_ftp_file_ssl_api/1, @@ -82,7 +83,7 @@ fts_native_file_ssl_api/1, fts_native_dir_api/1, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, install_data/2, uninstall_data/1, slave_sup/0, @@ -93,16 +94,28 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -all(doc) -> ["API tests for the cosFileTransfer interfaces", ""]; -all(suite) -> {req, - [mnesia, orber], - {conf, init_all, cases(), finish_all}}. + +all() -> + cases(). + +groups() -> + []. + + + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [fts_ftp_dir_api, fts_ftp_file_api, fts_ftp_file_ssl_api, - fts_native_dir_api, fts_native_file_api, fts_native_file_ssl_api, +cases() -> + [fts_ftp_dir_api, fts_ftp_file_api, + fts_ftp_file_ssl_api, fts_native_dir_api, + fts_native_file_api, fts_native_file_ssl_api, fileIterator_api, app_test]. - + %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- @@ -112,12 +125,12 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -init_all(Config) -> +init_per_suite(Config) -> orber:jump_start(), cosProperty:install(), cosProperty:start(), @@ -147,7 +160,7 @@ init_all(Config) -> exit("Config not a list") end. -finish_all(Config) -> +end_per_suite(Config) -> ssl:stop(), crypto:stop(), cosFileTransferApp:stop(), -- cgit v1.2.3 From 83f932257470f5ae01fc61130e997fdea0562653 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 6 Dec 2010 16:48:31 +0100 Subject: Add ts_install_scb to suite/0 --- erts/emulator/test/a_SUITE.erl | 4 +++- erts/emulator/test/after_SUITE.erl | 4 +++- erts/emulator/test/alloc_SUITE.erl | 4 +++- erts/emulator/test/beam_SUITE.erl | 4 +++- erts/emulator/test/beam_literals_SUITE.erl | 4 +++- erts/emulator/test/bif_SUITE.erl | 4 +++- erts/emulator/test/big_SUITE.erl | 4 +++- erts/emulator/test/binary_SUITE.erl | 4 +++- erts/emulator/test/bs_bincomp_SUITE.erl | 4 +++- erts/emulator/test/bs_bit_binaries_SUITE.erl | 4 +++- erts/emulator/test/bs_construct_SUITE.erl | 4 +++- erts/emulator/test/bs_match_bin_SUITE.erl | 4 +++- erts/emulator/test/bs_match_int_SUITE.erl | 4 +++- erts/emulator/test/bs_match_misc_SUITE.erl | 4 +++- erts/emulator/test/bs_match_tail_SUITE.erl | 4 +++- erts/emulator/test/bs_utf_SUITE.erl | 4 +++- erts/emulator/test/busy_port_SUITE.erl | 4 +++- erts/emulator/test/call_trace_SUITE.erl | 4 +++- erts/emulator/test/code_SUITE.erl | 4 +++- erts/emulator/test/crypto_SUITE.erl | 4 +++- erts/emulator/test/ddll_SUITE.erl | 4 +++- erts/emulator/test/decode_packet_SUITE.erl | 4 +++- erts/emulator/test/distribution_SUITE.erl | 4 +++- erts/emulator/test/driver_SUITE.erl | 4 +++- erts/emulator/test/efile_SUITE.erl | 4 +++- erts/emulator/test/erl_drv_thread_SUITE.erl | 4 +++- erts/emulator/test/erl_link_SUITE.erl | 4 +++- erts/emulator/test/erts_debug_SUITE.erl | 6 ++++-- erts/emulator/test/estone_SUITE.erl | 4 +++- erts/emulator/test/evil_SUITE.erl | 4 +++- erts/emulator/test/exception_SUITE.erl | 4 +++- erts/emulator/test/float_SUITE.erl | 4 +++- erts/emulator/test/fun_SUITE.erl | 4 +++- erts/emulator/test/fun_r12_SUITE.erl | 4 +++- erts/emulator/test/gc_SUITE.erl | 4 +++- erts/emulator/test/guard_SUITE.erl | 4 +++- erts/emulator/test/hash_SUITE.erl | 4 +++- erts/emulator/test/hibernate_SUITE.erl | 4 +++- erts/emulator/test/list_bif_SUITE.erl | 4 +++- erts/emulator/test/match_spec_SUITE.erl | 6 ++++-- erts/emulator/test/module_info_SUITE.erl | 4 +++- erts/emulator/test/monitor_SUITE.erl | 4 +++- erts/emulator/test/mtx_SUITE.erl | 4 +++- erts/emulator/test/nested_SUITE.erl | 4 +++- erts/emulator/test/nif_SUITE.erl | 6 ++++-- erts/emulator/test/node_container_SUITE.erl | 4 +++- erts/emulator/test/nofrag_SUITE.erl | 4 +++- erts/emulator/test/num_bif_SUITE.erl | 4 +++- erts/emulator/test/old_scheduler_SUITE.erl | 4 +++- erts/emulator/test/op_SUITE.erl | 4 +++- erts/emulator/test/port_SUITE.erl | 4 +++- erts/emulator/test/port_bif_SUITE.erl | 4 +++- erts/emulator/test/process_SUITE.erl | 4 +++- erts/emulator/test/pseudoknot_SUITE.erl | 4 +++- erts/emulator/test/receive_SUITE.erl | 4 +++- erts/emulator/test/ref_SUITE.erl | 4 +++- erts/emulator/test/register_SUITE.erl | 4 +++- erts/emulator/test/save_calls_SUITE.erl | 4 +++- erts/emulator/test/scheduler_SUITE.erl | 4 +++- erts/emulator/test/send_term_SUITE.erl | 4 +++- erts/emulator/test/sensitive_SUITE.erl | 4 +++- erts/emulator/test/signal_SUITE.erl | 4 +++- erts/emulator/test/statistics_SUITE.erl | 4 +++- erts/emulator/test/system_info_SUITE.erl | 4 +++- erts/emulator/test/system_profile_SUITE.erl | 4 +++- erts/emulator/test/time_SUITE.erl | 4 +++- erts/emulator/test/timer_bif_SUITE.erl | 4 +++- erts/emulator/test/trace_SUITE.erl | 4 +++- erts/emulator/test/trace_bif_SUITE.erl | 4 +++- erts/emulator/test/trace_call_count_SUITE.erl | 4 +++- erts/emulator/test/trace_call_time_SUITE.erl | 4 +++- erts/emulator/test/trace_local_SUITE.erl | 4 +++- erts/emulator/test/trace_meta_SUITE.erl | 4 +++- erts/emulator/test/trace_nif_SUITE.erl | 4 +++- erts/emulator/test/trace_port_SUITE.erl | 4 +++- erts/emulator/test/tuple_SUITE.erl | 4 +++- erts/emulator/test/z_SUITE.erl | 4 +++- erts/epmd/test/epmd_SUITE.erl | 4 +++- erts/test/autoimport_SUITE.erl | 4 +++- erts/test/erl_print_SUITE.erl | 4 +++- erts/test/erlc_SUITE.erl | 4 +++- erts/test/erlexec_SUITE.erl | 4 +++- erts/test/ethread_SUITE.erl | 4 +++- erts/test/install_SUITE.erl | 4 +++- erts/test/nt_SUITE.erl | 4 +++- erts/test/otp_SUITE.erl | 4 +++- erts/test/run_erl_SUITE.erl | 4 +++- erts/test/z_SUITE.erl | 4 +++- lib/asn1/test/asn1_SUITE.erl | 2 ++ lib/asn1/test/asn1_bin_SUITE.erl | 2 ++ lib/asn1/test/asn1_bin_v2_SUITE.erl | 2 ++ lib/common_test/test/ct_config_SUITE.erl | 2 ++ lib/common_test/test/ct_error_SUITE.erl | 2 ++ lib/common_test/test/ct_event_handler_SUITE.erl | 2 ++ lib/common_test/test/ct_groups_test_1_SUITE.erl | 2 ++ lib/common_test/test/ct_groups_test_2_SUITE.erl | 2 ++ lib/common_test/test/ct_master_SUITE.erl | 2 ++ lib/common_test/test/ct_misc_1_SUITE.erl | 2 ++ lib/common_test/test/ct_repeat_1_SUITE.erl | 2 ++ lib/common_test/test/ct_sequence_1_SUITE.erl | 2 ++ lib/common_test/test/ct_skip_SUITE.erl | 2 ++ lib/common_test/test/ct_smoke_test_SUITE.erl | 2 ++ lib/common_test/test/ct_test_server_if_1_SUITE.erl | 2 ++ lib/common_test/test/ct_testspec_1_SUITE.erl | 2 ++ lib/compiler/test/andor_SUITE.erl | 4 +++- lib/compiler/test/apply_SUITE.erl | 4 +++- lib/compiler/test/beam_validator_SUITE.erl | 4 +++- lib/compiler/test/bs_bincomp_SUITE.erl | 4 +++- lib/compiler/test/bs_bit_binaries_SUITE.erl | 4 +++- lib/compiler/test/bs_construct_SUITE.erl | 4 +++- lib/compiler/test/bs_match_SUITE.erl | 4 +++- lib/compiler/test/bs_utf_SUITE.erl | 4 +++- lib/compiler/test/compilation_SUITE.erl | 2 ++ lib/compiler/test/compile_SUITE.erl | 4 ++-- lib/compiler/test/core_SUITE.erl | 4 +++- lib/compiler/test/core_fold_SUITE.erl | 4 +++- lib/compiler/test/error_SUITE.erl | 4 +++- lib/compiler/test/float_SUITE.erl | 4 +++- lib/compiler/test/fun_SUITE.erl | 4 +++- lib/compiler/test/guard_SUITE.erl | 4 +++- lib/compiler/test/inline_SUITE.erl | 2 ++ lib/compiler/test/lc_SUITE.erl | 4 +++- lib/compiler/test/match_SUITE.erl | 4 +++- lib/compiler/test/misc_SUITE.erl | 11 ++++++----- lib/compiler/test/num_bif_SUITE.erl | 4 +++- lib/compiler/test/parteval_SUITE.erl | 4 +++- lib/compiler/test/pmod_SUITE.erl | 4 +++- lib/compiler/test/receive_SUITE.erl | 4 +++- lib/compiler/test/record_SUITE.erl | 4 +++- lib/compiler/test/trycatch_SUITE.erl | 4 +++- lib/compiler/test/warnings_SUITE.erl | 4 +++- lib/cosEvent/test/event_channel_SUITE.erl | 4 +++- lib/cosEvent/test/generated_SUITE.erl | 4 +++- lib/cosEventDomain/test/event_domain_SUITE.erl | 4 +++- lib/cosEventDomain/test/generated_SUITE.erl | 4 +++- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 4 +++- lib/cosNotification/test/eventDB_SUITE.erl | 4 +++- lib/cosNotification/test/generated_SUITE.erl | 4 +++- lib/cosNotification/test/grammar_SUITE.erl | 4 +++- lib/cosNotification/test/notification_SUITE.erl | 4 +++- lib/cosProperty/test/generated_SUITE.erl | 4 +++- lib/cosProperty/test/property_SUITE.erl | 4 +++- lib/cosTime/test/generated_SUITE.erl | 4 +++- lib/cosTime/test/time_SUITE.erl | 4 +++- lib/cosTransactions/test/generated_SUITE.erl | 4 +++- lib/cosTransactions/test/transactions_SUITE.erl | 4 +++- lib/crypto/test/blowfish_SUITE.erl | 2 ++ lib/crypto/test/crypto_SUITE.erl | 4 +++- lib/debugger/test/andor_SUITE.erl | 4 +++- lib/debugger/test/bs_bincomp_SUITE.erl | 4 +++- lib/debugger/test/bs_construct_SUITE.erl | 4 +++- lib/debugger/test/bs_match_bin_SUITE.erl | 4 +++- lib/debugger/test/bs_match_int_SUITE.erl | 4 +++- lib/debugger/test/bs_match_misc_SUITE.erl | 4 +++- lib/debugger/test/bs_match_tail_SUITE.erl | 4 +++- lib/debugger/test/bs_utf_SUITE.erl | 4 +++- lib/debugger/test/bug_SUITE.erl | 4 +++- lib/debugger/test/dbg_ui_SUITE.erl | 4 +++- lib/debugger/test/debugger_SUITE.erl | 4 +++- lib/debugger/test/erl_eval_SUITE.erl | 4 +++- lib/debugger/test/exception_SUITE.erl | 4 +++- lib/debugger/test/fun_SUITE.erl | 4 +++- lib/debugger/test/guard_SUITE.erl | 4 +++- lib/debugger/test/int_SUITE.erl | 4 +++- lib/debugger/test/int_break_SUITE.erl | 4 +++- lib/debugger/test/int_eval_SUITE.erl | 4 +++- lib/debugger/test/lc_SUITE.erl | 4 +++- lib/debugger/test/record_SUITE.erl | 4 +++- lib/debugger/test/trycatch_SUITE.erl | 8 ++++++-- lib/docbuilder/test/docb_SUITE.erl | 4 +++- lib/edoc/test/edoc_SUITE.erl | 4 +++- lib/erl_interface/test/ei_accept_SUITE.erl | 4 +++- lib/erl_interface/test/ei_connect_SUITE.erl | 4 +++- lib/erl_interface/test/ei_decode_SUITE.erl | 4 +++- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 4 +++- lib/erl_interface/test/ei_encode_SUITE.erl | 4 +++- lib/erl_interface/test/ei_format_SUITE.erl | 4 +++- lib/erl_interface/test/ei_print_SUITE.erl | 4 +++- lib/erl_interface/test/ei_tmo_SUITE.erl | 4 +++- lib/erl_interface/test/erl_connect_SUITE.erl | 4 +++- lib/erl_interface/test/erl_eterm_SUITE.erl | 4 +++- lib/erl_interface/test/erl_ext_SUITE.erl | 4 +++- lib/erl_interface/test/erl_format_SUITE.erl | 4 +++- lib/erl_interface/test/erl_match_SUITE.erl | 4 +++- lib/erl_interface/test/port_call_SUITE.erl | 4 +++- lib/et/test/et_wx_SUITE.erl | 4 +++- lib/eunit/test/eunit_SUITE.erl | 4 +++- lib/ic/test/c_client_erl_server_SUITE.erl | 4 +++- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 4 +++- lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl | 4 +++- lib/ic/test/erl_client_c_server_SUITE.erl | 4 +++- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 4 +++- lib/ic/test/ic_SUITE.erl | 4 +++- lib/ic/test/ic_be_SUITE.erl | 4 +++- lib/ic/test/ic_pp_SUITE.erl | 4 +++- lib/ic/test/ic_pragma_SUITE.erl | 4 +++- lib/ic/test/ic_register_SUITE.erl | 4 +++- lib/ic/test/java_client_erl_server_SUITE.erl | 4 +++- lib/inets/test/ftp_SUITE.erl | 4 +++- lib/inets/test/ftp_format_SUITE.erl | 4 +++- lib/inets/test/http_format_SUITE.erl | 4 +++- lib/inets/test/httpc_SUITE.erl | 2 ++ lib/inets/test/httpc_cookie_SUITE.erl | 4 +++- lib/inets/test/httpd_SUITE.erl | 4 +++- lib/inets/test/httpd_basic_SUITE.erl | 2 ++ lib/inets/test/inets_SUITE.erl | 2 ++ lib/inets/test/inets_sup_SUITE.erl | 2 ++ lib/inets/test/tftp_SUITE.erl | 2 ++ lib/inviso/test/inviso_tool_SUITE.erl | 2 ++ lib/jinterface/test/jinterface_SUITE.erl | 4 +++- lib/jinterface/test/nc_SUITE.erl | 4 +++- lib/kernel/test/application_SUITE.erl | 4 +++- lib/kernel/test/bif_SUITE.erl | 4 +++- lib/kernel/test/code_SUITE.erl | 4 +++- lib/kernel/test/disk_log_SUITE.erl | 4 +++- lib/kernel/test/erl_boot_server_SUITE.erl | 4 +++- lib/kernel/test/erl_distribution_SUITE.erl | 4 +++- lib/kernel/test/erl_distribution_wb_SUITE.erl | 4 +++- lib/kernel/test/erl_prim_loader_SUITE.erl | 4 +++- lib/kernel/test/error_logger_SUITE.erl | 4 +++- lib/kernel/test/error_logger_warn_SUITE.erl | 4 +++- lib/kernel/test/file_SUITE.erl | 4 +++- lib/kernel/test/file_name_SUITE.erl | 5 +++-- lib/kernel/test/gen_sctp_SUITE.erl | 4 +++- lib/kernel/test/gen_tcp_api_SUITE.erl | 4 +++- lib/kernel/test/gen_tcp_echo_SUITE.erl | 4 +++- lib/kernel/test/gen_tcp_misc_SUITE.erl | 4 +++- lib/kernel/test/gen_udp_SUITE.erl | 4 +++- lib/kernel/test/global_SUITE.erl | 4 +++- lib/kernel/test/global_group_SUITE.erl | 4 +++- lib/kernel/test/heart_SUITE.erl | 4 +++- lib/kernel/test/inet_SUITE.erl | 4 +++- lib/kernel/test/inet_res_SUITE.erl | 4 +++- lib/kernel/test/inet_sockopt_SUITE.erl | 4 +++- lib/kernel/test/init_SUITE.erl | 4 +++- lib/kernel/test/interactive_shell_SUITE.erl | 4 +++- lib/kernel/test/kernel_SUITE.erl | 4 +++- lib/kernel/test/kernel_config_SUITE.erl | 4 +++- lib/kernel/test/os_SUITE.erl | 8 ++++++-- lib/kernel/test/pdict_SUITE.erl | 4 +++- lib/kernel/test/pg2_SUITE.erl | 4 +++- lib/kernel/test/prim_file_SUITE.erl | 4 +++- lib/kernel/test/ram_file_SUITE.erl | 4 +++- lib/kernel/test/rpc_SUITE.erl | 4 +++- lib/kernel/test/seq_trace_SUITE.erl | 4 +++- lib/kernel/test/wrap_log_reader_SUITE.erl | 4 +++- lib/kernel/test/zlib_SUITE.erl | 2 ++ lib/megaco/test/megaco_SUITE.erl | 2 ++ lib/mnesia/test/mnesia_SUITE.erl | 2 ++ lib/observer/test/crashdump_viewer_SUITE.erl | 4 +++- lib/observer/test/etop_SUITE.erl | 4 +++- lib/observer/test/observer_SUITE.erl | 4 +++- lib/observer/test/ttb_SUITE.erl | 4 +++- lib/odbc/test/odbc_connect_SUITE.erl | 2 ++ lib/odbc/test/odbc_data_type_SUITE.erl | 2 ++ lib/odbc/test/odbc_query_SUITE.erl | 2 ++ lib/odbc/test/odbc_start_SUITE.erl | 2 ++ lib/orber/test/cdrcoding_10_SUITE.erl | 4 +++- lib/orber/test/cdrcoding_11_SUITE.erl | 4 +++- lib/orber/test/cdrcoding_12_SUITE.erl | 4 +++- lib/orber/test/cdrlib_SUITE.erl | 4 +++- lib/orber/test/corba_SUITE.erl | 4 +++- lib/orber/test/csiv2_SUITE.erl | 4 +++- lib/orber/test/data_types_SUITE.erl | 4 +++- lib/orber/test/generated_SUITE.erl | 4 +++- lib/orber/test/interceptors_SUITE.erl | 4 +++- lib/orber/test/iop_ior_10_SUITE.erl | 4 +++- lib/orber/test/iop_ior_11_SUITE.erl | 4 +++- lib/orber/test/iop_ior_12_SUITE.erl | 4 +++- lib/orber/test/lname_SUITE.erl | 4 +++- lib/orber/test/multi_ORB_SUITE.erl | 4 +++- lib/orber/test/naming_context_SUITE.erl | 4 +++- lib/orber/test/orber_SUITE.erl | 4 +++- lib/orber/test/orber_acl_SUITE.erl | 4 +++- lib/orber/test/orber_firewall_ipv4_in_SUITE.erl | 4 +++- lib/orber/test/orber_firewall_ipv4_out_SUITE.erl | 4 +++- lib/orber/test/orber_firewall_ipv6_in_SUITE.erl | 4 +++- lib/orber/test/orber_firewall_ipv6_out_SUITE.erl | 4 +++- lib/orber/test/orber_nat_SUITE.erl | 4 +++- lib/orber/test/orber_web_SUITE.erl | 4 +++- lib/orber/test/tc_SUITE.erl | 4 +++- lib/os_mon/test/cpu_sup_SUITE.erl | 4 +++- lib/os_mon/test/disksup_SUITE.erl | 4 +++- lib/os_mon/test/memsup_SUITE.erl | 4 +++- lib/os_mon/test/os_mon_SUITE.erl | 4 +++- lib/os_mon/test/os_mon_mib_SUITE.erl | 4 +++- lib/os_mon/test/os_sup_SUITE.erl | 4 +++- lib/parsetools/test/leex_SUITE.erl | 4 +++- lib/parsetools/test/yecc_SUITE.erl | 4 +++- lib/percept/test/egd_SUITE.erl | 4 +++- lib/percept/test/percept_SUITE.erl | 4 +++- lib/public_key/test/pkits_SUITE.erl | 2 ++ lib/public_key/test/public_key_SUITE.erl | 2 ++ lib/reltool/test/reltool_app_SUITE.erl | 2 ++ lib/reltool/test/reltool_server_SUITE.erl | 4 +++- lib/reltool/test/reltool_wx_SUITE.erl | 4 +++- lib/runtime_tools/test/dbg_SUITE.erl | 4 +++- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 4 +++- lib/runtime_tools/test/inviso_SUITE.erl | 2 ++ lib/runtime_tools/test/runtime_tools_SUITE.erl | 4 +++- lib/snmp/test/snmp_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_active_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_active_once_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_dist_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_misc_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_passive_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_protocol_SUITE.erl | 4 +++- lib/ssl/test/old_ssl_verify_SUITE.erl | 4 +++- lib/ssl/test/old_transport_accept_SUITE.erl | 4 +++- lib/ssl/test/ssl_basic_SUITE.erl | 2 ++ lib/ssl/test/ssl_packet_SUITE.erl | 2 ++ lib/ssl/test/ssl_payload_SUITE.erl | 2 ++ lib/ssl/test/ssl_session_cache_SUITE.erl | 3 ++- lib/ssl/test/ssl_to_openssl_SUITE.erl | 2 ++ lib/stdlib/test/array_SUITE.erl | 4 +++- lib/stdlib/test/base64_SUITE.erl | 4 +++- lib/stdlib/test/beam_lib_SUITE.erl | 4 +++- lib/stdlib/test/binary_module_SUITE.erl | 4 +++- lib/stdlib/test/c_SUITE.erl | 4 +++- lib/stdlib/test/calendar_SUITE.erl | 4 +++- lib/stdlib/test/dets_SUITE.erl | 4 +++- lib/stdlib/test/dict_SUITE.erl | 4 +++- lib/stdlib/test/digraph_SUITE.erl | 4 +++- lib/stdlib/test/digraph_utils_SUITE.erl | 4 +++- lib/stdlib/test/edlin_expand_SUITE.erl | 4 +++- lib/stdlib/test/epp_SUITE.erl | 4 +++- lib/stdlib/test/erl_eval_SUITE.erl | 18 +++++++++--------- lib/stdlib/test/erl_expand_records_SUITE.erl | 4 +++- lib/stdlib/test/erl_internal_SUITE.erl | 4 +++- lib/stdlib/test/erl_lint_SUITE.erl | 4 +++- lib/stdlib/test/erl_pp_SUITE.erl | 4 +++- lib/stdlib/test/erl_scan_SUITE.erl | 4 +++- lib/stdlib/test/escript_SUITE.erl | 4 +++- lib/stdlib/test/ets_SUITE.erl | 4 +++- lib/stdlib/test/ets_tough_SUITE.erl | 4 +++- lib/stdlib/test/file_sorter_SUITE.erl | 4 +++- lib/stdlib/test/filelib_SUITE.erl | 4 +++- lib/stdlib/test/filename_SUITE.erl | 4 +++- lib/stdlib/test/fixtable_SUITE.erl | 4 +++- lib/stdlib/test/format_SUITE.erl | 4 +++- lib/stdlib/test/gen_event_SUITE.erl | 4 +++- lib/stdlib/test/gen_fsm_SUITE.erl | 4 +++- lib/stdlib/test/gen_server_SUITE.erl | 4 +++- lib/stdlib/test/id_transform_SUITE.erl | 4 +++- lib/stdlib/test/io_SUITE.erl | 4 +++- lib/stdlib/test/io_proto_SUITE.erl | 4 +++- lib/stdlib/test/lists_SUITE.erl | 4 +++- lib/stdlib/test/log_mf_h_SUITE.erl | 4 +++- lib/stdlib/test/ms_transform_SUITE.erl | 4 +++- lib/stdlib/test/proc_lib_SUITE.erl | 4 +++- lib/stdlib/test/qlc_SUITE.erl | 4 +++- lib/stdlib/test/queue_SUITE.erl | 4 +++- lib/stdlib/test/random_SUITE.erl | 4 +++- lib/stdlib/test/re_SUITE.erl | 4 +++- lib/stdlib/test/select_SUITE.erl | 4 +++- lib/stdlib/test/sets_SUITE.erl | 4 +++- lib/stdlib/test/shell_SUITE.erl | 4 +++- lib/stdlib/test/slave_SUITE.erl | 4 +++- lib/stdlib/test/sofs_SUITE.erl | 4 +++- lib/stdlib/test/stdlib_SUITE.erl | 4 +++- lib/stdlib/test/string_SUITE.erl | 4 +++- lib/stdlib/test/supervisor_SUITE.erl | 4 +++- lib/stdlib/test/supervisor_bridge_SUITE.erl | 4 +++- lib/stdlib/test/sys_SUITE.erl | 4 +++- lib/stdlib/test/tar_SUITE.erl | 4 +++- lib/stdlib/test/timer_SUITE.erl | 4 +++- lib/stdlib/test/timer_simple_SUITE.erl | 4 +++- lib/stdlib/test/unicode_SUITE.erl | 4 +++- lib/stdlib/test/win32reg_SUITE.erl | 4 +++- lib/stdlib/test/y2k_SUITE.erl | 4 +++- lib/stdlib/test/zip_SUITE.erl | 4 +++- lib/syntax_tools/test/syntax_tools_SUITE.erl | 4 +++- lib/tools/test/cover_SUITE.erl | 4 +++- lib/tools/test/cprof_SUITE.erl | 4 +++- lib/tools/test/emem_SUITE.erl | 4 +++- lib/tools/test/eprof_SUITE.erl | 4 +++- lib/tools/test/fprof_SUITE.erl | 4 +++- lib/tools/test/instrument_SUITE.erl | 4 +++- lib/tools/test/lcnt_SUITE.erl | 4 +++- lib/tools/test/make_SUITE.erl | 6 ++++-- lib/tools/test/tools_SUITE.erl | 4 +++- lib/tools/test/xref_SUITE.erl | 4 +++- lib/wx/test/wx_app_SUITE.erl | 2 ++ lib/wx/test/wx_basic_SUITE.erl | 4 +++- lib/wx/test/wx_class_SUITE.erl | 4 +++- lib/wx/test/wx_event_SUITE.erl | 4 +++- lib/wx/test/wx_opengl_SUITE.erl | 4 +++- lib/wx/test/wx_xtra_SUITE.erl | 4 +++- 389 files changed, 1143 insertions(+), 368 deletions(-) diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl index c51f70a9e6..85166761cf 100644 --- a/erts/emulator/test/a_SUITE.erl +++ b/erts/emulator/test/a_SUITE.erl @@ -28,7 +28,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [long_timers, pollset_size]. diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl index cde4a69a30..5748d6ee75 100644 --- a/erts/emulator/test/after_SUITE.erl +++ b/erts/emulator/test/after_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, receive_after_errors/1, receive_var_zero/1, receive_zero/1, multi_timeout/1, receive_after_32bit/1]). @@ -33,6 +33,8 @@ -export([timeout_g/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_after, receive_after, receive_after_big, receive_after_errors, receive_var_zero, receive_zero, diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl index 6614fb045b..ed7d6ede71 100644 --- a/erts/emulator/test/alloc_SUITE.erl +++ b/erts/emulator/test/alloc_SUITE.erl @@ -18,7 +18,7 @@ -module(alloc_SUITE). -author('rickard.green@uab.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic/1, coalesce/1, @@ -35,6 +35,8 @@ -define(DEFAULT_TIMETRAP_SECS, 240). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, coalesce, threads, realloc_copy, bucket_index, bucket_mask, rbtree, mseg_clear_cache]. diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 5c5134c99d..416ca00aa4 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -19,7 +19,7 @@ -module(beam_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1, select_val/1]). @@ -27,6 +27,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [packed_registers, apply_last, apply_last_bif, buildo_mucho, heap_sizes, big_lists, select_val]. diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 1ceb4ef552..622c8dbfac 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_literals_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([putting/1, matching_smalls/1, matching_smalls_jt/1, matching_bigs/1, matching_more_bigs/1, matching_bigs_and_smalls/1, badmatch/1, case_clause/1, @@ -28,6 +28,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [putting, matching_smalls, matching_smalls_jt, matching_bigs, matching_more_bigs, diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 03b5e84bfd..6dff106bd2 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -21,12 +21,14 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, types/1, t_list_to_existing_atom/1,os_env/1,otp_7526/1, binary_to_atom/1,binary_to_existing_atom/1, atom_to_binary/1,min_max/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [types, t_list_to_existing_atom, os_env, otp_7526, atom_to_binary, binary_to_atom, binary_to_existing_atom, diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index d9c1c5acb3..1d70c6c08f 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -19,7 +19,7 @@ -module(big_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([t_div/1, eq_28/1, eq_32/1, eq_big/1, eq_math/1, big_literals/1, borders/1, negative/1, big_float_1/1, big_float_2/1, shift_limit_1/1, powmod/1, system_limit/1, otp_6692/1]). @@ -34,6 +34,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_div, eq_28, eq_32, eq_big, eq_math, big_literals, borders, negative, {group, big_float}, shift_limit_1, diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 92cb70ec63..e5e7162fe3 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -42,7 +42,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, copy_terms/1, conversions/1, deep_lists/1, deep_bitstr_lists/1, bad_list_to_binary/1, bad_binary_to_list/1, t_split_binary/1, bad_split/1, t_concat_binary/1, @@ -61,6 +61,8 @@ %% Internal exports. -export([sleeper/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [copy_terms, conversions, deep_lists, deep_bitstr_lists, t_split_binary, bad_split, t_concat_binary, diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl index 1dee587382..cb8be7aedf 100644 --- a/erts/emulator/test/bs_bincomp_SUITE.erl +++ b/erts/emulator/test/bs_bincomp_SUITE.erl @@ -22,12 +22,14 @@ -module(bs_bincomp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,tracing/1]). -include_lib("common_test/include/ct.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [byte_aligned, bit_aligned, extended_byte_aligned, extended_bit_aligned, mixed, tracing]. diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl index 40e085342f..357e606629 100644 --- a/erts/emulator/test/bs_bit_binaries_SUITE.erl +++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl @@ -22,7 +22,7 @@ -module(bs_bit_binaries_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -30,6 +30,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [misc, horrid_match, test_bitstr, test_bit_size, asymmetric_tests, big_asymmetric_tests, diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index c1ad198df3..498c675b85 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_construct_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, mem_leak/1, coerce_to_float/1, bjorn/1, @@ -31,6 +31,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [test1, test2, test3, test4, test5, testf, not_used, in_guard, mem_leak, coerce_to_float, bjorn, diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl index e770875181..fef8d41298 100644 --- a/erts/emulator/test/bs_match_bin_SUITE.erl +++ b/erts/emulator/test/bs_match_bin_SUITE.erl @@ -19,10 +19,12 @@ -module(bs_match_bin_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [byte_split_binary, bit_split_binary, match_huge_bin]. diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl index b688e0ccaa..fe60c91a20 100644 --- a/erts/emulator/test/bs_match_int_SUITE.erl +++ b/erts/emulator/test/bs_match_int_SUITE.erl @@ -18,13 +18,15 @@ -module(bs_match_int_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, match_huge_int/1,bignum/1,unaligned_32_bit/1]). -include_lib("test_server/include/test_server.hrl"). -import(lists, [seq/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [integer, signed_integer, dynamic, more_dynamic, mml, match_huge_int, bignum, unaligned_32_bit]. diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl index de1664aa04..07bfc92140 100644 --- a/erts/emulator/test/bs_match_misc_SUITE.erl +++ b/erts/emulator/test/bs_match_misc_SUITE.erl @@ -18,13 +18,15 @@ %% -module(bs_match_misc_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, kenneth/1,encode_binary/1,native/1,happi/1, size_var/1,wiger/1,x0_context/1,huge_float_field/1, writable_binary_matched/1,otp_7198/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [bound_var, bound_tail, t_float, little_float, sean, kenneth, encode_binary, native, happi, size_var, wiger, diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl index 6e1d589069..59157e413e 100644 --- a/erts/emulator/test/bs_match_tail_SUITE.erl +++ b/erts/emulator/test/bs_match_tail_SUITE.erl @@ -20,10 +20,12 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [aligned, unaligned, zero_tail]. diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl index 0e61952916..14f246ee2c 100644 --- a/erts/emulator/test/bs_utf_SUITE.erl +++ b/erts/emulator/test/bs_utf_SUITE.erl @@ -19,7 +19,7 @@ -module(bs_utf_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, utf8_roundtrip/1,utf16_roundtrip/1,utf32_roundtrip/1, utf8_illegal_sequences/1,utf16_illegal_sequences/1, utf32_illegal_sequences/1, @@ -37,6 +37,8 @@ fin_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [utf8_roundtrip, utf16_roundtrip, utf32_roundtrip, utf8_illegal_sequences, utf16_illegal_sequences, diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index e4c7800310..f4a0bfde00 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -19,7 +19,7 @@ -module(busy_port_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, system_monitor/1, no_trap_exit/1, no_trap_exit_unlinked/1, trap_exit/1, multiple_writers/1, hard_busy_driver/1, soft_busy_driver/1]). @@ -29,6 +29,8 @@ %% Internal exports. -export([init/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [io_to_busy, message_order, send_3, system_monitor, no_trap_exit, no_trap_exit_unlinked, trap_exit, diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl index b2b6144ba1..670e30e641 100644 --- a/erts/emulator/test/call_trace_SUITE.erl +++ b/erts/emulator/test/call_trace_SUITE.erl @@ -20,7 +20,7 @@ -module(call_trace_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, hipe/1,process_specs/1,basic/1,flags/1,errors/1,pam/1,change_pam/1, return_trace/1,exception_trace/1,on_load/1,deep_exception/1, exception_nocatch/1,bit_syntax/1]). @@ -39,6 +39,8 @@ -define(P, 20). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> Common = [errors, on_load], NotHipe = [process_specs, basic, flags, pam, change_pam, diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index beebab892f..38f426efd4 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -18,7 +18,7 @@ %% -module(code_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, new_binary_types/1,t_check_process_code/1,t_check_process_code_ets/1, external_fun/1,get_chunk/1,module_md5/1,make_stub/1, make_stub_many_funs/1,constant_pools/1, @@ -26,6 +26,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [new_binary_types, t_check_process_code, t_check_process_code_ets, external_fun, get_chunk, diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl index a1f6349cf5..e9cd41c312 100644 --- a/erts/emulator/test/crypto_SUITE.erl +++ b/erts/emulator/test/crypto_SUITE.erl @@ -21,10 +21,12 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_md5/1,t_md5_update/1,error/1,unaligned_context/1,random_lists/1, misc_errors/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_md5, t_md5_update, error, unaligned_context, random_lists, misc_errors]. diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl index 23b6013ff2..fd1eff5a1e 100644 --- a/erts/emulator/test/ddll_SUITE.erl +++ b/erts/emulator/test/ddll_SUITE.erl @@ -30,7 +30,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0,groups/0,init_per_group/2,end_per_group/2, ddll_test/1, errors/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, ddll_test/1, errors/1, reference_count/1, kill_port/1, dont_kill_port/1]). -export([unload_on_process_exit/1, delayed_unload_with_ports/1, @@ -52,6 +52,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ddll_test, errors, reference_count, kill_port, dont_kill_port, properties, load_and_unload, diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 40bfbc6204..93b095206b 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -23,9 +23,11 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, packet_size, neg, http, line, ssl, otp_8536]. diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 8456bcec0e..93423fa952 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, ping/1, bulk_send_small/1, bulk_send_big/1, bulk_send_bigbig/1, local_send_small/1, local_send_big/1, @@ -53,6 +53,8 @@ dist_evil_parallel_receiver/0, sendersender/4, sendersender2/4]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ping, {group, bulk_send}, {group, local_send}, link_to_busy, exit_to_busy, lost_exit, link_to_dead, diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 7f27536ee2..62a3fbcce2 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -27,7 +27,7 @@ %%% - queueing -module(driver_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, @@ -129,6 +129,8 @@ fin_per_testcase(Case, Config) -> end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [fun_to_port, outputv_echo, queue_echo, {group, timer}, driver_unloaded, io_ready_exit, use_fallback_pollset, diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl index 1380f797a4..5b6b35ae32 100644 --- a/erts/emulator/test/efile_SUITE.erl +++ b/erts/emulator/test/efile_SUITE.erl @@ -17,11 +17,13 @@ %% %CopyrightEnd% -module(efile_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([iter_max_files/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [iter_max_files]. diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl index 30b32dbcf7..685cbda728 100644 --- a/erts/emulator/test/erl_drv_thread_SUITE.erl +++ b/erts/emulator/test/erl_drv_thread_SUITE.erl @@ -19,7 +19,7 @@ -module(erl_drv_thread_SUITE). -author('rickard.s.green@ericsson.com'). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic/1, rwlock/1, tsd/1]). @@ -27,6 +27,8 @@ -define(DEFAULT_TIMETRAP_SECS, 240). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, rwlock, tsd]. diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index 772c873d0b..1cb6eb2e39 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -30,7 +30,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). % Test cases -export([links/1, @@ -77,6 +77,8 @@ +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [links, dist_links, monitor_nodes, process_monitors, dist_process_monitors, busy_dist_port_monitor, diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index 741d22f531..fc68632e80 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -20,8 +20,10 @@ -module(erts_debug_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, - flat_size/1,flat_size_big/1,df/1,instructions/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, + flat_size/1,flat_size_big/1,df/1, instructions/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [flat_size, flat_size_big, df, instructions]. diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index d5e8d78b47..66efeed331 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -18,7 +18,7 @@ -module(estone_SUITE). %% Test functions --export([all/0,groups/0,init_per_group/2,end_per_group/2,estone/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,estone/1]). -export([init_per_testcase/2, fin_per_testcase/2]). %% Internal exports for EStone tests @@ -73,6 +73,8 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [estone]. diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index 38436c7fb7..1c75edc466 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -18,7 +18,7 @@ -module(evil_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, heap_frag/1, encode_decode_ext/1, decode_integer_ext/1, @@ -32,6 +32,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [heap_frag, encode_decode_ext, decode_integer_ext, decode_small_big_ext, decode_large_big_ext, diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl index c501bc95ba..24252be176 100644 --- a/erts/emulator/test/exception_SUITE.erl +++ b/erts/emulator/test/exception_SUITE.erl @@ -19,7 +19,7 @@ -module(exception_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, stacktrace/1, nested_stacktrace/1, raise/1, gunilla/1, per/1, exception_with_heap_frag/1]). @@ -28,6 +28,8 @@ -include_lib("test_server/include/test_server.hrl"). -import(lists, [foreach/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [badmatch, pending_errors, nil_arith, stacktrace, nested_stacktrace, raise, gunilla, per, diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl index 3dbc6aa1b5..46ff8ff192 100644 --- a/erts/emulator/test/float_SUITE.erl +++ b/erts/emulator/test/float_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, fpe/1,fp_drv/1,fp_drv_thread/1,denormalized/1,match/1, bad_float_unpack/1]). -export([otp_7178/1]). @@ -35,6 +35,8 @@ fin_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [fpe, fp_drv, fp_drv_thread, otp_7178, denormalized, match, bad_float_unpack]. diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index 25d189d906..b8be503b71 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -22,7 +22,7 @@ -define(default_timeout, ?t:minutes(1)). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bad_apply/1,bad_fun_call/1,badarity/1,ext_badarity/1, equality/1,ordering/1, fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1, @@ -34,6 +34,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [bad_apply, bad_fun_call, badarity, ext_badarity, equality, ordering, fun_to_port, t_hash, t_phash, diff --git a/erts/emulator/test/fun_r12_SUITE.erl b/erts/emulator/test/fun_r12_SUITE.erl index bf928329d4..05fc1af4be 100644 --- a/erts/emulator/test/fun_r12_SUITE.erl +++ b/erts/emulator/test/fun_r12_SUITE.erl @@ -20,11 +20,13 @@ -module(fun_r12_SUITE). -compile(r12). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). -define(default_timeout, ?t:minutes(1)). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [dist_old_release]. diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl index 1e5c3a67f7..1f944e79fa 100644 --- a/erts/emulator/test/gc_SUITE.erl +++ b/erts/emulator/test/gc_SUITE.erl @@ -22,12 +22,14 @@ -module(gc_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -define(default_timeout, ?t:minutes(10)). -export([grow_heap/1, grow_stack/1, grow_stack_heap/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [grow_heap, grow_stack, grow_stack_heap]. diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl index 81ce24826e..b0f4530557 100644 --- a/erts/emulator/test/guard_SUITE.erl +++ b/erts/emulator/test/guard_SUITE.erl @@ -19,7 +19,7 @@ -module(guard_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, type_tests/1,guard_bif_binary_part/1]). -include_lib("test_server/include/test_server.hrl"). @@ -27,6 +27,8 @@ -export([init/3]). -import(lists, [member/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [bad_arith, bad_tuple, test_heap_guards, guard_bifs, type_tests, guard_bif_binary_part]. diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl index d5841b9e93..7dd4e23e9f 100644 --- a/erts/emulator/test/hash_SUITE.erl +++ b/erts/emulator/test/hash_SUITE.erl @@ -69,7 +69,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, test_phash2/1,otp_5292/1,bit_level_binaries/1,otp_7127/1, fin_per_testcase/2,init_per_testcase/2]). init_per_testcase(_Case, Config) -> @@ -80,6 +80,8 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [test_basic, test_cmp, test_range, test_spread, test_phash2, otp_5292, bit_level_binaries, otp_7127]. diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index f8c1816998..f6f553eb40 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -21,13 +21,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,min_heap_size/1,bad_args/1, messages_in_queue/1,undefined_mfa/1, no_heap/1]). %% Used by test cases. -export([basic_hibernator/1,messages_in_queue_restart/2, no_heap_loop/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, min_heap_size, bad_args, messages_in_queue, undefined_mfa, no_heap]. diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 3ecb2e8ba3..412b31c44c 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -20,11 +20,13 @@ -module(list_bif_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([hd_test/1,tl_test/1,t_length/1,t_list_to_pid/1, t_list_to_float/1,t_list_to_integer/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [hd_test, tl_test, t_length, t_list_to_pid, t_list_to_float, t_list_to_integer]. diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index 6206da7a14..c475a1bb05 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -19,7 +19,7 @@ -module(match_spec_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). -export([test_1/1, test_2/1, test_3/1, bad_match_spec_bin/1, trace_control_word/1, silent/1, silent_no_ms/1, ms_trace2/1, ms_trace3/1, boxed_and_small/1, @@ -29,7 +29,7 @@ -export([runner/2]). -export([f1/1, f2/2, f3/2, fn/1, fn/2, fn/3]). --export([do_boxed_and_small/0]). +-export([do_boxed_and_small/0, suite/0]). % This test suite assumes that tracing in general works. What we test is % the match spec functionality. @@ -47,6 +47,8 @@ fin_per_testcase(_Func, Config) -> ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(match_spec_SUITE) of false -> diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index 4d87e07937..d881c02e4a 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, exports/1,functions/1,native/1]). %%-compile(native). @@ -29,6 +29,8 @@ %% Helper. -export([native_proj/1,native_filter/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> modules(). diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl index 3ffa7a4079..ee2082991d 100644 --- a/erts/emulator/test/monitor_SUITE.erl +++ b/erts/emulator/test/monitor_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, case_1/1, case_1a/1, case_2/1, case_2a/1, mon_e_1/1, demon_e_1/1, demon_1/1, demon_2/1, demon_3/1, demonitor_flush/1, local_remove_monitor/1, remote_remove_monitor/1, mon_1/1, mon_2/1, @@ -31,6 +31,8 @@ -export([y2/1, g/1, g0/0, g1/0, large_exit_sub/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, demon_1, mon_1, mon_2, demon_2, demon_3, diff --git a/erts/emulator/test/mtx_SUITE.erl b/erts/emulator/test/mtx_SUITE.erl index ddeae9103a..806c0adfd5 100644 --- a/erts/emulator/test/mtx_SUITE.erl +++ b/erts/emulator/test/mtx_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("common_test/include/ct.hrl"). --export([all/0,groups/0, +-export([all/0,suite/0,groups/0, init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). @@ -72,6 +72,8 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [long_rwlock, hammer_rwlock_check, hammer_rwlock, hammer_tryrwlock_check, hammer_tryrwlock, diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl index f817c18a17..a8b6018c45 100644 --- a/erts/emulator/test/nested_SUITE.erl +++ b/erts/emulator/test/nested_SUITE.erl @@ -19,10 +19,12 @@ -module(nested_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [case_in_case, case_in_after, catch_in_catch, bif_in_bif]. diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index e7f604bde6..991fbce96f 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, %%init_per_testcase/2, fin_per_testcase/2, basic/1, reload/1, upgrade/1, heap_frag/1, types/1, many_args/1, binaries/1, get_string/1, get_atom/1, api_macros/1, @@ -40,7 +40,7 @@ %% list_seq/1,type_test/0,tuple_2_list/1,is_identical/2,compare/2, %% clone_bin/1,make_sub_bin/3,string_to_bin/2,atom_to_bin/2,macros/1, %% tuple_2_list_and_tuple/1,iolist_2_bin/1,get_resource_type/1,alloc_resource/2, -%% make_resource/1,get_resource/2,release_resource/1,last_resource_dtor_call/0, +%% make_resource/1,get_resource/2,release_resource/1,last_resource_dtor_call/0, suite/0, %% make_new_resource/2,make_new_resource_binary/1,send_list_seq/2,send_new_blob/2, %% alloc_msgenv/0,clear_msgenv/1,grow_blob/2,send_blob/2,send_blob_thread/3, %% join_send_thread/1]). @@ -48,6 +48,8 @@ -define(nif_stub,nif_stub_error(?LINE)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, reload, upgrade, heap_frag, types, many_args, binaries, get_string, get_atom, api_macros, from_array, diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index 0b3ce6326d..ca90934421 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, node_container_refc_check/1]). -export([term_to_binary_to_term_eq/1, @@ -55,6 +55,8 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [term_to_binary_to_term_eq, round_trip_eq, cmp, ref_eq, node_table_gc, dist_link_refc, dist_monitor_refc, diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl index 3ddbc9d3ca..6898c7c75b 100644 --- a/erts/emulator/test/nofrag_SUITE.erl +++ b/erts/emulator/test/nofrag_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, error_handler/1,error_handler_apply/1, error_handler_fixed_apply/1,error_handler_fun/1, error_handler_tuple_fun/1, @@ -30,6 +30,8 @@ %% Exported functions for an error_handler module. -export([undefined_function/3,undefined_lambda/3,breakpoint/3]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [error_handler, error_handler_apply, error_handler_fixed_apply, error_handler_fun, diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index 1646ad8261..25f63f6fe1 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -31,12 +31,14 @@ %% round/1 %% trunc/1 --export([all/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_abs, t_float, t_float_to_list, t_integer_to_list, {group, t_list_to_float}, t_list_to_integer, t_round, diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl index 77cfd39d7f..f8f62bd7b6 100644 --- a/erts/emulator/test/old_scheduler_SUITE.erl +++ b/erts/emulator/test/old_scheduler_SUITE.erl @@ -21,11 +21,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([equal/1, many_low/1, few_low/1, max/1, high/1]). -define(default_timeout, ?t:minutes(11)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case catch erlang:system_info(modified_timing_level) of Level when is_integer(Level) -> diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl index 2a01e42b07..17929cfbd1 100644 --- a/erts/emulator/test/op_SUITE.erl +++ b/erts/emulator/test/op_SUITE.erl @@ -21,12 +21,14 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bsl_bsr/1,logical/1,t_not/1,relop_simple/1,relop/1,complex_relop/1]). -export([]). -import(lists, [foldl/3,flatmap/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [bsl_bsr, logical, t_not, relop_simple, relop, complex_relop]. diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index 125f983b92..8315e2a9a6 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -73,7 +73,7 @@ %% --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, init_per_suite/1, end_per_suite/1, stream_small/1, stream_big/1, basic_ping/1, slow_writes/1, bad_packet/1, bad_port_messages/1, @@ -101,6 +101,8 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [otp_6224, {group, stream}, basic_ping, slow_writes, bad_packet, bad_port_messages, {group, options}, diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl index b22f9be3cb..32dc280956 100644 --- a/erts/emulator/test/port_bif_SUITE.erl +++ b/erts/emulator/test/port_bif_SUITE.erl @@ -20,7 +20,7 @@ -module(port_bif_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, command/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, command/1, command_e_1/1, command_e_2/1, command_e_3/1, command_e_4/1, port_info1/1, port_info2/1, connect/1, control/1, echo_to_busy/1]). @@ -31,6 +31,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [command, {group, port_info}, connect, control, echo_to_busy]. diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index 4def835a37..d31a4fe954 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -29,7 +29,7 @@ -define(heap_binary_size, 64). --export([all/0,groups/0,init_per_group/2,end_per_group/2, spawn_with_binaries/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, spawn_with_binaries/1, t_exit_1/1, t_exit_2_other/1, t_exit_2_other_normal/1, self_exit/1, normal_suicide_exit/1, abnormal_suicide_exit/1, t_exit_2_catch/1, trap_exit_badarg/1, trap_exit_badarg_in_bif/1, @@ -56,6 +56,8 @@ -export([hangaround/2, processes_bif_test/0, do_processes/1, processes_term_proc_list_test/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [spawn_with_binaries, t_exit_1, {group, t_exit_2}, trap_exit_badarg, trap_exit_badarg_in_bif, diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index 1fc1952278..8d7c88e49b 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -19,7 +19,9 @@ -module(pseudoknot_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,test/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,test/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [test]. diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl index a64fd8a8c5..faaa3a19ad 100644 --- a/erts/emulator/test/receive_SUITE.erl +++ b/erts/emulator/test/receive_SUITE.erl @@ -23,11 +23,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, call_with_huge_message_queue/1,receive_in_between/1]). -export([init_per_testcase/2,fin_per_testcase/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [call_with_huge_message_queue, receive_in_between]. diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl index 79ac5cb860..6596cbda26 100644 --- a/erts/emulator/test/ref_SUITE.erl +++ b/erts/emulator/test/ref_SUITE.erl @@ -19,7 +19,7 @@ -module(ref_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([wrap_1/1]). -export([loop_ref/1]). @@ -35,6 +35,8 @@ fin_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [wrap_1]. diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl index 781aefea85..cfb1ce4f40 100644 --- a/erts/emulator/test/register_SUITE.erl +++ b/erts/emulator/test/register_SUITE.erl @@ -25,12 +25,14 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([otp_8099/1]). -define(DEFAULT_TIMEOUT, ?t:minutes(2)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [otp_8099]. diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl index 78ea982419..ae1a9e0b43 100644 --- a/erts/emulator/test/save_calls_SUITE.erl +++ b/erts/emulator/test/save_calls_SUITE.erl @@ -21,12 +21,14 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([save_calls_1/1,dont_break_reductions/1]). -export([do_bopp/1, do_bipp/0, do_bepp/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [save_calls_1, dont_break_reductions]. diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index 324b08f078..cc6fba2ff9 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -33,7 +33,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). -export([equal/1, few_low/1, @@ -57,6 +57,8 @@ -define(MIN_SCHEDULER_TEST_TIMEOUT, ?t:minutes(1)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [equal, few_low, many_low, equal_with_part_time_high, equal_with_part_time_max, diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl index d898646f4b..5e33f9dae6 100644 --- a/erts/emulator/test/send_term_SUITE.erl +++ b/erts/emulator/test/send_term_SUITE.erl @@ -19,7 +19,7 @@ -module(send_term_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,basic/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,basic/1]). -export([init_per_testcase/2,fin_per_testcase/2]). -export([generate_external_terms_files/1]). @@ -34,6 +34,8 @@ fin_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic]. diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl index 0a8c955361..8fab014f38 100644 --- a/erts/emulator/test/sensitive_SUITE.erl +++ b/erts/emulator/test/sensitive_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, stickiness/1,send_trace/1,recv_trace/1,proc_trace/1,call_trace/1, meta_trace/1,running_trace/1,gc_trace/1,seq_trace/1, t_process_info/1,t_process_display/1,save_calls/1]). @@ -38,6 +38,8 @@ fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [stickiness, send_trace, recv_trace, proc_trace, call_trace, meta_trace, running_trace, gc_trace, diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index fa330f8f1c..9ff1089453 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -31,7 +31,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). % Test cases -export([xm_sig_order/1, @@ -65,6 +65,8 @@ end_per_suite(_Config) -> erts_debug:set_internal_state(not_running_optimization, true), available_internal_state(false). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [xm_sig_order, pending_exit_unlink_process, pending_exit_unlink_dist_process, diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl index bbe659547b..75dedc1c7d 100644 --- a/erts/emulator/test/statistics_SUITE.erl +++ b/erts/emulator/test/statistics_SUITE.erl @@ -21,7 +21,7 @@ %% Tests the statistics/1 bif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, wall_clock_zero_diff/1, wall_clock_update/1, @@ -46,6 +46,8 @@ fin_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, wall_clock}, {group, runtime}, reductions, reductions_big, {group, run_queue}, garbage_collection, diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index 9cbc46659c..6bf405ccea 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -33,12 +33,14 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1, wordsize/1]). -define(DEFAULT_TIMEOUT, ?t:minutes(2)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [process_count, system_version, misc_smoke_tests, heap_size, wordsize]. diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl index d5d15c91eb..785f132c4a 100644 --- a/erts/emulator/test/system_profile_SUITE.erl +++ b/erts/emulator/test/system_profile_SUITE.erl @@ -22,7 +22,7 @@ -module(system_profile_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, system_profile_on_and_off/1, runnable_procs/1, runnable_ports/1, @@ -45,6 +45,8 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [system_profile_on_and_off, runnable_procs, runnable_ports, scheduler]. diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl index 636abd288e..e826c9de63 100644 --- a/erts/emulator/test/time_SUITE.erl +++ b/erts/emulator/test/time_SUITE.erl @@ -29,7 +29,7 @@ %% now/0 %% --export([all/0,groups/0,init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, bad_univ_to_local/1, bad_local_to_univ/1, consistency/1, now_unique/1, now_update/1, timestamp/1]). @@ -54,6 +54,8 @@ -define(dst_timezone, 2). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [univ_to_local, local_to_univ, local_to_univ_utc, bad_univ_to_local, bad_local_to_univ, consistency, diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index 157311d381..bd03297ad2 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -19,7 +19,7 @@ -module(timer_bif_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). -export([start_timer_1/1, send_after_1/1, send_after_2/1, send_after_3/1, cancel_timer_1/1, start_timer_big/1, send_after_big/1, @@ -45,6 +45,8 @@ fin_per_testcase(_Case, Config) -> end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_timer_1, send_after_1, send_after_2, cancel_timer_1, start_timer_e, send_after_e, diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl index 1d453a3639..e9b569273a 100644 --- a/erts/emulator/test/trace_SUITE.erl +++ b/erts/emulator/test/trace_SUITE.erl @@ -23,7 +23,7 @@ %%% Tests the trace BIF. %%% --export([all/0,groups/0,init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, timeout_trace/1, send_trace/1, procs_trace/1, dist_procs_trace/1, suspend/1, mutual_suspend/1, suspend_exit/1, suspender_exit/1, @@ -40,6 +40,8 @@ %%% Internal exports -export([process/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cpu_timestamp, receive_trace, self_send, timeout_trace, send_trace, procs_trace, dist_procs_trace, suspend, diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl index e2d9589b3b..ce7f07b650 100644 --- a/erts/emulator/test/trace_bif_SUITE.erl +++ b/erts/emulator/test/trace_bif_SUITE.erl @@ -21,13 +21,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([trace_bif/1, trace_bif_timestamp/1, trace_on_and_off/1, trace_bif_local/1, trace_bif_timestamp_local/1, trace_bif_return/1, not_run/1, trace_info_old_code/1]). -export([bif_process/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_bif_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl index d3355a5364..5f4c7b1a0b 100644 --- a/erts/emulator/test/trace_call_count_SUITE.erl +++ b/erts/emulator/test/trace_call_count_SUITE.erl @@ -62,7 +62,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, combo/1]). @@ -78,6 +78,8 @@ fin_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_call_count_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 3b2e619123..12a9b0e7d9 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -60,7 +60,7 @@ -include_lib("test_server/include/test_server.hrl"). %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, scheduling/1, called_function/1, combo/1, bif/1, nif/1]). @@ -79,6 +79,8 @@ fin_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_call_time_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index a417ca7769..92383baf4b 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -68,7 +68,7 @@ config(priv_dir,_) -> %%% When run in test server %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, return/1, on_and_off/1, stack_grow/1,info/1, delete/1, exception/1, exception_apply/1, exception_function/1, exception_apply_function/1, @@ -89,6 +89,8 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_local_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index 195696ca49..73b183b85c 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -65,7 +65,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, return/1, on_and_off/1, stack_grow/1, info/1, tracer/1, combo/1, nosilent/1]). @@ -78,6 +78,8 @@ fin_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_meta_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 6a989fe295..79f445fec7 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([trace_nif/1, trace_nif_timestamp/1, trace_nif_local/1, @@ -32,6 +32,8 @@ -export([nif_process/0, nif/0, nif/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(trace_nif_SUITE) of true -> [not_run]; diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl index 114f62ccfe..b32015803b 100644 --- a/erts/emulator/test/trace_port_SUITE.erl +++ b/erts/emulator/test/trace_port_SUITE.erl @@ -20,7 +20,7 @@ -module(trace_port_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, call_trace/1, return_trace/1, send/1, @@ -44,6 +44,8 @@ test_cases() -> fake_schedule_after_getting_unlinked, gc, default_tracer]. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_cases(). diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index ac1d94774a..52ead630b9 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(tuple_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, t_list_to_tuple/1, t_tuple_to_list/1, t_make_tuple_2/1, t_make_tuple_3/1, t_append_element/1, build_and_match/1, tuple_with_case/1, tuple_in_guard/1]). @@ -33,6 +33,8 @@ %% make_tuple/2 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [build_and_match, t_size, t_tuple_size, t_list_to_tuple, t_tuple_to_list, t_element, t_setelement, diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl index 6dc2a962db..96db813039 100644 --- a/erts/emulator/test/z_SUITE.erl +++ b/erts/emulator/test/z_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([schedulers_alive/1, node_container_refc_check/1, long_timers/1, pollset_size/1, @@ -40,6 +40,8 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [schedulers_alive, node_container_refc_check, long_timers, pollset_size, check_io_debug]. diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index e45d574ac0..ff4c1a099b 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -35,7 +35,7 @@ -record(node_info, {port, node_type, prot, lvsn, hvsn, node_name, extra}). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export( [ @@ -101,6 +101,8 @@ %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [register_name, register_names_1, register_names_2, register_duplicate_name, get_port_nr, slow_get_port_nr, diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl index cd37ef1374..eb23ef46b9 100644 --- a/erts/test/autoimport_SUITE.erl +++ b/erts/test/autoimport_SUITE.erl @@ -20,9 +20,11 @@ -module(autoimport_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). -define(TEST_TIMEOUT, ?t:seconds(180)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [autoimports]. diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl index 5fd2bb5790..e598027885 100644 --- a/erts/test/erl_print_SUITE.erl +++ b/erts/test/erl_print_SUITE.erl @@ -32,12 +32,14 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([erlang_display/1, integer/1, float/1, string/1, character/1, snprintf/1, quote/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_cases(). diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index efa9c84208..973fbad6e9 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -20,12 +20,14 @@ %% Tests the erlc command by compiling various types of files. --export([all/0,groups/0,init_per_group/2,end_per_group/2, compile_erl/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, compile_erl/1, compile_yecc/1, compile_script/1, compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [compile_erl, compile_yecc, compile_script, compile_mib, good_citizen, deep_cwd, arg_overflow]. diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl index 255caca4df..785c788603 100644 --- a/erts/test/erlexec_SUITE.erl +++ b/erts/test/erlexec_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(1)). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([args_file/1, evil_args_file/1, env/1, args_file_env/1, otp_7461/1, otp_7461_remote/1, otp_8209/1, zdbbl_dist_buf_busy_limit/1]). @@ -51,6 +51,8 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [args_file, evil_args_file, env, args_file_env, otp_7461, otp_8209, zdbbl_dist_buf_busy_limit]. diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl index 5e6d677c66..dfce951c80 100644 --- a/erts/test/ethread_SUITE.erl +++ b/erts/test/ethread_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([create_join_thread/1, equal_tids/1, @@ -54,6 +54,8 @@ tests() -> cond_wait, broadcast, detached_thread, max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic]. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> tests(). diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl index 84892384aa..8797d62cfa 100644 --- a/erts/test/install_SUITE.erl +++ b/erts/test/install_SUITE.erl @@ -29,7 +29,7 @@ %-define(line_trace, 1). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, fin_per_testcase/2]). -export([bin_default/1, @@ -75,6 +75,8 @@ dont_need_symlink_cases() -> bin_unreasonable_path, 'bin white space', bin_no_srcfile]. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> dont_need_symlink_cases() ++ need_symlink_cases(). diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl index 981a1c55f4..fc073067f1 100644 --- a/erts/test/nt_SUITE.erl +++ b/erts/test/nt_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, middleman/1,service_basic/1, service_env/1, user_env/1, synced/1, service_prio/1, logout/1, debug/1, restart/1, restart_always/1,stopaction/1, @@ -31,6 +31,8 @@ -define(TEST_SERVICES, [1,2,3,4,5,6,7,8,9,10,11]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case os:type() of {win32, nt} -> diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index 15c56fd6ea..afc089408a 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -19,7 +19,7 @@ -module(otp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1]). -export([undefined_functions/1,deprecated_not_in_obsolete/1, obsolete_but_not_deprecated/1,call_to_deprecated/1, call_to_size_1/1,strong_components/1]). @@ -28,6 +28,8 @@ -import(lists, [filter/2,foldl/3,foreach/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [undefined_functions, deprecated_not_in_obsolete, obsolete_but_not_deprecated, call_to_deprecated, diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index e4efd3075d..e541e884df 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -19,7 +19,7 @@ -module(run_erl_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,heavy/1,heavier/1,defunct/1]). -export([ping_me_back/1]). @@ -34,6 +34,8 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, heavy, heavier, defunct]. diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index 8126acb18d..8421982961 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -35,7 +35,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([search_for_core_files/1, core_files/1]). @@ -51,6 +51,8 @@ fin_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [core_files]. diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 3c2c79d416..f0aa8e5697 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -62,6 +62,8 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, compile}, parse, default_per, default_ber, default_per_opt, per, {group, ber}, testPrim, diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl index e5a9442bc6..f3e075e63d 100644 --- a/lib/asn1/test/asn1_bin_SUITE.erl +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -62,6 +62,8 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, compile}, parse, default_per, default_ber, default_per_opt, per, {group, ber}, testPrim, diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl index 8459e6a005..d2a70f72e7 100644 --- a/lib/asn1/test/asn1_bin_v2_SUITE.erl +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -62,6 +62,8 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, compile}, parse, default_per, default_ber, default_per_opt, per, {group, ber}, testPrim, diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl index c4639ee9d6..c29398b856 100644 --- a/lib/common_test/test/ct_config_SUITE.erl +++ b/lib/common_test/test/ct_config_SUITE.erl @@ -64,6 +64,8 @@ end_per_testcase(install_config = TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [require, install_config, userconfig_static, userconfig_dynamic, testspec_legacy, testspec_static, diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index 4eae281da3..eb294826b2 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cfg_error, lib_error, no_compile, timetrap_end_conf, timetrap_normal, timetrap_extended]. diff --git a/lib/common_test/test/ct_event_handler_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE.erl index 7eac46586a..3646671460 100644 --- a/lib/common_test/test/ct_event_handler_SUITE.erl +++ b/lib/common_test/test/ct_event_handler_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_stop, results]. diff --git a/lib/common_test/test/ct_groups_test_1_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE.erl index 6703caf2fe..e75f21da04 100644 --- a/lib/common_test/test/ct_groups_test_1_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_1_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [groups_suite_1, groups_suite_2, groups_suites_1, groups_dir_1, groups_dirs_1]. diff --git a/lib/common_test/test/ct_groups_test_2_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE.erl index 9b27825d7c..11f915682d 100644 --- a/lib/common_test/test/ct_groups_test_2_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [missing_conf, repeat_1]. diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl index 9ccff6d959..74e0e73f9f 100644 --- a/lib/common_test/test/ct_master_SUITE.erl +++ b/lib/common_test/test/ct_master_SUITE.erl @@ -81,6 +81,8 @@ end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ct_master_test]. diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl index 420a258420..10ee0fd7ad 100644 --- a/lib/common_test/test/ct_misc_1_SUITE.erl +++ b/lib/common_test/test/ct_misc_1_SUITE.erl @@ -57,6 +57,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [beam_me_up, parse_table]. diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl index 5f85a6b61d..60d40e05a4 100644 --- a/lib/common_test/test/ct_repeat_1_SUITE.erl +++ b/lib/common_test/test/ct_repeat_1_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [repeat_cs, repeat_cs_and_grs, repeat_seq, repeat_cs_until_any_ok, repeat_gr_until_any_ok, diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl index b32d4ddf78..5d7cd1df4d 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [subgroup_return_fail, subgroup_init_fail, subgroup_after_failed_case, diff --git a/lib/common_test/test/ct_skip_SUITE.erl b/lib/common_test/test/ct_skip_SUITE.erl index dee525d4fb..5992b49489 100644 --- a/lib/common_test/test/ct_skip_SUITE.erl +++ b/lib/common_test/test/ct_skip_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [auto_skip, user_skip]. diff --git a/lib/common_test/test/ct_smoke_test_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE.erl index 6536ead27f..749c6cd9ed 100644 --- a/lib/common_test/test/ct_smoke_test_SUITE.erl +++ b/lib/common_test/test/ct_smoke_test_SUITE.erl @@ -112,6 +112,8 @@ end_per_testcase(TestCase, Config) -> %% Description: Returns a description of the test suite (doc) and a %% list of all test cases in the suite (suite). %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [dir1, dir2, dir1_2, suite11, suite21, suite11_21, tc111, tc211, tc111_112]. diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE.erl index 3d76cf20f1..6644233680 100644 --- a/lib/common_test/test/ct_test_server_if_1_SUITE.erl +++ b/lib/common_test/test/ct_test_server_if_1_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ts_if_1]. diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index 452e826b4f..9d759750cc 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -56,6 +56,8 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [all_suites, skip_all_suites, suite, skip_suite, all_testcases, skip_all_testcases, testcase, diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index 990ec13887..d9272b3f2e 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -18,12 +18,14 @@ %% -module(andor_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1,before_and_inside_if/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(andor_SUITE), [t_case, t_and_or, t_andalso, t_orelse, inside, overlap, diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index 7b34334fd1..cd55bcf96b 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -18,12 +18,14 @@ %% -module(apply_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). -export([foo/0,bar/1,baz/2]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(apply_SUITE), [mfa, fun_apply]. diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 85053f71ed..7efee6f5ab 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_validator_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, beam_files/1,compiler_bug/1,stupid_but_valid/1, xrange/1,yrange/1,stack/1,call_last/1,merge_undefined/1, uninit/1,unsafe_catch/1, @@ -41,6 +41,8 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(beam_validator_SUITE), [beam_files, compiler_bug, stupid_but_valid, xrange, diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl index 4eb815ab59..5509e8f786 100644 --- a/lib/compiler/test/bs_bincomp_SUITE.erl +++ b/lib/compiler/test/bs_bincomp_SUITE.erl @@ -21,13 +21,15 @@ -module(bs_bincomp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1, nomatch/1,sizes/1,tail/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(bs_bincomp_SUITE), [byte_aligned, bit_aligned, extended_byte_aligned, diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 6d3d26120e..ac738af59e 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_bit_binaries_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -29,6 +29,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(bs_bit_binaries_SUITE), [misc, horrid_match, test_bitstr, test_bit_size, diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index 0a19a9e20c..ab87da5231 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -23,13 +23,15 @@ -module(bs_construct_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, two/1,test1/1,fail/1,float_bin/1,in_guard/1,in_catch/1, nasty_literals/1,coerce_to_float/1,side_effect/1, opt/1,otp_7556/1,float_arith/1,otp_8054/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(bs_construct_SUITE), [two, test1, fail, float_bin, in_guard, in_catch, diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index b1ec1c4d59..4b74ddc749 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_SUITE). -compile(nowarn_shadow_vars). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1, bin_tail/1,save_restore/1,shadowed_size_var/1, partitioned_bs_match/1,function_clause/1, @@ -38,6 +38,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(bs_match_SUITE), [fun_shadow, int_float, otp_5269, null_fields, wiger, diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index fd1e3ab8d0..28a2ae6271 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -19,13 +19,15 @@ -module(bs_utf_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1, literals/1,coverage/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(bs_utf_SUITE), [utf8_roundtrip, unused_utf_char, utf16_roundtrip, diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 364e8ceba8..d747cd459c 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -24,6 +24,8 @@ -compile(export_all). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(compilation_SUITE), [self_compile_old_inliner, self_compile, compiler_1, diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index b2842e937b..b6054615f0 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, app_test/1, file_1/1, module_mismatch/1, big_file/1, outdir/1, binary/1, cond_and_ifdef/1, listings/1, listings_big/1, @@ -32,11 +32,11 @@ -export([init/3]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. %% To cover the stripping of 'type' and 'spec' in beam_asm. -type all_return_type() :: [atom()]. -spec all() -> all_return_type(). - all() -> test_lib:recompile(compile_SUITE), [app_test, file_1, module_mismatch, big_file, outdir, diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 0c7cb907b4..9d17b0cb48 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -18,7 +18,7 @@ %% -module(core_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1]). -include_lib("test_server/include/test_server.hrl"). @@ -35,6 +35,8 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(core_SUITE), [dehydrated_itracer, nested_tries]. diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index cb2d46ef40..3d5798fe5a 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -18,7 +18,7 @@ %% -module(core_fold_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_element/1,setelement/1,t_length/1,append/1,t_apply/1,bifs/1, eq/1,nested_call_in_case/1,coverage/1]). @@ -26,6 +26,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(core_fold_SUITE), [t_element, setelement, t_length, append, t_apply, bifs, diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index b6976c73b5..5360c5d700 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -20,9 +20,11 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(error_SUITE), [head_mismatch_line, warnings_as_errors, bif_clashes]. diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index 864458e4a8..5f0af29b87 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -17,10 +17,12 @@ %% %CopyrightEnd% %% -module(float_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(float_SUITE), [pending, bif_calls, math_functions, diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index ff04c043d4..7f8b91328d 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -18,11 +18,13 @@ %% -module(fun_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(fun_SUITE), [test1, overwritten_fun, otp_7202, bif_fun]. diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 1d8c0b0a3a..f01dc18ecc 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, misc/1,const_cond/1,basic_not/1,complex_not/1,nested_nots/1, semicolon/1,complex_semicolon/1,comma/1, or_guard/1,more_or_guards/1, @@ -33,6 +33,8 @@ basic_andalso_orelse/1,traverse_dcd/1, check_qlc_hrl/1,andalso_semi/1,t_tuple_size/1,binary_part/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(guard_SUITE), [misc, const_cond, basic_not, complex_not, nested_nots, diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 35b7fa91a0..9d435fc39b 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -28,6 +28,8 @@ %% Needed by test case `lists'. -compile(inline_list_funcs). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(inline_SUITE), [attribute, bsdecode, bsdes, barnes2, decode1, smith, diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index 55ca2d0501..edb44ff8b6 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -19,12 +19,14 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,deeply_nested/1,no_generator/1, empty_generator/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(lc_SUITE), [basic, deeply_nested, no_generator, empty_generator]. diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 9c9907d9b4..447c66db54 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -18,13 +18,15 @@ %% -module(match_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, pmatch/1,mixed/1,aliases/1,match_in_call/1, untuplify/1,shortcut_boolean/1,letify_guard/1, selectify/1,underscore/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(match_SUITE), [pmatch, mixed, aliases, match_in_call, untuplify, diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index 1054be0a5f..fa99e63574 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(misc_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, tobias/1,empty_string/1,md5/1,silly_coverage/1, confused_literals/1,integer_encoding/1,override_bif/1]). @@ -50,12 +50,13 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. --spec all() -> misc_SUITE_test_cases(). +suite() -> [{suite_callbacks,[ts_install_scb]}]. +-spec all() -> misc_SUITE_test_cases(). all() -> -test_lib:recompile(misc_SUITE), - [tobias, empty_string, md5, silly_coverage, - confused_literals, integer_encoding, override_bif]. + test_lib:recompile(misc_SUITE), + [tobias, empty_string, md5, silly_coverage, + confused_literals, integer_encoding, override_bif]. groups() -> []. diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl index 6861077c7b..3291398f88 100644 --- a/lib/compiler/test/num_bif_SUITE.erl +++ b/lib/compiler/test/num_bif_SUITE.erl @@ -30,12 +30,14 @@ %% round/1 %% trunc/1 --export([all/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(num_bif_SUITE), [t_abs, t_float, t_float_to_list, t_integer_to_list, diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index 087e7c087a..ebfb542ccb 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -20,7 +20,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, pe2/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, pe2/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [pe2]. diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index 37cf6ef0ba..372b640349 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -18,11 +18,13 @@ %% -module(pmod_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1, otp_8447/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(pmod_SUITE), [basic, otp_8447]. diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 2cae5aeac0..8a02025336 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -20,7 +20,7 @@ -module(receive_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, recv/1,coverage/1,otp_7980/1,ref_opt/1]). -include_lib("test_server/include/test_server.hrl"). @@ -34,6 +34,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(receive_SUITE), [recv, coverage, otp_7980, ref_opt, export]. diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index ee7dfda398..17d8b50d42 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1, guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]). @@ -35,6 +35,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(record_SUITE), [errors, record_test_2, record_test_3, diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index 6729b340c3..a844cca3b4 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -18,7 +18,7 @@ %% -module(trycatch_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1, nested_horrid/1,last_call_optimization/1,bool/1, @@ -26,6 +26,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(trycatch_SUITE), [basic, lean_throw, try_of, try_after, catch_oops, diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index 0cc395cf51..e0b1c84ad0 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([pattern/1,pattern2/1,pattern3/1,pattern4/1, guard/1,bad_arith/1,bool_cases/1,bad_apply/1, @@ -49,6 +49,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> test_lib:recompile(warnings_SUITE), [pattern, pattern2, pattern3, pattern4, guard, diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl index d93884e3b4..2d4a7f7a44 100644 --- a/lib/cosEvent/test/event_channel_SUITE.erl +++ b/lib/cosEvent/test/event_channel_SUITE.erl @@ -53,7 +53,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, event_objects_api/1, events_api/1, events_sync_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, event_objects_api/1, events_api/1, events_sync_api/1, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -61,6 +61,8 @@ %% Internal exports %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index 8ca08fe1fa..031cb5f576 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['CosEventChannelAdmin_AlreadyConnected', 'CosEventChannelAdmin_TypeError', diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl index 33a62be801..d22e6009a7 100644 --- a/lib/cosEventDomain/test/event_domain_SUITE.erl +++ b/lib/cosEventDomain/test/event_domain_SUITE.erl @@ -56,7 +56,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, event_domain_api/1, event_domain_factory_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, event_domain_api/1, event_domain_factory_api/1, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -64,6 +64,8 @@ %% Internal exports %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index 6a8f005588..eed727e470 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['CosEventDomainAdmin', 'CosEventDomainAdmin_DiamondSeq', diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index b45cc65cd0..eb7a0a6723 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -70,7 +70,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0, +-export([all/0,suite/0,groups/0, init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, @@ -94,6 +94,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> + [{suite_callbacks,[ts_install_scb]}]. all() -> cases(). diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl index 40c50ccedc..30456595f3 100644 --- a/lib/cosNotification/test/eventDB_SUITE.erl +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -259,7 +259,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, reorder_api/1, lookup_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, reorder_api/1, lookup_api/1, discard_api/1, max_events_api/1, gc_api/1, auto_gc_api/1, start_stop_time_api/1, mapping_filter_api/1, persisten_event_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -269,6 +269,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index e924351556..5d786ab675 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['CosNotification', 'CosNotification_AdminPropertiesAdmin', diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl index 48a2eeee67..6f47e92028 100644 --- a/lib/cosNotification/test/grammar_SUITE.erl +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -64,7 +64,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, union_api/1, enum_api/1, simple_types_api/1, components_api/1, positional_api/1, variable_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -76,6 +76,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl index c506e11b2a..dcaa068ec5 100644 --- a/lib/cosNotification/test/notification_SUITE.erl +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -123,7 +123,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, qos_api/1, adm_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, qos_api/1, adm_api/1, cosevent_api/1, filter_adm_api/1, events_api/1, events2_api/1, event_qos_api/1, filter_api/1, mapping_filter_api/1, subscription_api/1, init_per_testcase/2, end_per_testcase/2, persistent_max_events_api/1, @@ -137,6 +137,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 593791fa57..6575828b68 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['CosPropertyService_ConflictingProperty', 'CosPropertyService_ConstraintNotSupported', diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl index 8f3ce3e8c1..6dd48dbef2 100644 --- a/lib/cosProperty/test/property_SUITE.erl +++ b/lib/cosProperty/test/property_SUITE.erl @@ -86,7 +86,7 @@ %% External exports %%----------------------------------------------------------------- %% Fixed exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). %% Test cases -export([create_setdef_api/1, create_set_api/1, define_with_mode_api/1, @@ -98,6 +98,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index dd6d4ea354..80140aa47c 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['TimeBase_IntervalT', 'TimeBase_UtcT', 'CosTime_TimeUnavailable', 'CosTimerEvent_TimerEventT', diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index cdfb4dabf8..6c931585c3 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -67,7 +67,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, time_api/1, timerevent_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, time_api/1, timerevent_api/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -76,6 +76,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index e72751ad34..2b8498b46e 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -72,7 +72,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -85,6 +85,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['CosTransactions_Control', 'CosTransactions_Coordinator', diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl index 9a8aa8981a..0f7eb52d15 100644 --- a/lib/cosTransactions/test/transactions_SUITE.erl +++ b/lib/cosTransactions/test/transactions_SUITE.erl @@ -36,7 +36,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, resource_api/1, etrap_api/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -45,6 +45,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/crypto/test/blowfish_SUITE.erl b/lib/crypto/test/blowfish_SUITE.erl index ae7712479f..4ebcb2c7a0 100644 --- a/lib/crypto/test/blowfish_SUITE.erl +++ b/lib/crypto/test/blowfish_SUITE.erl @@ -100,6 +100,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ecb, cbc, cfb64, ofb64]. diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 7df0d662f4..b27994fc48 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, info/1, @@ -61,6 +61,8 @@ -export([hexstr2bin/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [link_test, md5, md5_update, md4, md4_update, md5_mac, md5_mac_io, sha, sha_update, diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl index 2ac7a73ebe..6932d5a162 100644 --- a/lib/debugger/test/andor_SUITE.erl +++ b/lib/debugger/test/andor_SUITE.erl @@ -20,12 +20,14 @@ %% -module(andor_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index d25f68e91d..52854a694a 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -23,7 +23,7 @@ -module(bs_bincomp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1]). @@ -39,6 +39,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [byte_aligned, bit_aligned, extended_byte_aligned, extended_bit_aligned, mixed]. diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl index 9971b90a42..262ff93500 100644 --- a/lib/debugger/test/bs_construct_SUITE.erl +++ b/lib/debugger/test/bs_construct_SUITE.erl @@ -19,12 +19,14 @@ -module(bs_construct_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, coerce_to_float/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl index d422580b20..8577a017d8 100644 --- a/lib/debugger/test/bs_match_bin_SUITE.erl +++ b/lib/debugger/test/bs_match_bin_SUITE.erl @@ -21,11 +21,13 @@ -module(bs_match_bin_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, byte_split_binary/1,bit_split_binary/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl index 14ccbe425a..11eab8090d 100644 --- a/lib/debugger/test/bs_match_int_SUITE.erl +++ b/lib/debugger/test/bs_match_int_SUITE.erl @@ -20,13 +20,15 @@ -module(bs_match_int_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1]). -include_lib("test_server/include/test_server.hrl"). -import(lists, [seq/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl index d9116c6f8a..e0dafa2801 100644 --- a/lib/debugger/test/bs_match_misc_SUITE.erl +++ b/lib/debugger/test/bs_match_misc_SUITE.erl @@ -20,11 +20,13 @@ -module(bs_match_misc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl index 3f5dea3011..33f805bbd3 100644 --- a/lib/debugger/test/bs_match_tail_SUITE.erl +++ b/lib/debugger/test/bs_match_tail_SUITE.erl @@ -20,11 +20,13 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, aligned/1,unaligned/1,zero_tail/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index c15c4be351..adca9356b3 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_utf_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1, init_per_testcase/2,end_per_testcase/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1]). @@ -29,6 +29,8 @@ -include_lib("test_server/include/test_server.hrl"). -compile([no_jopt,time]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl index fab94cc08f..26ae487c72 100644 --- a/lib/debugger/test/bug_SUITE.erl +++ b/lib/debugger/test/bug_SUITE.erl @@ -22,12 +22,14 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([]). -export([otp2163/1, otp4845/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, ticket_tests}]. diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 6207524be5..4f40cb3f9c 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -25,7 +25,7 @@ % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([function_tests/1]). @@ -62,6 +62,8 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [function_tests, {group, manual_tests}]. diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index a10b2aecbc..1a95cfe222 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -24,10 +24,12 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test, erts_debug, no_abstract_code, encrypted_debug_info]. diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index f49e95669e..69fe183d28 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -70,6 +70,8 @@ end_per_testcase(_Case, Config) -> ok. -endif. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [guard_1, guard_2, match_pattern, string_plusplus, pattern_expr, match_bin, guard_3, guard_4, lc, diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl index 9fc1a28b2f..e4e0897240 100644 --- a/lib/debugger/test/exception_SUITE.erl +++ b/lib/debugger/test/exception_SUITE.erl @@ -20,13 +20,15 @@ %% -module(exception_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, badmatch/1,pending_errors/1,nil_arith/1]). -export([bad_guy/2]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl index c52ddec1b5..e56df5fb09 100644 --- a/lib/debugger/test/fun_SUITE.erl +++ b/lib/debugger/test/fun_SUITE.erl @@ -20,7 +20,7 @@ %% -module(fun_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2,end_per_testcase/2, init_per_suite/1,end_per_suite/1, good_call/1,bad_apply/1,bad_fun_call/1,badarity/1, @@ -29,6 +29,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl index 8b127f183f..2b32fc702e 100644 --- a/lib/debugger/test/guard_SUITE.erl +++ b/lib/debugger/test/guard_SUITE.erl @@ -20,7 +20,7 @@ %% -module(guard_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, bad_arith/1,bad_tuple/1,test_heap_guards/1,guard_bifs/1, type_tests/1,const_guard/1, const_cond/1,basic_not/1,complex_not/1, @@ -40,6 +40,8 @@ -export([init/4]). -import(lists, [member/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl index f235d6e385..ad11705e21 100644 --- a/lib/debugger/test/int_SUITE.erl +++ b/lib/debugger/test/int_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -59,6 +59,8 @@ end_per_testcase(_Case, Config) -> ?line test_server:timetrap_cancel(Dog), ?line ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [interpret, guards, {group, list_suite}, interpretable]. diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index cd33046efa..d90ffebf8d 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -24,11 +24,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,cleanup/1]). -export([auto_attach/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, cleanup]. diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index 9f0836c406..2a1ee5a911 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -22,7 +22,7 @@ %% Purpose: Deeper test of the evaluator. --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, bifs_outside_erlang/1, spawning/1, applying/1, catch_and_throw/1, external_call/1, test_module_info/1, apply_interpreted_fun/1, apply_uninterpreted_fun/1, @@ -35,6 +35,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [bifs_outside_erlang, spawning, applying, catch_and_throw, external_call, test_module_info, diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl index 362e18eba1..90ec4474dc 100644 --- a/lib/debugger/test/lc_SUITE.erl +++ b/lib/debugger/test/lc_SUITE.erl @@ -21,11 +21,13 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, basic/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl index 684bc2eaa3..89f4b0ad74 100644 --- a/lib/debugger/test/record_SUITE.erl +++ b/lib/debugger/test/record_SUITE.erl @@ -24,9 +24,11 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, errors/1,record_test/1,eval_once/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl index 2d951be68f..8e2619e8e7 100644 --- a/lib/debugger/test/trycatch_SUITE.erl +++ b/lib/debugger/test/trycatch_SUITE.erl @@ -20,13 +20,15 @@ %% -module(trycatch_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cases()]. @@ -121,7 +123,9 @@ basic(Conf) when is_list(Conf) -> ok. -after_call() -> +after_csuite() -> [{suite_callbacks,[ts_install_scb]}]. + +all() -> put(basic, after_was_called). after_clean() -> diff --git a/lib/docbuilder/test/docb_SUITE.erl b/lib/docbuilder/test/docb_SUITE.erl index 2d368af23d..e743dbba8a 100644 --- a/lib/docbuilder/test/docb_SUITE.erl +++ b/lib/docbuilder/test/docb_SUITE.erl @@ -17,12 +17,14 @@ %% -module(docb_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,html/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,html/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("kernel/include/file.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [html]. diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl index e095913dc7..e110a48d56 100644 --- a/lib/edoc/test/edoc_SUITE.erl +++ b/lib/edoc/test/edoc_SUITE.erl @@ -20,11 +20,13 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %% Test cases -export([build_std/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [build_std]. diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index d1309734f6..c6f8193ab7 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -23,11 +23,13 @@ -include_lib("test_server/include/test_server.hrl"). -include("ei_accept_SUITE_data/ei_accept_test_cases.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, ei_accept/1, ei_threaded_accept/1]). -import(runner, [get_term/1,send_term/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ei_accept, ei_threaded_accept]. diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index 603a300a26..5ea420cdf2 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -24,7 +24,7 @@ -include("ei_connect_SUITE_data/ei_connect_test_cases.hrl"). -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, @@ -40,6 +40,8 @@ -import(runner, [get_term/1,send_term/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs, ei_threaded_send, ei_set_get_tracelevel]. diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index cf30ef96d1..e6a1948d4d 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -25,7 +25,7 @@ -export( [ -all/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test_ei_decode_long/1, test_ei_decode_ulong/1, test_ei_decode_longlong/1, @@ -35,6 +35,8 @@ all/0,groups/0,init_per_group/2,end_per_group/2, test_ei_decode_misc/1 ]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [test_ei_decode_long, test_ei_decode_ulong, test_ei_decode_longlong, test_ei_decode_ulonglong, diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index b4bb6e187c..2366f0f11d 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -25,10 +25,12 @@ -export( [ -all/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test_ei_decode_encode/1 ]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [test_ei_decode_encode]. diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index bc8bcc07a3..34d4d0fec4 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -25,7 +25,7 @@ -export( [ -all/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test_ei_encode_long/1, test_ei_encode_ulong/1, test_ei_encode_longlong/1, @@ -35,6 +35,8 @@ all/0,groups/0,init_per_group/2,end_per_group/2, test_ei_encode_fails/1 ]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [test_ei_encode_long, test_ei_encode_ulong, test_ei_encode_longlong, test_ei_encode_ulonglong, diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 29209d50b9..25458aaa13 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -25,7 +25,7 @@ -export([ format_wo_ver/1, - all/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1 @@ -36,6 +36,8 @@ %% This test suite test the erl_format() function. %% It uses the port program "ei_format_test". +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [format_wo_ver, atoms, tuples, lists]. diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index c5c0e84358..fc6b1ddde5 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -23,13 +23,15 @@ -include_lib("test_server/include/test_server.hrl"). -include("ei_print_SUITE_data/ei_print_test_cases.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). -import(runner, [get_term/1]). %% This test suite test the ei_print() function. %% It uses the port program "ei_format_test". +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [atoms, tuples, lists, strings]. diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index c1bf5e35f6..2b94e28ce0 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -26,10 +26,12 @@ -define(dummy_host,test01). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [framework_check, ei_accept_tmo, ei_connect_tmo, ei_send_tmo, ei_recv_tmo]. diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index 6a8d5a998e..d47428baa2 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -23,11 +23,13 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_connect_SUITE_data/erl_connect_test_cases.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]). -import(runner, [get_term/1,send_term/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [erl_send, erl_reg_send, erl_send_cookie_file]. diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index 084415ec41..45d9dabed1 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -33,7 +33,7 @@ %%% 5. Miscellanous functions. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0,groups/0,init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, decode_terms/1, decode_float/1, t_erl_mk_int/1, t_erl_mk_list/1, basic_copy/1, @@ -73,6 +73,8 @@ %% This test suite controls the running of the C language functions %% in eterm_test.c and print_term.c. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [build_terms, round_trip_conversion, decode_terms, decode_float, t_erl_mk_int, t_erl_mk_list, basic_copy, diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index c3a47a75a0..9c54d7416f 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -24,7 +24,7 @@ -include("erl_ext_SUITE_data/ext_test_cases.hrl"). -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, compare_tuple/1, compare_list/1, compare_string/1, @@ -34,6 +34,8 @@ -import(runner, [get_term/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [compare_tuple, compare_list, compare_string, compare_list_string, compare_nc_ext]. diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index 3e828d14b7..b23055b4f5 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -23,13 +23,15 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_format_SUITE_data/format_test_cases.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). -import(runner, [get_term/1]). %% This test suite test the erl_format() function. %% It uses the port program "format_test". +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [atoms, tuples, lists]. diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index d2ab6bd722..809356a693 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, bind/1, integers/1, floats/1, binaries/1, strings/1]). %% For interactive running of matcher. @@ -31,6 +31,8 @@ %% This test suite tests the erl_match() function. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [atoms, lists, tuples, references, pids, ports, bind, integers, floats, binaries, strings]. diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 3c1127bb18..547fc61cae 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -31,11 +31,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1]). % Private exports -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic]. diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 85926619fa..26479d0f11 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -18,7 +18,7 @@ -module(et_wx_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -38,6 +38,8 @@ end_per_testcase(Func,Config) -> et_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_all_windows]. diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index 0fc409b62e..95f590cc4f 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -18,10 +18,12 @@ %% -module(eunit_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,eunit_test/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,eunit_test/1]). -include_lib("common_test/include/ct.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [eunit_test]. diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index e23b943348..9434aaed49 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -63,6 +63,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [void_test, long_test, long_long_test, unsigned_short_test, unsigned_long_test, diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index fa7ab31db8..9434f232a3 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -62,6 +62,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [void_test, long_test, long_long_test, unsigned_short_test, unsigned_long_test, diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index 625a7fd253..887a76860f 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -62,6 +62,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [void_test, long_test, long_long_test, unsigned_short_test, unsigned_long_test, diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index 5dc3049671..ab11b682ac 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -26,7 +26,7 @@ -module(erl_client_c_server_SUITE). -include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2,all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -63,6 +63,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [void_test, long_test, longlong_test, ushort_test, ulong_test, ulonglong_test, double_test, char_test, diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index b5f49ba13e..f926f71060 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -26,7 +26,7 @@ -module(erl_client_c_server_proto_SUITE). -include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2,all/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -63,6 +63,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [void_test, long_test, longlong_test, ushort_test, ulong_test, ulonglong_test, double_test, char_test, diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index ac77d9c10e..ed6b2b9891 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -24,7 +24,7 @@ -module(ic_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -include_lib("orber/src/orber_ifr.hrl"). @@ -86,6 +86,8 @@ %% Top of cases +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test, {group, const}, {group, union}, {group, enum}, {group, attr}, {group, type}, diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index e53cbf9a15..7db2996cc1 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,plain/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,plain/1]). -define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). @@ -33,6 +33,8 @@ %% Top of cases +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [plain]. diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl index 140c81feeb..b36b14fd5d 100644 --- a/lib/ic/test/ic_pp_SUITE.erl +++ b/lib/ic/test/ic_pp_SUITE.erl @@ -32,7 +32,7 @@ -define(GCC, "g++"). -define(GCC_VER, "2.95.3"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([arg_norm/1]). -export([cascade_norm/1]). -export([comment_norm/1]). @@ -54,6 +54,8 @@ -export([cases/0, init_per_suite/1, end_per_suite/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index ae43e7f64d..da1c4e11aa 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -32,7 +32,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1]). -export([ifr_pragma_reg/1, pragma_error/1, uggly_pragmas/1]). @@ -53,6 +53,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index 6531030dc8..14e83f16a3 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -31,7 +31,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, ifr_reg_unreg/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, ifr_reg_unreg/1]). -export([ifr_inheritence_reg/1,ifr_reg_unreg_with_inheritence/1]). -export([ifr_reg_unreg_with_inheritence_bad_order/1]). @@ -57,6 +57,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index f2683896ed..6d4e530ffb 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1,init_per_testcase/2,end_per_testcase/2]). -export([marshal_ll/1,marshal_ull/1, marshal_l/1,marshal_ul/1, marshal_s/1,marshal_us/1, @@ -36,6 +36,8 @@ %% Top of cases +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl index 691157534b..173731b1ca 100644 --- a/lib/inets/test/ftp_SUITE.erl +++ b/lib/inets/test/ftp_SUITE.erl @@ -24,7 +24,7 @@ -include("test_server_line.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). % -export([init_per_testcase/2, end_per_testcase/2]). -export([init_per_suite/1, end_per_suite/1]). @@ -72,6 +72,8 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, solaris8_test}, {group, solaris9_test}, {group, solaris10_test}, {group, linux_x86_test}, diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 2499176898..9c0b904db7 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -25,7 +25,7 @@ -include("ftp_internal.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([ ftp_150/1, @@ -33,6 +33,8 @@ ftp_other_status_codes/1, ftp_multiple_lines/1, ftp_multipel_ctrl_messages/1, format_error/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, ftp_response}, format_error]. diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl index c53ae446d8..8abf93558b 100644 --- a/lib/inets/test/http_format_SUITE.erl +++ b/lib/inets/test/http_format_SUITE.erl @@ -26,7 +26,7 @@ -include("http_internal.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([ chunk_decode/1, chunk_encode/1, @@ -37,6 +37,8 @@ esi_parse_headers/1, cgi_parse_headers/1, is_absolut_uri/1, convert_netscapecookie_date/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, chunk}, http_response, http_request, validate_request_line, {group, script}, is_absolut_uri, diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 328b0a01f8..f1dbddee06 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -59,6 +59,8 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [proxy_options, proxy_head, proxy_get, proxy_trace, proxy_post, proxy_put, proxy_delete, proxy_auth, diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl index 31bc4f510a..f0885faf47 100644 --- a/lib/inets/test/httpc_cookie_SUITE.erl +++ b/lib/inets/test/httpc_cookie_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("stdlib/include/ms_transform.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([session_cookies_only/1, netscape_cookies/1, @@ -116,6 +116,8 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [session_cookies_only, netscape_cookies, cookie_cancel, cookie_expires, persistent_cookie, domain_cookie, diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index b93edaf93b..978ea0f817 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("kernel/include/file.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, init_per_suite/1, end_per_suite/1]). @@ -248,6 +248,8 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, ip}, {group, ssl}, {group, http_1_1_ip}, {group, http_1_0_ip}, {group, http_0_9_ip}, diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 8a654a7480..a67a082da9 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -26,6 +26,8 @@ -define(URL_START, "http://localhost:"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [uri_too_long_414, header_too_long_413, escaped_url_in_error_body]. diff --git a/lib/inets/test/inets_SUITE.erl b/lib/inets/test/inets_SUITE.erl index 3907e5ac3d..593ad2efc6 100644 --- a/lib/inets/test/inets_SUITE.erl +++ b/lib/inets/test/inets_SUITE.erl @@ -28,6 +28,8 @@ -define(NUM_DEFAULT_SERVICES, 1). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, app_test}, {group, appup_test}, {group, services_test}, httpd_reload]. diff --git a/lib/inets/test/inets_sup_SUITE.erl b/lib/inets/test/inets_sup_SUITE.erl index aef59597a8..f542506d00 100644 --- a/lib/inets/test/inets_sup_SUITE.erl +++ b/lib/inets/test/inets_sup_SUITE.erl @@ -26,6 +26,8 @@ %% Note: This directive should only be used in test suites. -compile(export_all). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [default_tree, ftpc_worker, tftpd_worker, httpd_subtree, httpc_subtree]. diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index 44fc189a96..41e06f493f 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -71,6 +71,8 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Top test case %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [simple, extra, reuse_connection, resend_client, resend_server]. diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl index 839cd0dd26..df95972534 100644 --- a/lib/inviso/test/inviso_tool_SUITE.erl +++ b/lib/inviso/test/inviso_tool_SUITE.erl @@ -33,6 +33,8 @@ -define(l,?line). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [dist_basic_1, dist_rtc, dist_reconnect, dist_adopt, dist_history, dist_start_session_special]. diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index 5c31469849..eff569a40e 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -18,7 +18,7 @@ %% -module(jinterface_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -export([nodename/1, register_and_whereis/1, get_names/1, boolean_atom/1, @@ -80,6 +80,8 @@ %%%----------------------------------------------------------------- %%% INIT/END %%%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> lists:append([fundamental(), ping(), send_receive(), link_unlink(), status_handler()]). diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index a96b3495aa..4b7ba1a437 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -23,7 +23,7 @@ -include("test_server_line.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, @@ -50,6 +50,8 @@ %% Top of cases +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [pid_roundtrip, port_roundtrip, ref_roundtrip, new_float, old_stuff, binary_roundtrip, diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index d4912680ec..b4cf7c72e8 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, load_use_cache/1, otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, @@ -41,6 +41,8 @@ % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [failover, failover_comp, permissions, load, load_use_cache, {group, reported_bugs}, start_phases, diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index c8ee765dba..668ee508c9 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(bif_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([ spawn1/1, spawn2/1, spawn3/1, spawn4/1, @@ -48,6 +48,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, spawn_tests}, {group, spawn_link_tests}, {group, spawn_opt_tests}, spawn_failures, wilderness]. diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 0f3a79f183..90b8a6a0d6 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([set_path/1, get_path/1, add_path/1, add_paths/1, del_path/1, replace_path/1, load_file/1, load_abs/1, ensure_loaded/1, delete/1, purge/1, soft_purge/1, is_loaded/1, all_loaded/1, @@ -43,6 +43,8 @@ handle_event/2, handle_call/2, handle_info/2, terminate/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [set_path, get_path, add_path, add_paths, del_path, replace_path, load_file, load_abs, ensure_loaded, diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index e7647c251b..f5bb9e2886 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -34,7 +34,7 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, halt_int_inf/1, halt_int_sz_1/1, halt_int_sz_2/1, @@ -142,6 +142,8 @@ change_size_after, default_size]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, halt_int}, {group, wrap_int}, {group, halt_ext}, {group, wrap_ext}, diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index b9c632ed9a..4a3bf1d7a3 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, start_link/1, stop/1, add/1, delete/1, responses/1]). @@ -33,6 +33,8 @@ %% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson. %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start, start_link, stop, add, delete, responses]. diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 96589b6165..ac2cd9b6b9 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -21,7 +21,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([tick/1, tick_change/1, illegal_nodenames/1, hidden_node/1, table_waste/1, net_setuptime/1, @@ -57,6 +57,8 @@ %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [tick, tick_change, illegal_nodenames, hidden_node, table_waste, net_setuptime, {group, monitor_nodes}]. diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index e34663496a..58cb93383d 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). @@ -77,6 +77,8 @@ -define(u32(X3,X2,X1,X0), (((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [whitebox, switch_options, missing_compulsory_dflags]. diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index f68ce4f8f7..144e58460d 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("kernel/include/file.hrl"). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_path/1, set_path/1, get_file/1, inet_existing/1, inet_coming_up/1, inet_disconnects/1, @@ -35,6 +35,8 @@ %% Test suite for erl_prim_loader. (Most code is run during system start/stop.) %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [get_path, set_path, get_file, inet_existing, inet_coming_up, inet_disconnects, multiple_slaves, diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index 90fdd4a00a..901877d43e 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -27,7 +27,7 @@ %% error_logger deliver the expected events. %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, emulator/1, tty/1, logfile/1, add/1, delete/1]). -export([generate_error/0]). @@ -37,6 +37,8 @@ terminate/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [error_report, info_report, error, info, emulator, tty, logfile, add, delete]. diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 85a2a0a303..d7198ba333 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_warn_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -43,6 +43,8 @@ -define(default_timeout, ?t:minutes(1)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, warnings_info, warnings_warnings, rb_basic, rb_warnings_info, rb_warnings_warnings, rb_trunc, diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index c75b8c03a2..a34f7b9d05 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -40,7 +40,7 @@ -module(?FILE_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, init_per_testcase/2, end_per_testcase/2, read_write_file/1, names/1]). @@ -98,6 +98,8 @@ +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [altname, read_write_file, {group, dirs}, {group, files}, delete, rename, names, {group, errors}, diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index 9d1315c3ab..f4b242d155 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -70,7 +70,7 @@ %% list_dir %% read_link --export([all/0,groups/0, +-export([all/0,groups/0,suite/0, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([normal/1,icky/1,very_icky/1,normalize/1]). @@ -84,6 +84,8 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [normal, icky, very_icky, normalize]. @@ -96,7 +98,6 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - normalize(suite) -> []; normalize(doc) -> diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 52f3a6b057..23cf136b4e 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -23,7 +23,7 @@ %%-compile(export_all). --export([all/0,groups/0, +-export([all/0, suite/0,groups/0, init_per_suite/1,end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). @@ -32,6 +32,8 @@ api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1, xfer_min/1,xfer_active/1,def_sndrcvinfo/1,implicit_inet6/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, api_open_close, api_listen, api_connect_init, api_opts, xfer_min, xfer_active, def_sndrcvinfo, diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 233c2535b6..7f1e851656 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -25,13 +25,15 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, t_connect_timeout/1, t_accept_timeout/1, t_connect_bad/1, t_recv_timeout/1, t_recv_eof/1, t_shutdown_write/1, t_shutdown_both/1, t_shutdown_error/1, t_fdopen/1, t_implicit_inet6/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, t_accept}, {group, t_connect}, {group, t_recv}, t_shutdown_write, t_shutdown_both, t_shutdown_error, diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index 676dc1c593..fc75620bb2 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -22,7 +22,7 @@ %%-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -31,6 +31,8 @@ -define(TPKT_VRSN, 3). -define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1 +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [active_echo, passive_echo, active_once_echo, slow_active_echo, slow_passive_echo, limit_active_echo, diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index 02b243a0ce..f40c5afdfe 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -22,7 +22,7 @@ %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, init_per_testcase/2, end_per_testcase/2, @@ -50,6 +50,8 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [controlling_process, no_accept, close_with_pending_output, data_before_close, diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index e9ae40b0cd..0d26ebd288 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -29,13 +29,15 @@ % XXX - we should pick a port that we _know_ is closed. That's pretty hard. -define(CLOSED_PORT, 6666). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, buffer_size/1, binary_passive_recv/1, bad_address/1, read_packets/1, open_fd/1, connect/1, implicit_inet6/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [send_to_closed, buffer_size, binary_passive_recv, bad_address, read_packets, open_fd, connect, diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 887ce059d3..bb1ea83239 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -20,7 +20,7 @@ %-define(line_trace, 1). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, names/1, names_hidden/1, locks/1, locks_hidden/1, bad_input/1, names_and_locks/1, lock_die/1, name_die/1, @@ -60,6 +60,8 @@ -define(GLOBAL_LOCK, global). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case init:get_argument(ring_line) of {ok, _} -> [ring_line]; diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index a94944c0e9..651ca08c41 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -19,7 +19,7 @@ -module(global_group_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1]). -export([start_gg_proc/1, no_gg_proc/1, no_gg_proc_sync/1, compatible/1, one_grp/1, one_grp_x/1, two_grp/1, hidden_groups/1, test_exit/1]). @@ -35,6 +35,8 @@ -define(UNTIL(Seq), loop_until_true(fun() -> Seq end)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, one_grp, one_grp_x, two_grp, test_exit, hidden_groups]. diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index d811183a41..20b0bc8ea0 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, dont_drop/1, kill_pid/1, fini/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -53,6 +53,8 @@ end_per_testcase(_Func, Config) -> %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start, restart, reboot, set_cmd, clear_cmd, kill_pid]. diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 596f31eb7e..ee4cf72fa5 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_gethostbyaddr/0, t_gethostbyaddr/1, t_getaddr/0, t_getaddr/1, t_gethostbyname/0, t_gethostbyname/1, @@ -42,6 +42,8 @@ kill_gethost/0, parallell_gethost/0]). -export([init_per_testcase/2, end_per_testcase/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_gethostbyaddr, t_gethostbyname, t_getaddr, t_gethostbyaddr_v6, t_gethostbyname_v6, t_getaddr_v6, diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index 9c7f232631..ea1836dbd8 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([basic/1, resolve/1, edns0/1, txt_record/1, files_monitor/1]). -export([ @@ -40,6 +40,8 @@ -define(RUN_NAMED, "run-named"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, resolve, edns0, txt_record, files_monitor, gethostbyaddr, gethostbyaddr_v6, gethostbyname, diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index f9606ff15a..e24672ce1e 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -48,7 +48,7 @@ -define(C_QUIT,99). --export([all/0,groups/0,init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, doc_examples_raw/1,doc_examples_raw_getbin/1, large_raw/1,large_raw_getbin/1,combined/1,combined_getbin/1, type_errors/1]). @@ -56,6 +56,8 @@ -export([init_per_testcase/2, end_per_testcase/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [simple, loop_all, simple_raw, simple_raw_getbin, doc_examples_raw, doc_examples_raw_getbin, large_raw, diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index ecfc8f8fd0..0897697c42 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_arguments/1, get_argument/1, boot_var/1, restart/1, get_plain_arguments/1, @@ -38,6 +38,8 @@ %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [get_arguments, get_argument, boot_var, get_plain_arguments, restart, get_status, script_id, diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index 8bf08a701a..a79aa56f8e 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -18,7 +18,7 @@ %% -module(interactive_shell_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, job_control_remote_noshell/1]). @@ -44,6 +44,8 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [get_columns_and_rows, exit_initial, job_control_local, job_control_remote, job_control_remote_noshell]. diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 3cf3723a85..0322056c46 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -36,6 +36,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test]. diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index bfb86ebec4..a51d1dafd2 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -20,10 +20,12 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, sync/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, sync/1]). -export([init_per_suite/1, end_per_suite/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [sync]. diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index a61c390cf3..45c4990036 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -18,12 +18,14 @@ %% -module(os_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([space_in_cwd/1, quoting/1, space_in_name/1, bad_command/1, find_executable/1, unix_comment_in_command/1, evil/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [space_in_cwd, quoting, space_in_name, bad_command, find_executable, unix_comment_in_command, evil]. @@ -264,7 +266,9 @@ strip_nl([$\n]) -> []; strip_nl([H|T]) -> [H|strip_nl(T)]; strip_nl([]) -> []. -receive_all() -> +receive_suite() -> [{suite_callbacks,[ts_install_scb]}]. + +all() -> receive X -> [X|receive_all()] after 0 -> [] diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 2d33487610..86c2cf6ce7 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -29,7 +29,7 @@ -define(DEBUGF(A,B), noop). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, simple/1, complicated/1, heavy/1, info/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). @@ -42,6 +42,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [simple, complicated, heavy, info]. diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index cd9de48c63..8f7083388b 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -24,7 +24,7 @@ -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ otp_7277/1, otp_8259/1, otp_8653/1, @@ -49,6 +49,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, tickets}]. diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 9d0d704b92..d53c17def4 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(prim_file_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, read_write_file/1]). -export([cur_dir_0a/1, cur_dir_0b/1, @@ -67,6 +67,8 @@ _ -> apply(?PRIM_FILE, F, [H | A]) end). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [read_write_file, {group, dirs}, {group, files}, delete_a, delete_b, rename_a, rename_b, {group, errors}, diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index 6b5df2a887..4045dbc784 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -19,7 +19,7 @@ -module(ram_file_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, %% init/1, fini/1, init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, @@ -34,6 +34,8 @@ %%-------------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [open_modes, open_old_modes, pread_pwrite, position, truncate, sync, get_set_file, compress, uuencode, diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 4c31924052..f7553f0346 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(rpc_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([call/1, block_call/1, multicall/1, multicall_timeout/1, multicall_dies/1, multicall_node_dies/1, called_dies/1, called_node_dies/1, @@ -28,6 +28,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [call, block_call, multicall, multicall_timeout, multicall_dies, multicall_node_dies, called_dies, diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index c7736b3f27..53a6e72fb0 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,7 @@ %% -module(seq_trace_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -34,6 +34,8 @@ -define(default_timeout, ?t:minutes(1)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [token_set_get, tracer_set_get, print, send, distributed_send, recv, distributed_recv, trace_exit, diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index 616d777e9b..3ce2121bf9 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -33,7 +33,7 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, no_file/1, one_empty/1, one_filled/1, two_filled/1, @@ -45,6 +45,8 @@ -export([init_per_testcase/2, end_per_testcase/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [no_file, {group, one}, {group, two}, {group, four}, {group, wrap}, wrapping, external, error]. diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index 135ef5ddaa..ffc50fc0c8 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -69,6 +69,8 @@ error(Format, Args, File, Line) -> %% end, %% log("<>ERROR<>~n" ++ Format, Args, File, Line). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, api}, {group, examples}, {group, func}, smp, otp_7359]. diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 03748e27ca..d50bb5949a 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -46,6 +46,8 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, app_test}, {group, appup_test}, {group, config}, {group, flex}, {group, udp}, diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 2b9f885c80..8be1a549d6 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -30,6 +30,8 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, light}, {group, medium}, {group, heavy}, clean_up_suite]. diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index 4e23061b44..73684eb246 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -20,7 +20,7 @@ -module(crashdump_viewer_SUITE). %% Test functions --export([all/0,groups/0,init_per_group/2,end_per_group/2,translate/1,start/1,fini/1,load_file/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,translate/1,start/1,fini/1,load_file/1, non_existing/1,not_a_crashdump/1,old_crashdump/1]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -46,6 +46,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [translate, load_file, non_existing, not_a_crashdump, old_crashdump]. diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index bacc390a77..07180e9f78 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -20,7 +20,7 @@ -module(etop_SUITE). %% Test functions --export([all/0,groups/0,init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). -export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). @@ -35,6 +35,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [text, text_tracing_off]. diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index 626a0125db..d3d4f4bdf0 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -39,6 +39,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_file]. diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 9ac3714603..0eff966e31 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -21,7 +21,7 @@ -compile(export_all). %% Test functions --export([all/0,groups/0,init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). @@ -41,6 +41,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [file, file_no_pi, file_fetch, wrap, wrap_merge, wrap_merge_fetch_format, write_config1, write_config2, diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index 3854e5e144..997ebfd0b6 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -41,6 +41,8 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case odbc_test_lib:odbc_check() of ok -> diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl index d4c133fb8b..120e9c6154 100644 --- a/lib/odbc/test/odbc_data_type_SUITE.erl +++ b/lib/odbc/test/odbc_data_type_SUITE.erl @@ -39,6 +39,8 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case odbc_test_lib:odbc_check() of ok -> diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index fd04125dbe..49e2239ad4 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -38,6 +38,8 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case odbc_test_lib:odbc_check() of ok -> diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl index 168e5452a5..7dc827799a 100644 --- a/lib/odbc/test/odbc_start_SUITE.erl +++ b/lib/odbc/test/odbc_start_SUITE.erl @@ -98,6 +98,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case odbc_test_lib:odbc_check() of ok -> [start]; diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl index a08a1aa5b9..05820bfca9 100644 --- a/lib/orber/test/cdrcoding_10_SUITE.erl +++ b/lib/orber/test/cdrcoding_10_SUITE.erl @@ -36,7 +36,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -48,6 +48,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl index 811dc34c8e..d52b5529f3 100644 --- a/lib/orber/test/cdrcoding_11_SUITE.erl +++ b/lib/orber/test/cdrcoding_11_SUITE.erl @@ -36,7 +36,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -48,6 +48,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl index 967413bef1..5d285369f7 100644 --- a/lib/orber/test/cdrcoding_12_SUITE.erl +++ b/lib/orber/test/cdrcoding_12_SUITE.erl @@ -37,7 +37,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -49,6 +49,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index cb0ff87be2..62c3405584 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -32,7 +32,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -45,6 +45,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [short, ushort, long, ulong, longlong, ulonglong, boolean, character, octet, float, double, enum]. diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl index 833d67d0ff..0f64dcd79d 100644 --- a/lib/orber/test/corba_SUITE.erl +++ b/lib/orber/test/corba_SUITE.erl @@ -51,7 +51,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -64,6 +64,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index b12c49bc6b..fee1571e02 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -272,7 +272,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, % code_CertificateChain_api/1, @@ -317,6 +317,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 8567bbcb5a..49e33cd651 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -48,7 +48,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -61,6 +61,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [fixed_type, any_type]. diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 712c6b0c39..172b3af1f9 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -84,6 +84,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port, erlang_ref, 'CosNaming_Binding', diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 04f51347d0..7ca0bc7bba 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -78,6 +78,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [local_pseudo, local_default, local_local, local_global]. diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index 7eb3bc4d05..7fc745c494 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -46,6 +46,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index b6fae33242..e66cb05e46 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -46,6 +46,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index 48e07c3e73..cda10c68da 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -47,6 +47,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index a38ca07d5b..780fc7ab6b 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -47,6 +47,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [lname_component, lname]. diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index e404d23130..3b2d7de06d 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -50,7 +50,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, basic_PI_api/1, multi_orber_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, basic_PI_api/1, multi_orber_api/1, init_per_testcase/2, end_per_testcase/2, multi_pseudo_orber_api/1, light_orber_api/1, light_orber2_api/1, ssl_1_multi_orber_api/1, ssl_2_multi_orber_api/1, ssl_reconfigure_api/1, @@ -86,6 +86,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl index 881babb7c9..d9b0f8448b 100644 --- a/lib/orber/test/naming_context_SUITE.erl +++ b/lib/orber/test/naming_context_SUITE.erl @@ -35,7 +35,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -75,6 +75,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index c6c8011f0f..e746279076 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -25,7 +25,7 @@ -define(application, orber). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -35,6 +35,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test, undefined_functions, install_load_order, install_local_content]. diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl index 898cd1f4f5..f97facddb2 100644 --- a/lib/orber/test/orber_acl_SUITE.erl +++ b/lib/orber/test/orber_acl_SUITE.erl @@ -47,7 +47,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -59,6 +59,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, ipv6_verify, ipv6_range, ipv6_interfaces, ipv6_bm]. diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl index 1c37431ac4..4cdf483b3d 100644 --- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -60,6 +60,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl index 1e8c279df8..a88b2281aa 100644 --- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -60,6 +60,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl index 33a09f7f0b..7df27a9478 100644 --- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -60,6 +60,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl index 75711a1e1a..40ae509b90 100644 --- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl @@ -49,7 +49,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -60,6 +60,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index 207656d377..8d687aa961 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -50,7 +50,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, nat_ip_address/1, nat_ip_address_multiple/1, nat_ip_address_local/1, nat_ip_address_local_local/1, @@ -68,6 +68,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> cases(). diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index 1b7295e277..ab7de22912 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -78,6 +78,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [menu, configure, info, nameservice, ifr_select, ifr_data, create, delete_ctx, add_ctx, delete_obj, diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index beb7de4c22..ec37d37122 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -128,7 +128,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -141,6 +141,8 @@ %% Args: %% Returns: %%----------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [null, void, short, ushort, long, ulong, longlong, ulonglong, boolean, char, wchar, octet, float, double, diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 7c51b9b54b..95c17e61a4 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -50,6 +50,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:os_type() of {unix, sunos} -> diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index f21b8db2ae..f33bde21c6 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -50,6 +50,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> Bugs = [otp_5910], case test_server:os_type() of diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index dc7af32746..96748990de 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -49,6 +49,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), Config. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> All = case test_server:os_type() of {unix, sunos} -> diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index f5dea6a92d..2706873b79 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -38,6 +38,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:os_type() of {unix, sunos} -> [app_file, config]; diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl index d784b636ff..8529cf5e0e 100644 --- a/lib/os_mon/test/os_mon_mib_SUITE.erl +++ b/lib/os_mon/test/os_mon_mib_SUITE.erl @@ -30,7 +30,7 @@ -endif. % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). @@ -77,6 +77,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> test_server:timetrap_cancel(Dog), Config. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [load_unload, get_mem_sys_mark, get_mem_proc_mark, get_disk_threshold, get_load_table, diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index 02e1acf1b7..878efedd49 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -63,6 +63,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:os_type() of {unix, sunos} -> [message, config, port]; diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 8b2cf1e4f3..534f8f7870 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ file/1, compile/1, syntax/1, @@ -54,6 +54,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, checks}, {group, examples}]. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index b504498b79..4e41fa013d 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -34,7 +34,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([app_test/1, @@ -60,6 +60,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test, {group, checks}, {group, examples}, {group, bugs}, {group, improvements}]. diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl index a3b7c54708..c8e01f39e2 100644 --- a/lib/percept/test/egd_SUITE.erl +++ b/lib/percept/test/egd_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -54,6 +54,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [image_create_and_destroy, image_shape, image_primitives, image_colors, image_font, diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index 7d637f267f..f2b51fa7f2 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -51,6 +51,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [webserver, profile, analyze, analyze_dist]. diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index b734caef12..c181f33dab 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -43,6 +43,8 @@ -define(NIST6, "2.16.840.1.101.3.2.1.48.6"). %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [signature_verification, validity_periods, verifying_name_chaining, diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 7fdf39395b..158916cb46 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -99,6 +99,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app, pk_decode_encode, encrypt_decrypt, sign_verify, pkix, pkix_path_validation, deprecated]. diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index 3afb4f9b2f..4b020daa19 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -60,6 +60,8 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [fields, modules, export_all, app_depend, undef_funcs]. diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index a42c07cd3d..49ae4d9425 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -18,7 +18,7 @@ -module(reltool_server_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -46,6 +46,8 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_server, set_config, create_release, create_script, create_target, create_embedded, diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index cfce774d22..a5e33dd6a7 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -18,7 +18,7 @@ -module(reltool_wx_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -38,6 +38,8 @@ end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start_all_windows]. diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index f8821712b4..65512bbe0e 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -19,7 +19,7 @@ -module(dbg_SUITE). %% Test functions --export([all/0,groups/0,init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1, ip_port_busy/1, wrap_port/1, wrap_port_time/1, with_seq_trace/1, dead_suspend/1, local_trace/1, @@ -39,6 +39,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [big, tiny, simple, message, distributed, ip_port, file_port, file_port2, file_port_schedfix, ip_port_busy, diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index 13177ddcec..c3e4d24a61 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Testcases -export([basic/1]). @@ -34,6 +34,8 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(2)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic]. diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index c5291a7904..b07a70afa8 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -34,6 +34,8 @@ -define(l,?line). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic_dist_trace_1, basic_dist_trace_2, basic_dist_trace_3, basic_dist_trace_ti_1, diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 61afd37ef0..5fcf26cee0 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -38,6 +38,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_file]. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 4261a1c155..db5b3593c1 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,7 +19,7 @@ -module(snmp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). @@ -54,6 +54,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, app}, {group, compiler}, {group, misc}, {group, agent}, {group, manager}]. diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index 5eb05ec743..ed2d2de2e5 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -53,6 +53,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cinit_return_chkclose, sinit_return_chkclose, cinit_big_return_chkclose, sinit_big_return_chkclose, diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 09e11503bf..8405bcf0de 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_once_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -53,6 +53,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [server_accept_timeout, cinit_return_chkclose, sinit_return_chkclose, cinit_big_return_chkclose, diff --git a/lib/ssl/test/old_ssl_dist_SUITE.erl b/lib/ssl/test/old_ssl_dist_SUITE.erl index c0f2b45c91..e40ac4d594 100644 --- a/lib/ssl/test/old_ssl_dist_SUITE.erl +++ b/lib/ssl/test/old_ssl_dist_SUITE.erl @@ -35,7 +35,7 @@ -define(AWAIT_SLL_NODE_UP_TIMEOUT, 30000). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, @@ -46,6 +46,8 @@ -record(node_handle, {connection_handler, socket, name, nodename}). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic]. diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index e57960e0d3..cd964b684e 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_misc_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -44,6 +44,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [seed, app]. diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index dcaa2ea8d4..59659f5a18 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_passive_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -53,6 +53,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [server_accept_timeout, cinit_return_chkclose, sinit_return_chkclose, cinit_big_return_chkclose, diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index cfff5d74b6..522e7fba1f 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_peer_cert_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -44,6 +44,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cinit_plain, cinit_both_verify, cinit_cnocert]. diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index 2908de1450..8ced900cab 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_protocol_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, finish/1, sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, sslv2_tlsv1/1, sslv3_tlsv1/1, sslv2_sslv3_tlsv1/1]). @@ -38,6 +38,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, sslv3_tlsv1, sslv2_sslv3_tlsv1]. diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index e11d41b181..6b3a894a83 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_verify_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -43,6 +43,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [cinit_both_verify, cinit_cnocert]. diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index 39c31922f7..9f6828252b 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -26,7 +26,7 @@ -define(default_timeout, ?t:minutes(1)). -define(application, ssh). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -47,6 +47,8 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [config, echo_once, echo_twice, close_before_ssl_accept]. diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 56b623d551..e44211b303 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -173,6 +173,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app, alerts, connection_info, protocol_versions, empty_protocol_versions, controlling_process, diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index 3b583b8e4d..a2f94f83b9 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -118,6 +118,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [packet_raw_passive_many_small, packet_0_passive_many_small, diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index 1c63006ac3..36eabff202 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -99,6 +99,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [server_echos_passive_small, server_echos_active_once_small, diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index 8b95329bef..9ef8c3bc14 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -145,6 +145,8 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [session_cache_process_list, session_cache_process_mnesia]. @@ -158,7 +160,6 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - session_cache_process_list(doc) -> ["Test reuse of sessions (short handshake)"]; diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index cddf234c2b..b59f1e19d0 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -143,6 +143,8 @@ end_per_testcase(_, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [erlang_client_openssl_server, erlang_server_openssl_client, diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index 0cb5eb33b0..19ad86977d 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:seconds(60)). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([ @@ -64,6 +64,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [new_test, fix_test, relax_test, resize_test, set_get_test, to_list_test, sparse_to_list_test, diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index c41cf2970a..146b63bc69 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -23,7 +23,7 @@ -include("test_server_line.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([base64_encode/1, base64_decode/1, base64_otp_5635/1, @@ -43,6 +43,8 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [base64_encode, base64_decode, base64_otp_5635, base64_otp_6279, big, illegal, mime_decode, mime_decode_to_string, roundtrip]. diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index cf4de516a6..539028d4aa 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -32,11 +32,13 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, building/1, md5/1, encrypted_abstr/1, encrypted_abstr_file/1]). -export([init_per_testcase/2, end_per_testcase/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [error, normal, cmp, cmp_literals, strip, otp_6711, building, md5, encrypted_abstr, encrypted_abstr_file]. diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index ec4894a2fa..b459f35f03 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -18,7 +18,7 @@ %% -module(binary_module_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]). @@ -62,6 +62,8 @@ end_per_testcase(_Case, Config) -> ok. -endif. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [interesting, random_ref_fla_comp, random_ref_sr_comp, random_ref_comp, parts, bin_to_list, list_to_bin, copy, diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index 4649bcb856..913bc104cd 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(c_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1, memory/1]). @@ -25,6 +25,8 @@ -import(c, [c/2, nc/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 12eae47474..12c38d3693 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, gregorian_days/1, gregorian_seconds/1, day_of_the_week/1, @@ -32,6 +32,8 @@ -define(START_YEAR, 1947). -define(END_YEAR, 2012). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [gregorian_days, gregorian_seconds, day_of_the_week, day_of_the_week_calibrate, leap_years, diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index e66afcdb9b..7f8231adff 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -34,7 +34,7 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, open_v8/1, open_v9/1, sets_v8/1, sets_v9/1, bags_v8/1, bags_v9/1, duplicate_bags_v8/1, duplicate_bags_v9/1, access_v8/1, access_v9/1, dirty_mark/1, dirty_mark2/1, @@ -88,6 +88,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case os:type() of vxworks -> [not_run]; diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index d58b50f9a1..af1de5164f 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -22,13 +22,15 @@ -module(dict_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,store/1]). -include_lib("test_server/include/test_server.hrl"). -import(lists, [foldl/3,reverse/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [create, store]. diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index efebea5496..3bdb0ec0d2 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([opts/1, degree/1, path/1, cycle/1, vertices/1, edges/1, data/1, otp_3522/1, otp_3630/1, otp_8066/1]). @@ -35,6 +35,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [opts, degree, path, cycle, {group, misc}, {group, tickets}]. diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 4434b0db04..0204501ca0 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([simple/1, loop/1, isolated/1, topsort/1, subgraph/1, condensation/1, tree/1]). @@ -33,6 +33,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [simple, loop, isolated, topsort, subgraph, condensation, tree]. diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 38ea43999f..326942b99b 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(edlin_expand_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]). @@ -36,6 +36,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [normal, quoted_fun, quoted_module, quoted_both]. diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index bd39af68f0..f4579d7312 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(epp_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([rec_1/1, predef_mac/1, upcase_mac_1/1, upcase_mac_2/1, @@ -59,6 +59,8 @@ end_per_testcase(_, Config) -> ok. -endif. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [rec_1, {group, upcase_mac}, predef_mac, {group, variable}, otp_4870, otp_4871, otp_5362, pmod, diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 756cefcf14..081ec6abb3 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -71,14 +71,14 @@ end_per_testcase(_Case, Config) -> ok. -endif. -all(doc) -> - ["Test cases for the 'erl_eval' module."]; -all(suite) -> - [guard_1, guard_2, match_pattern, string_plusplus, pattern_expr, - match_bin, guard_3, guard_4, - lc, simple_cases, unary_plus, apply_atom, otp_5269, otp_6539, otp_6543, - otp_6787, otp_6977, otp_7550, otp_8133, funs, try_catch, eval_expr_5, - zero_width]. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + +all() -> +[guard_1, guard_2, match_pattern, string_plusplus, + pattern_expr, match_bin, guard_3, guard_4, lc, + simple_cases, unary_plus, apply_atom, otp_5269, + otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, + otp_8133, funs, try_catch, eval_expr_5, zero_width]. groups() -> []. diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index 6eb038c0be..d81d5ff6a2 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([abstract_module/1, attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, @@ -50,6 +50,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [abstract_module, attributes, expr, guard, init, pattern, strict, update, {group, tickets}]. diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index 18a28c24dc..514d78b1d1 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -18,7 +18,7 @@ %% -module(erl_internal_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([behav/1]). @@ -26,6 +26,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [behav]. diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index e7603ad8c1..3fcdade385 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ unused_vars_warn_basic/1, @@ -69,6 +69,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, unused_vars_warn}, export_vars_warn, shadow_vars, unused_import, unused_function, diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index 41e4443f89..9ee8e27068 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ func/1, call/1, recs/1, try_catch/1, if_then/1, receive_after/1, bits/1, head_tail/1, package/1, @@ -63,6 +63,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, expr}, {group, attributes}, hook, neg_indent, {group, tickets}]. diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index 5a98890ba7..030964163e 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_scan_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([ error_1/1, error_2/1, iso88591/1, otp_7810/1]). @@ -55,6 +55,8 @@ end_per_testcase(_Case, Config) -> % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, error}, iso88591, otp_7810]. diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index d9535ae3ae..3a955d5764 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -18,7 +18,7 @@ -module(escript_SUITE). -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, basic/1, @@ -38,6 +38,8 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, errors, strange_name, emulator_flags, module_script, beam_script, archive_script, epp, diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 0e605a1407..480883f4a5 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -18,7 +18,7 @@ %% -module(ets_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1, privacy/1,privacy_owner/2]). -export([empty/1,badinsert/1]). @@ -120,6 +120,8 @@ end_per_suite(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, new}, {group, insert}, {group, lookup}, {group, delete}, firstnext, firstnext_concurrent, slot, diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index ef14403b0c..31e1585975 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -17,12 +17,14 @@ %% %CopyrightEnd% %% -module(ets_tough_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,ex1/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,ex1/1]). -export([init/1,terminate/2,handle_call/3,handle_info/2]). -export([init_per_testcase/2, end_per_testcase/2]). -compile([export_all]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [ex1]. diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index 050dac989b..27ba60c6a8 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, basic/1, badarg/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1, badarg/1, term_sort/1, term_keysort/1, binary_term_sort/1, binary_term_keysort/1, binary_sort/1, @@ -55,6 +55,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [basic, badarg, term_sort, term_keysort, binary_term_sort, binary_term_keysort, binary_sort, diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index 4df5bc8106..249f399b4a 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -19,7 +19,7 @@ -module(filelib_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, wildcard_one/1,wildcard_two/1,wildcard_errors/1, fold_files/1,otp_5960/1,ensure_dir_eexist/1]). @@ -37,6 +37,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [wildcard_one, wildcard_two, wildcard_errors, fold_files, otp_5960, ensure_dir_eexist]. diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl index e30fe2649c..728c6e9206 100644 --- a/lib/stdlib/test/filename_SUITE.erl +++ b/lib/stdlib/test/filename_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(filename_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([absname/1, absname_2/1, basename_1/1, basename_2/1, dirname/1, extension/1, join/1, t_nativename/1]). @@ -29,6 +29,8 @@ -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [absname, absname_2, basename_1, basename_2, dirname, extension, diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index 8259917c78..57894ab1f7 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -21,7 +21,7 @@ %%%---------------------------------------------------------------------- -module(fixtable_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %%% Test cases -export([multiple_fixes/1, multiple_processes/1, other_process_deletes/1, owner_dies/1, @@ -31,6 +31,8 @@ %%% Internal exports -export([command_loop/0,start_commander/0]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [multiple_fixes, multiple_processes, other_process_deletes, owner_dies, other_process_closes, diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 5304eb2350..932d9b5278 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(format_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([hang_1/1]). @@ -36,6 +36,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [hang_1]. diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index 99caa72f6c..cba210ddc1 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -20,12 +20,14 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, add_handler/1, add_sup_handler/1, delete_handler/1, swap_handler/1, swap_sup_handler/1, notify/1, sync_notify/1, call/1, info/1, hibernate/1, call_format_status/1, error_format_status/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start, {group, test_all}, hibernate, call_format_status, error_format_status]. diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index d487418adb..f97a85f315 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test cases --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([ start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1, start7/1, start8/1, start9/1, start10/1, start11/1]). @@ -53,6 +53,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, start}, {group, abnormal}, shutdown, {group, sys}, hibernate, enter_loop]. diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index 73407ce839..f30d0012ae 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -23,7 +23,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, crash/1, call/1, cast/1, cast_fast/1, info/1, abcast/1, multicall/1, multicall_down/1, call_remote1/1, call_remote2/1, call_remote3/1, @@ -45,6 +45,8 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, format_status/2]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [start, crash, call, cast, cast_fast, info, abcast, multicall, multicall_down, call_remote1, call_remote2, diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 7c49dcdd1b..80c76015f2 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("kernel/include/file.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, id_transform/1]). -export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1, @@ -31,6 +31,8 @@ -hej(hopp). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [id_transform]. diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 91d1143545..19664922b8 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -18,7 +18,7 @@ %% -module(io_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -54,6 +54,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [error_1, float_g, otp_5403, otp_5813, otp_6230, otp_6282, otp_6354, otp_6495, otp_6517, otp_6502, diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 1c9057a86e..56509881ff 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -19,7 +19,7 @@ -module(io_proto_SUITE). -compile(r12). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -80,6 +80,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [setopts_getopts, unicode_options, unicode_options_gen, binary_options, bc_with_r12, bc_with_r12_gl, diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index aa690c4231..a86666e673 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -30,7 +30,7 @@ -define(default_timeout, ?t:minutes(4)). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -76,6 +76,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, append}, reverse, member, keymember, keysearch_keyfind, keystore, keytake, dropwhile, sort, diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index e39b4b9297..a2aaa1d0cf 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, test/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [test]. diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 0e490d75ad..90b70e3933 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([basic_ets/1]). -export([basic_dbg/1]). -export([from_shell/1]). @@ -48,6 +48,8 @@ end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [from_shell, basic_ets, basic_dbg, records, record_index, multipass, bitsyntax, record_defaults, diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index 9b8a78dfbb..429f1800aa 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -23,7 +23,7 @@ %% %%-define(STANDALONE,1). --export([all/0,groups/0,init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, spawn_opt/1, sp1/0, sp2/0, sp3/1, sp4/2, sp5/1, hibernate/1]). -export([ otp_6345/1]). @@ -43,6 +43,8 @@ -include_lib("test_server/include/test_server.hrl"). -endif. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [crash, {group, sync_start}, spawn_opt, hibernate, {group, tickets}]. diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index d34ceba4e6..2ce5d034aa 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -51,7 +51,7 @@ -include_lib("stdlib/include/ms_transform.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, @@ -119,6 +119,8 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, parse_transform}, {group, evaluation}, {group, table_impls}, {group, join}, {group, tickets}, diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index ed777df0a9..79853b470c 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(queue_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]). @@ -36,6 +36,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [do, to_list, io_test, op_test, error, oops]. diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index ed56f8a8ac..8a284179d4 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(random_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([interval_1/1, seed0/1, seed/1]). @@ -36,6 +36,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [interval_1, seed0, seed]. diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index 9a174f2186..bd2d1d549c 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -18,11 +18,13 @@ %% -module(re_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [pcre, compile_options, run_options, combined_options, replace_autogen, global_capture, replace_input_types, diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index 112e07bcfd..d8ed30b384 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -58,7 +58,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, return_values/1]). init_per_testcase(_Case, Config) when is_list(Config) -> @@ -70,6 +70,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [return_values, select_test]. diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index 54937afb33..18d6170540 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -22,7 +22,7 @@ -module(sets_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,add_element/1,del_element/1, subtract/1,intersection/1,union/1,is_subset/1, is_set/1,fold/1,filter/1, @@ -41,6 +41,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [create, add_element, del_element, subtract, intersection, union, is_subset, is_set, fold, filter, diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index c06bcb18ce..1b46a008a2 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(shell_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([forget/1, records/1, known_bugs/1, otp_5226/1, otp_5327/1, otp_5435/1, otp_5195/1, otp_5915/1, otp_5916/1, @@ -71,6 +71,8 @@ end_per_testcase(_Case, Config) -> ok. -endif. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [forget, records, known_bugs, otp_5226, otp_5327, otp_5435, otp_5195, otp_5915, otp_5916, {group, bits}, diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl index 94ba327f51..0ccd7ec553 100644 --- a/lib/stdlib/test/slave_SUITE.erl +++ b/lib/stdlib/test/slave_SUITE.erl @@ -20,13 +20,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, start_link_nodedown/1, errors/1]). %% Internal exports. -export([fun_init/1, test_errors/1]). -export([timeout_test/1, auth_test/1, rsh_test/1, start_a_slave/3]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [t_start_link, start_link_nodedown, t_start, errors]. diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index fcf006da2b..e2aa5da6f5 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -30,7 +30,7 @@ -define(format(S, A), ok). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([ from_term_1/1, set_1/1, from_sets_1/1, relation_1/1, a_function_1/1, family_1/1, projection/1, @@ -85,6 +85,8 @@ -compile({inline,[{eval,2}]}). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, sofs}, {group, sofs_family}]. diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index 16832a142b..6454cd7b6c 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -28,7 +28,7 @@ -define(application, stdlib). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -38,6 +38,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [[app_test]]. diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index 165eaf5f31..e7da22b5eb 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -40,6 +40,8 @@ %% %% all/1 %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [len, equal, concat, chr_rchr, str_rstr, span_cspan, substr, tokens, chars, copies, words, strip, sub_word, diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 321e21814a..35977b819e 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Testserver specific export --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %% Indirect spawn export -export([init/1]). @@ -54,6 +54,8 @@ %------------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, sup_start}, {group, sup_stop}, child_adm, child_adm_simple, extra_return, child_specs, diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index a7aec23a3d..8bf3c846ed 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(supervisor_bridge_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). -export([client/1,init/1,internal_loop_init/1,terminate/2]). -include_lib("test_server/include/test_server.hrl"). @@ -26,6 +26,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [starting, mini_terminate, mini_die, badstart]. diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index 5d6d0a416c..48071ac24e 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(sys_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). -export([handle_call/3,terminate/2,init/1]). -include_lib("test_server/include/test_server.hrl"). @@ -29,6 +29,8 @@ %% system messages at all. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [log, log_to_file, stats, trace, suspend, install]. diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index b9f4f2cad8..138a209a7a 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -18,7 +18,7 @@ %% -module(tar_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, create_long_names/1, bad_tar/1, errors/1, extract_from_binary/1, extract_from_binary_compressed/1, extract_from_open_file/1, symlinks/1, open_add_close/1, cooked_compressed/1, @@ -27,6 +27,8 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [borderline, atomic, long_names, create_long_names, bad_tar, errors, extract_from_binary, diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl index 87b1495a58..629d0489ed 100644 --- a/lib/stdlib/test/timer_SUITE.erl +++ b/lib/stdlib/test/timer_SUITE.erl @@ -18,7 +18,7 @@ %% -module(timer_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([do_big_test/1]). -export([big_test/1, collect/3, i_t/3, a_t/2]). -export([do_nrev/1, internal_watchdog/2]). @@ -51,6 +51,8 @@ %% amount of load. The test suite should also include tests that test the %% interface of the timer module. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [do_big_test]. diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 8e209eab35..73e57b19d2 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -21,7 +21,7 @@ -module(timer_simple_SUITE). %% external --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, apply_after/1, send_after1/1, @@ -54,6 +54,8 @@ -define(MAXREF, (1 bsl 18)). -define(REFMARG, 30). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [apply_after, send_after1, send_after2, send_after3, exit_after1, exit_after2, kill_after1, kill_after2, diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index b5436696e9..6d6a89c81f 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, utf8_illegal_sequences_bif/1, @@ -38,6 +38,8 @@ end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [utf8_illegal_sequences_bif, utf16_illegal_sequences_bif, random_lists, roundtrips, diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl index 35c21861c1..583e1f96de 100644 --- a/lib/stdlib/test/win32reg_SUITE.erl +++ b/lib/stdlib/test/win32reg_SUITE.erl @@ -18,11 +18,13 @@ %% -module(win32reg_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,long/1,evil_write/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,long/1,evil_write/1]). -export([ostype/1,fini/1]). -include_lib("test_server/include/test_server.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [long, evil_write]. diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index 670c131afb..20b6ca31bc 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -23,13 +23,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, date_1999_01_01/1, date_1999_02_28/1, date_1999_09_09/1, date_2000_01_01/1, date_2000_02_29/1, date_2001_01_01/1, date_2001_02_29/1, date_2004_02_29/1 ]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [date_1999_01_01, date_1999_02_28, date_1999_09_09, date_2000_01_01, date_2000_02_29, date_2001_01_01, diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl index 06228317ce..33d1bae1bc 100644 --- a/lib/stdlib/test/zip_SUITE.erl +++ b/lib/stdlib/test/zip_SUITE.erl @@ -18,7 +18,7 @@ %% -module(zip_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, bad_zip/1, unzip_from_binary/1, unzip_to_binary/1, zip_to_binary/1, unzip_options/1, zip_options/1, list_dir_options/1, aliases/1, @@ -31,6 +31,8 @@ -include_lib("kernel/include/file.hrl"). -include_lib("stdlib/include/zip.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [borderline, atomic, bad_zip, unzip_from_binary, unzip_to_binary, zip_to_binary, unzip_options, diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index 30fb63d57b..e9a70a082a 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -20,11 +20,13 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). %% Test cases -export([smoke_test/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [smoke_test]. diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index aeda99c5fd..5540754270 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -18,7 +18,7 @@ %% -module(cover_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, compile/1, analyse/1, misc/1, stop/1, distribution/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, @@ -37,6 +37,8 @@ %% y %%---------------------------------------------------------------------- +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case whereis(cover_server) of undefined -> diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index 2f118deebe..679795df60 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -63,7 +63,7 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> @@ -78,6 +78,8 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(cprof_SUITE) of true -> [not_run]; diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index fdedcef650..6c67375e53 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -24,7 +24,7 @@ receive_and_save_trace/2, send_trace/2]). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([live_node/1, 'sparc_sunos5.8_32b_emt2.0'/1, @@ -65,6 +65,8 @@ %% %% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case is_debug_compiled() of true -> {skip, "Not run when debug compiled"}; diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index fa5fdf30e4..a24e822305 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -20,7 +20,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0,groups/0,init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). + +suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> [basic, tiny, eed]. diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 5ecb150e09..98033560c3 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server framework exports --export([all/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). %% Test suites -export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1, @@ -54,6 +54,8 @@ +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> case test_server:is_native(fprof_SUITE) of true -> [not_run]; diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index f607dab727..5b13a42143 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -18,7 +18,7 @@ %% -module(instrument_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export(['+Mim true'/1, '+Mis true'/1]). @@ -33,6 +33,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> ['+Mim true', '+Mis true']. diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index eeae182d8e..3de25766fb 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -51,6 +51,8 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [load_v1, conflicts, locations, swap_keys]. diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index d0692c9d6a..a4c9546eb8 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -18,7 +18,7 @@ %% -module(make_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, make_all/1, make_files/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, make_all/1, make_files/1]). -export([otp_6057_init/1, otp_6057_a/1, otp_6057_b/1, otp_6057_c/1, otp_6057_end/1]). @@ -35,6 +35,8 @@ %% that the file :"test5.erl" shall be compiled with the 'S' option, %% i.e. produce "test5.S" instead of "test5." +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [make_all, make_files, otp_6057_a, otp_6057_b, otp_6057_c]. @@ -156,7 +158,7 @@ otp_6057_init(Config) when is_list(Config) -> otp_6057_a(suite) -> []; otp_6057_a(doc) -> - ["Test that make:all/0 looks for object file in correct place"]; + ["Test that make:all/0, suite/0 looks for object file in correct place"]; otp_6057_a(Config) when is_list(Config) -> ?line PrivDir = ?config(priv_dir, Config), diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index 39d22b67cd..f587098a15 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -25,12 +25,14 @@ -define(application, tools). %% Test server specific exports --export([all/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([app_test/1]). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [app_test]. diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index 7ce77b94c5..9d5597447e 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -36,7 +36,7 @@ -define(copydir, ?config(copy_dir, Conf)). -endif. --export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1]). -export([ addrem/1, convert/1, intergraph/1, lines/1, loops/1, @@ -68,6 +68,8 @@ -include_lib("tools/src/xref.hrl"). +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [{group, xref}, {group, files}, {group, analyses}, {group, misc}]. diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index c34069af6b..32b872c88e 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -47,6 +47,8 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [fields, modules, exportall, app_depend, undef_funcs]. diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index ed40566749..85e3dee315 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_basic_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -43,6 +43,8 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [create_window, several_apps, wx_api, wx_misc, data_types]. diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 3c35925ba3..6693587b5e 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(wx_class_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -44,6 +44,8 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [calendarCtrl, treeCtrl, notebook, staticBoxSizer, clipboard, helpFrame, htmlWindow, listCtrlSort, diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index a8260f22de..dd2ca4b4dc 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_event_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,6 +42,8 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [connect, disconnect, connect_msg_20, connect_cb_20, mouse_on_grid, spin_event, connect_in_callback]. diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 59252381cb..87de58bfa8 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -22,7 +22,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_opengl_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -50,6 +50,8 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [canvas, glu_tesselation]. diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index 7f6d18fd41..b554d44b59 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -23,7 +23,7 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). --export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -43,6 +43,8 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification +suite() -> [{suite_callbacks,[ts_install_scb]}]. + all() -> [destroy_app, multiple_add_in_sizer, app_dies, menu_item_debug]. -- cgit v1.2.3 From 8fd1f31f3074bc9444a0769418506b1ccc2041d3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 11:35:13 +0100 Subject: Add init_per_suite and end_per_suite --- erts/emulator/test/a_SUITE.erl | 8 +++++++- erts/emulator/test/after_SUITE.erl | 8 +++++++- erts/emulator/test/alloc_SUITE.erl | 8 +++++++- erts/emulator/test/beam_SUITE.erl | 8 +++++++- erts/emulator/test/beam_literals_SUITE.erl | 8 +++++++- erts/emulator/test/bif_SUITE.erl | 8 +++++++- erts/emulator/test/big_SUITE.erl | 8 +++++++- erts/emulator/test/binary_SUITE.erl | 8 +++++++- erts/emulator/test/bs_bincomp_SUITE.erl | 8 +++++++- erts/emulator/test/bs_bit_binaries_SUITE.erl | 8 +++++++- erts/emulator/test/bs_construct_SUITE.erl | 8 +++++++- erts/emulator/test/bs_match_bin_SUITE.erl | 8 +++++++- erts/emulator/test/bs_match_int_SUITE.erl | 8 +++++++- erts/emulator/test/bs_match_misc_SUITE.erl | 8 +++++++- erts/emulator/test/bs_match_tail_SUITE.erl | 8 +++++++- erts/emulator/test/bs_utf_SUITE.erl | 8 +++++++- erts/emulator/test/busy_port_SUITE.erl | 8 +++++++- erts/emulator/test/call_trace_SUITE.erl | 8 +++++++- erts/emulator/test/code_SUITE.erl | 8 +++++++- erts/emulator/test/crypto_SUITE.erl | 8 +++++++- erts/emulator/test/ddll_SUITE.erl | 8 +++++++- erts/emulator/test/decode_packet_SUITE.erl | 8 +++++++- erts/emulator/test/distribution_SUITE.erl | 8 +++++++- erts/emulator/test/driver_SUITE.erl | 8 +++++++- erts/emulator/test/efile_SUITE.erl | 8 +++++++- erts/emulator/test/erl_drv_thread_SUITE.erl | 8 +++++++- erts/emulator/test/erl_link_SUITE.erl | 8 +++++++- erts/emulator/test/erts_debug_SUITE.erl | 8 +++++++- erts/emulator/test/estone_SUITE.erl | 8 +++++++- erts/emulator/test/evil_SUITE.erl | 8 +++++++- erts/emulator/test/exception_SUITE.erl | 8 +++++++- erts/emulator/test/float_SUITE.erl | 8 +++++++- erts/emulator/test/fun_SUITE.erl | 8 +++++++- erts/emulator/test/fun_r12_SUITE.erl | 8 +++++++- erts/emulator/test/gc_SUITE.erl | 8 +++++++- erts/emulator/test/guard_SUITE.erl | 8 +++++++- erts/emulator/test/hash_SUITE.erl | 8 +++++++- erts/emulator/test/hibernate_SUITE.erl | 8 +++++++- erts/emulator/test/list_bif_SUITE.erl | 8 +++++++- erts/emulator/test/match_spec_SUITE.erl | 8 +++++++- erts/emulator/test/module_info_SUITE.erl | 8 +++++++- erts/emulator/test/monitor_SUITE.erl | 8 +++++++- erts/emulator/test/nested_SUITE.erl | 8 +++++++- erts/emulator/test/nif_SUITE.erl | 8 +++++++- erts/emulator/test/node_container_SUITE.erl | 8 +++++++- erts/emulator/test/nofrag_SUITE.erl | 8 +++++++- erts/emulator/test/num_bif_SUITE.erl | 8 +++++++- erts/emulator/test/old_scheduler_SUITE.erl | 8 +++++++- erts/emulator/test/op_SUITE.erl | 8 +++++++- erts/emulator/test/port_bif_SUITE.erl | 8 +++++++- erts/emulator/test/process_SUITE.erl | 8 +++++++- erts/emulator/test/pseudoknot_SUITE.erl | 8 +++++++- erts/emulator/test/receive_SUITE.erl | 8 +++++++- erts/emulator/test/ref_SUITE.erl | 8 +++++++- erts/emulator/test/register_SUITE.erl | 8 +++++++- erts/emulator/test/save_calls_SUITE.erl | 8 +++++++- erts/emulator/test/scheduler_SUITE.erl | 8 +++++++- erts/emulator/test/send_term_SUITE.erl | 8 +++++++- erts/emulator/test/sensitive_SUITE.erl | 8 +++++++- erts/emulator/test/signal_SUITE.erl | 8 +++++++- erts/emulator/test/statistics_SUITE.erl | 8 +++++++- erts/emulator/test/system_info_SUITE.erl | 8 +++++++- erts/emulator/test/system_profile_SUITE.erl | 8 +++++++- erts/emulator/test/time_SUITE.erl | 8 +++++++- erts/emulator/test/timer_bif_SUITE.erl | 8 +++++++- erts/emulator/test/trace_SUITE.erl | 8 +++++++- erts/emulator/test/trace_bif_SUITE.erl | 8 +++++++- erts/emulator/test/trace_call_count_SUITE.erl | 8 +++++++- erts/emulator/test/trace_call_time_SUITE.erl | 8 +++++++- erts/emulator/test/trace_local_SUITE.erl | 8 +++++++- erts/emulator/test/trace_meta_SUITE.erl | 8 +++++++- erts/emulator/test/trace_nif_SUITE.erl | 8 +++++++- erts/emulator/test/trace_port_SUITE.erl | 8 +++++++- erts/emulator/test/tuple_SUITE.erl | 8 +++++++- erts/emulator/test/z_SUITE.erl | 8 +++++++- erts/epmd/test/epmd_SUITE.erl | 8 +++++++- erts/test/autoimport_SUITE.erl | 8 +++++++- erts/test/erl_print_SUITE.erl | 8 +++++++- erts/test/erlc_SUITE.erl | 8 +++++++- erts/test/erlexec_SUITE.erl | 8 +++++++- erts/test/ethread_SUITE.erl | 8 +++++++- erts/test/nt_SUITE.erl | 8 +++++++- erts/test/run_erl_SUITE.erl | 8 +++++++- erts/test/z_SUITE.erl | 8 +++++++- lib/asn1/test/asn1_SUITE.erl | 6 ++++++ lib/asn1/test/asn1_bin_SUITE.erl | 6 ++++++ lib/asn1/test/asn1_bin_v2_SUITE.erl | 6 ++++++ lib/compiler/test/andor_SUITE.erl | 8 +++++++- lib/compiler/test/apply_SUITE.erl | 8 +++++++- lib/compiler/test/beam_validator_SUITE.erl | 8 +++++++- lib/compiler/test/bs_bincomp_SUITE.erl | 8 +++++++- lib/compiler/test/bs_bit_binaries_SUITE.erl | 8 +++++++- lib/compiler/test/bs_construct_SUITE.erl | 8 +++++++- lib/compiler/test/bs_match_SUITE.erl | 8 +++++++- lib/compiler/test/bs_utf_SUITE.erl | 8 +++++++- lib/compiler/test/compilation_SUITE.erl | 6 ++++++ lib/compiler/test/compile_SUITE.erl | 8 +++++++- lib/compiler/test/core_SUITE.erl | 8 +++++++- lib/compiler/test/core_fold_SUITE.erl | 8 +++++++- lib/compiler/test/error_SUITE.erl | 8 +++++++- lib/compiler/test/float_SUITE.erl | 8 +++++++- lib/compiler/test/fun_SUITE.erl | 8 +++++++- lib/compiler/test/guard_SUITE.erl | 8 +++++++- lib/compiler/test/inline_SUITE.erl | 6 ++++++ lib/compiler/test/lc_SUITE.erl | 8 +++++++- lib/compiler/test/match_SUITE.erl | 8 +++++++- lib/compiler/test/misc_SUITE.erl | 8 +++++++- lib/compiler/test/num_bif_SUITE.erl | 8 +++++++- lib/compiler/test/parteval_SUITE.erl | 8 +++++++- lib/compiler/test/pmod_SUITE.erl | 8 +++++++- lib/compiler/test/receive_SUITE.erl | 8 +++++++- lib/compiler/test/record_SUITE.erl | 8 +++++++- lib/compiler/test/trycatch_SUITE.erl | 8 +++++++- lib/compiler/test/warnings_SUITE.erl | 8 +++++++- lib/cosEvent/test/generated_SUITE.erl | 8 +++++++- lib/cosEventDomain/test/generated_SUITE.erl | 8 +++++++- lib/cosNotification/test/generated_SUITE.erl | 8 +++++++- lib/cosProperty/test/generated_SUITE.erl | 8 +++++++- lib/cosTime/test/generated_SUITE.erl | 8 +++++++- lib/cosTransactions/test/generated_SUITE.erl | 8 +++++++- lib/crypto/test/crypto_SUITE.erl | 8 +++++++- lib/debugger/test/bs_bincomp_SUITE.erl | 8 +++++++- lib/debugger/test/bug_SUITE.erl | 8 +++++++- lib/debugger/test/dbg_ui_SUITE.erl | 8 +++++++- lib/debugger/test/debugger_SUITE.erl | 8 +++++++- lib/debugger/test/erl_eval_SUITE.erl | 8 +++++++- lib/debugger/test/int_SUITE.erl | 8 +++++++- lib/debugger/test/int_break_SUITE.erl | 8 +++++++- lib/debugger/test/int_eval_SUITE.erl | 8 +++++++- lib/docbuilder/test/docb_SUITE.erl | 8 +++++++- lib/edoc/test/edoc_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_accept_SUITE.erl | 10 +++++++++- lib/erl_interface/test/ei_connect_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_decode_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_encode_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_format_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_print_SUITE.erl | 8 +++++++- lib/erl_interface/test/ei_tmo_SUITE.erl | 8 +++++++- lib/erl_interface/test/erl_connect_SUITE.erl | 8 +++++++- lib/erl_interface/test/erl_eterm_SUITE.erl | 8 +++++++- lib/erl_interface/test/erl_ext_SUITE.erl | 8 +++++++- lib/erl_interface/test/erl_format_SUITE.erl | 8 +++++++- lib/erl_interface/test/erl_match_SUITE.erl | 8 +++++++- lib/erl_interface/test/port_call_SUITE.erl | 8 +++++++- lib/eunit/test/eunit_SUITE.erl | 8 +++++++- lib/ic/test/c_client_erl_server_SUITE.erl | 8 +++++++- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 8 +++++++- lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl | 8 +++++++- lib/ic/test/erl_client_c_server_SUITE.erl | 8 +++++++- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 8 +++++++- lib/ic/test/ic_SUITE.erl | 8 +++++++- lib/ic/test/ic_be_SUITE.erl | 8 +++++++- lib/inets/test/ftp_format_SUITE.erl | 8 +++++++- lib/inets/test/http_format_SUITE.erl | 8 +++++++- lib/inets/test/httpc_cookie_SUITE.erl | 8 +++++++- lib/inets/test/tftp_SUITE.erl | 6 ++++++ lib/kernel/test/application_SUITE.erl | 8 +++++++- lib/kernel/test/bif_SUITE.erl | 8 +++++++- lib/kernel/test/disk_log_SUITE.erl | 8 +++++++- lib/kernel/test/erl_boot_server_SUITE.erl | 8 +++++++- lib/kernel/test/erl_distribution_SUITE.erl | 8 +++++++- lib/kernel/test/erl_distribution_wb_SUITE.erl | 8 +++++++- lib/kernel/test/erl_prim_loader_SUITE.erl | 8 +++++++- lib/kernel/test/error_logger_SUITE.erl | 8 +++++++- lib/kernel/test/error_logger_warn_SUITE.erl | 8 +++++++- lib/kernel/test/file_SUITE.erl | 8 +++++++- lib/kernel/test/file_name_SUITE.erl | 7 +++++++ lib/kernel/test/gen_tcp_api_SUITE.erl | 8 +++++++- lib/kernel/test/gen_tcp_echo_SUITE.erl | 8 +++++++- lib/kernel/test/gen_tcp_misc_SUITE.erl | 8 +++++++- lib/kernel/test/gen_udp_SUITE.erl | 8 +++++++- lib/kernel/test/heart_SUITE.erl | 8 +++++++- lib/kernel/test/inet_SUITE.erl | 8 +++++++- lib/kernel/test/inet_res_SUITE.erl | 8 +++++++- lib/kernel/test/inet_sockopt_SUITE.erl | 8 +++++++- lib/kernel/test/init_SUITE.erl | 8 +++++++- lib/kernel/test/interactive_shell_SUITE.erl | 8 +++++++- lib/kernel/test/kernel_SUITE.erl | 8 +++++++- lib/kernel/test/os_SUITE.erl | 16 ++++++++++------ lib/kernel/test/pdict_SUITE.erl | 8 +++++++- lib/kernel/test/pg2_SUITE.erl | 8 +++++++- lib/kernel/test/prim_file_SUITE.erl | 8 +++++++- lib/kernel/test/ram_file_SUITE.erl | 8 +++++++- lib/kernel/test/rpc_SUITE.erl | 8 +++++++- lib/kernel/test/seq_trace_SUITE.erl | 8 +++++++- lib/kernel/test/wrap_log_reader_SUITE.erl | 8 +++++++- lib/kernel/test/zlib_SUITE.erl | 6 ++++++ lib/megaco/test/megaco_SUITE.erl | 6 ++++++ lib/observer/test/etop_SUITE.erl | 8 +++++++- lib/observer/test/observer_SUITE.erl | 8 +++++++- lib/observer/test/ttb_SUITE.erl | 8 +++++++- lib/orber/test/cdrlib_SUITE.erl | 8 +++++++- lib/orber/test/data_types_SUITE.erl | 8 +++++++- lib/orber/test/generated_SUITE.erl | 8 +++++++- lib/orber/test/interceptors_SUITE.erl | 8 +++++++- lib/orber/test/iop_ior_10_SUITE.erl | 8 +++++++- lib/orber/test/iop_ior_11_SUITE.erl | 8 +++++++- lib/orber/test/iop_ior_12_SUITE.erl | 8 +++++++- lib/orber/test/lname_SUITE.erl | 8 +++++++- lib/orber/test/orber_SUITE.erl | 8 +++++++- lib/orber/test/orber_web_SUITE.erl | 8 +++++++- lib/orber/test/tc_SUITE.erl | 8 +++++++- lib/os_mon/test/os_mon_SUITE.erl | 8 +++++++- lib/parsetools/test/leex_SUITE.erl | 8 +++++++- lib/parsetools/test/yecc_SUITE.erl | 8 +++++++- lib/runtime_tools/test/dbg_SUITE.erl | 8 +++++++- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 8 +++++++- lib/runtime_tools/test/runtime_tools_SUITE.erl | 8 +++++++- lib/snmp/test/snmp_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_active_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_active_once_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_misc_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_passive_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_protocol_SUITE.erl | 8 +++++++- lib/ssl/test/old_ssl_verify_SUITE.erl | 8 +++++++- lib/ssl/test/old_transport_accept_SUITE.erl | 8 +++++++- lib/stdlib/test/array_SUITE.erl | 8 +++++++- lib/stdlib/test/base64_SUITE.erl | 8 +++++++- lib/stdlib/test/beam_lib_SUITE.erl | 8 +++++++- lib/stdlib/test/binary_module_SUITE.erl | 8 +++++++- lib/stdlib/test/c_SUITE.erl | 8 +++++++- lib/stdlib/test/calendar_SUITE.erl | 8 +++++++- lib/stdlib/test/dets_SUITE.erl | 8 +++++++- lib/stdlib/test/dict_SUITE.erl | 8 +++++++- lib/stdlib/test/digraph_SUITE.erl | 8 +++++++- lib/stdlib/test/digraph_utils_SUITE.erl | 8 +++++++- lib/stdlib/test/edlin_expand_SUITE.erl | 8 +++++++- lib/stdlib/test/epp_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_eval_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_expand_records_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_internal_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_lint_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_pp_SUITE.erl | 8 +++++++- lib/stdlib/test/erl_scan_SUITE.erl | 8 +++++++- lib/stdlib/test/escript_SUITE.erl | 8 +++++++- lib/stdlib/test/ets_SUITE.erl | 8 +++++++- lib/stdlib/test/ets_tough_SUITE.erl | 8 +++++++- lib/stdlib/test/file_sorter_SUITE.erl | 8 +++++++- lib/stdlib/test/filelib_SUITE.erl | 8 +++++++- lib/stdlib/test/filename_SUITE.erl | 8 +++++++- lib/stdlib/test/fixtable_SUITE.erl | 8 +++++++- lib/stdlib/test/format_SUITE.erl | 8 +++++++- lib/stdlib/test/gen_event_SUITE.erl | 8 +++++++- lib/stdlib/test/gen_fsm_SUITE.erl | 8 +++++++- lib/stdlib/test/gen_server_SUITE.erl | 8 +++++++- lib/stdlib/test/id_transform_SUITE.erl | 8 +++++++- lib/stdlib/test/io_SUITE.erl | 8 +++++++- lib/stdlib/test/io_proto_SUITE.erl | 8 +++++++- lib/stdlib/test/lists_SUITE.erl | 8 +++++++- lib/stdlib/test/log_mf_h_SUITE.erl | 8 +++++++- lib/stdlib/test/ms_transform_SUITE.erl | 8 +++++++- lib/stdlib/test/proc_lib_SUITE.erl | 8 +++++++- lib/stdlib/test/qlc_SUITE.erl | 8 +++++++- lib/stdlib/test/queue_SUITE.erl | 8 +++++++- lib/stdlib/test/random_SUITE.erl | 8 +++++++- lib/stdlib/test/re_SUITE.erl | 8 +++++++- lib/stdlib/test/select_SUITE.erl | 8 +++++++- lib/stdlib/test/sets_SUITE.erl | 8 +++++++- lib/stdlib/test/shell_SUITE.erl | 8 +++++++- lib/stdlib/test/slave_SUITE.erl | 8 +++++++- lib/stdlib/test/sofs_SUITE.erl | 8 +++++++- lib/stdlib/test/stdlib_SUITE.erl | 8 +++++++- lib/stdlib/test/string_SUITE.erl | 8 +++++++- lib/stdlib/test/supervisor_SUITE.erl | 8 +++++++- lib/stdlib/test/supervisor_bridge_SUITE.erl | 8 +++++++- lib/stdlib/test/sys_SUITE.erl | 8 +++++++- lib/stdlib/test/tar_SUITE.erl | 8 +++++++- lib/stdlib/test/timer_SUITE.erl | 8 +++++++- lib/stdlib/test/timer_simple_SUITE.erl | 8 +++++++- lib/stdlib/test/unicode_SUITE.erl | 8 +++++++- lib/stdlib/test/win32reg_SUITE.erl | 8 +++++++- lib/stdlib/test/y2k_SUITE.erl | 8 +++++++- lib/stdlib/test/zip_SUITE.erl | 8 +++++++- lib/syntax_tools/test/syntax_tools_SUITE.erl | 8 +++++++- lib/tools/test/cover_SUITE.erl | 8 +++++++- lib/tools/test/cprof_SUITE.erl | 8 +++++++- lib/tools/test/eprof_SUITE.erl | 8 +++++++- lib/tools/test/fprof_SUITE.erl | 8 +++++++- lib/tools/test/instrument_SUITE.erl | 8 +++++++- lib/tools/test/make_SUITE.erl | 8 +++++++- lib/tools/test/tools_SUITE.erl | 8 +++++++- lib/tools/test/xref_SUITE.erl | 8 +++++++- lib/wx/test/wx_app_SUITE.erl | 6 ++++++ 285 files changed, 1991 insertions(+), 280 deletions(-) diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl index 85166761cf..a52777a7e1 100644 --- a/erts/emulator/test/a_SUITE.erl +++ b/erts/emulator/test/a_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -38,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl index 5748d6ee75..95fc8c22b8 100644 --- a/erts/emulator/test/after_SUITE.erl +++ b/erts/emulator/test/after_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, receive_after_errors/1, receive_var_zero/1, receive_zero/1, multi_timeout/1, receive_after_32bit/1]). @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl index ed7d6ede71..98f282f9cd 100644 --- a/erts/emulator/test/alloc_SUITE.erl +++ b/erts/emulator/test/alloc_SUITE.erl @@ -18,7 +18,7 @@ -module(alloc_SUITE). -author('rickard.green@uab.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([basic/1, coalesce/1, @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 416ca00aa4..8fd1c8a5be 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -19,7 +19,7 @@ -module(beam_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1, select_val/1]). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 622c8dbfac..a9154f117b 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_literals_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([putting/1, matching_smalls/1, matching_smalls_jt/1, matching_bigs/1, matching_more_bigs/1, matching_bigs_and_smalls/1, badmatch/1, case_clause/1, @@ -40,6 +40,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 6dff106bd2..7313d25c8e 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, types/1, t_list_to_existing_atom/1,os_env/1,otp_7526/1, binary_to_atom/1,binary_to_existing_atom/1, @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index 1d70c6c08f..a42d91ef13 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -19,7 +19,7 @@ -module(big_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([t_div/1, eq_28/1, eq_32/1, eq_big/1, eq_math/1, big_literals/1, borders/1, negative/1, big_float_1/1, big_float_2/1, shift_limit_1/1, powmod/1, system_limit/1, otp_6692/1]). @@ -44,6 +44,12 @@ all() -> groups() -> [{big_float, [], [big_float_1, big_float_2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index e5e7162fe3..cd9e8c71fc 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -42,7 +42,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, copy_terms/1, conversions/1, deep_lists/1, deep_bitstr_lists/1, bad_list_to_binary/1, bad_binary_to_list/1, t_split_binary/1, bad_split/1, t_concat_binary/1, @@ -78,6 +78,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl index cb8be7aedf..51412d2e4f 100644 --- a/erts/emulator/test/bs_bincomp_SUITE.erl +++ b/erts/emulator/test/bs_bincomp_SUITE.erl @@ -22,7 +22,7 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,tracing/1]). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl index 357e606629..4216ff0325 100644 --- a/erts/emulator/test/bs_bit_binaries_SUITE.erl +++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl @@ -22,7 +22,7 @@ -module(bs_bit_binaries_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -41,6 +41,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 498c675b85..9c2e67ce65 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_construct_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, mem_leak/1, coerce_to_float/1, bjorn/1, @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl index fef8d41298..b60e735ae4 100644 --- a/erts/emulator/test/bs_match_bin_SUITE.erl +++ b/erts/emulator/test/bs_match_bin_SUITE.erl @@ -19,7 +19,7 @@ -module(bs_match_bin_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). -include_lib("test_server/include/test_server.hrl"). @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl index fe60c91a20..cb3cd89e3a 100644 --- a/erts/emulator/test/bs_match_int_SUITE.erl +++ b/erts/emulator/test/bs_match_int_SUITE.erl @@ -18,7 +18,7 @@ -module(bs_match_int_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, match_huge_int/1,bignum/1,unaligned_32_bit/1]). -include_lib("test_server/include/test_server.hrl"). @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl index 07bfc92140..a32a530e80 100644 --- a/erts/emulator/test/bs_match_misc_SUITE.erl +++ b/erts/emulator/test/bs_match_misc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(bs_match_misc_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, kenneth/1,encode_binary/1,native/1,happi/1, size_var/1,wiger/1,x0_context/1,huge_float_field/1, writable_binary_matched/1,otp_7198/1]). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl index 59157e413e..02709d7c3e 100644 --- a/erts/emulator/test/bs_match_tail_SUITE.erl +++ b/erts/emulator/test/bs_match_tail_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,6 +32,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl index 14f246ee2c..a72afd0d7c 100644 --- a/erts/emulator/test/bs_utf_SUITE.erl +++ b/erts/emulator/test/bs_utf_SUITE.erl @@ -19,7 +19,7 @@ -module(bs_utf_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, utf8_roundtrip/1,utf16_roundtrip/1,utf32_roundtrip/1, utf8_illegal_sequences/1,utf16_illegal_sequences/1, utf32_illegal_sequences/1, @@ -47,6 +47,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index f4a0bfde00..4d11fe1377 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -19,7 +19,7 @@ -module(busy_port_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, system_monitor/1, no_trap_exit/1, no_trap_exit_unlinked/1, trap_exit/1, multiple_writers/1, hard_busy_driver/1, soft_busy_driver/1]). @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl index 670e30e641..9cfc9364df 100644 --- a/erts/emulator/test/call_trace_SUITE.erl +++ b/erts/emulator/test/call_trace_SUITE.erl @@ -20,7 +20,7 @@ -module(call_trace_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, hipe/1,process_specs/1,basic/1,flags/1,errors/1,pam/1,change_pam/1, return_trace/1,exception_trace/1,on_load/1,deep_exception/1, exception_nocatch/1,bit_syntax/1]). @@ -55,6 +55,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 38f426efd4..986ad02074 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -18,7 +18,7 @@ %% -module(code_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, new_binary_types/1,t_check_process_code/1,t_check_process_code_ets/1, external_fun/1,get_chunk/1,module_md5/1,make_stub/1, make_stub_many_funs/1,constant_pools/1, @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl index e9cd41c312..057f44a041 100644 --- a/erts/emulator/test/crypto_SUITE.erl +++ b/erts/emulator/test/crypto_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_md5/1,t_md5_update/1,error/1,unaligned_context/1,random_lists/1, misc_errors/1]). @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl index fd1eff5a1e..3eeffba418 100644 --- a/erts/emulator/test/ddll_SUITE.erl +++ b/erts/emulator/test/ddll_SUITE.erl @@ -30,7 +30,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, ddll_test/1, errors/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, ddll_test/1, errors/1, reference_count/1, kill_port/1, dont_kill_port/1]). -export([unload_on_process_exit/1, delayed_unload_with_ports/1, @@ -71,6 +71,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 93b095206b..aac08b5f63 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 93423fa952..8f0eaf2aa2 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, ping/1, bulk_send_small/1, bulk_send_big/1, bulk_send_bigbig/1, local_send_small/1, local_send_big/1, @@ -75,6 +75,12 @@ groups() -> [bad_dist_ext_receive, bad_dist_ext_process_info, bad_dist_ext_control, bad_dist_ext_connection_id]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 62a3fbcce2..46732d4d05 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -27,7 +27,7 @@ %%% - queueing -module(driver_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, @@ -156,6 +156,12 @@ groups() -> ioq_exit_ready_input_async, ioq_exit_ready_output_async, ioq_exit_timeout_async, ioq_exit_event_async]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl index 5b6b35ae32..a91aa8c16a 100644 --- a/erts/emulator/test/efile_SUITE.erl +++ b/erts/emulator/test/efile_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(efile_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([iter_max_files/1]). -include_lib("test_server/include/test_server.hrl"). @@ -30,6 +30,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl index 685cbda728..d68891f3b0 100644 --- a/erts/emulator/test/erl_drv_thread_SUITE.erl +++ b/erts/emulator/test/erl_drv_thread_SUITE.erl @@ -19,7 +19,7 @@ -module(erl_drv_thread_SUITE). -author('rickard.s.green@ericsson.com'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([basic/1, rwlock/1, tsd/1]). @@ -35,6 +35,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index 1cb6eb2e39..81e3f6baa2 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -30,7 +30,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). % Test cases -export([links/1, @@ -88,6 +88,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index fc68632e80..1188341127 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -20,7 +20,7 @@ -module(erts_debug_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, flat_size/1,flat_size_big/1,df/1, instructions/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index 66efeed331..c6994612d2 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -18,7 +18,7 @@ -module(estone_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,estone/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,estone/1]). -export([init_per_testcase/2, fin_per_testcase/2]). %% Internal exports for EStone tests @@ -81,6 +81,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index 1c75edc466..031387fc82 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -18,7 +18,7 @@ -module(evil_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, heap_frag/1, encode_decode_ext/1, decode_integer_ext/1, @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl index 24252be176..740c5f2cab 100644 --- a/erts/emulator/test/exception_SUITE.erl +++ b/erts/emulator/test/exception_SUITE.erl @@ -19,7 +19,7 @@ -module(exception_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, stacktrace/1, nested_stacktrace/1, raise/1, gunilla/1, per/1, exception_with_heap_frag/1]). @@ -38,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl index 46ff8ff192..41f7395a9e 100644 --- a/erts/emulator/test/float_SUITE.erl +++ b/erts/emulator/test/float_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, fpe/1,fp_drv/1,fp_drv_thread/1,denormalized/1,match/1, bad_float_unpack/1]). -export([otp_7178/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index b8be503b71..cfb4d59f39 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -22,7 +22,7 @@ -define(default_timeout, ?t:minutes(1)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bad_apply/1,bad_fun_call/1,badarity/1,ext_badarity/1, equality/1,ordering/1, fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1, @@ -45,6 +45,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/fun_r12_SUITE.erl b/erts/emulator/test/fun_r12_SUITE.erl index 05fc1af4be..1faa8bfa1b 100644 --- a/erts/emulator/test/fun_r12_SUITE.erl +++ b/erts/emulator/test/fun_r12_SUITE.erl @@ -20,7 +20,7 @@ -module(fun_r12_SUITE). -compile(r12). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). -define(default_timeout, ?t:minutes(1)). -include_lib("test_server/include/test_server.hrl"). @@ -33,6 +33,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl index 1f944e79fa..7aa1a40371 100644 --- a/erts/emulator/test/gc_SUITE.erl +++ b/erts/emulator/test/gc_SUITE.erl @@ -22,7 +22,7 @@ -module(gc_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -define(default_timeout, ?t:minutes(10)). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl index b0f4530557..e316daec92 100644 --- a/erts/emulator/test/guard_SUITE.erl +++ b/erts/emulator/test/guard_SUITE.erl @@ -19,7 +19,7 @@ -module(guard_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, type_tests/1,guard_bif_binary_part/1]). -include_lib("test_server/include/test_server.hrl"). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl index 7dd4e23e9f..49ab9a3cb1 100644 --- a/erts/emulator/test/hash_SUITE.erl +++ b/erts/emulator/test/hash_SUITE.erl @@ -69,7 +69,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, test_phash2/1,otp_5292/1,bit_level_binaries/1,otp_7127/1, fin_per_testcase/2,init_per_testcase/2]). init_per_testcase(_Case, Config) -> @@ -89,6 +89,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index f6f553eb40..0b1151a7fa 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,min_heap_size/1,bad_args/1, messages_in_queue/1,undefined_mfa/1, no_heap/1]). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 412b31c44c..46141c72a8 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -20,7 +20,7 @@ -module(list_bif_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([hd_test/1,tl_test/1,t_length/1,t_list_to_pid/1, t_list_to_float/1,t_list_to_integer/1]). @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index c475a1bb05..8ff8925981 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -19,7 +19,7 @@ -module(match_spec_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1]). -export([test_1/1, test_2/1, test_3/1, bad_match_spec_bin/1, trace_control_word/1, silent/1, silent_no_ms/1, ms_trace2/1, ms_trace3/1, boxed_and_small/1, @@ -63,6 +63,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index d881c02e4a..3e1682d97e 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, exports/1,functions/1,native/1]). %%-compile(native). @@ -37,6 +37,12 @@ modules(). groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl index ee2082991d..c5950a6bab 100644 --- a/erts/emulator/test/monitor_SUITE.erl +++ b/erts/emulator/test/monitor_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, case_1/1, case_1a/1, case_2/1, case_2a/1, mon_e_1/1, demon_e_1/1, demon_1/1, demon_2/1, demon_3/1, demonitor_flush/1, local_remove_monitor/1, remote_remove_monitor/1, mon_1/1, mon_2/1, @@ -43,6 +43,12 @@ groups() -> [{remove_monitor, [], [local_remove_monitor, remote_remove_monitor]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl index a8b6018c45..8a69ee6859 100644 --- a/erts/emulator/test/nested_SUITE.erl +++ b/erts/emulator/test/nested_SUITE.erl @@ -19,7 +19,7 @@ -module(nested_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,6 +32,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 991fbce96f..1ac3e7f4e7 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, %%init_per_testcase/2, fin_per_testcase/2, basic/1, reload/1, upgrade/1, heap_frag/1, types/1, many_args/1, binaries/1, get_string/1, get_atom/1, api_macros/1, @@ -61,6 +61,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index ca90934421..0955c70cfc 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, node_container_refc_check/1]). -export([term_to_binary_to_term_eq/1, @@ -67,6 +67,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl index 6898c7c75b..62ab123c01 100644 --- a/erts/emulator/test/nofrag_SUITE.erl +++ b/erts/emulator/test/nofrag_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, error_handler/1,error_handler_apply/1, error_handler_fixed_apply/1,error_handler_fun/1, error_handler_tuple_fun/1, @@ -40,6 +40,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index 25f63f6fe1..b51ee01a5c 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -31,7 +31,7 @@ %% round/1 %% trunc/1 --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, @@ -48,6 +48,12 @@ groups() -> [{t_list_to_float, [], [t_list_to_float_safe, t_list_to_float_risky]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl index f8f62bd7b6..fb9e9dcd64 100644 --- a/erts/emulator/test/old_scheduler_SUITE.erl +++ b/erts/emulator/test/old_scheduler_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([equal/1, many_low/1, few_low/1, max/1, high/1]). -define(default_timeout, ?t:minutes(11)). @@ -42,6 +42,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl index 17929cfbd1..bea851e141 100644 --- a/erts/emulator/test/op_SUITE.erl +++ b/erts/emulator/test/op_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, bsl_bsr/1,logical/1,t_not/1,relop_simple/1,relop/1,complex_relop/1]). -export([]). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl index 32dc280956..0489572221 100644 --- a/erts/emulator/test/port_bif_SUITE.erl +++ b/erts/emulator/test/port_bif_SUITE.erl @@ -20,7 +20,7 @@ -module(port_bif_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, command/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, command/1, command_e_1/1, command_e_2/1, command_e_3/1, command_e_4/1, port_info1/1, port_info2/1, connect/1, control/1, echo_to_busy/1]). @@ -42,6 +42,12 @@ groups() -> [command_e_1, command_e_2, command_e_3, command_e_4]}, {port_info, [], [port_info1, port_info2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index d31a4fe954..e057f19e46 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -29,7 +29,7 @@ -define(heap_binary_size, 64). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, spawn_with_binaries/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, spawn_with_binaries/1, t_exit_1/1, t_exit_2_other/1, t_exit_2_other_normal/1, self_exit/1, normal_suicide_exit/1, abnormal_suicide_exit/1, t_exit_2_catch/1, trap_exit_badarg/1, trap_exit_badarg_in_bif/1, @@ -85,6 +85,12 @@ groups() -> [otp_7738_waiting, otp_7738_suspended, otp_7738_resume]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index 8d7c88e49b..73d0a9ff2c 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -19,7 +19,7 @@ -module(pseudoknot_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,test/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -29,6 +29,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl index faaa3a19ad..1d7394b817 100644 --- a/erts/emulator/test/receive_SUITE.erl +++ b/erts/emulator/test/receive_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, call_with_huge_message_queue/1,receive_in_between/1]). -export([init_per_testcase/2,fin_per_testcase/2]). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl index 6596cbda26..fbf51b2397 100644 --- a/erts/emulator/test/ref_SUITE.erl +++ b/erts/emulator/test/ref_SUITE.erl @@ -19,7 +19,7 @@ -module(ref_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). -export([wrap_1/1]). -export([loop_ref/1]). @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl index cfb1ce4f40..a3fa27473e 100644 --- a/erts/emulator/test/register_SUITE.erl +++ b/erts/emulator/test/register_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([otp_8099/1]). @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl index ae1a9e0b43..31faf537b6 100644 --- a/erts/emulator/test/save_calls_SUITE.erl +++ b/erts/emulator/test/save_calls_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([save_calls_1/1,dont_break_reductions/1]). @@ -35,6 +35,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index cc6fba2ff9..1855ec65cb 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -33,7 +33,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). -export([equal/1, few_low/1, @@ -72,6 +72,12 @@ groups() -> [scheduler_bind_types, cpu_topology, update_cpu_info, sct_cmd, sbt_cmd]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl index 5e33f9dae6..11c947f06b 100644 --- a/erts/emulator/test/send_term_SUITE.erl +++ b/erts/emulator/test/send_term_SUITE.erl @@ -19,7 +19,7 @@ -module(send_term_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,basic/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,basic/1]). -export([init_per_testcase/2,fin_per_testcase/2]). -export([generate_external_terms_files/1]). @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl index 8fab014f38..579cdc509d 100644 --- a/erts/emulator/test/sensitive_SUITE.erl +++ b/erts/emulator/test/sensitive_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, stickiness/1,send_trace/1,recv_trace/1,proc_trace/1,call_trace/1, meta_trace/1,running_trace/1,gc_trace/1,seq_trace/1, t_process_info/1,t_process_display/1,save_calls/1]). @@ -49,6 +49,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index 9ff1089453..6e3cab22e2 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -31,7 +31,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). % Test cases -export([xm_sig_order/1, @@ -81,6 +81,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl index 75dedc1c7d..4ad3f37e1b 100644 --- a/erts/emulator/test/statistics_SUITE.erl +++ b/erts/emulator/test/statistics_SUITE.erl @@ -21,7 +21,7 @@ %% Tests the statistics/1 bif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, wall_clock_zero_diff/1, wall_clock_update/1, @@ -60,6 +60,12 @@ groups() -> [runtime_zero_diff, runtime_update, runtime_diff]}, {run_queue, [], [run_queue_one]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index 6bf405ccea..47d96861cd 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -33,7 +33,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1, wordsize/1]). @@ -48,6 +48,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl index 785f132c4a..672b8cbceb 100644 --- a/erts/emulator/test/system_profile_SUITE.erl +++ b/erts/emulator/test/system_profile_SUITE.erl @@ -22,7 +22,7 @@ -module(system_profile_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, system_profile_on_and_off/1, runnable_procs/1, runnable_ports/1, @@ -54,6 +54,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl index e826c9de63..d249e07006 100644 --- a/erts/emulator/test/time_SUITE.erl +++ b/erts/emulator/test/time_SUITE.erl @@ -29,7 +29,7 @@ %% now/0 %% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, bad_univ_to_local/1, bad_local_to_univ/1, consistency/1, now_unique/1, now_update/1, timestamp/1]). @@ -64,6 +64,12 @@ all() -> groups() -> [{now, [], [now_unique, now_update]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index bd03297ad2..b3f7cadc27 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -19,7 +19,7 @@ -module(timer_bif_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). -export([start_timer_1/1, send_after_1/1, send_after_2/1, send_after_3/1, cancel_timer_1/1, start_timer_big/1, send_after_big/1, @@ -57,6 +57,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl index e9b569273a..455a159d57 100644 --- a/erts/emulator/test/trace_SUITE.erl +++ b/erts/emulator/test/trace_SUITE.erl @@ -23,7 +23,7 @@ %%% Tests the trace BIF. %%% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, timeout_trace/1, send_trace/1, procs_trace/1, dist_procs_trace/1, suspend/1, mutual_suspend/1, suspend_exit/1, suspender_exit/1, @@ -56,6 +56,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl index ce7f07b650..485dcc9e73 100644 --- a/erts/emulator/test/trace_bif_SUITE.erl +++ b/erts/emulator/test/trace_bif_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([trace_bif/1, trace_bif_timestamp/1, trace_on_and_off/1, trace_bif_local/1, trace_bif_timestamp_local/1, trace_bif_return/1, not_run/1, trace_info_old_code/1]). @@ -42,6 +42,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl index 5f4c7b1a0b..c78f2ffdc8 100644 --- a/erts/emulator/test/trace_call_count_SUITE.erl +++ b/erts/emulator/test/trace_call_count_SUITE.erl @@ -62,7 +62,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, combo/1]). @@ -90,6 +90,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 12a9b0e7d9..31bd7dd9c0 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -60,7 +60,7 @@ -include_lib("test_server/include/test_server.hrl"). %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, scheduling/1, called_function/1, combo/1, bif/1, nif/1]). @@ -92,6 +92,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index 92383baf4b..ceffcb4b40 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -68,7 +68,7 @@ config(priv_dir,_) -> %%% When run in test server %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, return/1, on_and_off/1, stack_grow/1,info/1, delete/1, exception/1, exception_apply/1, exception_function/1, exception_apply_function/1, @@ -111,6 +111,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index 73b183b85c..6ab29fe2a6 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -65,7 +65,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). -export([basic/1, return/1, on_and_off/1, stack_grow/1, info/1, tracer/1, combo/1, nosilent/1]). @@ -91,6 +91,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 79f445fec7..6a96e35c51 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([trace_nif/1, trace_nif_timestamp/1, trace_nif_local/1, @@ -46,6 +46,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl index b32015803b..640f67f3ca 100644 --- a/erts/emulator/test/trace_port_SUITE.erl +++ b/erts/emulator/test/trace_port_SUITE.erl @@ -20,7 +20,7 @@ -module(trace_port_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, call_trace/1, return_trace/1, send/1, @@ -52,6 +52,12 @@ test_cases(). groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index 52ead630b9..3fe0f18376 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(tuple_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, t_list_to_tuple/1, t_tuple_to_list/1, t_make_tuple_2/1, t_make_tuple_3/1, t_append_element/1, build_and_match/1, tuple_with_case/1, tuple_in_guard/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl index 96db813039..476ac18566 100644 --- a/erts/emulator/test/z_SUITE.erl +++ b/erts/emulator/test/z_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([schedulers_alive/1, node_container_refc_check/1, long_timers/1, pollset_size/1, @@ -49,6 +49,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index ff4c1a099b..d7b0806b95 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -35,7 +35,7 @@ -record(node_info, {port, node_type, prot, lvsn, hvsn, node_name, extra}). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export( [ @@ -120,6 +120,12 @@ groups() -> [{buffer_overrun, [], [buffer_overrun_1, buffer_overrun_2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl index eb23ef46b9..8c4d2ac2d0 100644 --- a/erts/test/autoimport_SUITE.erl +++ b/erts/test/autoimport_SUITE.erl @@ -20,7 +20,7 @@ -module(autoimport_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). -define(TEST_TIMEOUT, ?t:seconds(180)). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl index e598027885..5820ae6aad 100644 --- a/erts/test/erl_print_SUITE.erl +++ b/erts/test/erl_print_SUITE.erl @@ -32,7 +32,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([erlang_display/1, integer/1, float/1, string/1, character/1, snprintf/1, quote/1]). @@ -46,6 +46,12 @@ test_cases(). groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index 973fbad6e9..0dcf712638 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -20,7 +20,7 @@ %% Tests the erlc command by compiling various types of files. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, compile_erl/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, compile_erl/1, compile_yecc/1, compile_script/1, compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]). @@ -35,6 +35,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl index 785c788603..f9b7a07069 100644 --- a/erts/test/erlexec_SUITE.erl +++ b/erts/test/erlexec_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(1)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([args_file/1, evil_args_file/1, env/1, args_file_env/1, otp_7461/1, otp_7461_remote/1, otp_8209/1, zdbbl_dist_buf_busy_limit/1]). @@ -60,6 +60,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl index dfce951c80..a44b34f317 100644 --- a/erts/test/ethread_SUITE.erl +++ b/erts/test/ethread_SUITE.erl @@ -31,7 +31,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([create_join_thread/1, equal_tids/1, @@ -62,6 +62,12 @@ tests(). groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl index fc073067f1..833275009f 100644 --- a/erts/test/nt_SUITE.erl +++ b/erts/test/nt_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, middleman/1,service_basic/1, service_env/1, user_env/1, synced/1, service_prio/1, logout/1, debug/1, restart/1, restart_always/1,stopaction/1, @@ -45,6 +45,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index e541e884df..9ddb9d0084 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -19,7 +19,7 @@ -module(run_erl_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, basic/1,heavy/1,heavier/1,defunct/1]). -export([ping_me_back/1]). @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index 8421982961..8ed79c04ce 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -35,7 +35,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). -export([search_for_core_files/1, core_files/1]). @@ -59,6 +59,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index f0aa8e5697..4ea4260458 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -125,6 +125,12 @@ groups() -> {app_test, [], [{asn1_app_test, all}]}, {appup_test, [], [{asn1_appup_test, all}]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl index f3e075e63d..cb727e7186 100644 --- a/lib/asn1/test/asn1_bin_SUITE.erl +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -123,6 +123,12 @@ groups() -> [ber_choiceinseq, ber_optional, ber_optional_keyed_list, ber_other]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl index d2a70f72e7..08a6e4cb08 100644 --- a/lib/asn1/test/asn1_bin_v2_SUITE.erl +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -123,6 +123,12 @@ groups() -> [ber_choiceinseq, ber_optional, ber_optional_keyed_list, ber_other]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index d9272b3f2e..01561fc7e6 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -18,7 +18,7 @@ %% -module(andor_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1,before_and_inside_if/1]). @@ -34,6 +34,12 @@ test_lib:recompile(andor_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index cd55bcf96b..dfb061e0f7 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -18,7 +18,7 @@ %% -module(apply_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). -export([foo/0,bar/1,baz/2]). @@ -33,6 +33,12 @@ test_lib:recompile(apply_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 7efee6f5ab..a2b42d8446 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -18,7 +18,7 @@ %% -module(beam_validator_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, beam_files/1,compiler_bug/1,stupid_but_valid/1, xrange/1,yrange/1,stack/1,call_last/1,merge_undefined/1, uninit/1,unsafe_catch/1, @@ -57,6 +57,12 @@ test_lib:recompile(beam_validator_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl index 5509e8f786..830492c482 100644 --- a/lib/compiler/test/bs_bincomp_SUITE.erl +++ b/lib/compiler/test/bs_bincomp_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1, nomatch/1,sizes/1,tail/1]). @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index ac738af59e..8dbd6dbb33 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -21,7 +21,7 @@ -module(bs_bit_binaries_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -41,6 +41,12 @@ test_lib:recompile(bs_bit_binaries_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index ab87da5231..5d7ec4f1bd 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -23,7 +23,7 @@ -module(bs_construct_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, two/1,test1/1,fail/1,float_bin/1,in_guard/1,in_catch/1, nasty_literals/1,coerce_to_float/1,side_effect/1, opt/1,otp_7556/1,float_arith/1,otp_8054/1]). @@ -41,6 +41,12 @@ test_lib:recompile(bs_construct_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 4b74ddc749..b5537adbbb 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -20,7 +20,7 @@ -module(bs_match_SUITE). -compile(nowarn_shadow_vars). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1, bin_tail/1,save_restore/1,shadowed_size_var/1, partitioned_bs_match/1,function_clause/1, @@ -56,6 +56,12 @@ test_lib:recompile(bs_match_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index 28a2ae6271..ac27c6d1f0 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -19,7 +19,7 @@ -module(bs_utf_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1, literals/1,coverage/1]). @@ -37,6 +37,12 @@ test_lib:recompile(bs_utf_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index d747cd459c..5651adf721 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -49,6 +49,12 @@ all() -> groups() -> [{vsn, [], [vsn_1, vsn_2, vsn_3]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index b6054615f0..69a777be2d 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, app_test/1, file_1/1, module_mismatch/1, big_file/1, outdir/1, binary/1, cond_and_ifdef/1, listings/1, listings_big/1, @@ -49,6 +49,12 @@ groups() -> [{bad_record_use, [], [bad_record_use1, bad_record_use2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 9d17b0cb48..f72271d2fc 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -18,7 +18,7 @@ %% -module(core_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1]). -include_lib("test_server/include/test_server.hrl"). @@ -44,6 +44,12 @@ test_lib:recompile(core_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 3d5798fe5a..40d28e90cc 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -18,7 +18,7 @@ %% -module(core_fold_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_element/1,setelement/1,t_length/1,append/1,t_apply/1,bifs/1, eq/1,nested_call_in_case/1,coverage/1]). @@ -36,6 +36,12 @@ test_lib:recompile(core_fold_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index 5360c5d700..e1985965da 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -32,6 +32,12 @@ test_lib:recompile(error_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index 5f0af29b87..f635667d7e 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(float_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). -include_lib("test_server/include/test_server.hrl"). @@ -31,6 +31,12 @@ test_lib:recompile(float_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index 7f8b91328d..8579b80d89 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -18,7 +18,7 @@ %% -module(fun_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,6 +32,12 @@ test_lib:recompile(fun_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index f01dc18ecc..ad3d91f2e5 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, misc/1,const_cond/1,basic_not/1,complex_not/1,nested_nots/1, semicolon/1,complex_semicolon/1,comma/1, or_guard/1,more_or_guards/1, @@ -48,6 +48,12 @@ test_lib:recompile(guard_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 9d435fc39b..83c2163316 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -39,6 +39,12 @@ test_lib:recompile(inline_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index edb44ff8b6..f1fc4c9085 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -19,7 +19,7 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,deeply_nested/1,no_generator/1, empty_generator/1]). @@ -34,6 +34,12 @@ test_lib:recompile(lc_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 447c66db54..ddd84ad638 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -18,7 +18,7 @@ %% -module(match_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pmatch/1,mixed/1,aliases/1,match_in_call/1, untuplify/1,shortcut_boolean/1,letify_guard/1, selectify/1,underscore/1]). @@ -35,6 +35,12 @@ test_lib:recompile(match_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index fa99e63574..c0673f447b 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(misc_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, tobias/1,empty_string/1,md5/1,silly_coverage/1, confused_literals/1,integer_encoding/1,override_bif/1]). @@ -61,6 +61,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl index 3291398f88..80bee6b9ff 100644 --- a/lib/compiler/test/num_bif_SUITE.erl +++ b/lib/compiler/test/num_bif_SUITE.erl @@ -30,7 +30,7 @@ %% round/1 %% trunc/1 --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, @@ -48,6 +48,12 @@ groups() -> [{t_list_to_float, [], [t_list_to_float_safe, t_list_to_float_risky]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index ebfb542ccb..9cdc40a6fe 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, pe2/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pe2/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -30,6 +30,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index 372b640349..c36b95b482 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -18,7 +18,7 @@ %% -module(pmod_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1, otp_8447/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,6 +32,12 @@ test_lib:recompile(pmod_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 8a02025336..64d55d2f3e 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -20,7 +20,7 @@ -module(receive_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, recv/1,coverage/1,otp_7980/1,ref_opt/1]). -include_lib("test_server/include/test_server.hrl"). @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index 17d8b50d42..a252cd3c31 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1, guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]). @@ -46,6 +46,12 @@ test_lib:recompile(record_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index a844cca3b4..fe6f8de9cf 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -18,7 +18,7 @@ %% -module(trycatch_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1, nested_horrid/1,last_call_optimization/1,bool/1, @@ -38,6 +38,12 @@ test_lib:recompile(trycatch_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index e0b1c84ad0..d18ab3a810 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([pattern/1,pattern2/1,pattern3/1,pattern4/1, guard/1,bad_arith/1,bool_cases/1,bad_apply/1, @@ -60,6 +60,12 @@ test_lib:recompile(warnings_SUITE), groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index 031cb5f576..2d3e1e1b8d 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -107,6 +107,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index eed727e470..d67bafb8c8 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -106,6 +106,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index 5d786ab675..2df02ed867 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -175,6 +175,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 6575828b68..860e838e10 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -117,6 +117,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index 80140aa47c..8c6685ab45 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -96,6 +96,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index 2b8498b46e..f4a300fb0c 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -72,7 +72,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -115,6 +115,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index b27994fc48..e145d61654 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, info/1, @@ -77,6 +77,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index 52854a694a..c2bd599ae5 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -23,7 +23,7 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1]). @@ -48,6 +48,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl index 26ae487c72..c5d8ad550b 100644 --- a/lib/debugger/test/bug_SUITE.erl +++ b/lib/debugger/test/bug_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([]). @@ -36,6 +36,12 @@ all() -> groups() -> [{ticket_tests, [], [otp2163, otp4845]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 4f40cb3f9c..380fb2fe4c 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -25,7 +25,7 @@ % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([function_tests/1]). @@ -76,6 +76,12 @@ groups() -> normal5, exit5, options5, distsetup6, all_step6, all_next6]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index 1a95cfe222..993854db8c 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index 69fe183d28..44b7e52a2f 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -82,6 +82,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl index ad11705e21..cdbc43daf9 100644 --- a/lib/debugger/test/int_SUITE.erl +++ b/lib/debugger/test/int_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -68,6 +68,12 @@ groups() -> [{list_suite, [], [{group, append}, reverse, member]}, {append, [], [append_1, append_2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index d90ffebf8d..08a643edbd 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,cleanup/1]). -export([auto_attach/1]). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index 2a1ee5a911..3deb02f35a 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -22,7 +22,7 @@ %% Purpose: Deeper test of the evaluator. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, bifs_outside_erlang/1, spawning/1, applying/1, catch_and_throw/1, external_call/1, test_module_info/1, apply_interpreted_fun/1, apply_uninterpreted_fun/1, @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/docbuilder/test/docb_SUITE.erl b/lib/docbuilder/test/docb_SUITE.erl index e743dbba8a..ddce50c0fb 100644 --- a/lib/docbuilder/test/docb_SUITE.erl +++ b/lib/docbuilder/test/docb_SUITE.erl @@ -17,7 +17,7 @@ %% -module(docb_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,html/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,html/1]). -include_lib("common_test/include/ct.hrl"). @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl index e110a48d56..a0af2d9cbb 100644 --- a/lib/edoc/test/edoc_SUITE.erl +++ b/lib/edoc/test/edoc_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %% Test cases -export([build_std/1]). @@ -33,6 +33,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index c6f8193ab7..a3aa587da4 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -23,7 +23,9 @@ -include_lib("test_server/include/test_server.hrl"). -include("ei_accept_SUITE_data/ei_accept_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, ei_accept/1, ei_threaded_accept/1]). -import(runner, [get_term/1,send_term/2]). @@ -36,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index 5ea420cdf2..87e91dc6e3 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -24,7 +24,7 @@ -include("ei_connect_SUITE_data/ei_connect_test_cases.hrl"). -export([ - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, @@ -49,6 +49,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index e6a1948d4d..0b51c5182c 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -25,7 +25,7 @@ -export( [ -all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test_ei_decode_long/1, test_ei_decode_ulong/1, test_ei_decode_longlong/1, @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index 2366f0f11d..b3f6df431b 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -25,7 +25,7 @@ -export( [ -all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test_ei_decode_encode/1 ]). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index 34d4d0fec4..70596855bb 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -25,7 +25,7 @@ -export( [ -all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test_ei_encode_long/1, test_ei_encode_ulong/1, test_ei_encode_longlong/1, @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 25458aaa13..7c0e20312c 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -25,7 +25,7 @@ -export([ format_wo_ver/1, - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1 @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index fc6b1ddde5..52ead1ad0d 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -include("ei_print_SUITE_data/ei_print_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). -import(runner, [get_term/1]). @@ -38,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index 2b94e28ce0..28e6df1f56 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -26,7 +26,7 @@ -define(dummy_host,test01). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index d47428baa2..2e10d89b1b 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_connect_SUITE_data/erl_connect_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]). -import(runner, [get_term/1,send_term/2]). @@ -36,6 +36,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index 45d9dabed1..84c2aa7cc0 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -33,7 +33,7 @@ %%% 5. Miscellanous functions. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, decode_terms/1, decode_float/1, t_erl_mk_int/1, t_erl_mk_list/1, basic_copy/1, @@ -93,6 +93,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index 9c54d7416f..1b330d2342 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -24,7 +24,7 @@ -include("erl_ext_SUITE_data/ext_test_cases.hrl"). -export([ - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, compare_tuple/1, compare_list/1, compare_string/1, @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index b23055b4f5..e9363ad597 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_format_SUITE_data/format_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). -import(runner, [get_term/1]). @@ -38,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index 809356a693..0b865ae14e 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, bind/1, integers/1, floats/1, binaries/1, strings/1]). %% For interactive running of matcher. @@ -40,6 +40,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 547fc61cae..1bd47b33d3 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -31,7 +31,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1]). % Private exports -include_lib("test_server/include/test_server.hrl"). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index 95f590cc4f..e615bf998b 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -18,7 +18,7 @@ %% -module(eunit_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,eunit_test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,eunit_test/1]). -include_lib("common_test/include/ct.hrl"). @@ -30,6 +30,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 9434aaed49..97beff3e84 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -80,6 +80,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index 9434f232a3..363235b9d2 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -79,6 +79,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index 887a76860f..4e0a508c5b 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -79,6 +79,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index ab11b682ac..8ed995656e 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -26,7 +26,7 @@ -module(erl_client_c_server_SUITE). -include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -79,6 +79,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index f926f71060..6bee7adc3b 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -26,7 +26,7 @@ -module(erl_client_c_server_proto_SUITE). -include_lib("common_test/include/ct.hrl"). --export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, void_test/1, +-export([init_per_testcase/2, end_per_testcase/2,all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, longlong_test/1, ushort_test/1, ulong_test/1, ulonglong_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, struct2_test/1, @@ -79,6 +79,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index ed6b2b9891..f0ad0abbcf 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -24,7 +24,7 @@ -module(ic_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -include_lib("orber/src/orber_ifr.hrl"). @@ -114,6 +114,12 @@ groups() -> {syntax, [], [syntax1, syntax2, syntax3, syntax4, syntax5, syntax6]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index 7db2996cc1..4e3c91722f 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,plain/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,plain/1]). -define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). @@ -41,6 +41,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 9c0b904db7..7efc2816af 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -25,7 +25,7 @@ -include("ftp_internal.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([ ftp_150/1, @@ -44,6 +44,12 @@ groups() -> ftp_425, ftp_other_status_codes, ftp_multiple_lines, ftp_multipel_ctrl_messages]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl index 8abf93558b..83e1f08670 100644 --- a/lib/inets/test/http_format_SUITE.erl +++ b/lib/inets/test/http_format_SUITE.erl @@ -26,7 +26,7 @@ -include("http_internal.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([ chunk_decode/1, chunk_encode/1, @@ -52,6 +52,12 @@ groups() -> chunk_decode_empty_chunk_otp_6511, chunk_decode_trailer]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl index f0885faf47..685c8cacc4 100644 --- a/lib/inets/test/httpc_cookie_SUITE.erl +++ b/lib/inets/test/httpc_cookie_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("stdlib/include/ms_transform.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([session_cookies_only/1, netscape_cookies/1, @@ -127,6 +127,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index 41e06f493f..a53bfa86f4 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -80,6 +80,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index b4cf7c72e8..a46967e010 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, load_use_cache/1, otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, @@ -58,6 +58,12 @@ groups() -> {distr_changed, [], [distr_changed_tc1, distr_changed_tc2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index 668ee508c9..ddb6866179 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(bif_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([ spawn1/1, spawn2/1, spawn3/1, spawn4/1, @@ -61,6 +61,12 @@ groups() -> {spawn_opt_tests, [], [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index f5bb9e2886..40a7edb363 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -34,7 +34,7 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, halt_int_inf/1, halt_int_sz_1/1, halt_int_sz_2/1, @@ -183,6 +183,12 @@ groups() -> dist_terminate, dist_accessible, dist_deadlock, dist_open2, other_groups]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index 4a3bf1d7a3..775f1b1e47 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([start/1, start_link/1, stop/1, add/1, delete/1, responses/1]). @@ -41,6 +41,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index ac2cd9b6b9..09b5eecc4c 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -21,7 +21,7 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([tick/1, tick_change/1, illegal_nodenames/1, hidden_node/1, table_waste/1, net_setuptime/1, @@ -72,6 +72,12 @@ groups() -> monitor_nodes_combinations, monitor_nodes_cleanup, monitor_nodes_many]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 58cb93383d..5b1dc78245 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). @@ -85,6 +85,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index 144e58460d..ba2b369ec2 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("kernel/include/file.hrl"). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([get_path/1, set_path/1, get_file/1, inet_existing/1, inet_coming_up/1, inet_disconnects/1, @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index 901877d43e..93b23c38b3 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -27,7 +27,7 @@ %% error_logger deliver the expected events. %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, emulator/1, tty/1, logfile/1, add/1, delete/1]). -export([generate_error/0]). @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index d7198ba333..59139ba38b 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_warn_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -53,6 +53,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index a34f7b9d05..8b0470bad4 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -40,7 +40,7 @@ -module(?FILE_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init/1, fini/1, init_per_testcase/2, end_per_testcase/2, read_write_file/1, names/1]). @@ -135,6 +135,12 @@ groups() -> {links, [], [make_link, read_link_info_for_non_link, symlinks]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index f4b242d155..99996bd7bd 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -71,6 +71,7 @@ %% read_link -export([all/0,groups/0,suite/0, + init_per_suite/1,end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([normal/1,icky/1,very_icky/1,normalize/1]). @@ -92,6 +93,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 7f1e851656..e7dc0edd17 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, t_connect_timeout/1, t_accept_timeout/1, t_connect_bad/1, t_recv_timeout/1, t_recv_eof/1, @@ -44,6 +44,12 @@ groups() -> {t_connect, [], [t_connect_timeout, t_connect_bad]}, {t_recv, [], [t_recv_timeout, t_recv_eof]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index fc75620bb2..ead976b94a 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -22,7 +22,7 @@ %%-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index f40c5afdfe..b2a8a309ed 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -22,7 +22,7 @@ %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, init_per_testcase/2, end_per_testcase/2, @@ -74,6 +74,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 0d26ebd288..266876d3d7 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -29,7 +29,7 @@ % XXX - we should pick a port that we _know_ is closed. That's pretty hard. -define(CLOSED_PORT, 6666). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index 20b0bc8ea0..e38d6df7c1 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, dont_drop/1, kill_pid/1, fini/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -61,6 +61,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index ee4cf72fa5..4d673e0814 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -22,7 +22,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_gethostbyaddr/0, t_gethostbyaddr/1, t_getaddr/0, t_getaddr/1, t_gethostbyname/0, t_gethostbyname/1, @@ -72,6 +72,12 @@ required(hosts) -> [{require, test_hosts}] end. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index ea1836dbd8..a3daf8d053 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([basic/1, resolve/1, edns0/1, txt_record/1, files_monitor/1]). -export([ @@ -51,6 +51,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index e24672ce1e..31910b625c 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -48,7 +48,7 @@ -define(C_QUIT,99). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, doc_examples_raw/1,doc_examples_raw_getbin/1, large_raw/1,large_raw_getbin/1,combined/1,combined_getbin/1, type_errors/1]). @@ -67,6 +67,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index 0897697c42..8c7dc1bb2f 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([get_arguments/1, get_argument/1, boot_var/1, restart/1, get_plain_arguments/1, @@ -48,6 +48,12 @@ all() -> groups() -> [{boot, [], [boot1, boot2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index a79aa56f8e..7ef7f80d44 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -18,7 +18,7 @@ %% -module(interactive_shell_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, job_control_remote_noshell/1]). @@ -53,6 +53,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 0322056c46..801505e683 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index 45c4990036..06b60871cc 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -18,7 +18,7 @@ %% -module(os_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([space_in_cwd/1, quoting/1, space_in_name/1, bad_command/1, find_executable/1, unix_comment_in_command/1, evil/1]). @@ -33,11 +33,17 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. space_in_cwd(doc) -> @@ -266,9 +272,7 @@ strip_nl([$\n]) -> []; strip_nl([H|T]) -> [H|strip_nl(T)]; strip_nl([]) -> []. -receive_suite() -> [{suite_callbacks,[ts_install_scb]}]. - -all() -> +receive_all() -> receive X -> [X|receive_all()] after 0 -> [] diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 86c2cf6ce7..c296b3b84f 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -29,7 +29,7 @@ -define(DEBUGF(A,B), noop). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, simple/1, complicated/1, heavy/1, info/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). @@ -50,6 +50,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index 8f7083388b..25ce71eb00 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -24,7 +24,7 @@ -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ otp_7277/1, otp_8259/1, otp_8653/1, @@ -58,6 +58,12 @@ groups() -> [{tickets, [], [otp_7277, otp_8259, otp_8653, compat, basic]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index d53c17def4..881d6396ed 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(prim_file_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init/1, fini/1, read_write_file/1]). -export([cur_dir_0a/1, cur_dir_0b/1, @@ -100,6 +100,12 @@ groups() -> [make_link_a, make_link_b, read_link_info_for_non_link, symlinks_a, symlinks_b]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index 4045dbc784..5d079d5bee 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -19,7 +19,7 @@ -module(ram_file_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, %% init/1, fini/1, init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index f7553f0346..2cced82f4d 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(rpc_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([call/1, block_call/1, multicall/1, multicall_timeout/1, multicall_dies/1, multicall_node_dies/1, called_dies/1, called_node_dies/1, @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index 53a6e72fb0..b66684f13d 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,7 @@ %% -module(seq_trace_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -45,6 +45,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index 3ce2121bf9..a7b63474ec 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -33,7 +33,7 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, no_file/1, one_empty/1, one_filled/1, two_filled/1, @@ -56,6 +56,12 @@ groups() -> {two, [], [two_filled]}, {four, [], [four_filled]}, {wrap, [], [wrap_filled]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index ffc50fc0c8..9a0fa61faa 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -90,6 +90,12 @@ groups() -> [zip_usage, gz_usage, gz_usage2, compress_usage, dictionary_usage, large_deflate, crc, adler]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index d50bb5949a..84ec761fc6 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -83,6 +83,12 @@ groups() -> {timer, [], [{megaco_timer_test, all}]}, {flex, [], [{megaco_flex_test, all}]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index 07180e9f78..d721913b72 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -20,7 +20,7 @@ -module(etop_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). -export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). @@ -43,6 +43,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index d3d4f4bdf0..f0c99a34c2 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -47,6 +47,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 0eff966e31..18e28e690c 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -21,7 +21,7 @@ -compile(export_all). %% Test functions --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). @@ -52,6 +52,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index 62c3405584..873168685c 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -32,7 +32,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -54,6 +54,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 49e33cd651..09849eb933 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -48,7 +48,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -69,6 +69,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 172b3af1f9..12c997312e 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -71,7 +71,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -103,6 +103,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 7ca0bc7bba..1157ea8830 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -86,6 +86,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index 7fc745c494..ff2cf45160 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -54,6 +54,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index e66cb05e46..cacedcd87d 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -33,7 +33,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -54,6 +54,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index cda10c68da..16b5a45f3a 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -55,6 +55,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index 780fc7ab6b..e4b13da486 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -34,7 +34,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -55,6 +55,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index e746279076..679d6f45b5 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -25,7 +25,7 @@ -define(application, orber). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index ab7de22912..67bef737c2 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -65,7 +65,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -88,6 +88,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index ec37d37122..f1ac9f4ff8 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -128,7 +128,7 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -154,6 +154,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index 2706873b79..ac11475789 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -49,6 +49,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 534f8f7870..23ecc265e9 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ file/1, compile/1, syntax/1, @@ -63,6 +63,12 @@ groups() -> [{checks, [], [file, compile, syntax]}, {examples, [], [pt, man, ex, ex2, not_yet]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index 4e41fa013d..8d6643590e 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -34,7 +34,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([app_test/1, @@ -75,6 +75,12 @@ groups() -> [otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]}, {improvements, [], [otp_7292, otp_7969]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index 65512bbe0e..5272c3bb4d 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -19,7 +19,7 @@ -module(dbg_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1, ip_port_busy/1, wrap_port/1, wrap_port_time/1, with_seq_trace/1, dead_suspend/1, local_trace/1, @@ -50,6 +50,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index c3e4d24a61..0f141cffed 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Testcases -export([basic/1]). @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 5fcf26cee0..030f72a255 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index db5b3593c1..7919519913 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,7 +19,7 @@ -module(snmp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). @@ -88,6 +88,12 @@ groups() -> [{snmp_manager_user_test, all}]}, {manager_test, [], [{snmp_manager_test, all}]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index ed2d2de2e5..98e426435d 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -65,6 +65,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 8405bcf0de..51fb1d913a 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_active_once_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -66,6 +66,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index cd964b684e..8c77b46f88 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_misc_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -52,6 +52,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index 59659f5a18..5bc13c2f44 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_passive_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -65,6 +65,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index 522e7fba1f..3ce155943f 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_peer_cert_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -52,6 +52,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index 8ced900cab..30a7727f49 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_protocol_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, finish/1, sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, sslv2_tlsv1/1, sslv3_tlsv1/1, sslv2_sslv3_tlsv1/1]). @@ -47,6 +47,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index 6b3a894a83..1e7d02a04c 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -20,7 +20,7 @@ %% -module(old_ssl_verify_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -51,6 +51,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index 9f6828252b..4075154035 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -26,7 +26,7 @@ -define(default_timeout, ?t:minutes(1)). -define(application, ssh). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -55,6 +55,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index 19ad86977d..ddeab1d52e 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:seconds(60)). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([ @@ -77,6 +77,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index 146b63bc69..46ba0fb7dc 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -23,7 +23,7 @@ -include("test_server_line.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([base64_encode/1, base64_decode/1, base64_otp_5635/1, @@ -52,6 +52,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index 539028d4aa..033786edee 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, building/1, md5/1, encrypted_abstr/1, encrypted_abstr_file/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index b459f35f03..d43a7852a4 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -18,7 +18,7 @@ %% -module(binary_module_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]). @@ -73,6 +73,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index 913bc104cd..0b9f15745f 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(c_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1, memory/1]). @@ -33,6 +33,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 12c38d3693..51676aa688 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, gregorian_days/1, gregorian_seconds/1, day_of_the_week/1, @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index 7f8231adff..79f7a07b56 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -34,7 +34,7 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, open_v8/1, open_v9/1, sets_v8/1, sets_v9/1, bags_v8/1, bags_v9/1, duplicate_bags_v8/1, duplicate_bags_v9/1, access_v8/1, access_v9/1, dirty_mark/1, dirty_mark2/1, @@ -116,6 +116,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index af1de5164f..4c7f0486e7 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -22,7 +22,7 @@ -module(dict_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,store/1]). -include_lib("test_server/include/test_server.hrl"). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index 3bdb0ec0d2..d027e7521d 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([opts/1, degree/1, path/1, cycle/1, vertices/1, edges/1, data/1, otp_3522/1, otp_3630/1, otp_8066/1]). @@ -45,6 +45,12 @@ groups() -> [{misc, [], [vertices, edges, data]}, {tickets, [], [otp_3522, otp_3630, otp_8066]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 0204501ca0..03a3cc3166 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([simple/1, loop/1, isolated/1, topsort/1, subgraph/1, condensation/1, tree/1]). @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 326942b99b..84d3497020 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(edlin_expand_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index f4579d7312..fe5a6bdf71 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(epp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([rec_1/1, predef_mac/1, upcase_mac_1/1, upcase_mac_2/1, @@ -72,6 +72,12 @@ groups() -> [{upcase_mac, [], [upcase_mac_1, upcase_mac_2]}, {variable, [], [variable_1]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 081ec6abb3..577ee14e76 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -83,6 +83,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index d81d5ff6a2..3410dd52af 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -31,7 +31,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([abstract_module/1, attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, @@ -60,6 +60,12 @@ groups() -> [{tickets, [], [otp_5915, otp_7931, otp_5990, otp_7078, otp_7101]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index 514d78b1d1..18dabce2ff 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -18,7 +18,7 @@ %% -module(erl_internal_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([behav/1]). @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 3fcdade385..b85ed01601 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ unused_vars_warn_basic/1, @@ -88,6 +88,12 @@ groups() -> unused_vars_OTP_4858]}, {on_load, [], [on_load_successful, on_load_failing]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index 9ee8e27068..5ad522fdef 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -35,7 +35,7 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ func/1, call/1, recs/1, try_catch/1, if_then/1, receive_after/1, bits/1, head_tail/1, package/1, @@ -79,6 +79,12 @@ groups() -> [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, otp_8473, otp_8522, otp_8567, otp_8664]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index 030964163e..aa7843eaaa 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(erl_scan_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([ error_1/1, error_2/1, iso88591/1, otp_7810/1]). @@ -63,6 +63,12 @@ all() -> groups() -> [{error, [], [error_1, error_2]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 3a955d5764..73c1fb9726 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -18,7 +18,7 @@ -module(escript_SUITE). -export([ - all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, basic/1, @@ -48,6 +48,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 480883f4a5..9e77447fe2 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -18,7 +18,7 @@ %% -module(ets_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1, privacy/1,privacy_owner/2]). -export([empty/1,badinsert/1]). @@ -173,6 +173,12 @@ groups() -> meta_lookup_named_read, meta_lookup_named_write, meta_newdel_unnamed, meta_newdel_named]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index 31e1585975..4fda9bbbf2 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(ets_tough_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,ex1/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,ex1/1]). -export([init/1,terminate/2,handle_call/3,handle_info/2]). -export([init_per_testcase/2, end_per_testcase/2]). -compile([export_all]). @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index 27ba60c6a8..ccb9a26976 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -32,7 +32,7 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, basic/1, badarg/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1, badarg/1, term_sort/1, term_keysort/1, binary_term_sort/1, binary_term_keysort/1, binary_sort/1, @@ -68,6 +68,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index 249f399b4a..d853eaf6c6 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -19,7 +19,7 @@ -module(filelib_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, wildcard_one/1,wildcard_two/1,wildcard_errors/1, fold_files/1,otp_5960/1,ensure_dir_eexist/1]). @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl index 728c6e9206..bd6db97289 100644 --- a/lib/stdlib/test/filename_SUITE.erl +++ b/lib/stdlib/test/filename_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(filename_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([absname/1, absname_2/1, basename_1/1, basename_2/1, dirname/1, extension/1, join/1, t_nativename/1]). @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index 57894ab1f7..66b142fceb 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -21,7 +21,7 @@ %%%---------------------------------------------------------------------- -module(fixtable_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %%% Test cases -export([multiple_fixes/1, multiple_processes/1, other_process_deletes/1, owner_dies/1, @@ -41,6 +41,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 932d9b5278..7fff294448 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(format_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([hang_1/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index cba210ddc1..f22f171d1d 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([start/1, add_handler/1, add_sup_handler/1, delete_handler/1, swap_handler/1, swap_sup_handler/1, notify/1, sync_notify/1, call/1, info/1, hibernate/1, @@ -38,6 +38,12 @@ groups() -> swap_handler, swap_sup_handler, notify, sync_notify, call, info]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index f97a85f315..1f190bdaaa 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test cases --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([ start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1, start7/1, start8/1, start9/1, start10/1, start11/1]). @@ -67,6 +67,12 @@ groups() -> {sys, [], [sys1, call_format_status, error_format_status]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index f30d0012ae..c64674246e 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -23,7 +23,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([start/1, crash/1, call/1, cast/1, cast_fast/1, info/1, abcast/1, multicall/1, multicall_down/1, call_remote1/1, call_remote2/1, call_remote3/1, @@ -60,6 +60,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 80c76015f2..739749ee7d 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, id_transform/1]). -export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1, @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 19664922b8..1704f5f216 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -18,7 +18,7 @@ %% -module(io_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -66,6 +66,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 56509881ff..5ce589773d 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -19,7 +19,7 @@ -module(io_proto_SUITE). -compile(r12). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -91,6 +91,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index a86666e673..95ef4b1e9f 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -30,7 +30,7 @@ -define(default_timeout, ?t:minutes(4)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -110,6 +110,12 @@ groups() -> [flatten_1, flatten_2, flatten_1_e, flatten_2_e]}, {tickets, [], [otp_5939, otp_6023, otp_6606, otp_7230]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index a2aaa1d0cf..1aa3e47921 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 90b70e3933..68f1547184 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([basic_ets/1]). -export([basic_dbg/1]). -export([from_shell/1]). @@ -60,6 +60,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index 429f1800aa..41c9c6093d 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -23,7 +23,7 @@ %% %%-define(STANDALONE,1). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, spawn_opt/1, sp1/0, sp2/0, sp3/1, sp4/2, sp5/1, hibernate/1]). -export([ otp_6345/1]). @@ -53,6 +53,12 @@ groups() -> [{tickets, [], [otp_6345]}, {sync_start, [], [sync_start_nolink, sync_start_link]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index 2ce5d034aa..2faf43503f 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -51,7 +51,7 @@ -include_lib("stdlib/include/ms_transform.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([ badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, @@ -147,6 +147,12 @@ groups() -> otp_7238, otp_7552, otp_6674, otp_7714]}, {compat, [], [backward, forward]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index 79853b470c..e494c46196 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(queue_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index 8a284179d4..801d059aef 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% -module(random_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([interval_1/1, seed0/1, seed/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index bd2d1d549c..de921f03f5 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -18,7 +18,7 @@ %% -module(re_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). @@ -35,6 +35,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index d8ed30b384..589fdbed0f 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -58,7 +58,7 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, return_values/1]). init_per_testcase(_Case, Config) when is_list(Config) -> @@ -78,6 +78,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index 18d6170540..003c9d9daa 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -22,7 +22,7 @@ -module(sets_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, create/1,add_element/1,del_element/1, subtract/1,intersection/1,union/1,is_subset/1, is_set/1,fold/1,filter/1, @@ -51,6 +51,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index 1b46a008a2..a95b7effac 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(shell_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([forget/1, records/1, known_bugs/1, otp_5226/1, otp_5327/1, otp_5435/1, otp_5195/1, otp_5915/1, otp_5916/1, @@ -94,6 +94,12 @@ groups() -> [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, otp_7232, otp_8393]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl index 0ccd7ec553..eafff8893e 100644 --- a/lib/stdlib/test/slave_SUITE.erl +++ b/lib/stdlib/test/slave_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, start_link_nodedown/1, errors/1]). %% Internal exports. @@ -35,6 +35,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index e2aa5da6f5..69b852077b 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -30,7 +30,7 @@ -define(format(S, A), ok). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([ from_term_1/1, set_1/1, from_sets_1/1, relation_1/1, a_function_1/1, family_1/1, projection/1, @@ -113,6 +113,12 @@ groups() -> family_intersection_2, family_union_1, family_union_2, partition_family]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index 6454cd7b6c..f203e810ba 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -28,7 +28,7 @@ -define(application, stdlib). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -46,6 +46,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index e7da22b5eb..766ccda6db 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -51,6 +51,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 35977b819e..ac47d2ebad 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Testserver specific export --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %% Indirect spawn export -export([init/1]). @@ -90,6 +90,12 @@ groups() -> {restart_rest_for_one, [], [rest_for_one, rest_for_one_escalation]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index 8bf3c846ed..502bb1e7a7 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(supervisor_bridge_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). -export([client/1,init/1,internal_loop_init/1,terminate/2]). -include_lib("test_server/include/test_server.hrl"). @@ -34,6 +34,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index 48071ac24e..83ee9815b5 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -17,7 +17,7 @@ %% %CopyrightEnd% %% -module(sys_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). -export([handle_call/3,terminate/2,init/1]). -include_lib("test_server/include/test_server.hrl"). @@ -37,6 +37,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index 138a209a7a..d524ab4b3d 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -18,7 +18,7 @@ %% -module(tar_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, create_long_names/1, bad_tar/1, errors/1, extract_from_binary/1, extract_from_binary_compressed/1, extract_from_open_file/1, symlinks/1, open_add_close/1, cooked_compressed/1, @@ -38,6 +38,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl index 629d0489ed..a23b546aee 100644 --- a/lib/stdlib/test/timer_SUITE.erl +++ b/lib/stdlib/test/timer_SUITE.erl @@ -18,7 +18,7 @@ %% -module(timer_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([do_big_test/1]). -export([big_test/1, collect/3, i_t/3, a_t/2]). -export([do_nrev/1, internal_watchdog/2]). @@ -59,6 +59,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 73e57b19d2..652ea67ef3 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -21,7 +21,7 @@ -module(timer_simple_SUITE). %% external --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, apply_after/1, send_after1/1, @@ -66,6 +66,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index 6d6a89c81f..41e10c74b7 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, utf8_illegal_sequences_bif/1, @@ -48,6 +48,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl index 583e1f96de..a8d3b207cc 100644 --- a/lib/stdlib/test/win32reg_SUITE.erl +++ b/lib/stdlib/test/win32reg_SUITE.erl @@ -18,7 +18,7 @@ %% -module(win32reg_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,long/1,evil_write/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,long/1,evil_write/1]). -export([ostype/1,fini/1]). -include_lib("test_server/include/test_server.hrl"). @@ -31,6 +31,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index 20b6ca31bc..98e2721810 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, date_1999_01_01/1, date_1999_02_28/1, date_1999_09_09/1, date_2000_01_01/1, date_2000_02_29/1, date_2001_01_01/1, @@ -40,6 +40,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl index 33d1bae1bc..a427067412 100644 --- a/lib/stdlib/test/zip_SUITE.erl +++ b/lib/stdlib/test/zip_SUITE.erl @@ -18,7 +18,7 @@ %% -module(zip_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, borderline/1, atomic/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, borderline/1, atomic/1, bad_zip/1, unzip_from_binary/1, unzip_to_binary/1, zip_to_binary/1, unzip_options/1, zip_options/1, list_dir_options/1, aliases/1, @@ -42,6 +42,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index e9a70a082a..6ef3d28f06 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). %% Test cases -export([smoke_test/1]). @@ -33,6 +33,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 5540754270..fe3e987790 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -18,7 +18,7 @@ %% -module(cover_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([start/1, compile/1, analyse/1, misc/1, stop/1, distribution/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, @@ -55,6 +55,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index 679795df60..64287c8ba1 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -63,7 +63,7 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> @@ -89,6 +89,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index a24e822305..492e613a3f 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -20,7 +20,7 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. @@ -30,6 +30,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 98033560c3..3cfff2473f 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -21,7 +21,7 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server framework exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1]). %% Test suites -export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1, @@ -68,6 +68,12 @@ end. groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index 5b13a42143..4ce5965d6f 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -18,7 +18,7 @@ %% -module(instrument_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export(['+Mim true'/1, '+Mis true'/1]). @@ -41,6 +41,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index a4c9546eb8..5c6d388843 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -18,7 +18,7 @@ %% -module(make_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, make_all/1, make_files/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, make_all/1, make_files/1]). -export([otp_6057_init/1, otp_6057_a/1, otp_6057_b/1, otp_6057_c/1, otp_6057_end/1]). @@ -44,6 +44,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index f587098a15..ee50283895 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -25,7 +25,7 @@ -define(application, tools). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. @@ -39,6 +39,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index 9d5597447e..7dccc7aab4 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -36,7 +36,7 @@ -define(copydir, ?config(copy_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init/1, fini/1]). -export([ addrem/1, convert/1, intergraph/1, lines/1, loops/1, @@ -86,6 +86,12 @@ groups() -> [analyze, basic, md, q, variables, unused_locals]}, {misc, [], [format_error, otp_7423, otp_7831]}]. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index 32b872c88e..0dacb7d5ac 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -55,6 +55,12 @@ all() -> groups() -> []. +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + init_per_group(_GroupName, Config) -> Config. -- cgit v1.2.3 From 0a0332c09f3cda72deecc39f01b967a62023e585 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:51:44 +0100 Subject: Fix formatting in ASN --- lib/asn1/test/asn1_SUITE.erl | 132 +++++++++++++++++------------------- lib/asn1/test/asn1_app_test.erl | 3 +- lib/asn1/test/asn1_appup_test.erl | 3 +- lib/asn1/test/asn1_bin_SUITE.erl | 117 +++++++++++++++----------------- lib/asn1/test/asn1_bin_v2_SUITE.erl | 114 +++++++++++++++---------------- 5 files changed, 176 insertions(+), 193 deletions(-) diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 4ea4260458..d45cc6df15 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -51,8 +51,10 @@ -include_lib("test_server/include/test_server.hrl"). %% records used by test-case default --record('Def1',{ -bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). +-record('Def1',{ bool0, + bool1 = asn1_DEFAULT, + bool2 = asn1_DEFAULT, + bool3 = asn1_DEFAULT}). %-record('Def2',{ %bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}). @@ -60,70 +62,67 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). %-record('Def3',{ %bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}). - - suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, compile}, parse, default_per, default_ber, - default_per_opt, per, {group, ber}, testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, - testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, - testSeqDefault, testSeqExtension, testSeqExternal, - testSeqOptional, testSeqPrim, testSeqTag, - testSeqTypeRefCho, testSeqTypeRefPrim, - testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, - testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, - testSetDefault, testSetExtension, - testExtensionAdditionGroup, testSetExternal, - testSeqOfTag, testSetOptional, testSetPrim, testSetTag, - testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, - testSetOfCho, testSetOfExternal, testSetOfTag, - testEnumExt, value_test, testSeq2738, constructed, - ber_decode_error, h323test, testSeqIndefinite, - testSetIndefinite, testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, testInvokeMod, - testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, - testINSTANCE_OF, testTCAP, testDER, specialized_decodes, - special_decode_performance, test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel, test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options, testDoubleEllipses, - test_modified_x420, testX420, test_x691, ticket_6143, - testExtensionAdditionGroup] - ++ common() ++ particular(). + [{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] ++ common() ++ particular(). groups() -> [{option_tests, [], - [test_compile_options, ticket_6143]}, - {infobj, [], - [testInfObjectClass, testParameterizedInfObj, - testMergeCompile, testobj, testDeepTConstr]}, - {performance, [], - [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, - testTimer_per_opt, testTimer_uper_bin]}, - {bugs, [], - [test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier]}, - {compile, [], - [c_syntax, c_string_per, c_string_ber, - c_implicit_before_choice]}, - {ber, [], - [ber_choiceinseq, ber_optional, ber_optional_keyed_list, - ber_other]}, - {app_test, [], [{asn1_app_test, all}]}, - {appup_test, [], [{asn1_appup_test, all}]}]. + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}, + {app_test, [], [{asn1_app_test, all}]}, + {appup_test, [], [{asn1_appup_test, all}]}]. init_per_suite(Config) -> Config. @@ -141,9 +140,6 @@ end_per_group(_GroupName, Config) -> %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. - - - init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), @@ -2482,12 +2478,12 @@ testName2Number(Config) -> particular() -> -[ticket_7407]. + [ticket_7407]. ticket_7407(suite) -> []; ticket_7407(Config) -> - ?line ok = asn1_test_lib:ticket_7407_compile(Config,[]), - ?line ok = asn1_test_lib:ticket_7407_code(true), + ?line ok = asn1_test_lib:ticket_7407_compile(Config,[]), + ?line ok = asn1_test_lib:ticket_7407_code(true), - ?line ok = asn1_test_lib:ticket_7407_compile(Config,[no_final_padding]), - ?line ok = asn1_test_lib:ticket_7407_code(false). + ?line ok = asn1_test_lib:ticket_7407_compile(Config,[no_final_padding]), + ?line ok = asn1_test_lib:ticket_7407_code(false). diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl index 75ff6ffc22..c3797f08b2 100644 --- a/lib/asn1/test/asn1_app_test.erl +++ b/lib/asn1/test/asn1_app_test.erl @@ -27,8 +27,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [fields, modules, exportall, app_depend], - Cases. + [fields, modules, exportall, app_depend]. groups() -> []. diff --git a/lib/asn1/test/asn1_appup_test.erl b/lib/asn1/test/asn1_appup_test.erl index a50b2e2c87..a2c1423eda 100644 --- a/lib/asn1/test/asn1_appup_test.erl +++ b/lib/asn1/test/asn1_appup_test.erl @@ -27,8 +27,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [appup], - Cases. + [appup]. groups() -> []. diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl index cb727e7186..0c3fc43dde 100644 --- a/lib/asn1/test/asn1_bin_SUITE.erl +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -51,8 +51,9 @@ -include_lib("test_server/include/test_server.hrl"). %% records used by test-case default --record('Def1',{ -bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). +-record('Def1',{bool0, bool1 = asn1_DEFAULT, + bool2 = asn1_DEFAULT, + bool3 = asn1_DEFAULT}). %-record('Def2',{ %bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}). @@ -65,63 +66,62 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, compile}, parse, default_per, default_ber, - default_per_opt, per, {group, ber}, testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, - testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, - testSeqDefault, testSeqExtension, testSeqExternal, - testSeqOptional, testSeqPrim, testSeqTag, - testSeqTypeRefCho, testSeqTypeRefPrim, - testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, - testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, - testSetDefault, testSetExtension, - testExtensionAdditionGroup, testSetExternal, - testSeqOfTag, testSetOptional, testSetPrim, testSetTag, - testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, - testSetOfCho, testSetOfExternal, testSetOfTag, - testEnumExt, value_test, testSeq2738, constructed, - ber_decode_error, h323test, testSeqIndefinite, - testSetIndefinite, testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, testInvokeMod, - testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, - testINSTANCE_OF, testTCAP, testDER, specialized_decodes, - special_decode_performance, test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel, test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options, testDoubleEllipses, - test_modified_x420, testX420, test_x691, ticket_6143, - testExtensionAdditionGroup] - ++ common() ++ particular(). + [{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] ++ common() ++ particular(). groups() -> [{option_tests, [], - [test_compile_options, ticket_6143]}, - {infobj, [], - [testInfObjectClass, testParameterizedInfObj, - testMergeCompile, testobj, testDeepTConstr]}, - {performance, [], - [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, - testTimer_per_opt, testTimer_uper_bin]}, - {bugs, [], - [test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier]}, - {compile, [], - [c_syntax, c_string_per, c_string_ber, - c_implicit_before_choice]}, - {ber, [], - [ber_choiceinseq, ber_optional, ber_optional_keyed_list, - ber_other]}]. + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}]. init_per_suite(Config) -> Config. @@ -135,13 +135,8 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. - - - - init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl index 08a6e4cb08..6e541a788c 100644 --- a/lib/asn1/test/asn1_bin_v2_SUITE.erl +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -65,63 +65,62 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, compile}, parse, default_per, default_ber, - default_per_opt, per, {group, ber}, testPrim, - testPrimStrings, testPrimExternal, testChoPrim, - testChoExtension, testChoExternal, testChoOptional, - testChoOptionalImplicitTag, testChoRecursive, - testChoTypeRefCho, testChoTypeRefPrim, - testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, - testSeqDefault, testSeqExtension, testSeqExternal, - testSeqOptional, testSeqPrim, testSeqTag, - testSeqTypeRefCho, testSeqTypeRefPrim, - testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, - testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, - testSetDefault, testSetExtension, - testExtensionAdditionGroup, testSetExternal, - testSeqOfTag, testSetOptional, testSetPrim, testSetTag, - testSetTypeRefCho, testSetTypeRefPrim, - testSetTypeRefSeq, testSetTypeRefSet, testSetOf, - testSetOfCho, testSetOfExternal, testSetOfTag, - testEnumExt, value_test, testSeq2738, constructed, - ber_decode_error, h323test, testSeqIndefinite, - testSetIndefinite, testChoiceIndefinite, - per_GeneralString, per_open_type, testInfObjectClass, - testParameterizedInfObj, testMergeCompile, testobj, - testDeepTConstr, testConstraints, testInvokeMod, - testExport, testImport, testCompactBitString, - testMegaco, testParamBasic, testMvrasn6, - testContextSwitchingTypes, testTypeValueNotation, - testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, - testINSTANCE_OF, testTCAP, testDER, specialized_decodes, - special_decode_performance, test_driver_load, - test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier, testSelectionType, - testSSLspecs, testNortel, test_undecoded_rest, - test_inline, testTcapsystem, testNBAPsystem, - test_compile_options, testDoubleEllipses, - test_modified_x420, testX420, test_x691, ticket_6143, - testExtensionAdditionGroup] - ++ common() ++ particular(). + [{group, compile}, parse, default_per, default_ber, + default_per_opt, per, {group, ber}, testPrim, + testPrimStrings, testPrimExternal, testChoPrim, + testChoExtension, testChoExternal, testChoOptional, + testChoOptionalImplicitTag, testChoRecursive, + testChoTypeRefCho, testChoTypeRefPrim, + testChoTypeRefSeq, testChoTypeRefSet, testDef, testOpt, + testSeqDefault, testSeqExtension, testSeqExternal, + testSeqOptional, testSeqPrim, testSeqTag, + testSeqTypeRefCho, testSeqTypeRefPrim, + testSeqTypeRefSeq, testSeqTypeRefSet, testSeqOf, + testSeqOfIndefinite, testSeqOfCho, testSeqOfExternal, + testSetDefault, testSetExtension, + testExtensionAdditionGroup, testSetExternal, + testSeqOfTag, testSetOptional, testSetPrim, testSetTag, + testSetTypeRefCho, testSetTypeRefPrim, + testSetTypeRefSeq, testSetTypeRefSet, testSetOf, + testSetOfCho, testSetOfExternal, testSetOfTag, + testEnumExt, value_test, testSeq2738, constructed, + ber_decode_error, h323test, testSeqIndefinite, + testSetIndefinite, testChoiceIndefinite, + per_GeneralString, per_open_type, testInfObjectClass, + testParameterizedInfObj, testMergeCompile, testobj, + testDeepTConstr, testConstraints, testInvokeMod, + testExport, testImport, testCompactBitString, + testMegaco, testParamBasic, testMvrasn6, + testContextSwitchingTypes, testTypeValueNotation, + testOpenTypeImplicitTag, duplicate_tags, rtUI, testROSE, + testINSTANCE_OF, testTCAP, testDER, specialized_decodes, + special_decode_performance, test_driver_load, + test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier, testSelectionType, + testSSLspecs, testNortel, test_undecoded_rest, + test_inline, testTcapsystem, testNBAPsystem, + test_compile_options, testDoubleEllipses, + test_modified_x420, testX420, test_x691, ticket_6143, + testExtensionAdditionGroup] ++ common() ++ particular(). groups() -> [{option_tests, [], - [test_compile_options, ticket_6143]}, - {infobj, [], - [testInfObjectClass, testParameterizedInfObj, - testMergeCompile, testobj, testDeepTConstr]}, - {performance, [], - [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, - testTimer_per_opt, testTimer_uper_bin]}, - {bugs, [], - [test_ParamTypeInfObj, test_WS_ParamClass, - test_Defed_ObjectIdentifier]}, - {compile, [], - [c_syntax, c_string_per, c_string_ber, - c_implicit_before_choice]}, - {ber, [], - [ber_choiceinseq, ber_optional, ber_optional_keyed_list, - ber_other]}]. + [test_compile_options, ticket_6143]}, + {infobj, [], + [testInfObjectClass, testParameterizedInfObj, + testMergeCompile, testobj, testDeepTConstr]}, + {performance, [], + [testTimer_ber, testTimer_ber_opt_driver, testTimer_per, + testTimer_per_opt, testTimer_uper_bin]}, + {bugs, [], + [test_ParamTypeInfObj, test_WS_ParamClass, + test_Defed_ObjectIdentifier]}, + {compile, [], + [c_syntax, c_string_per, c_string_ber, + c_implicit_before_choice]}, + {ber, [], + [ber_choiceinseq, ber_optional, ber_optional_keyed_list, + ber_other]}]. init_per_suite(Config) -> Config. @@ -135,13 +134,8 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - %all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143]. - - - - init_per_testcase(Func,Config) -> %%?line test_server:format("Func: ~p~n",[Func]), ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])), @@ -153,7 +147,7 @@ init_per_testcase(Func,Config) -> _ -> test_server:timetrap({minutes,30}) % 60 minutes end, -%% Dog=test_server:timetrap(1800000), % 30 minutes + %% Dog=test_server:timetrap(1800000), % 30 minutes [{watchdog, Dog}|Config]. end_per_testcase(_Func,Config) -> -- cgit v1.2.3 From 7b80fda5902bb59a6314a3f2dcedd5f36ca4f2f8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 10:58:34 +0100 Subject: Fix formatting for common test testcases --- lib/common_test/test/ct_config_SUITE.erl | 144 ++++++++++----------- lib/common_test/test/ct_error_SUITE.erl | 28 ++-- lib/common_test/test/ct_event_handler_SUITE.erl | 4 +- lib/common_test/test/ct_groups_test_1_SUITE.erl | 4 +- lib/common_test/test/ct_groups_test_2_SUITE.erl | 6 +- lib/common_test/test/ct_misc_1_SUITE.erl | 15 +-- lib/common_test/test/ct_repeat_1_SUITE.erl | 14 +- lib/common_test/test/ct_sequence_1_SUITE.erl | 8 +- lib/common_test/test/ct_skip_SUITE.erl | 2 +- lib/common_test/test/ct_smoke_test_SUITE.erl | 4 +- lib/common_test/test/ct_test_server_if_1_SUITE.erl | 2 +- lib/common_test/test/ct_testspec_1_SUITE.erl | 18 +-- 12 files changed, 123 insertions(+), 126 deletions(-) diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl index c29398b856..438d3f52e8 100644 --- a/lib/common_test/test/ct_config_SUITE.erl +++ b/lib/common_test/test/ct_config_SUITE.erl @@ -67,9 +67,9 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[require, install_config, userconfig_static, - userconfig_dynamic, testspec_legacy, testspec_static, - testspec_dynamic]. + [require, install_config, userconfig_static, + userconfig_dynamic, testspec_legacy, testspec_static, + testspec_dynamic]. groups() -> []. @@ -202,74 +202,74 @@ events_to_check(Test, N) -> expected_events(Test) ++ events_to_check(Test, N-1). expected_events(config_static_SUITE)-> -[ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,start_info,{1,1,8}}, - {?eh,tc_start,{config_static_SUITE,init_per_suite}}, - {?eh,tc_done,{config_static_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{config_static_SUITE,test_get_config_simple}}, - {?eh,tc_done,{config_static_SUITE,test_get_config_simple,ok}}, - {?eh,test_stats,{1,0,{0,0}}}, - {?eh,tc_start,{config_static_SUITE,test_get_config_nested}}, - {?eh,tc_done,{config_static_SUITE,test_get_config_nested,ok}}, - {?eh,test_stats,{2,0,{0,0}}}, - {?eh,tc_start,{config_static_SUITE,test_default_suitewide}}, - {?eh,tc_done,{config_static_SUITE,test_default_suitewide,ok}}, - {?eh,test_stats,{3,0,{0,0}}}, - {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use1}}, - {?eh,tc_done, - {config_static_SUITE,test_config_name_already_in_use1,{skipped,{config_name_already_in_use,[x1]}}}}, - {?eh,test_stats,{3,0,{1,0}}}, - {?eh,tc_start,{config_static_SUITE,test_default_tclocal}}, - {?eh,tc_done,{config_static_SUITE,test_default_tclocal,ok}}, - {?eh,test_stats,{4,0,{1,0}}}, - {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use2}}, - {?eh,tc_done, - {config_static_SUITE,test_config_name_already_in_use2, - {skipped,{config_name_already_in_use,[x1,alias]}}}}, - {?eh,test_stats,{4,0,{2,0}}}, - {?eh,tc_start,{config_static_SUITE,test_alias_tclocal}}, - {?eh,tc_done,{config_static_SUITE,test_alias_tclocal,ok}}, - {?eh,test_stats,{5,0,{2,0}}}, - {?eh,tc_start,{config_static_SUITE,test_get_config_undefined}}, - {?eh,tc_done,{config_static_SUITE,test_get_config_undefined,ok}}, - {?eh,test_stats,{6,0,{2,0}}}, - {?eh,tc_start,{config_static_SUITE,end_per_suite}}, - {?eh,tc_done,{config_static_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} -]; + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,start_info,{1,1,8}}, + {?eh,tc_start,{config_static_SUITE,init_per_suite}}, + {?eh,tc_done,{config_static_SUITE,init_per_suite,ok}}, + {?eh,tc_start,{config_static_SUITE,test_get_config_simple}}, + {?eh,tc_done,{config_static_SUITE,test_get_config_simple,ok}}, + {?eh,test_stats,{1,0,{0,0}}}, + {?eh,tc_start,{config_static_SUITE,test_get_config_nested}}, + {?eh,tc_done,{config_static_SUITE,test_get_config_nested,ok}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_start,{config_static_SUITE,test_default_suitewide}}, + {?eh,tc_done,{config_static_SUITE,test_default_suitewide,ok}}, + {?eh,test_stats,{3,0,{0,0}}}, + {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use1}}, + {?eh,tc_done, + {config_static_SUITE,test_config_name_already_in_use1,{skipped,{config_name_already_in_use,[x1]}}}}, + {?eh,test_stats,{3,0,{1,0}}}, + {?eh,tc_start,{config_static_SUITE,test_default_tclocal}}, + {?eh,tc_done,{config_static_SUITE,test_default_tclocal,ok}}, + {?eh,test_stats,{4,0,{1,0}}}, + {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use2}}, + {?eh,tc_done, + {config_static_SUITE,test_config_name_already_in_use2, + {skipped,{config_name_already_in_use,[x1,alias]}}}}, + {?eh,test_stats,{4,0,{2,0}}}, + {?eh,tc_start,{config_static_SUITE,test_alias_tclocal}}, + {?eh,tc_done,{config_static_SUITE,test_alias_tclocal,ok}}, + {?eh,test_stats,{5,0,{2,0}}}, + {?eh,tc_start,{config_static_SUITE,test_get_config_undefined}}, + {?eh,tc_done,{config_static_SUITE,test_get_config_undefined,ok}}, + {?eh,test_stats,{6,0,{2,0}}}, + {?eh,tc_start,{config_static_SUITE,end_per_suite}}, + {?eh,tc_done,{config_static_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]; expected_events(config_dynamic_SUITE)-> -[ - {?eh,start_logging,{'DEF','RUNDIR'}}, - {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,start_info,{1,1,5}}, - {?eh,tc_start,{config_dynamic_SUITE,init_per_suite}}, - {?eh,tc_done,{config_dynamic_SUITE,init_per_suite,ok}}, - {?eh,tc_start,{config_dynamic_SUITE,test_get_known_variable}}, - {?eh,tc_done, - {config_dynamic_SUITE,test_get_known_variable,ok}}, - {?eh,test_stats,{1,0,{0,0}}}, - {?eh,tc_start,{config_dynamic_SUITE,test_localtime_update}}, - {?eh,tc_done,{config_dynamic_SUITE,test_localtime_update,ok}}, - {?eh,test_stats,{2,0,{0,0}}}, - {?eh,tc_start,{config_dynamic_SUITE,test_server_pid}}, - {?eh,tc_done,{config_dynamic_SUITE,test_server_pid,ok}}, - {?eh,test_stats,{3,0,{0,0}}}, - {?eh,tc_start, - {config_dynamic_SUITE,test_disappearable_variable}}, - {?eh,tc_done, - {config_dynamic_SUITE,test_disappearable_variable,ok}}, - {?eh,test_stats,{4,0,{0,0}}}, - {?eh,tc_start, - {config_dynamic_SUITE,test_disappearable_variable_alias}}, - {?eh,tc_done, - {config_dynamic_SUITE,test_disappearable_variable_alias,ok}}, - {?eh,test_stats,{5,0,{0,0}}}, - {?eh,tc_start,{config_dynamic_SUITE,end_per_suite}}, - {?eh,tc_done,{config_dynamic_SUITE,end_per_suite,ok}}, - {?eh,test_done,{'DEF','STOP_TIME'}}, - {?eh,stop_logging,[]} -]. + [ + {?eh,start_logging,{'DEF','RUNDIR'}}, + {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, + {?eh,start_info,{1,1,5}}, + {?eh,tc_start,{config_dynamic_SUITE,init_per_suite}}, + {?eh,tc_done,{config_dynamic_SUITE,init_per_suite,ok}}, + {?eh,tc_start,{config_dynamic_SUITE,test_get_known_variable}}, + {?eh,tc_done, + {config_dynamic_SUITE,test_get_known_variable,ok}}, + {?eh,test_stats,{1,0,{0,0}}}, + {?eh,tc_start,{config_dynamic_SUITE,test_localtime_update}}, + {?eh,tc_done,{config_dynamic_SUITE,test_localtime_update,ok}}, + {?eh,test_stats,{2,0,{0,0}}}, + {?eh,tc_start,{config_dynamic_SUITE,test_server_pid}}, + {?eh,tc_done,{config_dynamic_SUITE,test_server_pid,ok}}, + {?eh,test_stats,{3,0,{0,0}}}, + {?eh,tc_start, + {config_dynamic_SUITE,test_disappearable_variable}}, + {?eh,tc_done, + {config_dynamic_SUITE,test_disappearable_variable,ok}}, + {?eh,test_stats,{4,0,{0,0}}}, + {?eh,tc_start, + {config_dynamic_SUITE,test_disappearable_variable_alias}}, + {?eh,tc_done, + {config_dynamic_SUITE,test_disappearable_variable_alias,ok}}, + {?eh,test_stats,{5,0,{0,0}}}, + {?eh,tc_start,{config_dynamic_SUITE,end_per_suite}}, + {?eh,tc_done,{config_dynamic_SUITE,end_per_suite,ok}}, + {?eh,test_done,{'DEF','STOP_TIME'}}, + {?eh,stop_logging,[]} + ]. diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index eb294826b2..75d1c7d079 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -59,19 +59,19 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cfg_error, lib_error, no_compile, timetrap_end_conf, - timetrap_normal, timetrap_extended]. + [cfg_error, lib_error, no_compile, timetrap_end_conf, + timetrap_normal, timetrap_extended]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - %%-------------------------------------------------------------------- %% TEST CASES @@ -125,7 +125,7 @@ lib_error(Config) when is_list(Config) -> TestEvents = events_to_check(lib_error), ok = ct_test_support:verify_events(TestEvents, Events, Config). - + %%%----------------------------------------------------------------- %%% @@ -143,7 +143,7 @@ no_compile(Config) when is_list(Config) -> TestEvents = events_to_check(no_compile), ok = ct_test_support:verify_events(TestEvents, Events, Config). - + %%%----------------------------------------------------------------- %%% timetrap_end_conf(Config) when is_list(Config) -> @@ -217,8 +217,8 @@ setup(Test, Config) -> reformat(Events, EH) -> ct_test_support:reformat(Events, EH). -%reformat(Events, _EH) -> -% Events. + %reformat(Events, _EH) -> + % Events. %%%----------------------------------------------------------------- %%% TEST EVENTS @@ -251,7 +251,7 @@ test_events(cfg_error) -> {?eh,test_stats,{0,0,{0,2}}}, {?eh,tc_auto_skip, {cfg_error_1_SUITE,end_per_suite,{failed,{cfg_error_1_SUITE,init_per_suite, - {'EXIT',init_per_suite_fails}}}}}, + {'EXIT',init_per_suite_fails}}}}}, {?eh,tc_start,{cfg_error_2_SUITE,init_per_suite}}, {?eh,tc_done, @@ -381,12 +381,12 @@ test_events(cfg_error) -> {?eh,tc_auto_skip, {cfg_error_8_SUITE,tc1, {failed,{cfg_error_8_SUITE,init_per_group, - {'EXIT',{init_per_group_fails,g1}}}}}}, + {'EXIT',{init_per_group_fails,g1}}}}}}, {?eh,test_stats,{4,0,{0,11}}}, {?eh,tc_auto_skip, {cfg_error_8_SUITE,end_per_group, {failed,{cfg_error_8_SUITE,init_per_group, - {'EXIT',{init_per_group_fails,g1}}}}}}], + {'EXIT',{init_per_group_fails,g1}}}}}}], [{?eh,tc_start,{cfg_error_8_SUITE,{init_per_group,g2,[]}}}, {?eh,tc_done,{cfg_error_8_SUITE, @@ -399,7 +399,7 @@ test_events(cfg_error) -> {?eh,tc_auto_skip,{cfg_error_8_SUITE,end_per_group, {failed,{cfg_error_8_SUITE,init_per_group, {timetrap_timeout,2000}}}}}], - + [{?eh,tc_start,{cfg_error_8_SUITE,{init_per_group,g3,[]}}}, {?eh,tc_done, {cfg_error_8_SUITE,{init_per_group,g3,[]}, @@ -439,7 +439,7 @@ test_events(cfg_error) -> {?eh,test_stats,{5,0,{0,13}}}, {?eh,tc_start,{cfg_error_8_SUITE,{end_per_group,g4,[]}}}, {?eh,tc_done,{cfg_error_8_SUITE,{end_per_group,g4,[]},ok}}], - + [{?eh,tc_start,{cfg_error_8_SUITE,{init_per_group,g5,[]}}}, {?eh,tc_done,{cfg_error_8_SUITE,{init_per_group,g5,[]},ok}}, {?eh,tc_start,{cfg_error_8_SUITE,tc1}}, diff --git a/lib/common_test/test/ct_event_handler_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE.erl index 3646671460..39216d9b9e 100644 --- a/lib/common_test/test/ct_event_handler_SUITE.erl +++ b/lib/common_test/test/ct_event_handler_SUITE.erl @@ -59,13 +59,13 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_stop, results]. + [start_stop, results]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> Config. diff --git a/lib/common_test/test/ct_groups_test_1_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE.erl index e75f21da04..8ba44e9925 100644 --- a/lib/common_test/test/ct_groups_test_1_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_1_SUITE.erl @@ -59,8 +59,8 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[groups_suite_1, groups_suite_2, groups_suites_1, - groups_dir_1, groups_dirs_1]. + [groups_suite_1, groups_suite_2, groups_suites_1, + groups_dir_1, groups_dirs_1]. groups() -> []. diff --git a/lib/common_test/test/ct_groups_test_2_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE.erl index 11f915682d..f4503e97a8 100644 --- a/lib/common_test/test/ct_groups_test_2_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl @@ -59,16 +59,16 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[missing_conf, repeat_1]. + [missing_conf, repeat_1]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%-------------------------------------------------------------------- diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl index 10ee0fd7ad..c2ce713fe0 100644 --- a/lib/common_test/test/ct_misc_1_SUITE.erl +++ b/lib/common_test/test/ct_misc_1_SUITE.erl @@ -60,10 +60,14 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[beam_me_up, parse_table]. + [beam_me_up, {group,parse_table}]. groups() -> - []. + [{parse_table,[parallel], + [parse_table_empty, parse_table_single, + parse_table_multiline_row, + parse_table_one_column_multiline, + parse_table_one_column_simple]}]. init_per_group(_GroupName, Config) -> Config. @@ -112,13 +116,6 @@ beam_me_up(Config) when is_list(Config) -> TestEvents = events_to_check(beam_me_up, 1), ok = ct_test_support:verify_events(TestEvents, Events, Config). - -parse_table(suite) -> - [parse_table_empty, parse_table_single, - parse_table_multiline_row, - parse_table_one_column_multiline, - parse_table_one_column_simple]. - parse_table_empty(Config) when is_list(Config) -> String = ["+----+-------+---------+---------+----------+------+--------+", diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl index 60d40e05a4..52ef5cba4b 100644 --- a/lib/common_test/test/ct_repeat_1_SUITE.erl +++ b/lib/common_test/test/ct_repeat_1_SUITE.erl @@ -59,13 +59,13 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[repeat_cs, repeat_cs_and_grs, repeat_seq, - repeat_cs_until_any_ok, repeat_gr_until_any_ok, - repeat_cs_until_any_fail, repeat_gr_until_any_fail, - repeat_cs_until_all_ok, repeat_gr_until_all_ok, - repeat_cs_until_all_fail, repeat_gr_until_all_fail, - repeat_seq_until_any_fail, - repeat_shuffled_seq_until_any_fail]. + [repeat_cs, repeat_cs_and_grs, repeat_seq, + repeat_cs_until_any_ok, repeat_gr_until_any_ok, + repeat_cs_until_any_fail, repeat_gr_until_any_fail, + repeat_cs_until_all_ok, repeat_gr_until_all_ok, + repeat_cs_until_all_fail, repeat_gr_until_all_fail, + repeat_seq_until_any_fail, + repeat_shuffled_seq_until_any_fail]. groups() -> []. diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl index 5d7cd1df4d..80275c28f7 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE.erl @@ -59,10 +59,10 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[subgroup_return_fail, subgroup_init_fail, - subgroup_after_failed_case, - case_after_subgroup_return_fail, - case_after_subgroup_fail_init]. + [subgroup_return_fail, subgroup_init_fail, + subgroup_after_failed_case, + case_after_subgroup_return_fail, + case_after_subgroup_fail_init]. groups() -> []. diff --git a/lib/common_test/test/ct_skip_SUITE.erl b/lib/common_test/test/ct_skip_SUITE.erl index 5992b49489..1284932717 100644 --- a/lib/common_test/test/ct_skip_SUITE.erl +++ b/lib/common_test/test/ct_skip_SUITE.erl @@ -59,7 +59,7 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[auto_skip, user_skip]. + [auto_skip, user_skip]. groups() -> []. diff --git a/lib/common_test/test/ct_smoke_test_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE.erl index 749c6cd9ed..0e02fb4fc6 100644 --- a/lib/common_test/test/ct_smoke_test_SUITE.erl +++ b/lib/common_test/test/ct_smoke_test_SUITE.erl @@ -115,8 +115,8 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[dir1, dir2, dir1_2, suite11, suite21, suite11_21, - tc111, tc211, tc111_112]. + [dir1, dir2, dir1_2, suite11, suite21, suite11_21, + tc111, tc211, tc111_112]. groups() -> []. diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE.erl index 6644233680..70943285bd 100644 --- a/lib/common_test/test/ct_test_server_if_1_SUITE.erl +++ b/lib/common_test/test/ct_test_server_if_1_SUITE.erl @@ -59,7 +59,7 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ts_if_1]. + [ts_if_1]. groups() -> []. diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index 9d759750cc..949269a9e4 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -59,15 +59,15 @@ end_per_testcase(TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[all_suites, skip_all_suites, suite, skip_suite, - all_testcases, skip_all_testcases, testcase, - skip_testcase, all_groups, skip_all_groups, group, - skip_group, group_all_testcases, - skip_group_all_testcases, group_testcase, - skip_group_testcase, topgroup, subgroup, skip_subgroup, - subgroup_all_testcases, skip_subgroup_all_testcases, - subgroup_testcase, skip_subgroup_testcase, - sub_skipped_by_top, testcase_in_multiple_groups]. + [all_suites, skip_all_suites, suite, skip_suite, + all_testcases, skip_all_testcases, testcase, + skip_testcase, all_groups, skip_all_groups, group, + skip_group, group_all_testcases, + skip_group_all_testcases, group_testcase, + skip_group_testcase, topgroup, subgroup, skip_subgroup, + subgroup_all_testcases, skip_subgroup_all_testcases, + subgroup_testcase, skip_subgroup_testcase, + sub_skipped_by_top, testcase_in_multiple_groups]. groups() -> []. -- cgit v1.2.3 From c777f9b28459cb83b4fd0e07fac76432113c63f4 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 11:37:41 +0100 Subject: Fix formatting for compiler --- lib/compiler/test/andor_SUITE.erl | 9 +++++---- lib/compiler/test/apply_SUITE.erl | 11 ++++++----- lib/compiler/test/beam_validator_SUITE.erl | 22 +++++++++++---------- lib/compiler/test/bs_bincomp_SUITE.erl | 3 ++- lib/compiler/test/bs_bit_binaries_SUITE.erl | 17 ++++++++-------- lib/compiler/test/bs_construct_SUITE.erl | 16 ++++++++------- lib/compiler/test/bs_match_SUITE.erl | 30 +++++++++++++++-------------- lib/compiler/test/bs_utf_SUITE.erl | 15 ++++++++------- lib/compiler/test/compilation_SUITE.erl | 4 ++-- lib/compiler/test/compile_SUITE.erl | 17 ++++++++-------- lib/compiler/test/core_SUITE.erl | 8 +++++--- lib/compiler/test/core_fold_SUITE.erl | 13 +++++++------ lib/compiler/test/error_SUITE.erl | 12 ++++++------ lib/compiler/test/float_SUITE.erl | 14 ++++++++------ lib/compiler/test/fun_SUITE.erl | 11 ++++++----- lib/compiler/test/guard_SUITE.erl | 27 +++++++++++++------------- lib/compiler/test/inline_SUITE.erl | 12 ++++++------ lib/compiler/test/lc_SUITE.erl | 12 +++++++----- lib/compiler/test/match_SUITE.erl | 13 +++++++------ lib/compiler/test/misc_SUITE.erl | 8 +++++--- lib/compiler/test/num_bif_SUITE.erl | 17 ++++++++-------- lib/compiler/test/parteval_SUITE.erl | 9 +++++---- lib/compiler/test/pmod_SUITE.erl | 12 +++++++----- lib/compiler/test/receive_SUITE.erl | 10 ++++++---- lib/compiler/test/record_SUITE.erl | 16 ++++++++------- lib/compiler/test/trycatch_SUITE.erl | 18 +++++++++-------- lib/compiler/test/warnings_SUITE.erl | 16 ++++++++------- 27 files changed, 204 insertions(+), 168 deletions(-) diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index 01561fc7e6..d592a20bb0 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -18,7 +18,8 @@ %% -module(andor_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_case/1,t_and_or/1,t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1,before_and_inside_if/1]). @@ -27,9 +28,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(andor_SUITE), - [t_case, t_and_or, t_andalso, t_orelse, inside, overlap, - combined, in_case, before_and_inside_if]. + test_lib:recompile(andor_SUITE), + [t_case, t_and_or, t_andalso, t_orelse, inside, overlap, + combined, in_case, before_and_inside_if]. groups() -> []. diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index dfb061e0f7..8a8c971837 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -18,7 +18,8 @@ %% -module(apply_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,mfa/1,fun_apply/1]). -export([foo/0,bar/1,baz/2]). @@ -27,8 +28,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(apply_SUITE), - [mfa, fun_apply]. + test_lib:recompile(apply_SUITE), + [mfa, fun_apply]. groups() -> []. @@ -40,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(APPLY0(M, F), (fun(Res) -> Res = M:F() end)(apply(M, F, []))). diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index a2b42d8446..2699e90bb4 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -18,7 +18,9 @@ %% -module(beam_validator_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, beam_files/1,compiler_bug/1,stupid_but_valid/1, xrange/1,yrange/1,stack/1,call_last/1,merge_undefined/1, uninit/1,unsafe_catch/1, @@ -44,15 +46,15 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(beam_validator_SUITE), - [beam_files, compiler_bug, stupid_but_valid, xrange, - yrange, stack, call_last, merge_undefined, uninit, - unsafe_catch, dead_code, mult_labels, - overwrite_catchtag, overwrite_trytag, accessing_tags, - bad_catch_try, cons_guard, freg_range, freg_uninit, - freg_state, bin_match, bin_aligned, bad_dsetel, - state_after_fault_in_catch, no_exception_in_catch, - undef_label, illegal_instruction, failing_gc_guard_bif]. + test_lib:recompile(beam_validator_SUITE), + [beam_files, compiler_bug, stupid_but_valid, xrange, + yrange, stack, call_last, merge_undefined, uninit, + unsafe_catch, dead_code, mult_labels, + overwrite_catchtag, overwrite_trytag, accessing_tags, + bad_catch_try, cons_guard, freg_range, freg_uninit, + freg_state, bin_match, bin_aligned, bad_dsetel, + state_after_fault_in_catch, no_exception_in_catch, + undef_label, illegal_instruction, failing_gc_guard_bif]. groups() -> []. diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl index 830492c482..c5a054aba6 100644 --- a/lib/compiler/test/bs_bincomp_SUITE.erl +++ b/lib/compiler/test/bs_bincomp_SUITE.erl @@ -21,7 +21,8 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,filters/1,trim_coverage/1, nomatch/1,sizes/1,tail/1]). diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 8dbd6dbb33..1b5a4a9666 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -21,7 +21,8 @@ -module(bs_bit_binaries_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -32,11 +33,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(bs_bit_binaries_SUITE), - [misc, horrid_match, test_bitstr, test_bit_size, - asymmetric_tests, big_asymmetric_tests, - binary_to_and_from_list, big_binary_to_and_from_list, - send_and_receive, send_and_receive_alot]. + test_lib:recompile(bs_bit_binaries_SUITE), + [misc, horrid_match, test_bitstr, test_bit_size, + asymmetric_tests, big_asymmetric_tests, + binary_to_and_from_list, big_binary_to_and_from_list, + send_and_receive, send_and_receive_alot]. groups() -> []. @@ -48,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. misc(Config) when is_list(Config) -> diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index 5d7ec4f1bd..0d6582d16f 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -23,7 +23,9 @@ -module(bs_construct_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, two/1,test1/1,fail/1,float_bin/1,in_guard/1,in_catch/1, nasty_literals/1,coerce_to_float/1,side_effect/1, opt/1,otp_7556/1,float_arith/1,otp_8054/1]). @@ -33,10 +35,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(bs_construct_SUITE), - [two, test1, fail, float_bin, in_guard, in_catch, - nasty_literals, side_effect, opt, otp_7556, float_arith, - otp_8054]. + test_lib:recompile(bs_construct_SUITE), + [two, test1, fail, float_bin, in_guard, in_catch, + nasty_literals, side_effect, opt, otp_7556, float_arith, + otp_8054]. groups() -> []. @@ -48,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index b5537adbbb..6cc5a35b5e 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -20,7 +20,9 @@ -module(bs_match_SUITE). -compile(nowarn_shadow_vars). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, fun_shadow/1,int_float/1,otp_5269/1,null_fields/1,wiger/1, bin_tail/1,save_restore/1,shadowed_size_var/1, partitioned_bs_match/1,function_clause/1, @@ -41,17 +43,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(bs_match_SUITE), - [fun_shadow, int_float, otp_5269, null_fields, wiger, - bin_tail, save_restore, shadowed_size_var, - partitioned_bs_match, function_clause, unit, - shared_sub_bins, bin_and_float, dec_subidentifiers, - skip_optional_tag, wfbm, degenerated_match, bs_sum, - coverage, multiple_uses, zero_label, followed_by_catch, - matching_meets_construction, simon, - matching_and_andalso, otp_7188, otp_7233, otp_7240, - otp_7498, match_string, zero_width, bad_size, haystack, - cover_beam_bool]. + test_lib:recompile(bs_match_SUITE), + [fun_shadow, int_float, otp_5269, null_fields, wiger, + bin_tail, save_restore, shadowed_size_var, + partitioned_bs_match, function_clause, unit, + shared_sub_bins, bin_and_float, dec_subidentifiers, + skip_optional_tag, wfbm, degenerated_match, bs_sum, + coverage, multiple_uses, zero_label, followed_by_catch, + matching_meets_construction, simon, + matching_and_andalso, otp_7188, otp_7233, otp_7240, + otp_7498, match_string, zero_width, bad_size, haystack, + cover_beam_bool]. groups() -> []. @@ -63,10 +65,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index ac27c6d1f0..db38fa0fa3 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -19,7 +19,8 @@ -module(bs_utf_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1, literals/1,coverage/1]). @@ -29,10 +30,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(bs_utf_SUITE), - [utf8_roundtrip, unused_utf_char, utf16_roundtrip, - utf32_roundtrip, guard, extreme_tripping, literals, - coverage]. + test_lib:recompile(bs_utf_SUITE), + [utf8_roundtrip, unused_utf_char, utf16_roundtrip, + utf32_roundtrip, guard, extreme_tripping, literals, + coverage]. groups() -> []. @@ -44,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. utf8_roundtrip(Config) when is_list(Config) -> diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 5651adf721..746c74f6a9 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -56,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(comp(N), N(Config) when is_list(Config) -> try_it(N, Config)). diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index 69a777be2d..96456211a2 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -22,7 +22,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, app_test/1, file_1/1, module_mismatch/1, big_file/1, outdir/1, binary/1, cond_and_ifdef/1, listings/1, listings_big/1, @@ -38,16 +39,16 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. -type all_return_type() :: [atom()]. -spec all() -> all_return_type(). all() -> -test_lib:recompile(compile_SUITE), - [app_test, file_1, module_mismatch, big_file, outdir, - binary, cond_and_ifdef, listings, listings_big, - other_output, package_forms, encrypted_abstr, - {group, bad_record_use}, strict_record, - missing_testheap, cover, env, core, asm]. + test_lib:recompile(compile_SUITE), + [app_test, file_1, module_mismatch, big_file, outdir, + binary, cond_and_ifdef, listings, listings_big, + other_output, package_forms, encrypted_abstr, + {group, bad_record_use}, strict_record, + missing_testheap, cover, env, core, asm]. groups() -> [{bad_record_use, [], - [bad_record_use1, bad_record_use2]}]. + [bad_record_use1, bad_record_use2]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index f72271d2fc..8d472ec44b 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -18,7 +18,9 @@ %% -module(core_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, dehydrated_itracer/1,nested_tries/1]). -include_lib("test_server/include/test_server.hrl"). @@ -38,8 +40,8 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(core_SUITE), - [dehydrated_itracer, nested_tries]. + test_lib:recompile(core_SUITE), + [dehydrated_itracer, nested_tries]. groups() -> []. diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 40d28e90cc..8491c4eaf0 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -18,7 +18,8 @@ %% -module(core_fold_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_element/1,setelement/1,t_length/1,append/1,t_apply/1,bifs/1, eq/1,nested_call_in_case/1,coverage/1]). @@ -29,9 +30,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(core_fold_SUITE), - [t_element, setelement, t_length, append, t_apply, bifs, - eq, nested_call_in_case, coverage]. + test_lib:recompile(core_fold_SUITE), + [t_element, setelement, t_length, append, t_apply, bifs, + eq, nested_call_in_case, coverage]. groups() -> []. @@ -43,10 +44,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. t_element(Config) when is_list(Config) -> diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index e1985965da..dc051fbd98 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -20,14 +20,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(error_SUITE), - [head_mismatch_line, warnings_as_errors, bif_clashes]. + test_lib:recompile(error_SUITE), + [head_mismatch_line, warnings_as_errors, bif_clashes]. groups() -> []. @@ -39,11 +40,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - + Config. bif_clashes(Config) when is_list(Config) -> diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index f635667d7e..b963634aec 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -17,16 +17,18 @@ %% %CopyrightEnd% %% -module(float_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + pending/1,bif_calls/1,math_functions/1,mixed_float_and_int/1]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(float_SUITE), - [pending, bif_calls, math_functions, - mixed_float_and_int]. + test_lib:recompile(float_SUITE), + [pending, bif_calls, math_functions, + mixed_float_and_int]. groups() -> []. @@ -38,10 +40,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Thanks to Tobias Lindahl diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index 8579b80d89..810d98b5aa 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -18,7 +18,8 @@ %% -module(fun_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test1/1,overwritten_fun/1,otp_7202/1,bif_fun/1]). -include_lib("test_server/include/test_server.hrl"). @@ -26,8 +27,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(fun_SUITE), - [test1, overwritten_fun, otp_7202, bif_fun]. + test_lib:recompile(fun_SUITE), + [test1, overwritten_fun, otp_7202, bif_fun]. groups() -> []. @@ -39,10 +40,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%% The help functions below are copied from emulator:bs_construct_SUITE. diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index ad3d91f2e5..60b53efa47 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, misc/1,const_cond/1,basic_not/1,complex_not/1,nested_nots/1, semicolon/1,complex_semicolon/1,comma/1, or_guard/1,more_or_guards/1, @@ -36,14 +37,14 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(guard_SUITE), - [misc, const_cond, basic_not, complex_not, nested_nots, - semicolon, complex_semicolon, comma, or_guard, - more_or_guards, complex_or_guards, and_guard, xor_guard, - more_xor_guards, build_in_guard, old_guard_tests, gbif, - t_is_boolean, is_function_2, tricky, rel_ops, - literal_type_tests, basic_andalso_orelse, traverse_dcd, - check_qlc_hrl, andalso_semi, t_tuple_size, binary_part]. + test_lib:recompile(guard_SUITE), + [misc, const_cond, basic_not, complex_not, nested_nots, + semicolon, complex_semicolon, comma, or_guard, + more_or_guards, complex_or_guards, and_guard, xor_guard, + more_xor_guards, build_in_guard, old_guard_tests, gbif, + t_is_boolean, is_function_2, tricky, rel_ops, + literal_type_tests, basic_andalso_orelse, traverse_dcd, + check_qlc_hrl, andalso_semi, t_tuple_size, binary_part]. groups() -> []. @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. misc(Config) when is_list(Config) -> @@ -1153,7 +1154,7 @@ make_test([{T,L}|Ts]) -> make_test([]) -> []. test(T, L) -> - S0 = io_lib:format("begin io:format(\"~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T,L,T,L]), + S0 = io_lib:format("begin io:format(\"~~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T,L,T,L]), S = lists:flatten(S0), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), @@ -1161,7 +1162,7 @@ test(T, L) -> {match,0,{atom,0,Val},hd(E)}. test(T, L1, L2) -> - S0 = io_lib:format("begin io:format(\"~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L1,L2,T,L1,L2]), + S0 = io_lib:format("begin io:format(\"~~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L1,L2,T,L1,L2]), S = lists:flatten(S0), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 83c2163316..ec86daea9b 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -31,10 +31,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(inline_SUITE), - [attribute, bsdecode, bsdes, barnes2, decode1, smith, - itracer, pseudoknot, lists, really_inlined, otp_7223, - coverage]. + test_lib:recompile(inline_SUITE), + [attribute, bsdecode, bsdes, barnes2, decode1, smith, + itracer, pseudoknot, lists, really_inlined, otp_7223, + coverage]. groups() -> []. @@ -46,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. attribute(Config) when is_list(Config) -> diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index f1fc4c9085..2f95ca9d76 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -19,7 +19,9 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1,deeply_nested/1,no_generator/1, empty_generator/1]). @@ -28,8 +30,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(lc_SUITE), - [basic, deeply_nested, no_generator, empty_generator]. + test_lib:recompile(lc_SUITE), + [basic, deeply_nested, no_generator, empty_generator]. groups() -> []. @@ -41,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index ddd84ad638..3cd519a6ef 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -18,7 +18,8 @@ %% -module(match_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, pmatch/1,mixed/1,aliases/1,match_in_call/1, untuplify/1,shortcut_boolean/1,letify_guard/1, selectify/1,underscore/1]). @@ -28,9 +29,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(match_SUITE), - [pmatch, mixed, aliases, match_in_call, untuplify, - shortcut_boolean, letify_guard, selectify, underscore]. + test_lib:recompile(match_SUITE), + [pmatch, mixed, aliases, match_in_call, untuplify, + shortcut_boolean, letify_guard, selectify, underscore]. groups() -> []. @@ -42,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. pmatch(Config) when is_list(Config) -> diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index c0673f447b..d80eabd1e7 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -18,7 +18,9 @@ %% -module(misc_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, tobias/1,empty_string/1,md5/1,silly_coverage/1, confused_literals/1,integer_encoding/1,override_bif/1]). @@ -68,10 +70,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl index 80bee6b9ff..8534b63602 100644 --- a/lib/compiler/test/num_bif_SUITE.erl +++ b/lib/compiler/test/num_bif_SUITE.erl @@ -30,7 +30,8 @@ %% round/1 %% trunc/1 --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, @@ -39,14 +40,14 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(num_bif_SUITE), - [t_abs, t_float, t_float_to_list, t_integer_to_list, - {group, t_list_to_float}, t_list_to_integer, t_round, - t_trunc]. + test_lib:recompile(num_bif_SUITE), + [t_abs, t_float, t_float_to_list, t_integer_to_list, + {group, t_list_to_float}, t_list_to_integer, t_round, + t_trunc]. groups() -> [{t_list_to_float, [], - [t_list_to_float_safe, t_list_to_float_risky]}]. + [t_list_to_float_safe, t_list_to_float_risky]}]. init_per_suite(Config) -> Config. @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. t_abs(Config) when is_list(Config) -> diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index 9cdc40a6fe..8d7542516c 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -20,12 +20,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pe2/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, pe2/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[pe2]. + [pe2]. groups() -> []. @@ -37,10 +38,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% (This is more general than needed, since we once compiled the same diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index c36b95b482..3479bf9270 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -18,7 +18,9 @@ %% -module(pmod_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1, otp_8447/1]). -include_lib("test_server/include/test_server.hrl"). @@ -26,8 +28,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(pmod_SUITE), - [basic, otp_8447]. + test_lib:recompile(pmod_SUITE), + [basic, otp_8447]. groups() -> []. @@ -39,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 64d55d2f3e..12aa81a30c 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -20,8 +20,10 @@ -module(receive_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, - recv/1,coverage/1,otp_7980/1,ref_opt/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + export/1,recv/1,coverage/1,otp_7980/1,ref_opt/1]). -include_lib("test_server/include/test_server.hrl"). @@ -50,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -record(state, {ena = true}). diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index a252cd3c31..07add97246 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -22,7 +22,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, errors/1,record_test_2/1,record_test_3/1,record_access_in_guards/1, guard_opt/1,eval_once/1,foobar/1,missing_test_heap/1, nested_access/1]). @@ -38,10 +40,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(record_SUITE), - [errors, record_test_2, record_test_3, - record_access_in_guards, guard_opt, eval_once, foobar, - missing_test_heap, nested_access]. + test_lib:recompile(record_SUITE), + [errors, record_test_2, record_test_3, + record_access_in_guards, guard_opt, eval_once, foobar, + missing_test_heap, nested_access]. groups() -> []. @@ -53,10 +55,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -record(foo, {a,b,c,d}). diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index fe6f8de9cf..61cb87799e 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -18,7 +18,9 @@ %% -module(trycatch_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,basic/1,lean_throw/1, + try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1, nested_horrid/1,last_call_optimization/1,bool/1, @@ -29,11 +31,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(trycatch_SUITE), - [basic, lean_throw, try_of, try_after, catch_oops, - after_oops, eclectic, rethrow, nested_of, nested_catch, - nested_after, nested_horrid, last_call_optimization, - bool, plain_catch_coverage, andalso_orelse]. + test_lib:recompile(trycatch_SUITE), + [basic, lean_throw, try_of, try_after, catch_oops, + after_oops, eclectic, rethrow, nested_of, nested_catch, + nested_after, nested_horrid, last_call_optimization, + bool, plain_catch_coverage, andalso_orelse]. groups() -> []. @@ -45,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index d18ab3a810..8f827de428 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -31,7 +31,9 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export([pattern/1,pattern2/1,pattern3/1,pattern4/1, guard/1,bad_arith/1,bool_cases/1,bad_apply/1, @@ -52,10 +54,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_lib:recompile(warnings_SUITE), - [pattern, pattern2, pattern3, pattern4, guard, - bad_arith, bool_cases, bad_apply, files, effect, - bin_opt_info, bin_construction]. + test_lib:recompile(warnings_SUITE), + [pattern, pattern2, pattern3, pattern4, guard, + bad_arith, bool_cases, bad_apply, files, effect, + bin_opt_info, bin_construction]. groups() -> []. @@ -67,10 +69,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. pattern(Config) when is_list(Config) -> -- cgit v1.2.3 From dd062265ad54a6a2fc705df9cfcc24dc16c4e7bf Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:12:54 +0100 Subject: Fix formatting for cosEvent --- lib/cosEvent/test/event_channel_SUITE.erl | 15 ++++++------ lib/cosEvent/test/generated_SUITE.erl | 40 +++++++++++++++---------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl index 2d4a7f7a44..742a85af78 100644 --- a/lib/cosEvent/test/event_channel_SUITE.erl +++ b/lib/cosEvent/test/event_channel_SUITE.erl @@ -53,7 +53,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, event_objects_api/1, events_api/1, events_sync_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + event_objects_api/1, events_api/1, events_sync_api/1, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -64,21 +65,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[events_api, events_sync_api, event_objects_api, - app_test]. + [events_api, events_sync_api, event_objects_api, + app_test]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index 2d3e1e1b8d..c21c4b1e45 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -71,12 +71,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -87,22 +87,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['CosEventChannelAdmin_AlreadyConnected', - 'CosEventChannelAdmin_TypeError', - 'CosEventComm_Disconnected', - 'CosEventChannelAdmin_ConsumerAdmin', - 'CosEventChannelAdmin_EventChannel', - 'CosEventChannelAdmin_ProxyPullConsumer', - 'CosEventChannelAdmin_ProxyPullSupplier', - 'CosEventChannelAdmin_ProxyPushConsumer', - 'CosEventChannelAdmin_ProxyPushSupplier', - 'CosEventChannelAdmin_SupplierAdmin', - oe_CosEventComm_CAdmin, oe_CosEventComm_Channel, - oe_CosEventComm_Event, oe_CosEventComm_PullerS, - oe_CosEventComm_PusherS, 'CosEventComm_PullConsumer', - 'CosEventComm_PullSupplier', - 'CosEventComm_PushConsumer', - 'CosEventComm_PushSupplier']. + ['CosEventChannelAdmin_AlreadyConnected', + 'CosEventChannelAdmin_TypeError', + 'CosEventComm_Disconnected', + 'CosEventChannelAdmin_ConsumerAdmin', + 'CosEventChannelAdmin_EventChannel', + 'CosEventChannelAdmin_ProxyPullConsumer', + 'CosEventChannelAdmin_ProxyPullSupplier', + 'CosEventChannelAdmin_ProxyPushConsumer', + 'CosEventChannelAdmin_ProxyPushSupplier', + 'CosEventChannelAdmin_SupplierAdmin', + oe_CosEventComm_CAdmin, oe_CosEventComm_Channel, + oe_CosEventComm_Event, oe_CosEventComm_PullerS, + oe_CosEventComm_PusherS, 'CosEventComm_PullConsumer', + 'CosEventComm_PullSupplier', + 'CosEventComm_PushConsumer', + 'CosEventComm_PushSupplier']. groups() -> []. @@ -114,10 +114,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- -- cgit v1.2.3 From a5da203c8c2983490c42f34b018db820d21d858d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:13:06 +0100 Subject: Fix formatting for cosEventDomain --- lib/cosEventDomain/test/event_domain_SUITE.erl | 13 +++++----- lib/cosEventDomain/test/generated_SUITE.erl | 35 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl index d22e6009a7..b3bb109b3c 100644 --- a/lib/cosEventDomain/test/event_domain_SUITE.erl +++ b/lib/cosEventDomain/test/event_domain_SUITE.erl @@ -56,7 +56,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, event_domain_api/1, event_domain_factory_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + event_domain_api/1, event_domain_factory_api/1, cases/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -67,20 +68,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[event_domain_api, event_domain_factory_api, app_test]. + [event_domain_api, event_domain_factory_api, app_test]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index d67bafb8c8..c810e84605 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -76,7 +76,6 @@ %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -87,21 +86,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['CosEventDomainAdmin', - 'CosEventDomainAdmin_DiamondSeq', - 'CosEventDomainAdmin_AlreadyExists', - 'CosEventDomainAdmin_DomainIDSeq', - 'CosEventDomainAdmin_Connection', - 'CosEventDomainAdmin_ConnectionIDSeq', - 'CosEventDomainAdmin_ConnectionNotFound', - 'CosEventDomainAdmin_CycleCreationForbidden', - 'CosEventDomainAdmin_CycleSeq', - 'CosEventDomainAdmin_DiamondCreationForbidden', - 'CosEventDomainAdmin_DomainNotFound', - 'CosEventDomainAdmin_MemberIDSeq', - 'CosEventDomainAdmin_RouteSeq', - 'CosEventDomainAdmin_EventDomainFactory', - 'CosEventDomainAdmin_EventDomain']. + ['CosEventDomainAdmin', + 'CosEventDomainAdmin_DiamondSeq', + 'CosEventDomainAdmin_AlreadyExists', + 'CosEventDomainAdmin_DomainIDSeq', + 'CosEventDomainAdmin_Connection', + 'CosEventDomainAdmin_ConnectionIDSeq', + 'CosEventDomainAdmin_ConnectionNotFound', + 'CosEventDomainAdmin_CycleCreationForbidden', + 'CosEventDomainAdmin_CycleSeq', + 'CosEventDomainAdmin_DiamondCreationForbidden', + 'CosEventDomainAdmin_DomainNotFound', + 'CosEventDomainAdmin_MemberIDSeq', + 'CosEventDomainAdmin_RouteSeq', + 'CosEventDomainAdmin_EventDomainFactory', + 'CosEventDomainAdmin_EventDomain']. groups() -> []. @@ -113,10 +112,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- -- cgit v1.2.3 From 233b5fad18efb97bb8e9b1770c6b1d9101763b4b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:13:16 +0100 Subject: Fix formatting for cosTime --- lib/cosTime/test/generated_SUITE.erl | 18 +++++++++--------- lib/cosTime/test/time_SUITE.erl | 13 +++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index 8c6685ab45..0083d45a22 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -71,12 +71,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -87,11 +87,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['TimeBase_IntervalT', 'TimeBase_UtcT', - 'CosTime_TimeUnavailable', 'CosTimerEvent_TimerEventT', - 'CosTime_TIO', 'CosTime_TimeService', 'CosTime_UTO', - 'CosTimerEvent_TimerEventHandler', - 'CosTimerEvent_TimerEventService']. + ['TimeBase_IntervalT', 'TimeBase_UtcT', + 'CosTime_TimeUnavailable', 'CosTimerEvent_TimerEventT', + 'CosTime_TIO', 'CosTime_TimeService', 'CosTime_UTO', + 'CosTimerEvent_TimerEventHandler', + 'CosTimerEvent_TimerEventService']. groups() -> []. @@ -103,10 +103,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index 6c931585c3..2b8fdcebdb 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -67,7 +67,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, time_api/1, timerevent_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, time_api/1, timerevent_api/1, init_per_testcase/2, end_per_testcase/2, app_test/1]). @@ -79,20 +80,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[time_api, timerevent_api, app_test]. + [time_api, timerevent_api, app_test]. -- cgit v1.2.3 From 6a3d27a6522b5d48a36711dd8705ba33996a6f41 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:14:37 +0100 Subject: Fix formatting for cosTransactions --- lib/cosTransactions/test/generated_SUITE.erl | 54 ++++++++++++------------- lib/cosTransactions/test/transactions_SUITE.erl | 10 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index f4a300fb0c..20988b53f1 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -72,12 +72,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -88,29 +88,29 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['CosTransactions_Control', - 'CosTransactions_Coordinator', - 'CosTransactions_HeuristicCommit', - 'CosTransactions_HeuristicHazard', - 'CosTransactions_HeuristicMixed', - 'CosTransactions_HeuristicRollback', - 'CosTransactions_Inactive', - 'CosTransactions_InvalidControl', - 'CosTransactions_NoTransaction', - 'CosTransactions_NotPrepared', - 'CosTransactions_NotSubtransaction', - 'CosTransactions_RecoveryCoordinator', - 'CosTransactions_Resource', - 'CosTransactions_SubtransactionAwareResource', - 'CosTransactions_SubtransactionsUnavailable', - 'CosTransactions_Terminator', - 'CosTransactions_TransactionFactory', - 'CosTransactions_Unavailable', - 'CosTransactions_SynchronizationUnavailable', - 'CosTransactions_TransIdentity', - 'CosTransactions_PropagationContext', - 'CosTransactions_otid_t', - 'CosTransactions_WrongTransaction', 'ETraP_Server']. + ['CosTransactions_Control', + 'CosTransactions_Coordinator', + 'CosTransactions_HeuristicCommit', + 'CosTransactions_HeuristicHazard', + 'CosTransactions_HeuristicMixed', + 'CosTransactions_HeuristicRollback', + 'CosTransactions_Inactive', + 'CosTransactions_InvalidControl', + 'CosTransactions_NoTransaction', + 'CosTransactions_NotPrepared', + 'CosTransactions_NotSubtransaction', + 'CosTransactions_RecoveryCoordinator', + 'CosTransactions_Resource', + 'CosTransactions_SubtransactionAwareResource', + 'CosTransactions_SubtransactionsUnavailable', + 'CosTransactions_Terminator', + 'CosTransactions_TransactionFactory', + 'CosTransactions_Unavailable', + 'CosTransactions_SynchronizationUnavailable', + 'CosTransactions_TransIdentity', + 'CosTransactions_PropagationContext', + 'CosTransactions_otid_t', + 'CosTransactions_WrongTransaction', 'ETraP_Server']. groups() -> []. @@ -122,10 +122,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl index 0f7eb52d15..3727d94e67 100644 --- a/lib/cosTransactions/test/transactions_SUITE.erl +++ b/lib/cosTransactions/test/transactions_SUITE.erl @@ -48,20 +48,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[etrap_api, resource_api, app_test]. + [etrap_api, resource_api, app_test]. -- cgit v1.2.3 From 9943617414fd89162fce181f91545e4f1ca2fc64 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:14:50 +0100 Subject: Fix formatting for cosFileTransfer --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index eb7a0a6723..3e27d7b83b 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -25,8 +25,6 @@ -module(fileTransfer_SUITE). - - %%--------------- INCLUDES ----------------------------------- -include_lib("cosFileTransfer/src/cosFileTransferApp.hrl"). @@ -103,15 +101,15 @@ all() -> groups() -> []. - + init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> [fts_ftp_dir_api, fts_ftp_file_api, fts_ftp_file_ssl_api, fts_native_dir_api, -- cgit v1.2.3 From d7dfc91b854528df3ce71e5fa2c4d9bacb8f1bef Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:15:18 +0100 Subject: Fix formatting for cosNotification --- lib/cosNotification/test/eventDB_SUITE.erl | 18 +-- lib/cosNotification/test/generated_SUITE.erl | 176 ++++++++++++------------ lib/cosNotification/test/grammar_SUITE.erl | 17 +-- lib/cosNotification/test/notification_SUITE.erl | 24 ++-- 4 files changed, 118 insertions(+), 117 deletions(-) diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl index 30456595f3..ff0888366f 100644 --- a/lib/cosNotification/test/eventDB_SUITE.erl +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -259,7 +259,9 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, reorder_api/1, lookup_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + cases/0, init_per_suite/1, end_per_suite/1, reorder_api/1, + lookup_api/1, discard_api/1, max_events_api/1, gc_api/1, auto_gc_api/1, start_stop_time_api/1, mapping_filter_api/1, persisten_event_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -272,22 +274,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[persisten_event_api, start_stop_time_api, - mapping_filter_api, max_events_api, discard_api, - reorder_api, lookup_api, gc_api, auto_gc_api]. + [persisten_event_api, start_stop_time_api, + mapping_filter_api, max_events_api, discard_api, + reorder_api, lookup_api, gc_api, auto_gc_api]. diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index 2df02ed867..5002d2dd8e 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -71,12 +71,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -87,90 +87,90 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['CosNotification', - 'CosNotification_AdminPropertiesAdmin', - 'CosNotification_EventHeader', - 'CosNotification_EventType', - 'CosNotification_FixedEventHeader', - 'CosNotification_NamedPropertyRange', - 'CosNotification_Property', - 'CosNotification_PropertyError', - 'CosNotification_PropertyRange', - 'CosNotification_QoSAdmin', - 'CosNotification_StructuredEvent', - 'CosNotification_UnsupportedAdmin', - 'CosNotification_UnsupportedQoS', - 'CosNotification_EventBatch', - 'CosNotification_EventTypeSeq', - 'CosNotification_NamedPropertyRangeSeq', - 'CosNotification_PropertyErrorSeq', - 'CosNotifyChannelAdmin_AdminLimit', - 'CosNotifyChannelAdmin_AdminNotFound', - 'CosNotifyChannelAdmin_ChannelNotFound', - 'CosNotifyChannelAdmin_ConnectionAlreadyActive', - 'CosNotifyChannelAdmin_ConnectionAlreadyInactive', - 'CosNotifyChannelAdmin_NotConnected', - 'CosNotifyChannelAdmin_AdminIDSeq', - 'CosNotifyChannelAdmin_ChannelIDSeq', - 'CosNotifyChannelAdmin_ProxyIDSeq', - 'CosNotifyFilter_CallbackNotFound', - 'CosNotifyFilter_ConstraintExp', - 'CosNotifyFilter_ConstraintInfo', - 'CosNotifyFilter_ConstraintNotFound', - 'CosNotifyFilter_DuplicateConstraintID', - 'CosNotifyFilter_FilterNotFound', - 'CosNotifyFilter_InvalidConstraint', - 'CosNotifyFilter_InvalidGrammar', - 'CosNotifyFilter_InvalidValue', - 'CosNotifyFilter_MappingConstraintInfo', - 'CosNotifyFilter_MappingConstraintPair', - 'CosNotifyFilter_UnsupportedFilterableData', - 'CosNotifyFilter_CallbackIDSeq', - 'CosNotifyFilter_ConstraintExpSeq', - 'CosNotifyFilter_ConstraintIDSeq', - 'CosNotifyFilter_ConstraintInfoSeq', - 'CosNotifyFilter_FilterIDSeq', - 'CosNotifyFilter_MappingConstraintInfoSeq', - 'CosNotifyFilter_MappingConstraintPairSeq', - 'CosNotifyComm_InvalidEventType', - 'CosNotifyChannelAdmin_ConsumerAdmin', - 'CosNotifyChannelAdmin_EventChannel', - 'CosNotifyChannelAdmin_EventChannelFactory', - 'CosNotifyChannelAdmin_ProxyConsumer', - 'CosNotifyChannelAdmin_ProxyNotFound', - 'CosNotifyChannelAdmin_ProxyPullConsumer', - 'CosNotifyChannelAdmin_ProxyPullSupplier', - 'CosNotifyChannelAdmin_ProxyPushConsumer', - 'CosNotifyChannelAdmin_ProxyPushSupplier', - 'CosNotifyChannelAdmin_ProxySupplier', - 'CosNotifyChannelAdmin_SequenceProxyPullConsumer', - 'CosNotifyChannelAdmin_SequenceProxyPullSupplier', - 'CosNotifyChannelAdmin_SequenceProxyPushConsumer', - 'CosNotifyChannelAdmin_SequenceProxyPushSupplier', - 'CosNotifyChannelAdmin_StructuredProxyPullConsumer', - 'CosNotifyChannelAdmin_StructuredProxyPullSupplier', - 'CosNotifyChannelAdmin_StructuredProxyPushConsumer', - 'CosNotifyChannelAdmin_StructuredProxyPushSupplier', - 'CosNotifyChannelAdmin_SupplierAdmin', - 'CosNotifyFilter_Filter', 'CosNotifyFilter_FilterAdmin', - 'CosNotifyFilter_FilterFactory', - 'CosNotifyFilter_MappingFilter', - 'CosNotifyComm_NotifyPublish', - 'CosNotifyComm_NotifySubscribe', - 'CosNotifyComm_PullConsumer', - 'CosNotifyComm_PullSupplier', - 'CosNotifyComm_PushConsumer', - 'CosNotifyComm_PushSupplier', - 'CosNotifyComm_SequencePullConsumer', - 'CosNotifyComm_SequencePullSupplier', - 'CosNotifyComm_SequencePushConsumer', - 'CosNotifyComm_SequencePushSupplier', - 'CosNotifyComm_StructuredPullConsumer', - 'CosNotifyComm_StructuredPullSupplier', - 'CosNotifyComm_StructuredPushConsumer', - 'CosNotifyComm_StructuredPushSupplier', - oe_CosNotificationComm_Event, - 'CosNotification_PropertySeq']. + ['CosNotification', + 'CosNotification_AdminPropertiesAdmin', + 'CosNotification_EventHeader', + 'CosNotification_EventType', + 'CosNotification_FixedEventHeader', + 'CosNotification_NamedPropertyRange', + 'CosNotification_Property', + 'CosNotification_PropertyError', + 'CosNotification_PropertyRange', + 'CosNotification_QoSAdmin', + 'CosNotification_StructuredEvent', + 'CosNotification_UnsupportedAdmin', + 'CosNotification_UnsupportedQoS', + 'CosNotification_EventBatch', + 'CosNotification_EventTypeSeq', + 'CosNotification_NamedPropertyRangeSeq', + 'CosNotification_PropertyErrorSeq', + 'CosNotifyChannelAdmin_AdminLimit', + 'CosNotifyChannelAdmin_AdminNotFound', + 'CosNotifyChannelAdmin_ChannelNotFound', + 'CosNotifyChannelAdmin_ConnectionAlreadyActive', + 'CosNotifyChannelAdmin_ConnectionAlreadyInactive', + 'CosNotifyChannelAdmin_NotConnected', + 'CosNotifyChannelAdmin_AdminIDSeq', + 'CosNotifyChannelAdmin_ChannelIDSeq', + 'CosNotifyChannelAdmin_ProxyIDSeq', + 'CosNotifyFilter_CallbackNotFound', + 'CosNotifyFilter_ConstraintExp', + 'CosNotifyFilter_ConstraintInfo', + 'CosNotifyFilter_ConstraintNotFound', + 'CosNotifyFilter_DuplicateConstraintID', + 'CosNotifyFilter_FilterNotFound', + 'CosNotifyFilter_InvalidConstraint', + 'CosNotifyFilter_InvalidGrammar', + 'CosNotifyFilter_InvalidValue', + 'CosNotifyFilter_MappingConstraintInfo', + 'CosNotifyFilter_MappingConstraintPair', + 'CosNotifyFilter_UnsupportedFilterableData', + 'CosNotifyFilter_CallbackIDSeq', + 'CosNotifyFilter_ConstraintExpSeq', + 'CosNotifyFilter_ConstraintIDSeq', + 'CosNotifyFilter_ConstraintInfoSeq', + 'CosNotifyFilter_FilterIDSeq', + 'CosNotifyFilter_MappingConstraintInfoSeq', + 'CosNotifyFilter_MappingConstraintPairSeq', + 'CosNotifyComm_InvalidEventType', + 'CosNotifyChannelAdmin_ConsumerAdmin', + 'CosNotifyChannelAdmin_EventChannel', + 'CosNotifyChannelAdmin_EventChannelFactory', + 'CosNotifyChannelAdmin_ProxyConsumer', + 'CosNotifyChannelAdmin_ProxyNotFound', + 'CosNotifyChannelAdmin_ProxyPullConsumer', + 'CosNotifyChannelAdmin_ProxyPullSupplier', + 'CosNotifyChannelAdmin_ProxyPushConsumer', + 'CosNotifyChannelAdmin_ProxyPushSupplier', + 'CosNotifyChannelAdmin_ProxySupplier', + 'CosNotifyChannelAdmin_SequenceProxyPullConsumer', + 'CosNotifyChannelAdmin_SequenceProxyPullSupplier', + 'CosNotifyChannelAdmin_SequenceProxyPushConsumer', + 'CosNotifyChannelAdmin_SequenceProxyPushSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPullConsumer', + 'CosNotifyChannelAdmin_StructuredProxyPullSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPushConsumer', + 'CosNotifyChannelAdmin_StructuredProxyPushSupplier', + 'CosNotifyChannelAdmin_SupplierAdmin', + 'CosNotifyFilter_Filter', 'CosNotifyFilter_FilterAdmin', + 'CosNotifyFilter_FilterFactory', + 'CosNotifyFilter_MappingFilter', + 'CosNotifyComm_NotifyPublish', + 'CosNotifyComm_NotifySubscribe', + 'CosNotifyComm_PullConsumer', + 'CosNotifyComm_PullSupplier', + 'CosNotifyComm_PushConsumer', + 'CosNotifyComm_PushSupplier', + 'CosNotifyComm_SequencePullConsumer', + 'CosNotifyComm_SequencePullSupplier', + 'CosNotifyComm_SequencePushConsumer', + 'CosNotifyComm_SequencePushSupplier', + 'CosNotifyComm_StructuredPullConsumer', + 'CosNotifyComm_StructuredPullSupplier', + 'CosNotifyComm_StructuredPushConsumer', + 'CosNotifyComm_StructuredPushSupplier', + oe_CosNotificationComm_Event, + 'CosNotification_PropertySeq']. groups() -> []. @@ -182,10 +182,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl index 6f47e92028..69aac76506 100644 --- a/lib/cosNotification/test/grammar_SUITE.erl +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -64,7 +64,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + cases/0, init_per_suite/1, end_per_suite/1, union_api/1, enum_api/1, simple_types_api/1, components_api/1, positional_api/1, variable_api/1, init_per_testcase/2, end_per_testcase/2]). @@ -79,22 +80,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - cases() -> -[variable_api, union_api, enum_api, simple_types_api, - components_api, positional_api]. - + [variable_api, union_api, enum_api, simple_types_api, + components_api, positional_api]. + %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl index dcaa068ec5..bce3a5d6d4 100644 --- a/lib/cosNotification/test/notification_SUITE.erl +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -123,7 +123,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, qos_api/1, adm_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, qos_api/1, adm_api/1, cosevent_api/1, filter_adm_api/1, events_api/1, events2_api/1, event_qos_api/1, filter_api/1, mapping_filter_api/1, subscription_api/1, init_per_testcase/2, end_per_testcase/2, persistent_max_events_api/1, @@ -140,28 +141,25 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. - cases() -> -[persistent_max_events_api, - persistent_timeout_events_api, - persistent_recover_events_api, mapping_filter_api, - filter_api, filter_adm_api, event_qos_api, qos_api, - adm_api, cosevent_api, subscription_api, events_api, - events2_api, app_test]. - + [persistent_max_events_api, + persistent_timeout_events_api, + persistent_recover_events_api, mapping_filter_api, + filter_api, filter_adm_api, event_qos_api, qos_api, + adm_api, cosevent_api, subscription_api, events_api, + events2_api, app_test]. - %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- -- cgit v1.2.3 From 86108c144f9b0c4bed2e109ff4abb77408f22b9b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:15:45 +0100 Subject: Fix formatting for cosProperty --- lib/cosProperty/test/generated_SUITE.erl | 60 ++++++++++++++++---------------- lib/cosProperty/test/property_SUITE.erl | 18 +++++----- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 860e838e10..8abb12b43f 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -71,12 +71,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -87,32 +87,32 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['CosPropertyService_ConflictingProperty', - 'CosPropertyService_ConstraintNotSupported', - 'CosPropertyService_FixedProperty', - 'CosPropertyService_InvalidPropertyName', - 'CosPropertyService_MultipleExceptions', - 'CosPropertyService_Properties', - 'CosPropertyService_Property', - 'CosPropertyService_PropertyDef', - 'CosPropertyService_PropertyDefs', - 'CosPropertyService_PropertyException', - 'CosPropertyService_PropertyExceptions', - 'CosPropertyService_PropertyMode', - 'CosPropertyService_PropertyModes', - 'CosPropertyService_PropertyNames', - 'CosPropertyService_PropertyNotFound', - 'CosPropertyService_PropertyTypes', - 'CosPropertyService_ReadOnlyProperty', - 'CosPropertyService_UnsupportedMode', - 'CosPropertyService_UnsupportedProperty', - 'CosPropertyService_UnsupportedTypeCode', - 'CosPropertyService_PropertyNamesIterator', - 'CosPropertyService_PropertiesIterator', - 'CosPropertyService_PropertySet', - 'CosPropertyService_PropertySetDef', - 'CosPropertyService_PropertySetDefFactory', - 'CosPropertyService_PropertySetFactory']. + ['CosPropertyService_ConflictingProperty', + 'CosPropertyService_ConstraintNotSupported', + 'CosPropertyService_FixedProperty', + 'CosPropertyService_InvalidPropertyName', + 'CosPropertyService_MultipleExceptions', + 'CosPropertyService_Properties', + 'CosPropertyService_Property', + 'CosPropertyService_PropertyDef', + 'CosPropertyService_PropertyDefs', + 'CosPropertyService_PropertyException', + 'CosPropertyService_PropertyExceptions', + 'CosPropertyService_PropertyMode', + 'CosPropertyService_PropertyModes', + 'CosPropertyService_PropertyNames', + 'CosPropertyService_PropertyNotFound', + 'CosPropertyService_PropertyTypes', + 'CosPropertyService_ReadOnlyProperty', + 'CosPropertyService_UnsupportedMode', + 'CosPropertyService_UnsupportedProperty', + 'CosPropertyService_UnsupportedTypeCode', + 'CosPropertyService_PropertyNamesIterator', + 'CosPropertyService_PropertiesIterator', + 'CosPropertyService_PropertySet', + 'CosPropertyService_PropertySetDef', + 'CosPropertyService_PropertySetDefFactory', + 'CosPropertyService_PropertySetFactory']. groups() -> []. @@ -124,10 +124,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl index 6dd48dbef2..3a40f217ea 100644 --- a/lib/cosProperty/test/property_SUITE.erl +++ b/lib/cosProperty/test/property_SUITE.erl @@ -86,7 +86,8 @@ %% External exports %%----------------------------------------------------------------- %% Fixed exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). %% Test cases -export([create_setdef_api/1, create_set_api/1, define_with_mode_api/1, @@ -101,24 +102,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. - cases() -> -[create_setdef_api, create_set_api, - define_with_mode_api, define_api, names_iterator_api, - properties_iterator_api, app_test]. - - + [create_setdef_api, create_set_api, + define_with_mode_api, define_api, names_iterator_api, + properties_iterator_api, app_test]. %%----------------------------------------------------------------- %% Init and cleanup functions. -- cgit v1.2.3 From b3b108bac507ef4572226ad086912865f4672edb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:28:28 +0100 Subject: Fix formatting and also some migration fixes for debugger --- lib/debugger/test/andor_SUITE.erl | 16 +++++---- lib/debugger/test/bs_bincomp_SUITE.erl | 12 ++++--- lib/debugger/test/bs_construct_SUITE.erl | 16 +++++---- lib/debugger/test/bs_match_bin_SUITE.erl | 14 ++++---- lib/debugger/test/bs_match_int_SUITE.erl | 14 ++++---- lib/debugger/test/bs_match_misc_SUITE.erl | 14 ++++---- lib/debugger/test/bs_match_tail_SUITE.erl | 14 ++++---- lib/debugger/test/bs_utf_SUITE.erl | 15 ++++---- lib/debugger/test/bug_SUITE.erl | 7 ++-- lib/debugger/test/dbg_ui_SUITE.erl | 58 +++++++------------------------ lib/debugger/test/debugger_SUITE.erl | 12 ++++--- lib/debugger/test/erl_eval_SUITE.erl | 17 ++++----- lib/debugger/test/exception_SUITE.erl | 14 ++++---- lib/debugger/test/fun_SUITE.erl | 12 +++---- lib/debugger/test/guard_SUITE.erl | 28 ++++++++------- lib/debugger/test/int_SUITE.erl | 11 +++--- lib/debugger/test/int_break_SUITE.erl | 10 +++--- lib/debugger/test/int_eval_SUITE.erl | 27 +++++++------- lib/debugger/test/lc_SUITE.erl | 14 ++++---- lib/debugger/test/record_SUITE.erl | 14 ++++---- lib/debugger/test/trycatch_SUITE.erl | 22 ++++++------ 21 files changed, 177 insertions(+), 184 deletions(-) diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl index 6932d5a162..0c0eb78339 100644 --- a/lib/debugger/test/andor_SUITE.erl +++ b/lib/debugger/test/andor_SUITE.erl @@ -20,7 +20,9 @@ %% -module(andor_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, t_andalso/1,t_orelse/1,inside/1,overlap/1, combined/1,in_case/1]). @@ -29,16 +31,16 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> @@ -54,14 +56,14 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. cases() -> -[t_andalso, t_orelse, inside, overlap, combined, - in_case]. + [t_andalso, t_orelse, inside, overlap, combined, + in_case]. t_andalso(Config) when is_list(Config) -> Bs = [true,false], diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index c2bd599ae5..e361ebefbb 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -23,7 +23,9 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1]). @@ -42,8 +44,8 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[byte_aligned, bit_aligned, extended_byte_aligned, - extended_bit_aligned, mixed]. + [byte_aligned, bit_aligned, extended_byte_aligned, + extended_bit_aligned, mixed]. groups() -> []. @@ -55,10 +57,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl index 262ff93500..3ea0b08600 100644 --- a/lib/debugger/test/bs_construct_SUITE.erl +++ b/lib/debugger/test/bs_construct_SUITE.erl @@ -19,7 +19,9 @@ -module(bs_construct_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, coerce_to_float/1]). @@ -28,21 +30,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[test1, test2, test3, test4, test5, testf, not_used, - in_guard, coerce_to_float]. + [test1, test2, test3, test4, test5, testf, not_used, + in_guard, coerce_to_float]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -57,7 +59,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl index 8577a017d8..bbe3728816 100644 --- a/lib/debugger/test/bs_match_bin_SUITE.erl +++ b/lib/debugger/test/bs_match_bin_SUITE.erl @@ -21,7 +21,9 @@ -module(bs_match_bin_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, byte_split_binary/1,bit_split_binary/1]). -include_lib("test_server/include/test_server.hrl"). @@ -29,20 +31,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[byte_split_binary, bit_split_binary]. + [byte_split_binary, bit_split_binary]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -57,7 +59,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl index 11eab8090d..7a5b5c8f74 100644 --- a/lib/debugger/test/bs_match_int_SUITE.erl +++ b/lib/debugger/test/bs_match_int_SUITE.erl @@ -20,7 +20,9 @@ -module(bs_match_int_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1]). -include_lib("test_server/include/test_server.hrl"). @@ -30,20 +32,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + [cases()]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[integer, signed_integer, dynamic, more_dynamic, mml]. + [integer, signed_integer, dynamic, more_dynamic, mml]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -58,7 +60,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl index e0dafa2801..eec0973668 100644 --- a/lib/debugger/test/bs_match_misc_SUITE.erl +++ b/lib/debugger/test/bs_match_misc_SUITE.erl @@ -20,7 +20,9 @@ -module(bs_match_misc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1]). -include_lib("test_server/include/test_server.hrl"). @@ -28,20 +30,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[bound_var, bound_tail, t_float, little_float, sean]. + [bound_var, bound_tail, t_float, little_float, sean]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -56,7 +58,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl index 33f805bbd3..69362b7d14 100644 --- a/lib/debugger/test/bs_match_tail_SUITE.erl +++ b/lib/debugger/test/bs_match_tail_SUITE.erl @@ -20,7 +20,9 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, aligned/1,unaligned/1,zero_tail/1]). -include_lib("test_server/include/test_server.hrl"). @@ -28,20 +30,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[aligned, unaligned, zero_tail]. + [aligned, unaligned, zero_tail]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -56,7 +58,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index adca9356b3..3f85dd855a 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -21,7 +21,8 @@ -module(bs_utf_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1,end_per_suite/1, init_per_testcase/2,end_per_testcase/2, utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1, utf32_roundtrip/1,guard/1,extreme_tripping/1]). @@ -32,21 +33,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[utf8_roundtrip, unused_utf_char, utf16_roundtrip, - utf32_roundtrip, guard, extreme_tripping]. + [utf8_roundtrip, unused_utf_char, utf16_roundtrip, + utf32_roundtrip, guard, extreme_tripping]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -61,7 +62,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl index c5d8ad550b..e98eeae92e 100644 --- a/lib/debugger/test/bug_SUITE.erl +++ b/lib/debugger/test/bug_SUITE.erl @@ -22,16 +22,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). - --export([]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([otp2163/1, otp4845/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, ticket_tests}]. + [{group, ticket_tests}]. groups() -> [{ticket_tests, [], [otp2163, otp4845]}]. diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 380fb2fe4c..532ded06f6 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -25,19 +25,13 @@ % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). --export([function_tests/1]). - +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). % Test cases must be exported. -export ([dbg_ui/1]). - - - - % Manual test suites/cases exports --export([]). -export([start1/1, interpret1/1, quit1/1, start2/1, interpret2/1, break2/1, options2/1, quit2/1, interpret3/1, all_step3/1,all_next3/1,save3/1,restore3/1,finish3/1, @@ -46,13 +40,8 @@ attach5/1, normal5/1, exit5/1, options5/1, distsetup6/1, all_step6/1, all_next6/1]). - - - -export([init_per_testcase/2, end_per_testcase/2]). - - init_per_testcase(_Func, Config) -> Dog=test_server:timetrap(60*1000), [{watchdog, Dog}|Config]. @@ -65,16 +54,16 @@ end_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[function_tests, {group, manual_tests}]. + [dbg_ui, {group, manual_tests}]. groups() -> [{manual_tests, [], - [start1, interpret1, quit1, start2, interpret2, break2, - options2, interpret3, all_step3, all_next3, save3, - restore3, finish3, killinit3, killone3, killall3, - deleteone3, deleteall3, viewbreak4, delete4, attach5, - normal5, exit5, options5, distsetup6, all_step6, - all_next6]}]. + [start1, interpret1, quit1, start2, interpret2, break2, + options2, interpret3, all_step3, all_next3, save3, + restore3, finish3, killinit3, killone3, killall3, + deleteone3, deleteall3, viewbreak4, delete4, attach5, + normal5, exit5, options5, distsetup6, all_step6, + all_next6]}]. init_per_suite(Config) -> Config. @@ -83,20 +72,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - -function_tests (doc) -> - ["Tests documented functions"]; - -function_tests (suite) -> - [dbg_ui]. - - + Config. dbg_ui (doc) -> ["Debugger GUI"]; @@ -108,7 +87,7 @@ dbg_ui (_Config) -> case os:getenv("DISPLAY") of false -> {skipped,"No display"}; - Other when list(Other) -> + Other when is_list(Other) -> % ?line {ok, Pid} = debugger:start (), % ?line ok = is_pid (Pid), % ?line true = erlang:is_process_alive(Pid), @@ -117,11 +96,6 @@ dbg_ui (_Config) -> {skipped,"Gunilla: Workaround"} end. - - - - - %% check/2 - returns the result for the specified testcase. %% pass - means the user has run the case, and it passed %% fail - means the user has run the case, and it failed @@ -186,14 +160,6 @@ check(Case, Config) -> ). - - - - - - - - %% SET 1 ?MAN_CASE(start1, "Start the debugger from the toolbar", "Before proceeding with the test cases, please move or remove diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index 993854db8c..9ae255d2ea 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -24,15 +24,17 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test, erts_debug, no_abstract_code, - encrypted_debug_info]. + [app_test, erts_debug, no_abstract_code, + encrypted_debug_info]. groups() -> []. @@ -44,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index 44b7e52a2f..b8d66d698d 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -73,11 +74,11 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[guard_1, guard_2, match_pattern, string_plusplus, - pattern_expr, match_bin, guard_3, guard_4, lc, - simple_cases, unary_plus, apply_atom, otp_5269, - otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, - otp_8133, funs, try_catch, eval_expr_5]. + [guard_1, guard_2, match_pattern, string_plusplus, + pattern_expr, match_bin, guard_3, guard_4, lc, + simple_cases, unary_plus, apply_atom, otp_5269, + otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, + otp_8133, funs, try_catch, eval_expr_5]. groups() -> []. @@ -89,10 +90,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. guard_1(doc) -> diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl index e4e0897240..cb7c55ee2a 100644 --- a/lib/debugger/test/exception_SUITE.erl +++ b/lib/debugger/test/exception_SUITE.erl @@ -20,7 +20,9 @@ %% -module(exception_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, badmatch/1,pending_errors/1,nil_arith/1]). -export([bad_guy/2]). @@ -30,20 +32,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[badmatch, pending_errors, nil_arith]. + [badmatch, pending_errors, nil_arith]. -define(try_match(E), catch ?MODULE:bar(), @@ -62,7 +64,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl index e56df5fb09..673de5bead 100644 --- a/lib/debugger/test/fun_SUITE.erl +++ b/lib/debugger/test/fun_SUITE.erl @@ -32,21 +32,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[good_call, bad_apply, bad_fun_call, badarity, - ext_badarity, otp_6061]. + [good_call, bad_apply, bad_fun_call, badarity, + ext_badarity, otp_6061]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -61,7 +61,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl index 2b32fc702e..36bd5c7137 100644 --- a/lib/debugger/test/guard_SUITE.erl +++ b/lib/debugger/test/guard_SUITE.erl @@ -20,7 +20,9 @@ %% -module(guard_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, bad_arith/1,bad_tuple/1,test_heap_guards/1,guard_bifs/1, type_tests/1,const_guard/1, const_cond/1,basic_not/1,complex_not/1, @@ -43,27 +45,27 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[bad_arith, bad_tuple, test_heap_guards, guard_bifs, - type_tests, const_guard, const_cond, basic_not, - complex_not, semicolon, complex_semicolon, comma, - or_guard, more_or_guards, complex_or_guards, and_guard, - xor_guard, more_xor_guards, build_in_guard, - old_guard_tests, gbif, t_is_boolean, is_function_2, - tricky, rel_ops, basic_andalso_orelse, traverse_dcd, - check_qlc_hrl]. + [bad_arith, bad_tuple, test_heap_guards, guard_bifs, + type_tests, const_guard, const_cond, basic_not, + complex_not, semicolon, complex_semicolon, comma, + or_guard, more_or_guards, complex_or_guards, and_guard, + xor_guard, more_xor_guards, build_in_guard, + old_guard_tests, gbif, t_is_boolean, is_function_2, + tricky, rel_ops, basic_andalso_orelse, traverse_dcd, + check_qlc_hrl]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -78,7 +80,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl index cdbc43daf9..3cfc90f01f 100644 --- a/lib/debugger/test/int_SUITE.erl +++ b/lib/debugger/test/int_SUITE.erl @@ -22,7 +22,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -62,11 +63,11 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[interpret, guards, {group, list_suite}, interpretable]. + [interpret, guards, {group, list_suite}, interpretable]. groups() -> [{list_suite, [], [{group, append}, reverse, member]}, - {append, [], [append_1, append_2]}]. + {append, [], [append_1, append_2]}]. init_per_suite(Config) -> Config. @@ -75,10 +76,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. interpret(suite) -> diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index 08a643edbd..f8cd542e98 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -24,7 +24,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1,cleanup/1]). -export([auto_attach/1]). @@ -32,7 +34,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, cleanup]. + [basic, cleanup]. groups() -> []. @@ -44,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index 3deb02f35a..ab72715190 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -22,7 +22,9 @@ %% Purpose: Deeper test of the evaluator. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, bifs_outside_erlang/1, spawning/1, applying/1, catch_and_throw/1, external_call/1, test_module_info/1, apply_interpreted_fun/1, apply_uninterpreted_fun/1, @@ -35,13 +37,14 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{suite_callbacks,[ts_install_scb]}, + {timetrap,{minutes,1}}]. all() -> -[bifs_outside_erlang, spawning, applying, - catch_and_throw, external_call, test_module_info, - apply_interpreted_fun, apply_uninterpreted_fun, - interpreted_exit, otp_8310]. + [bifs_outside_erlang, spawning, applying, + catch_and_throw, external_call, test_module_info, + apply_interpreted_fun, apply_uninterpreted_fun, + interpreted_exit, otp_8310]. groups() -> []. @@ -53,24 +56,20 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line DataDir = ?config(data_dir, Config), ?line {module,?IM} = int:i(filename:join(DataDir, ?IM)), ?line ok = io:format("Interpreted modules: ~p",[int:interpreted()]), - {ok, Dog} = timer:apply_after(timer:minutes(1), - erlang, exit, [self(), kill]), - [{watchdog,Dog}|Config]. + Config. -end_per_testcase(_Case, Config) -> +end_per_testcase(_Case, _Config) -> ok = io:format("Interpreted modules: ~p", [int:interpreted()]), - Dog = ?config(watchdog, Config), - timer:cancel(Dog), ok. bifs_outside_erlang(doc) -> diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl index 90ec4474dc..2a31143b4d 100644 --- a/lib/debugger/test/lc_SUITE.erl +++ b/lib/debugger/test/lc_SUITE.erl @@ -21,7 +21,9 @@ -module(lc_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, basic/1]). -include_lib("test_server/include/test_server.hrl"). @@ -29,20 +31,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[basic]. + [basic]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -57,7 +59,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl index 89f4b0ad74..e17ad74e5b 100644 --- a/lib/debugger/test/record_SUITE.erl +++ b/lib/debugger/test/record_SUITE.erl @@ -24,26 +24,28 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, errors/1,record_test/1,eval_once/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[errors, record_test, eval_once]. + [errors, record_test, eval_once]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -58,7 +60,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl index 8e2619e8e7..3d5dd9a615 100644 --- a/lib/debugger/test/trycatch_SUITE.erl +++ b/lib/debugger/test/trycatch_SUITE.erl @@ -20,7 +20,9 @@ %% -module(trycatch_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2,init_per_suite/1,end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + init_per_suite/1,end_per_suite/1, basic/1,lean_throw/1,try_of/1,try_after/1,%after_bind/1, catch_oops/1,after_oops/1,eclectic/1,rethrow/1, nested_of/1,nested_catch/1,nested_after/1]). @@ -30,22 +32,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cases()]. + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[basic, lean_throw, try_of, try_after, catch_oops, - after_oops, eclectic, rethrow, nested_of, nested_catch, - nested_after]. + [basic, lean_throw, try_of, try_after, catch_oops, + after_oops, eclectic, rethrow, nested_of, nested_catch, + nested_after]. init_per_testcase(_Case, Config) -> test_lib:interpret(?MODULE), @@ -60,7 +62,7 @@ end_per_testcase(_Case, Config) -> init_per_suite(Config) when is_list(Config) -> ?line test_lib:interpret(?MODULE), ?line true = lists:member(?MODULE, int:interpreted()), - ok. + Config. end_per_suite(Config) when is_list(Config) -> ok. @@ -123,9 +125,7 @@ basic(Conf) when is_list(Conf) -> ok. -after_csuite() -> [{suite_callbacks,[ts_install_scb]}]. - -all() -> +after_call() -> put(basic, after_was_called). after_clean() -> -- cgit v1.2.3 From a528cd498462c13a02af2865f977cbb6ef65050f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:32:45 +0100 Subject: Fix formatting for edoc --- lib/edoc/test/edoc_SUITE.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl index a0af2d9cbb..54b999d068 100644 --- a/lib/edoc/test/edoc_SUITE.erl +++ b/lib/edoc/test/edoc_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %% Test cases -export([build_std/1]). @@ -28,7 +29,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[build_std]. + [build_std]. groups() -> []. @@ -40,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. build_std(suite) -> -- cgit v1.2.3 From a0bdac1dae67efaedfc4ab07363d23c484e0f4d7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:39:23 +0100 Subject: Fix formatting for erl_interface --- lib/erl_interface/test/ei_accept_SUITE.erl | 6 ++-- lib/erl_interface/test/ei_connect_SUITE.erl | 33 +++++++++++----------- lib/erl_interface/test/ei_decode_SUITE.erl | 15 +++++----- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 9 +++--- lib/erl_interface/test/ei_encode_SUITE.erl | 15 +++++----- lib/erl_interface/test/ei_format_SUITE.erl | 18 ++++++------ lib/erl_interface/test/ei_print_SUITE.erl | 10 ++++--- lib/erl_interface/test/ei_tmo_SUITE.erl | 12 ++++---- lib/erl_interface/test/erl_connect_SUITE.erl | 10 ++++--- lib/erl_interface/test/erl_eterm_SUITE.erl | 34 ++++++++++++----------- lib/erl_interface/test/erl_ext_SUITE.erl | 21 +++++++------- lib/erl_interface/test/erl_format_SUITE.erl | 9 +++--- lib/erl_interface/test/erl_match_SUITE.erl | 12 ++++---- 13 files changed, 111 insertions(+), 93 deletions(-) diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index a3aa587da4..c75916cbe5 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -33,7 +33,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ei_accept, ei_threaded_accept]. + [ei_accept, ei_threaded_accept]. groups() -> []. @@ -45,10 +45,10 @@ end_per_suite(Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index 87e91dc6e3..314ac1c140 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -24,18 +24,19 @@ -include("ei_connect_SUITE_data/ei_connect_test_cases.hrl"). -export([ - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - init_per_testcase/2, - end_per_testcase/2, - - ei_send/1, - ei_reg_send/1, - ei_format_pid/1, - ei_rpc/1, - rpc_test/1, - ei_send_funs/1, - ei_threaded_send/1, - ei_set_get_tracelevel/1 + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, + end_per_testcase/2, + + ei_send/1, + ei_reg_send/1, + ei_format_pid/1, + ei_rpc/1, + rpc_test/1, + ei_send_funs/1, + ei_threaded_send/1, + ei_set_get_tracelevel/1 ]). -import(runner, [get_term/1,send_term/2]). @@ -43,8 +44,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs, - ei_threaded_send, ei_set_get_tracelevel]. + [ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs, + ei_threaded_send, ei_set_get_tracelevel]. groups() -> []. @@ -56,10 +57,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(0.25)), diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index 0b51c5182c..d032303ef8 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -25,7 +25,8 @@ -export( [ -all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test_ei_decode_long/1, test_ei_decode_ulong/1, test_ei_decode_longlong/1, @@ -38,10 +39,10 @@ all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test_ei_decode_long, test_ei_decode_ulong, - test_ei_decode_longlong, test_ei_decode_ulonglong, - test_ei_decode_char, test_ei_decode_nonoptimal, - test_ei_decode_misc]. + [test_ei_decode_long, test_ei_decode_ulong, + test_ei_decode_longlong, test_ei_decode_ulonglong, + test_ei_decode_char, test_ei_decode_nonoptimal, + test_ei_decode_misc]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index b3f6df431b..3b37b2ba5d 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -25,14 +25,15 @@ -export( [ -all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test_ei_decode_encode/1 ]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test_ei_decode_encode]. + [test_ei_decode_encode]. groups() -> []. @@ -44,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index 70596855bb..5551913c30 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -25,7 +25,8 @@ -export( [ -all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test_ei_encode_long/1, test_ei_encode_ulong/1, test_ei_encode_longlong/1, @@ -38,10 +39,10 @@ all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test_ei_encode_long, test_ei_encode_ulong, - test_ei_encode_longlong, test_ei_encode_ulonglong, - test_ei_encode_char, test_ei_encode_misc, - test_ei_encode_fails]. + [test_ei_encode_long, test_ei_encode_ulong, + test_ei_encode_longlong, test_ei_encode_ulonglong, + test_ei_encode_char, test_ei_encode_misc, + test_ei_encode_fails]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% --------------------------------------------------------------------------- diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 7c0e20312c..106282cef7 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -24,11 +24,13 @@ -include("ei_format_SUITE_data/ei_format_test_cases.hrl"). -export([ - format_wo_ver/1, - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - atoms/1, - tuples/1, - lists/1 + format_wo_ver/1, + all/0, suite/0,groups/0, + init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + atoms/1, + tuples/1, + lists/1 ]). -import(runner, [get_term/1]). @@ -39,7 +41,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[format_wo_ver, atoms, tuples, lists]. + [format_wo_ver, atoms, tuples, lists]. groups() -> []. @@ -51,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index 52ead1ad0d..7f5b011c23 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -23,7 +23,9 @@ -include_lib("test_server/include/test_server.hrl"). -include("ei_print_SUITE_data/ei_print_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1, strings/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + atoms/1, tuples/1, lists/1, strings/1]). -import(runner, [get_term/1]). @@ -33,7 +35,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[atoms, tuples, lists, strings]. + [atoms, tuples, lists, strings]. groups() -> []. @@ -45,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index 28e6df1f56..cf8d273f90 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -26,15 +26,17 @@ -define(dummy_host,test01). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[framework_check, ei_accept_tmo, ei_connect_tmo, - ei_send_tmo, ei_recv_tmo]. + [framework_check, ei_accept_tmo, ei_connect_tmo, + ei_send_tmo, ei_recv_tmo]. groups() -> []. @@ -46,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index 2e10d89b1b..2d60ce5204 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -23,7 +23,9 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_connect_SUITE_data/erl_connect_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, erl_send/1,erl_reg_send/1, erl_send_cookie_file/1]). -import(runner, [get_term/1,send_term/2]). @@ -31,7 +33,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[erl_send, erl_reg_send, erl_send_cookie_file]. + [erl_send, erl_reg_send, erl_send_cookie_file]. groups() -> []. @@ -43,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index 84c2aa7cc0..860d080acf 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -33,7 +33,9 @@ %%% 5. Miscellanous functions. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, build_terms/1, round_trip_conversion/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + build_terms/1, round_trip_conversion/1, decode_terms/1, decode_float/1, t_erl_mk_int/1, t_erl_mk_list/1, basic_copy/1, @@ -76,19 +78,19 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[build_terms, round_trip_conversion, decode_terms, - decode_float, t_erl_mk_int, t_erl_mk_list, basic_copy, - t_erl_mk_atom, t_erl_mk_binary, t_erl_mk_empty_list, - t_erl_mk_float, t_erl_mk_pid, t_erl_mk_xpid, - t_erl_mk_port, t_erl_mk_xport, t_erl_mk_ref, - t_erl_mk_long_ref, t_erl_mk_string, t_erl_mk_estring, - t_erl_mk_tuple, t_erl_mk_uint, t_erl_mk_var, t_erl_size, - t_erl_var_content, t_erl_element, t_erl_cons, - t_erl_length, t_erl_hd, t_erl_tl, type_checks, - extractor_macros, t_erl_iolist_length, - t_erl_iolist_to_binary, t_erl_iolist_to_string, - erl_print_term, print_string, t_erl_free_compound, - high_chaparal, broken_data, cnode_1]. + [build_terms, round_trip_conversion, decode_terms, + decode_float, t_erl_mk_int, t_erl_mk_list, basic_copy, + t_erl_mk_atom, t_erl_mk_binary, t_erl_mk_empty_list, + t_erl_mk_float, t_erl_mk_pid, t_erl_mk_xpid, + t_erl_mk_port, t_erl_mk_xport, t_erl_mk_ref, + t_erl_mk_long_ref, t_erl_mk_string, t_erl_mk_estring, + t_erl_mk_tuple, t_erl_mk_uint, t_erl_mk_var, t_erl_size, + t_erl_var_content, t_erl_element, t_erl_cons, + t_erl_length, t_erl_hd, t_erl_tl, type_checks, + extractor_macros, t_erl_iolist_length, + t_erl_iolist_to_binary, t_erl_iolist_to_string, + erl_print_term, print_string, t_erl_free_compound, + high_chaparal, broken_data, cnode_1]. groups() -> []. @@ -100,10 +102,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index 1b330d2342..ddf9970df8 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -24,12 +24,13 @@ -include("erl_ext_SUITE_data/ext_test_cases.hrl"). -export([ - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - compare_tuple/1, - compare_list/1, - compare_string/1, - compare_list_string/1, - compare_nc_ext/1 + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + compare_tuple/1, + compare_list/1, + compare_string/1, + compare_list_string/1, + compare_nc_ext/1 ]). -import(runner, [get_term/1]). @@ -37,8 +38,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[compare_tuple, compare_list, compare_string, - compare_list_string, compare_nc_ext]. + [compare_tuple, compare_list, compare_string, + compare_list_string, compare_nc_ext]. groups() -> []. @@ -50,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. compare_tuple(suite) -> []; diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index e9363ad597..00f4a2ada0 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -23,7 +23,8 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_format_SUITE_data/format_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, atoms/1, tuples/1, lists/1]). -import(runner, [get_term/1]). @@ -33,7 +34,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[atoms, tuples, lists]. + [atoms, tuples, lists]. groups() -> []. @@ -45,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Tests formatting various atoms. diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index 0b865ae14e..1f0a274c14 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -23,7 +23,9 @@ -include_lib("test_server/include/test_server.hrl"). -include("erl_match_SUITE_data/match_test_cases.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + atoms/1, lists/1, tuples/1, references/1, pids/1, ports/1, bind/1, integers/1, floats/1, binaries/1, strings/1]). %% For interactive running of matcher. @@ -34,8 +36,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[atoms, lists, tuples, references, pids, ports, bind, - integers, floats, binaries, strings]. + [atoms, lists, tuples, references, pids, ports, bind, + integers, floats, binaries, strings]. groups() -> []. @@ -47,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. atoms(suite) -> []; -- cgit v1.2.3 From 274512ff010a080ae84d6cb7f0195415b6227e71 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:40:29 +0100 Subject: Fix formatting for et --- lib/et/test/et_wx_SUITE.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index 26479d0f11..b1e805e2c8 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -18,8 +18,9 @@ -module(et_wx_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, - end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -41,16 +42,16 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_all_windows]. + [start_all_windows]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases -- cgit v1.2.3 From 7df548b47c3fde9f15f4e4fc2908f7f84878c227 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:41:08 +0100 Subject: Fix formatting for eunit --- lib/eunit/test/eunit_SUITE.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index e615bf998b..02c32aebd5 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -18,14 +18,15 @@ %% -module(eunit_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,eunit_test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,eunit_test/1]). -include_lib("common_test/include/ct.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[eunit_test]. + [eunit_test]. groups() -> []. @@ -37,10 +38,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. eunit_test(Config) when is_list(Config) -> -- cgit v1.2.3 From b388b422ad85f46594556790b38b21e906f7cd3d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:46:07 +0100 Subject: Fix formatting for ic --- lib/ic/test/c_client_erl_server_SUITE.erl | 30 +++++++-------- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 30 +++++++-------- .../test/c_client_erl_server_proto_tmo_SUITE.erl | 28 +++++++------- lib/ic/test/ic_SUITE.erl | 45 +++++++++++----------- lib/ic/test/ic_be_SUITE.erl | 9 +++-- lib/ic/test/ic_pragma_SUITE.erl | 11 +++--- lib/ic/test/ic_register_SUITE.erl | 15 ++++---- lib/ic/test/java_client_erl_server_SUITE.erl | 16 ++++---- 8 files changed, 96 insertions(+), 88 deletions(-) diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 97beff3e84..60ea6c50e8 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -27,7 +27,9 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -66,16 +68,16 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[void_test, long_test, long_long_test, - unsigned_short_test, unsigned_long_test, - unsigned_long_long_test, double_test, char_test, - wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, - seq4_test, seq5_test, array1_test, array2_test, - enum_test, string1_test, string2_test, string3_test, - string4_test, pid_test, port_test, ref_test, term_test, - typedef_test, inline_sequence_test, term_sequence_test, - term_struct_test, wstring1_test]. + [void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. groups() -> []. @@ -87,12 +89,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - + Config. array1_test(doc) -> ""; array1_test(suite) -> []; diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index 363235b9d2..5f298fcd51 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -26,7 +26,9 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -65,16 +67,16 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[void_test, long_test, long_long_test, - unsigned_short_test, unsigned_long_test, - unsigned_long_long_test, double_test, char_test, - wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, - seq4_test, seq5_test, array1_test, array2_test, - enum_test, string1_test, string2_test, string3_test, - string4_test, pid_test, port_test, ref_test, term_test, - typedef_test, inline_sequence_test, term_sequence_test, - term_struct_test, wstring1_test]. + [void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. groups() -> []. @@ -86,12 +88,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - + Config. array1_test(doc) -> ""; array1_test(suite) -> []; diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index 4e0a508c5b..2532bc9b46 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -26,7 +26,9 @@ -include_lib("common_test/include/ct.hrl"). -export([init_per_testcase/2, end_per_testcase/2, - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, void_test/1, long_test/1, long_long_test/1, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + void_test/1, long_test/1, long_long_test/1, unsigned_short_test/1, unsigned_long_test/1, unsigned_long_long_test/1, double_test/1, char_test/1, wchar_test/1, octet_test/1, bool_test/1, struct_test/1, @@ -65,16 +67,16 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[void_test, long_test, long_long_test, - unsigned_short_test, unsigned_long_test, - unsigned_long_long_test, double_test, char_test, - wchar_test, octet_test, bool_test, struct_test, - struct2_test, seq1_test, seq2_test, seq3_test, - seq4_test, seq5_test, array1_test, array2_test, - enum_test, string1_test, string2_test, string3_test, - string4_test, pid_test, port_test, ref_test, term_test, - typedef_test, inline_sequence_test, term_sequence_test, - term_struct_test, wstring1_test]. + [void_test, long_test, long_long_test, + unsigned_short_test, unsigned_long_test, + unsigned_long_long_test, double_test, char_test, + wchar_test, octet_test, bool_test, struct_test, + struct2_test, seq1_test, seq2_test, seq3_test, + seq4_test, seq5_test, array1_test, array2_test, + enum_test, string1_test, string2_test, string3_test, + string4_test, pid_test, port_test, ref_test, term_test, + typedef_test, inline_sequence_test, term_sequence_test, + term_struct_test, wstring1_test]. groups() -> []. @@ -86,10 +88,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index f0ad0abbcf..84ddc89454 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -24,7 +24,8 @@ -module(ic_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -include_lib("orber/src/orber_ifr.hrl"). @@ -89,30 +90,30 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test, {group, const}, {group, union}, - {group, enum}, {group, attr}, {group, type}, - {group, struct}, {group, general}, {group, inherit}, - {group, oneway}, {group, syntax}, raises_reg]. + [app_test, {group, const}, {group, union}, + {group, enum}, {group, attr}, {group, type}, + {group, struct}, {group, general}, {group, inherit}, + {group, oneway}, {group, syntax}, raises_reg]. groups() -> [{const, [], - [const_norm, const_bad_tk, const_bad_type, - const_bad_comb]}, - {union, [], - [union_norm, union_type, union_mult_err, - union_case_mult, union_default]}, - {enum, [], [enum_norm]}, {struct, [], [struct_norm]}, - {general, [], - [typeid, undef_id, mult_ids, forward, include, - nasty_names]}, - {inherit, [], - [inherit_norm, inherit_warn, inherit_err]}, - {oneway, [], - [oneway_norm, oneway_out, oneway_raises, oneway_void, - oneway_followed]}, - {attr, [], [attr_norm]}, {type, [], [type_norm]}, - {syntax, [], - [syntax1, syntax2, syntax3, syntax4, syntax5, syntax6]}]. + [const_norm, const_bad_tk, const_bad_type, + const_bad_comb]}, + {union, [], + [union_norm, union_type, union_mult_err, + union_case_mult, union_default]}, + {enum, [], [enum_norm]}, {struct, [], [struct_norm]}, + {general, [], + [typeid, undef_id, mult_ids, forward, include, + nasty_names]}, + {inherit, [], + [inherit_norm, inherit_warn, inherit_err]}, + {oneway, [], + [oneway_norm, oneway_out, oneway_raises, oneway_void, + oneway_followed]}, + {attr, [], [attr_norm]}, {type, [], [type_norm]}, + {syntax, [], + [syntax1, syntax2, syntax3, syntax4, syntax5, syntax6]}]. init_per_suite(Config) -> Config. diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index 4e3c91722f..1f9c830776 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -25,7 +25,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,plain/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,plain/1]). -define(OUT(X), filename:join([?config(priv_dir, Config), gen, to_list(X)])). @@ -36,7 +37,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[plain]. + [plain]. groups() -> []. @@ -48,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index da1c4e11aa..e825287945 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -32,7 +32,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1]). -export([ifr_pragma_reg/1, pragma_error/1, uggly_pragmas/1]). @@ -56,20 +57,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[ifr_pragma_reg, pragma_error, uggly_pragmas]. + [ifr_pragma_reg, pragma_error, uggly_pragmas]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index 14e83f16a3..8cc6394077 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -31,7 +31,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, ifr_reg_unreg/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, ifr_reg_unreg/1]). -export([ifr_inheritence_reg/1,ifr_reg_unreg_with_inheritence/1]). -export([ifr_reg_unreg_with_inheritence_bad_order/1]). @@ -60,22 +61,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[ifr_reg_unreg, ifr_reg_unreg_with_inheritence, - ifr_reg_unreg_with_inheritence_bad_order, - ifr_inheritence_reg]. + [ifr_reg_unreg, ifr_reg_unreg_with_inheritence, + ifr_reg_unreg_with_inheritence_bad_order, + ifr_inheritence_reg]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index 6d4e530ffb..bde78f709f 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -25,7 +25,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1,end_per_suite/1, + init_per_testcase/2,end_per_testcase/2]). -export([marshal_ll/1,marshal_ull/1, marshal_l/1,marshal_ul/1, marshal_s/1,marshal_us/1, @@ -39,22 +41,22 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[marshal_ll, marshal_ull, marshal_l, marshal_ul, - marshal_s, marshal_us, marshal_c, marshal_wc, - marshal_str, marshal_any_3, marshal_any_2]. + [marshal_ll, marshal_ull, marshal_l, marshal_ul, + marshal_s, marshal_us, marshal_c, marshal_wc, + marshal_str, marshal_any_3, marshal_any_2]. init_per_suite(Config) when is_list(Config) -> case case code:priv_dir(jinterface) of -- cgit v1.2.3 From e8c4dac89375ed2ed774ef869a86a998c6c50349 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 15:57:21 +0100 Subject: Fix formatting for inets --- lib/inets/test/ftp_SUITE.erl | 61 +++----- lib/inets/test/ftp_format_SUITE.erl | 22 +-- lib/inets/test/ftp_freebsd_x86_test.erl | 14 +- lib/inets/test/ftp_linux_ppc_test.erl | 14 +- lib/inets/test/ftp_linux_x86_test.erl | 14 +- lib/inets/test/ftp_netbsd_x86_test.erl | 14 +- lib/inets/test/ftp_openbsd_x86_test.erl | 14 +- lib/inets/test/ftp_solaris10_sparc_test.erl | 14 +- lib/inets/test/ftp_solaris10_x86_test.erl | 14 +- lib/inets/test/ftp_solaris8_sparc_test.erl | 14 +- lib/inets/test/ftp_solaris9_sparc_test.erl | 14 +- lib/inets/test/ftp_ticket_test.erl | 12 +- lib/inets/test/ftp_windows_2003_server_test.erl | 14 +- lib/inets/test/ftp_windows_xp_test.erl | 14 +- lib/inets/test/http_format_SUITE.erl | 32 ++-- lib/inets/test/httpc_SUITE.erl | 64 ++++---- lib/inets/test/httpc_cookie_SUITE.erl | 12 +- lib/inets/test/httpd_SUITE.erl | 194 +++++++++++------------- lib/inets/test/httpd_basic_SUITE.erl | 4 +- lib/inets/test/inets_SUITE.erl | 16 +- lib/inets/test/inets_app_test.erl | 21 ++- lib/inets/test/inets_appup_test.erl | 23 ++- lib/inets/test/inets_sup_SUITE.erl | 8 +- lib/inets/test/tftp_SUITE.erl | 8 +- 24 files changed, 304 insertions(+), 327 deletions(-) diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl index 173731b1ca..32501af362 100644 --- a/lib/inets/test/ftp_SUITE.erl +++ b/lib/inets/test/ftp_SUITE.erl @@ -28,21 +28,6 @@ % -export([init_per_testcase/2, end_per_testcase/2]). -export([init_per_suite/1, end_per_suite/1]). -%% Test cases must be exported. --export([ - - - - - - - - - - - -]). - -define(FTP_USER, "anonymous"). -define(FTP_PASS, passwd()). -define(FTP_PORT, 21). @@ -75,32 +60,32 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, solaris8_test}, {group, solaris9_test}, - {group, solaris10_test}, {group, linux_x86_test}, - {group, linux_ppc_test}, {group, macosx_x86_test}, - {group, macosx_ppc_test}, {group, openbsd_test}, - {group, freebsd_test}, {group, netbsd_test}, - {group, windows_xp_test}, - {group, windows_2003_server_test}, - {group, ticket_tests}]. + [{group, solaris8_test}, {group, solaris9_test}, + {group, solaris10_test}, {group, linux_x86_test}, + {group, linux_ppc_test}, {group, macosx_x86_test}, + {group, macosx_ppc_test}, {group, openbsd_test}, + {group, freebsd_test}, {group, netbsd_test}, + {group, windows_xp_test}, + {group, windows_2003_server_test}, + {group, ticket_tests}]. groups() -> [{solaris8_test, [], [{ftp_solaris8_sparc_test, all}]}, - {solaris9_test, [], [{ftp_solaris9_sparc_test, all}]}, - {solaris10_test, [], - [{ftp_solaris10_sparc_test, all}, - {ftp_solaris10_x86_test, all}]}, - {linux_x86_test, [], [{ftp_linux_x86_test, all}]}, - {linux_ppc_test, [], [{ftp_linux_ppc_test, all}]}, - {macosx_x86_test, [], [{ftp_macosx_x86_test, all}]}, - {macosx_ppc_test, [], [{ftp_macosx_ppc_test, all}]}, - {openbsd_test, [], [{ftp_openbsd_x86_test, all}]}, - {freebsd_test, [], [{ftp_freebsd_x86_test, all}]}, - {netbsd_test, [], [{ftp_netbsd_x86_test, all}]}, - {windows_xp_test, [], [{ftp_windows_xp_test, all}]}, - {windows_2003_server_test, [], - [{ftp_windows_2003_server_test, all}]}, - {ticket_tests, [], [{ftp_ticket_test, all}]}]. + {solaris9_test, [], [{ftp_solaris9_sparc_test, all}]}, + {solaris10_test, [], + [{ftp_solaris10_sparc_test, all}, + {ftp_solaris10_x86_test, all}]}, + {linux_x86_test, [], [{ftp_linux_x86_test, all}]}, + {linux_ppc_test, [], [{ftp_linux_ppc_test, all}]}, + {macosx_x86_test, [], [{ftp_macosx_x86_test, all}]}, + {macosx_ppc_test, [], [{ftp_macosx_ppc_test, all}]}, + {openbsd_test, [], [{ftp_openbsd_x86_test, all}]}, + {freebsd_test, [], [{ftp_freebsd_x86_test, all}]}, + {netbsd_test, [], [{ftp_netbsd_x86_test, all}]}, + {windows_xp_test, [], [{ftp_windows_xp_test, all}]}, + {windows_2003_server_test, [], + [{ftp_windows_2003_server_test, all}]}, + {ticket_tests, [], [{ftp_ticket_test, all}]}]. init_per_group(_GroupName, Config) -> Config. diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 7efc2816af..488560b266 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -25,24 +25,26 @@ -include("ftp_internal.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([ ftp_150/1, - ftp_200/1, ftp_220/1, ftp_226/1, ftp_257/1, ftp_331/1, ftp_425/1, - ftp_other_status_codes/1, ftp_multiple_lines/1, - ftp_multipel_ctrl_messages/1, format_error/1]). + ftp_200/1, ftp_220/1, ftp_226/1, ftp_257/1, ftp_331/1, ftp_425/1, + ftp_other_status_codes/1, ftp_multiple_lines/1, + ftp_multipel_ctrl_messages/1, format_error/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, ftp_response}, format_error]. + [{group, ftp_response}, format_error]. groups() -> [{ftp_response, [], - [ftp_150, ftp_200, ftp_220, ftp_226, ftp_257, ftp_331, - ftp_425, ftp_other_status_codes, ftp_multiple_lines, - ftp_multipel_ctrl_messages]}]. + [ftp_150, ftp_200, ftp_220, ftp_226, ftp_257, ftp_331, + ftp_425, ftp_other_status_codes, ftp_multiple_lines, + ftp_multipel_ctrl_messages]}]. init_per_suite(Config) -> Config. @@ -51,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_, Config) -> diff --git a/lib/inets/test/ftp_freebsd_x86_test.erl b/lib/inets/test/ftp_freebsd_x86_test.erl index d7b9a65470..1d66779882 100644 --- a/lib/inets/test/ftp_freebsd_x86_test.erl +++ b/lib/inets/test/ftp_freebsd_x86_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_linux_ppc_test.erl b/lib/inets/test/ftp_linux_ppc_test.erl index 061e49d6c9..bba97237f1 100644 --- a/lib/inets/test/ftp_linux_ppc_test.erl +++ b/lib/inets/test/ftp_linux_ppc_test.erl @@ -88,20 +88,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_linux_x86_test.erl b/lib/inets/test/ftp_linux_x86_test.erl index eb7feb6045..bbefd8231e 100644 --- a/lib/inets/test/ftp_linux_x86_test.erl +++ b/lib/inets/test/ftp_linux_x86_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_netbsd_x86_test.erl b/lib/inets/test/ftp_netbsd_x86_test.erl index 64f215e550..bb474852c5 100644 --- a/lib/inets/test/ftp_netbsd_x86_test.erl +++ b/lib/inets/test/ftp_netbsd_x86_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_openbsd_x86_test.erl b/lib/inets/test/ftp_openbsd_x86_test.erl index 5785820bfc..54fce702a0 100644 --- a/lib/inets/test/ftp_openbsd_x86_test.erl +++ b/lib/inets/test/ftp_openbsd_x86_test.erl @@ -88,20 +88,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_solaris10_sparc_test.erl b/lib/inets/test/ftp_solaris10_sparc_test.erl index 3e8d8d6fd0..0da50dc91b 100644 --- a/lib/inets/test/ftp_solaris10_sparc_test.erl +++ b/lib/inets/test/ftp_solaris10_sparc_test.erl @@ -88,20 +88,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_solaris10_x86_test.erl b/lib/inets/test/ftp_solaris10_x86_test.erl index 6f703b8e30..3e7045bb4d 100644 --- a/lib/inets/test/ftp_solaris10_x86_test.erl +++ b/lib/inets/test/ftp_solaris10_x86_test.erl @@ -89,20 +89,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_solaris8_sparc_test.erl b/lib/inets/test/ftp_solaris8_sparc_test.erl index 982ef6ce1c..23dbfc8fe3 100644 --- a/lib/inets/test/ftp_solaris8_sparc_test.erl +++ b/lib/inets/test/ftp_solaris8_sparc_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_solaris9_sparc_test.erl b/lib/inets/test/ftp_solaris9_sparc_test.erl index 1db0708182..896e2f497f 100644 --- a/lib/inets/test/ftp_solaris9_sparc_test.erl +++ b/lib/inets/test/ftp_solaris9_sparc_test.erl @@ -86,20 +86,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_ticket_test.erl b/lib/inets/test/ftp_ticket_test.erl index 3b0163a203..fe4ab35728 100644 --- a/lib/inets/test/ftp_ticket_test.erl +++ b/lib/inets/test/ftp_ticket_test.erl @@ -36,26 +36,26 @@ end_per_testcase(Case, Config) -> all() -> -tickets(). + tickets(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -init(Config) -> +init_per_suite(Config) -> ?LIB_MOD:ftpd_init(ticket_test, Config). tickets() -> -[ticket_6035]. + [ticket_6035]. -fin(Config) -> +end_per_suite(Config) -> ?LIB_MOD:ftpd_fin(Config). ticket_6035(X) -> ?LIB_MOD:ticket_6035(X). diff --git a/lib/inets/test/ftp_windows_2003_server_test.erl b/lib/inets/test/ftp_windows_2003_server_test.erl index 98cbb70a75..57f1ae8358 100644 --- a/lib/inets/test/ftp_windows_2003_server_test.erl +++ b/lib/inets/test/ftp_windows_2003_server_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/ftp_windows_xp_test.erl b/lib/inets/test/ftp_windows_xp_test.erl index a63b5a0844..06d919ba00 100644 --- a/lib/inets/test/ftp_windows_xp_test.erl +++ b/lib/inets/test/ftp_windows_xp_test.erl @@ -87,20 +87,20 @@ end_per_testcase(Case, Config) -> %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- all() -> -[open, open_port, {group, passive}, {group, active}, - api_missuse, not_owner, {group, progress_report}]. + [open, open_port, {group, passive}, {group, active}, + api_missuse, not_owner, {group, progress_report}]. groups() -> [{passive, [], ftp_suite_lib:passive(suite)}, - {active, [], ftp_suite_lib:active(suite)}, - {progress_report, [], - ftp_suite_lib:progress_report(suite)}]. + {active, [], ftp_suite_lib:active(suite)}, + {progress_report, [], + ftp_suite_lib:progress_report(suite)}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. open(X) -> ?CASE_WRAPPER(?PLATFORM,X,fun ?LIB_MOD:open/1). diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl index 83e1f08670..61df8c396a 100644 --- a/lib/inets/test/http_format_SUITE.erl +++ b/lib/inets/test/http_format_SUITE.erl @@ -30,27 +30,27 @@ %% Test cases must be exported. -export([ chunk_decode/1, chunk_encode/1, - chunk_extensions_otp_6005/1, chunk_decode_otp_6264/1, - chunk_decode_empty_chunk_otp_6511/1, - chunk_decode_trailer/1, - http_response/1, http_request/1, validate_request_line/1, - esi_parse_headers/1, cgi_parse_headers/1, - is_absolut_uri/1, convert_netscapecookie_date/1]). + chunk_extensions_otp_6005/1, chunk_decode_otp_6264/1, + chunk_decode_empty_chunk_otp_6511/1, + chunk_decode_trailer/1, + http_response/1, http_request/1, validate_request_line/1, + esi_parse_headers/1, cgi_parse_headers/1, + is_absolut_uri/1, convert_netscapecookie_date/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, chunk}, http_response, http_request, - validate_request_line, {group, script}, is_absolut_uri, - convert_netscapecookie_date]. + [{group, chunk}, http_response, http_request, + validate_request_line, {group, script}, is_absolut_uri, + convert_netscapecookie_date]. groups() -> [{script, [], [esi_parse_headers, cgi_parse_headers]}, - {chunk, [], - [chunk_decode, chunk_encode, chunk_extensions_otp_6005, - chunk_decode_otp_6264, - chunk_decode_empty_chunk_otp_6511, - chunk_decode_trailer]}]. + {chunk, [], + [chunk_decode, chunk_encode, chunk_extensions_otp_6005, + chunk_decode_otp_6264, + chunk_decode_empty_chunk_otp_6511, + chunk_decode_trailer]}]. init_per_suite(Config) -> Config. @@ -59,10 +59,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_, Config) -> diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index f1dbddee06..e7bde8b541 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -62,44 +62,44 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[proxy_options, proxy_head, proxy_get, proxy_trace, - proxy_post, proxy_put, proxy_delete, proxy_auth, - proxy_headers, proxy_emulate_lower_versions, - http_options, http_head, http_get, http_post, - http_dummy_pipe, http_inets_pipe, http_trace, - http_async, http_save_to_file, http_save_to_file_async, - http_headers, http_headers_dummy, http_bad_response, - ssl_head, ossl_head, essl_head, ssl_get, ossl_get, - essl_get, ssl_trace, ossl_trace, essl_trace, - http_redirect, http_redirect_loop, - http_internal_server_error, http_userinfo, http_cookie, - http_server_does_not_exist, http_invalid_http, - http_emulate_lower_versions, http_relaxed, - page_does_not_exist, proxy_page_does_not_exist, - proxy_https_not_supported, http_stream, - http_stream_once, proxy_stream, parse_url, options, - ipv6, headers_as_is, {group, tickets}]. + [proxy_options, proxy_head, proxy_get, proxy_trace, + proxy_post, proxy_put, proxy_delete, proxy_auth, + proxy_headers, proxy_emulate_lower_versions, + http_options, http_head, http_get, http_post, + http_dummy_pipe, http_inets_pipe, http_trace, + http_async, http_save_to_file, http_save_to_file_async, + http_headers, http_headers_dummy, http_bad_response, + ssl_head, ossl_head, essl_head, ssl_get, ossl_get, + essl_get, ssl_trace, ossl_trace, essl_trace, + http_redirect, http_redirect_loop, + http_internal_server_error, http_userinfo, http_cookie, + http_server_does_not_exist, http_invalid_http, + http_emulate_lower_versions, http_relaxed, + page_does_not_exist, proxy_page_does_not_exist, + proxy_https_not_supported, http_stream, + http_stream_once, proxy_stream, parse_url, options, + ipv6, headers_as_is, {group, tickets}]. groups() -> [{tickets, [], - [hexed_query_otp_6191, empty_body_otp_6243, - empty_response_header_otp_6830, - transfer_encoding_otp_6807, proxy_not_modified_otp_6821, - no_content_204_otp_6982, missing_CR_otp_7304, - {group, otp_7883}, {group, otp_8154}, {group, otp_8106}, - otp_8056, otp_8352, otp_8371, otp_8739]}, - {otp_7883, [], [otp_7883_1, otp_7883_2]}, - {otp_8154, [], [otp_8154_1]}, - {otp_8106, [], - [otp_8106_pid, otp_8106_fun, otp_8106_mfa]}]. + [hexed_query_otp_6191, empty_body_otp_6243, + empty_response_header_otp_6830, + transfer_encoding_otp_6807, proxy_not_modified_otp_6821, + no_content_204_otp_6982, missing_CR_otp_7304, + {group, otp_7883}, {group, otp_8154}, {group, otp_8106}, + otp_8056, otp_8352, otp_8371, otp_8739]}, + {otp_7883, [], [otp_7883_1, otp_7883_2]}, + {otp_8154, [], [otp_8154_1]}, + {otp_8106, [], + [otp_8106_pid, otp_8106_fun, otp_8106_mfa]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config %% Config - [tuple()] @@ -211,6 +211,8 @@ init_per_testcase(Case, Timeout, Config) -> tsp("init_per_testcase -> [proxy case] start inets"), inets:start(), tsp("init_per_testcase -> [proxy case] start ssl"), + application:start(crypto), + application:start(public_key), case (catch application:start(ssl)) of ok -> [{watchdog, Dog} | TmpConfig]; @@ -1743,7 +1745,7 @@ ipv6(Config) when is_list(Config) -> {ok, Hostname} = inet:gethostname(), case lists:member(list_to_atom(Hostname), - ?config(ipv6_hosts, Config)) of + ct:get_config(ipv6_hosts)) of true -> {DummyServerPid, Port} = dummy_server(self(), ipv6), diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl index 685c8cacc4..c4d8a107d1 100644 --- a/lib/inets/test/httpc_cookie_SUITE.erl +++ b/lib/inets/test/httpc_cookie_SUITE.erl @@ -119,10 +119,10 @@ end_per_testcase(Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[session_cookies_only, netscape_cookies, cookie_cancel, - cookie_expires, persistent_cookie, domain_cookie, - secure_cookie, update_cookie, update_cookie_session, - cookie_attributes]. + [session_cookies_only, netscape_cookies, cookie_cancel, + cookie_expires, persistent_cookie, domain_cookie, + secure_cookie, update_cookie, update_cookie_session, + cookie_attributes]. groups() -> []. @@ -134,10 +134,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index 978ea0f817..02ee2d802e 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -31,16 +31,6 @@ -export([init_per_testcase/2, end_per_testcase/2, init_per_suite/1, end_per_suite/1]). -%% Test cases must be exported. --export([ - - - - - - -]). - %% Core Server tests -export([ ip_mod_alias/1, @@ -251,106 +241,106 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, ip}, {group, ssl}, {group, http_1_1_ip}, - {group, http_1_0_ip}, {group, http_0_9_ip}, - {group, tickets}]. + [{group, ip}, {group, ssl}, {group, http_1_1_ip}, + {group, http_1_0_ip}, {group, http_0_9_ip}, + {group, tickets}]. groups() -> [{ip, [], - [ip_mod_alias, ip_mod_actions, ip_mod_security, - ip_mod_auth, ip_mod_auth_api, ip_mod_auth_mnesia_api, - ip_mod_htaccess, ip_mod_cgi, ip_mod_esi, ip_mod_get, - ip_mod_head, ip_mod_all, ip_load_light, ip_load_medium, - ip_load_heavy, ip_dos_hostname, ip_time_test, - ip_restart_no_block, ip_restart_disturbing_block, - ip_restart_non_disturbing_block, - ip_block_disturbing_idle, ip_block_non_disturbing_idle, - ip_block_503, ip_block_disturbing_active, - ip_block_non_disturbing_active, - ip_block_disturbing_active_timeout_not_released, - ip_block_disturbing_active_timeout_released, - ip_block_non_disturbing_active_timeout_not_released, - ip_block_non_disturbing_active_timeout_released, - ip_block_disturbing_blocker_dies, - ip_block_non_disturbing_blocker_dies]}, - {ssl, [], - [{group, pssl}, {group, ossl}, {group, essl}]}, - {pssl, [], - [pssl_mod_alias, pssl_mod_actions, pssl_mod_security, - pssl_mod_auth, pssl_mod_auth_api, - pssl_mod_auth_mnesia_api, pssl_mod_htaccess, - pssl_mod_cgi, pssl_mod_esi, pssl_mod_get, pssl_mod_head, - pssl_mod_all, pssl_load_light, pssl_load_medium, - pssl_load_heavy, pssl_dos_hostname, pssl_time_test, - pssl_restart_no_block, pssl_restart_disturbing_block, - pssl_restart_non_disturbing_block, - pssl_block_disturbing_idle, - pssl_block_non_disturbing_idle, pssl_block_503, - pssl_block_disturbing_active, - pssl_block_non_disturbing_active, - pssl_block_disturbing_active_timeout_not_released, - pssl_block_disturbing_active_timeout_released, - pssl_block_non_disturbing_active_timeout_not_released, - pssl_block_non_disturbing_active_timeout_released, - pssl_block_disturbing_blocker_dies, - pssl_block_non_disturbing_blocker_dies]}, - {ossl, [], - [ossl_mod_alias, ossl_mod_actions, ossl_mod_security, - ossl_mod_auth, ossl_mod_auth_api, - ossl_mod_auth_mnesia_api, ossl_mod_htaccess, - ossl_mod_cgi, ossl_mod_esi, ossl_mod_get, ossl_mod_head, - ossl_mod_all, ossl_load_light, ossl_load_medium, - ossl_load_heavy, ossl_dos_hostname, ossl_time_test, - ossl_restart_no_block, ossl_restart_disturbing_block, - ossl_restart_non_disturbing_block, - ossl_block_disturbing_idle, - ossl_block_non_disturbing_idle, ossl_block_503, - ossl_block_disturbing_active, - ossl_block_non_disturbing_active, - ossl_block_disturbing_active_timeout_not_released, - ossl_block_disturbing_active_timeout_released, - ossl_block_non_disturbing_active_timeout_not_released, - ossl_block_non_disturbing_active_timeout_released, - ossl_block_disturbing_blocker_dies, - ossl_block_non_disturbing_blocker_dies]}, - {essl, [], - [essl_mod_alias, essl_mod_actions, essl_mod_security, - essl_mod_auth, essl_mod_auth_api, - essl_mod_auth_mnesia_api, essl_mod_htaccess, - essl_mod_cgi, essl_mod_esi, essl_mod_get, essl_mod_head, - essl_mod_all, essl_load_light, essl_load_medium, - essl_load_heavy, essl_dos_hostname, essl_time_test, - essl_restart_no_block, essl_restart_disturbing_block, - essl_restart_non_disturbing_block, - essl_block_disturbing_idle, - essl_block_non_disturbing_idle, essl_block_503, - essl_block_disturbing_active, - essl_block_non_disturbing_active, - essl_block_disturbing_active_timeout_not_released, - essl_block_disturbing_active_timeout_released, - essl_block_non_disturbing_active_timeout_not_released, - essl_block_non_disturbing_active_timeout_released, - essl_block_disturbing_blocker_dies, - essl_block_non_disturbing_blocker_dies]}, - {http_1_1_ip, [], - [ip_host, ip_chunked, ip_expect, ip_range, ip_if_test, - ip_http_trace, ip_http1_1_head, - ip_mod_cgi_chunked_encoding_test]}, - {http_1_0_ip, [], - [ip_head_1_0, ip_get_1_0, ip_post_1_0]}, - {http_0_9_ip, [], [ip_get_0_9]}, - {ipv6, [], [ipv6_hostname, ipv6_address]}, - {tickets, [], - [ticket_5775, ticket_5865, ticket_5913, ticket_6003, - ticket_7304]}]. + [ip_mod_alias, ip_mod_actions, ip_mod_security, + ip_mod_auth, ip_mod_auth_api, ip_mod_auth_mnesia_api, + ip_mod_htaccess, ip_mod_cgi, ip_mod_esi, ip_mod_get, + ip_mod_head, ip_mod_all, ip_load_light, ip_load_medium, + ip_load_heavy, ip_dos_hostname, ip_time_test, + ip_restart_no_block, ip_restart_disturbing_block, + ip_restart_non_disturbing_block, + ip_block_disturbing_idle, ip_block_non_disturbing_idle, + ip_block_503, ip_block_disturbing_active, + ip_block_non_disturbing_active, + ip_block_disturbing_active_timeout_not_released, + ip_block_disturbing_active_timeout_released, + ip_block_non_disturbing_active_timeout_not_released, + ip_block_non_disturbing_active_timeout_released, + ip_block_disturbing_blocker_dies, + ip_block_non_disturbing_blocker_dies]}, + {ssl, [], + [{group, pssl}, {group, ossl}, {group, essl}]}, + {pssl, [], + [pssl_mod_alias, pssl_mod_actions, pssl_mod_security, + pssl_mod_auth, pssl_mod_auth_api, + pssl_mod_auth_mnesia_api, pssl_mod_htaccess, + pssl_mod_cgi, pssl_mod_esi, pssl_mod_get, pssl_mod_head, + pssl_mod_all, pssl_load_light, pssl_load_medium, + pssl_load_heavy, pssl_dos_hostname, pssl_time_test, + pssl_restart_no_block, pssl_restart_disturbing_block, + pssl_restart_non_disturbing_block, + pssl_block_disturbing_idle, + pssl_block_non_disturbing_idle, pssl_block_503, + pssl_block_disturbing_active, + pssl_block_non_disturbing_active, + pssl_block_disturbing_active_timeout_not_released, + pssl_block_disturbing_active_timeout_released, + pssl_block_non_disturbing_active_timeout_not_released, + pssl_block_non_disturbing_active_timeout_released, + pssl_block_disturbing_blocker_dies, + pssl_block_non_disturbing_blocker_dies]}, + {ossl, [], + [ossl_mod_alias, ossl_mod_actions, ossl_mod_security, + ossl_mod_auth, ossl_mod_auth_api, + ossl_mod_auth_mnesia_api, ossl_mod_htaccess, + ossl_mod_cgi, ossl_mod_esi, ossl_mod_get, ossl_mod_head, + ossl_mod_all, ossl_load_light, ossl_load_medium, + ossl_load_heavy, ossl_dos_hostname, ossl_time_test, + ossl_restart_no_block, ossl_restart_disturbing_block, + ossl_restart_non_disturbing_block, + ossl_block_disturbing_idle, + ossl_block_non_disturbing_idle, ossl_block_503, + ossl_block_disturbing_active, + ossl_block_non_disturbing_active, + ossl_block_disturbing_active_timeout_not_released, + ossl_block_disturbing_active_timeout_released, + ossl_block_non_disturbing_active_timeout_not_released, + ossl_block_non_disturbing_active_timeout_released, + ossl_block_disturbing_blocker_dies, + ossl_block_non_disturbing_blocker_dies]}, + {essl, [], + [essl_mod_alias, essl_mod_actions, essl_mod_security, + essl_mod_auth, essl_mod_auth_api, + essl_mod_auth_mnesia_api, essl_mod_htaccess, + essl_mod_cgi, essl_mod_esi, essl_mod_get, essl_mod_head, + essl_mod_all, essl_load_light, essl_load_medium, + essl_load_heavy, essl_dos_hostname, essl_time_test, + essl_restart_no_block, essl_restart_disturbing_block, + essl_restart_non_disturbing_block, + essl_block_disturbing_idle, + essl_block_non_disturbing_idle, essl_block_503, + essl_block_disturbing_active, + essl_block_non_disturbing_active, + essl_block_disturbing_active_timeout_not_released, + essl_block_disturbing_active_timeout_released, + essl_block_non_disturbing_active_timeout_not_released, + essl_block_non_disturbing_active_timeout_released, + essl_block_disturbing_blocker_dies, + essl_block_non_disturbing_blocker_dies]}, + {http_1_1_ip, [], + [ip_host, ip_chunked, ip_expect, ip_range, ip_if_test, + ip_http_trace, ip_http1_1_head, + ip_mod_cgi_chunked_encoding_test]}, + {http_1_0_ip, [], + [ip_head_1_0, ip_get_1_0, ip_post_1_0]}, + {http_0_9_ip, [], [ip_get_0_9]}, + {ipv6, [], [ipv6_hostname, ipv6_address]}, + {tickets, [], + [ticket_5775, ticket_5865, ticket_5913, ticket_6003, + ticket_7304]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config %% Config - [tuple()] diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index a67a082da9..b52af364d4 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -35,10 +35,10 @@ groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%-------------------------------------------------------------------- %% Function: init_per_suite(Config) -> Config diff --git a/lib/inets/test/inets_SUITE.erl b/lib/inets/test/inets_SUITE.erl index 593ad2efc6..b67db0a7c5 100644 --- a/lib/inets/test/inets_SUITE.erl +++ b/lib/inets/test/inets_SUITE.erl @@ -31,21 +31,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, app_test}, {group, appup_test}, - {group, services_test}, httpd_reload]. + [{group, app_test}, {group, appup_test}, + {group, services_test}, httpd_reload]. groups() -> [{services_test, [], - [start_inets, start_httpc, start_httpd, start_ftpc, - start_tftpd]}, - {app_test, [], [{inets_app_test, all}]}, - {appup_test, [], [{inets_appup_test, all}]}]. + [start_inets, start_httpc, start_httpd, start_ftpc, + start_tftpd]}, + {app_test, [], [{inets_app_test, all}]}, + {appup_test, [], [{inets_appup_test, all}]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/inets/test/inets_app_test.erl b/lib/inets/test/inets_app_test.erl index 71f94a4327..11b507fa26 100644 --- a/lib/inets/test/inets_app_test.erl +++ b/lib/inets/test/inets_app_test.erl @@ -45,26 +45,25 @@ end_per_testcase(_Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [fields, modules, exportall, app_depend, - undef_funcs], - Cases. + [fields, modules, exportall, app_depend, + undef_funcs]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -app_init(suite) -> []; -app_init(doc) -> []; -app_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> case is_app(inets) of {ok, AppFile} -> io:format("AppFile: ~n~p~n", [AppFile]), @@ -85,9 +84,9 @@ is_app(App) -> end. -app_fin(suite) -> []; -app_fin(doc) -> []; -app_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/inets/test/inets_appup_test.erl b/lib/inets/test/inets_appup_test.erl index 5065db202e..7ed237243e 100644 --- a/lib/inets/test/inets_appup_test.erl +++ b/lib/inets/test/inets_appup_test.erl @@ -28,8 +28,8 @@ -include("inets_test_lib.hrl"). -% t() -> megaco_test_lib:t(?MODULE). -% t(Case) -> megaco_test_lib:t({?MODULE, Case}). + % t() -> megaco_test_lib:t(?MODULE). + % t(Case) -> megaco_test_lib:t({?MODULE, Case}). %% Test server callbacks @@ -42,24 +42,23 @@ end_per_testcase(_Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [appup], - Cases. + [appup]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -appup_init(suite) -> []; -appup_init(doc) -> []; -appup_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> AppFile = file_name(inets, ".app"), AppupFile = file_name(inets, ".appup"), [{app_file, AppFile}, {appup_file, AppupFile}|Config]. @@ -70,9 +69,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -appup_fin(suite) -> []; -appup_fin(doc) -> []; -appup_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/inets/test/inets_sup_SUITE.erl b/lib/inets/test/inets_sup_SUITE.erl index f542506d00..181eb29f7b 100644 --- a/lib/inets/test/inets_sup_SUITE.erl +++ b/lib/inets/test/inets_sup_SUITE.erl @@ -29,17 +29,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[default_tree, ftpc_worker, tftpd_worker, httpd_subtree, - httpc_subtree]. + [default_tree, ftpc_worker, tftpd_worker, httpd_subtree, + httpc_subtree]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%-------------------------------------------------------------------- diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index a53bfa86f4..606b829ca4 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -74,8 +74,8 @@ end_per_testcase(Case, Config) when is_list(Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[simple, extra, reuse_connection, resend_client, - resend_server]. + [simple, extra, reuse_connection, resend_client, + resend_server]. groups() -> []. @@ -87,10 +87,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3 From 1dbe670df66a89942ce544be59e6314a80332452 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:00:33 +0100 Subject: Fix formatting for invision --- lib/inviso/test/inviso_tool_SUITE.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl index df95972534..e0704c3d2b 100644 --- a/lib/inviso/test/inviso_tool_SUITE.erl +++ b/lib/inviso/test/inviso_tool_SUITE.erl @@ -36,17 +36,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[dist_basic_1, dist_rtc, dist_reconnect, dist_adopt, - dist_history, dist_start_session_special]. + [dist_basic_1, dist_rtc, dist_reconnect, dist_adopt, + dist_history, dist_start_session_special]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% ----------------------------------------------------------------------------- -- cgit v1.2.3 From 892b9be5e72daeefd4af514f4c79d0b4c1863479 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:02:14 +0100 Subject: Fix formatting for jinterface --- lib/jinterface/test/jinterface_SUITE.erl | 89 ++++++++++++++++++++++++++++---- lib/jinterface/test/nc_SUITE.erl | 16 +++--- 2 files changed, 88 insertions(+), 17 deletions(-) diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index eff569a40e..db33059af5 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -18,7 +18,8 @@ %% -module(jinterface_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -export([nodename/1, register_and_whereis/1, get_names/1, boolean_atom/1, @@ -31,7 +32,8 @@ erl_link_java_exit/1, java_link_erl_exit/1, internal_link_linking_exits/1, internal_link_linked_exits/1, internal_unlink_linking_exits/1, internal_unlink_linked_exits/1, - normal_exit/1, kill_erl_proc_from_java/1, + normal_exit/1, kill_mbox/1,kill_erl_proc_from_java/1, + kill_mbox_from_erlang/1, erl_exit_with_reason_any_term/1, java_exit_with_reason_any_term/1, status_handler_localStatus/1, status_handler_remoteStatus/1, @@ -83,19 +85,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -lists:append([fundamental(), ping(), send_receive(), - link_unlink(), status_handler()]). + lists:append([fundamental(), ping(), send_receive(), + link_unlink(), status_handler()]). groups() -> - [{kill_mbox, [], {skip, "Not yet implemented"}}, - {kill_mbox_from_erlang, [], - {skip, "Not yet implemented"}}]. + []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. fundamental() -> @@ -168,6 +168,10 @@ init_per_suite(Config) when is_list(Config) -> end_per_suite(Config) when is_list(Config) -> jitu:finish_all(Config). +init_per_testcase(Case, _Config) + when Case =:= kill_mbox; + Case =:= kill_mbox_from_erlang -> + {skip, "Not yet implemented"}; init_per_testcase(_Case,Config) -> Dog = ?t:timetrap({seconds,10}), [{watch_dog,Dog}|Config]. @@ -485,6 +489,59 @@ normal_exit(Config) when is_list(Config) -> %%%----------------------------------------------------------------- +kill_mbox(doc) -> + ["MboxLinkUnlink.java: " + "Test that mbox.exit(new OtpErlangAtom(\"kill\") causes linked " + "processes to exit with reason 'killed', which can be trapped."]; +kill_mbox(suite) -> + {skip, "Not yet implemented"}; +kill_mbox(Config) when is_list(Config) -> + Fun = + fun() -> + register(erl_link_server,self()), + process_flag(trap_exit,true), + receive + {Main,Mbox} when is_pid(Main), is_pid(Mbox) -> + ?dbg("Erlang sending \"~p\"",[kill_mbox]), + Pid = spawn_link(fun() -> + process_flag(trap_exit,true), + link(Mbox), + Mbox ! {?kill_mbox}, + receive + {'EXIT',Mbox,killed} -> + exit(correct_reason); + {'EXIT',Mbox,R} -> + exit({faulty_reason,R}) + end + end), + receive + {'EXIT',Pid,{faulty_reason,Reason}} -> + receive done -> Main ! done end, + exit({faulty_reason,Reason}); + {'EXIT',Pid,im_killed} -> + receive done -> Main ! done end + after 1000 -> + receive + Other -> + ?dbg("Got garbage when waiting for exit:" + " ~p", [Other]), + Main ! done, + exit({got_unexpected,Other}) + after 0 -> + ok + end + end; + Other -> + ?dbg("Got garbage: ~p",[Other]), + exit(Other) + end + end, + + spawn_link(Fun), + ok = jitu:java(?config(java, Config), + ?config(data_dir, Config), + "MboxLinkUnlink", + [erlang:get_cookie(),node()]). %%%----------------------------------------------------------------- kill_erl_proc_from_java(doc) -> @@ -503,6 +560,20 @@ kill_erl_proc_from_java(Config) when is_list(Config) -> erl_java_link(LinkFun,kill_erl_proc_from_java,killed,Config). %%%----------------------------------------------------------------- +kill_mbox_from_erlang(doc) -> + ["MboxLinkUnlink.java: " + "Test that exit(Mbox,kill) causes linked the Mbox to be killed, and" + "linked processes to exit with reason 'killed', even if trapping exits"]; +kill_mbox_from_erlang(suite) -> + {skip, "Not yet implemented"}; +kill_mbox_from_erlang(Config) when is_list(Config) -> + LinkFun = fun(Mbox) -> + link(Mbox), + Mbox ! {?kill_mbox_from_erlang}, + exit(Mbox,kill), + receive after infinity -> ok end + end, + erl_java_link(LinkFun,kill_mbox_from_erlang,killed,Config). %%%----------------------------------------------------------------- erl_exit_with_reason_any_term(doc) -> diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index 4b7ba1a437..fde2fd5071 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -53,21 +53,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[pid_roundtrip, port_roundtrip, ref_roundtrip, - new_float, old_stuff, binary_roundtrip, - decompress_roundtrip, compress_roundtrip, - integer_roundtrip, fun_roundtrip, lists_roundtrip, - lists_roundtrip_2, lists_iterator, unicode, - unicode_list_to_string, unicode_string_to_list, connect]. + [pid_roundtrip, port_roundtrip, ref_roundtrip, + new_float, old_stuff, binary_roundtrip, + decompress_roundtrip, compress_roundtrip, + integer_roundtrip, fun_roundtrip, lists_roundtrip, + lists_roundtrip_2, lists_iterator, unicode, + unicode_list_to_string, unicode_string_to_list, connect]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -- cgit v1.2.3 From 9037c4a828e699d5d3bba423d82db93cddf3d079 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:13:06 +0100 Subject: Fix formatting for kernel --- lib/kernel/test/application_SUITE.erl | 28 ++++---- lib/kernel/test/bif_SUITE.erl | 22 +++---- lib/kernel/test/cleanup.erl | 6 +- lib/kernel/test/code_SUITE.erl | 5 +- lib/kernel/test/disk_log_SUITE.erl | 75 ++++++++++----------- lib/kernel/test/erl_boot_server_SUITE.erl | 6 +- lib/kernel/test/erl_distribution_SUITE.erl | 23 +++---- lib/kernel/test/erl_distribution_wb_SUITE.erl | 9 +-- lib/kernel/test/erl_prim_loader_SUITE.erl | 15 +++-- lib/kernel/test/error_logger_SUITE.erl | 12 ++-- lib/kernel/test/error_logger_warn_SUITE.erl | 14 ++-- lib/kernel/test/file_SUITE.erl | 78 ++++++++++------------ lib/kernel/test/gen_sctp_SUITE.erl | 10 +-- lib/kernel/test/gen_tcp_api_SUITE.erl | 18 ++--- lib/kernel/test/gen_tcp_echo_SUITE.erl | 16 +++-- lib/kernel/test/gen_tcp_misc_SUITE.erl | 53 ++++++++------- lib/kernel/test/gen_udp_SUITE.erl | 13 ++-- lib/kernel/test/global_SUITE.erl | 34 +++++----- lib/kernel/test/global_group_SUITE.erl | 16 ++--- lib/kernel/test/heart_SUITE.erl | 22 +++---- lib/kernel/test/inet_SUITE.erl | 7 +- lib/kernel/test/inet_res_SUITE.erl | 15 +++-- lib/kernel/test/inet_sockopt_SUITE.erl | 16 +++-- lib/kernel/test/init_SUITE.erl | 13 ++-- lib/kernel/test/interactive_shell_SUITE.erl | 12 ++-- lib/kernel/test/kernel_SUITE.erl | 9 +-- lib/kernel/test/kernel_config_SUITE.erl | 6 +- lib/kernel/test/os_SUITE.erl | 7 +- lib/kernel/test/pdict_SUITE.erl | 9 +-- lib/kernel/test/pg2_SUITE.erl | 14 ++-- lib/kernel/test/prim_file_SUITE.erl | 94 +++++++++++++-------------- lib/kernel/test/ram_file_SUITE.erl | 13 ++-- lib/kernel/test/rpc_SUITE.erl | 15 +++-- lib/kernel/test/seq_trace_SUITE.erl | 18 ++--- lib/kernel/test/wrap_log_reader_SUITE.erl | 15 +++-- lib/kernel/test/zlib_SUITE.erl | 32 ++++----- 36 files changed, 394 insertions(+), 376 deletions(-) diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index a46967e010..c139c0eefe 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -20,7 +20,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + failover/1, failover_comp/1, permissions/1, load/1, load_use_cache/1, otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, @@ -44,19 +46,19 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[failover, failover_comp, permissions, load, - load_use_cache, {group, reported_bugs}, start_phases, - script_start, nodedown_start, permit_false_start_local, - permit_false_start_dist, get_key, - {group, distr_changed}, config_change, shutdown_func]. + [failover, failover_comp, permissions, load, + load_use_cache, {group, reported_bugs}, start_phases, + script_start, nodedown_start, permit_false_start_local, + permit_false_start_dist, get_key, + {group, distr_changed}, config_change, shutdown_func]. groups() -> [{reported_bugs, [], - [otp_1586, otp_2078, otp_2012, otp_2718, otp_2973, - otp_3002, otp_3184, otp_4066, otp_4227, otp_5363, - otp_5606]}, - {distr_changed, [], - [distr_changed_tc1, distr_changed_tc2]}]. + [otp_1586, otp_2078, otp_2012, otp_2718, otp_2973, + otp_3002, otp_3184, otp_4066, otp_4227, otp_5363, + otp_5606]}, + {distr_changed, [], + [distr_changed_tc1, distr_changed_tc2]}]. init_per_suite(Config) -> Config. @@ -65,10 +67,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index ddb6866179..980d162f55 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(bif_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([ spawn1/1, spawn2/1, spawn3/1, spawn4/1, @@ -51,15 +52,15 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, spawn_tests}, {group, spawn_link_tests}, - {group, spawn_opt_tests}, spawn_failures, wilderness]. + [{group, spawn_tests}, {group, spawn_link_tests}, + {group, spawn_opt_tests}, spawn_failures, wilderness]. groups() -> [{spawn_tests, [], [spawn1, spawn2, spawn3, spawn4]}, - {spawn_link_tests, [], - [spawn_link1, spawn_link2, spawn_link3, spawn_link4]}, - {spawn_opt_tests, [], - [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}]. + {spawn_link_tests, [], + [spawn_link1, spawn_link2, spawn_link3, spawn_link4]}, + {spawn_opt_tests, [], + [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}]. init_per_suite(Config) -> Config. @@ -68,13 +69,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - + Config. spawn1(doc) -> ["Test spawn/1"]; diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl index 7fb00b4305..01db1e9124 100644 --- a/lib/kernel/test/cleanup.erl +++ b/lib/kernel/test/cleanup.erl @@ -23,16 +23,16 @@ -include_lib("test_server/include/test_server.hrl"). all() -> -[cleanup]. + [cleanup]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cleanup(suite) -> []; diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 90b8a6a0d6..64c2878f9e 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -87,9 +87,10 @@ init_per_testcase(_Func, Config) -> P=code:get_path(), [{watchdog, Dog}, {code_path, P}|Config]. -end_per_testcase(mult_lib_roots, Config) -> +end_per_testcase(TC, Config) when TC == mult_lib_roots; + TC == big_boot_embedded -> {ok, HostName} = inet:gethostname(), - NodeName = list_to_atom("mult_lib_roots@"++HostName), + NodeName = list_to_atom(atom_to_list(TC)++"@"++HostName), ?t:stop_node(NodeName), end_per_testcase(Config); end_per_testcase(_Func, Config) -> diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index 40a7edb363..b5faf984ff 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -34,7 +34,8 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, halt_int_inf/1, halt_int_sz_1/1, halt_int_sz_2/1, @@ -145,43 +146,43 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, halt_int}, {group, wrap_int}, - {group, halt_ext}, {group, wrap_ext}, - {group, read_mode}, {group, head}, {group, notif}, - new_idx_vsn, reopen, {group, block}, unblock, - {group, open}, {group, close}, {group, error}, chunk, - truncate, many_users, {group, info}, - {group, change_size}, change_attribute, - {group, distribution}, evil, otp_6278]. + [{group, halt_int}, {group, wrap_int}, + {group, halt_ext}, {group, wrap_ext}, + {group, read_mode}, {group, head}, {group, notif}, + new_idx_vsn, reopen, {group, block}, unblock, + {group, open}, {group, close}, {group, error}, chunk, + truncate, many_users, {group, info}, + {group, change_size}, change_attribute, + {group, distribution}, evil, otp_6278]. groups() -> [{halt_int, [], [halt_int_inf, {group, halt_int_sz}]}, - {halt_int_sz, [], [halt_int_sz_1, halt_int_sz_2]}, - {read_mode, [], - [halt_int_ro, halt_ext_ro, wrap_int_ro, wrap_ext_ro, - halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, - halt_ro_crash]}, - {wrap_int, [], [wrap_int_1, wrap_int_2, inc_wrap_file]}, - {halt_ext, [], [halt_ext_inf, {group, halt_ext_sz}]}, - {halt_ext_sz, [], [halt_ext_sz_1, halt_ext_sz_2]}, - {wrap_ext, [], [wrap_ext_1, wrap_ext_2]}, - {head, [], [head_func, plain_head, one_header]}, - {notif, [], - [wrap_notif, full_notif, trunc_notif, blocked_notif]}, - {block, [], [block_blocked, block_queue, block_queue2]}, - {open, [], - [open_overwrite, open_size, open_truncate, open_error]}, - {close, [], [close_race, close_block, close_deadlock]}, - {error, [], [error_repair, error_log, error_index]}, - {info, [], [info_current]}, - {change_size, [], - [change_size_before, change_size_during, - change_size_after, default_size, change_size2, - change_size_truncate]}, - {distribution, [], - [dist_open, dist_error_open, dist_notify, - dist_terminate, dist_accessible, dist_deadlock, - dist_open2, other_groups]}]. + {halt_int_sz, [], [halt_int_sz_1, halt_int_sz_2]}, + {read_mode, [], + [halt_int_ro, halt_ext_ro, wrap_int_ro, wrap_ext_ro, + halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, + halt_ro_crash]}, + {wrap_int, [], [wrap_int_1, wrap_int_2, inc_wrap_file]}, + {halt_ext, [], [halt_ext_inf, {group, halt_ext_sz}]}, + {halt_ext_sz, [], [halt_ext_sz_1, halt_ext_sz_2]}, + {wrap_ext, [], [wrap_ext_1, wrap_ext_2]}, + {head, [], [head_func, plain_head, one_header]}, + {notif, [], + [wrap_notif, full_notif, trunc_notif, blocked_notif]}, + {block, [], [block_blocked, block_queue, block_queue2]}, + {open, [], + [open_overwrite, open_size, open_truncate, open_error]}, + {close, [], [close_race, close_block, close_deadlock]}, + {error, [], [error_repair, error_log, error_index]}, + {info, [], [info_current]}, + {change_size, [], + [change_size_before, change_size_during, + change_size_after, default_size, change_size2, + change_size_truncate]}, + {distribution, [], + [dist_open, dist_error_open, dist_notify, + dist_terminate, dist_accessible, dist_deadlock, + dist_open2, other_groups]}]. init_per_suite(Config) -> Config. @@ -190,10 +191,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index 775f1b1e47..ad71e0c1bd 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -36,7 +36,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start, start_link, stop, add, delete, responses]. + [start, start_link, stop, add, delete, responses]. groups() -> []. @@ -48,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(all_ones, {255, 255, 255, 255}). diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 09b5eecc4c..4933137650 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -21,7 +21,8 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([tick/1, tick_change/1, illegal_nodenames/1, hidden_node/1, table_waste/1, net_setuptime/1, @@ -60,17 +61,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[tick, tick_change, illegal_nodenames, hidden_node, - table_waste, net_setuptime, {group, monitor_nodes}]. + [tick, tick_change, illegal_nodenames, hidden_node, + table_waste, net_setuptime, {group, monitor_nodes}]. groups() -> [{monitor_nodes, [], - [monitor_nodes_nodedown_reason, - monitor_nodes_complex_nodedown_reason, - monitor_nodes_node_type, monitor_nodes_misc, - monitor_nodes_otp_6481, monitor_nodes_errors, - monitor_nodes_combinations, monitor_nodes_cleanup, - monitor_nodes_many]}]. + [monitor_nodes_nodedown_reason, + monitor_nodes_complex_nodedown_reason, + monitor_nodes_node_type, monitor_nodes_misc, + monitor_nodes_otp_6481, monitor_nodes_errors, + monitor_nodes_combinations, monitor_nodes_cleanup, + monitor_nodes_many]}]. init_per_suite(Config) -> Config. @@ -79,10 +80,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 5b1dc78245..f61a8fe2cc 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). @@ -80,7 +81,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[whitebox, switch_options, missing_compulsory_dflags]. + [whitebox, switch_options, missing_compulsory_dflags]. groups() -> []. @@ -92,10 +93,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index ba2b369ec2..e429986ca9 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("kernel/include/file.hrl"). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([get_path/1, set_path/1, get_file/1, inet_existing/1, inet_coming_up/1, inet_disconnects/1, @@ -38,10 +39,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[get_path, set_path, get_file, inet_existing, - inet_coming_up, inet_disconnects, multiple_slaves, - file_requests, local_archive, remote_archive, - primary_archive, virtual_dir_in_archive]. + [get_path, set_path, get_file, inet_existing, + inet_coming_up, inet_disconnects, multiple_slaves, + file_requests, local_archive, remote_archive, + primary_archive, virtual_dir_in_archive]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index 93b23c38b3..57d7f07ebc 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -27,7 +27,9 @@ %% error_logger deliver the expected events. %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + error_report/1, info_report/1, error/1, info/1, emulator/1, tty/1, logfile/1, add/1, delete/1]). -export([generate_error/0]). @@ -40,8 +42,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[error_report, info_report, error, info, emulator, tty, - logfile, add, delete]. + [error_report, info_report, error, info, emulator, tty, + logfile, add, delete]. groups() -> []. @@ -53,10 +55,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 59139ba38b..3e76355dfd 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -18,7 +18,9 @@ %% -module(error_logger_warn_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -46,9 +48,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, warnings_info, warnings_warnings, rb_basic, - rb_warnings_info, rb_warnings_warnings, rb_trunc, - rb_utc, file_utc]. + [basic, warnings_info, warnings_warnings, rb_basic, + rb_warnings_info, rb_warnings_warnings, rb_trunc, + rb_utc, file_utc]. groups() -> []. @@ -60,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 8b0470bad4..0e84cae7ca 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -40,8 +40,8 @@ -module(?FILE_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - init/1, fini/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, read_write_file/1, names/1]). -export([cur_dir_0/1, cur_dir_1/1, make_del_dir/1, @@ -101,54 +101,48 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[altname, read_write_file, {group, dirs}, - {group, files}, delete, rename, names, {group, errors}, - {group, compression}, {group, links}, copy, - delayed_write, read_ahead, segment_read, segment_write, - ipread, pid2name, interleaved_read_write, otp_5814, - large_file, read_line_1, read_line_2, read_line_3, - read_line_4, standard_io]. + [altname, read_write_file, {group, dirs}, + {group, files}, delete, rename, names, {group, errors}, + {group, compression}, {group, links}, copy, + delayed_write, read_ahead, segment_read, segment_write, + ipread, pid2name, interleaved_read_write, otp_5814, + large_file, read_line_1, read_line_2, read_line_3, + read_line_4, standard_io]. groups() -> [{dirs, [], [make_del_dir, cur_dir_0, cur_dir_1]}, - {files, [], - [{group, open}, {group, pos}, {group, file_info}, - {group, consult}, {group, eval}, {group, script}, - truncate, sync, datasync, advise]}, - {open, [], - [open1, old_modes, new_modes, path_open, close, access, - read_write, pread_write, append, open_errors, - exclusive]}, - {pos, [], [pos1, pos2]}, - {file_info, [], - [file_info_basic_file, file_info_basic_directory, - file_info_bad, file_info_times, file_write_file_info]}, - {consult, [], [consult1, path_consult]}, - {eval, [], [eval1, path_eval]}, - {script, [], [script1, path_script]}, - {errors, [], - [e_delete, e_rename, e_make_dir, e_del_dir]}, - {compression, [], - [read_compressed_cooked, read_compressed_cooked_binary, - read_cooked_tar_problem, read_not_really_compressed, - write_compressed, compress_errors, catenated_gzips]}, - {links, [], - [make_link, read_link_info_for_non_link, symlinks]}]. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + {group, consult}, {group, eval}, {group, script}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, old_modes, new_modes, path_open, close, access, + read_write, pread_write, append, open_errors, + exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file, file_info_basic_directory, + file_info_bad, file_info_times, file_write_file_info]}, + {consult, [], [consult1, path_consult]}, + {eval, [], [eval1, path_eval]}, + {script, [], [script1, path_script]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed_cooked, read_compressed_cooked_binary, + read_cooked_tar_problem, read_not_really_compressed, + write_compressed, compress_errors, catenated_gzips]}, + {links, [], + [make_link, read_link_info_for_non_link, symlinks]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -init(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case os:type() of {win32, _} -> Priv = ?config(priv_dir, Config), @@ -165,7 +159,7 @@ init(Config) when is_list(Config) -> ?FILE_INIT(Config) end. -fini(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> case os:type() of {win32, _} -> os:cmd("subst z: /d"); diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 23cf136b4e..20b0d46d56 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -35,9 +35,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, api_open_close, api_listen, api_connect_init, - api_opts, xfer_min, xfer_active, def_sndrcvinfo, - implicit_inet6]. + [basic, api_open_close, api_listen, api_connect_init, + api_opts, xfer_min, xfer_active, def_sndrcvinfo, + implicit_inet6]. groups() -> []. @@ -60,10 +60,10 @@ end_per_suite(_Conifig) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index e7dc0edd17..6fcc2bed40 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -25,7 +25,9 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, t_connect_timeout/1, t_accept_timeout/1, t_connect_bad/1, t_recv_timeout/1, t_recv_eof/1, @@ -35,14 +37,14 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, t_accept}, {group, t_connect}, {group, t_recv}, - t_shutdown_write, t_shutdown_both, t_shutdown_error, - t_fdopen, t_implicit_inet6]. + [{group, t_accept}, {group, t_connect}, {group, t_recv}, + t_shutdown_write, t_shutdown_both, t_shutdown_error, + t_fdopen, t_implicit_inet6]. groups() -> [{t_accept, [], [t_accept_timeout]}, - {t_connect, [], [t_connect_timeout, t_connect_bad]}, - {t_recv, [], [t_recv_timeout, t_recv_eof]}]. + {t_connect, [], [t_connect_timeout, t_connect_bad]}, + {t_recv, [], [t_recv_timeout, t_recv_eof]}]. init_per_suite(Config) -> Config. @@ -51,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index ead976b94a..bebd4fa880 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -22,7 +22,9 @@ %%-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -34,10 +36,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[active_echo, passive_echo, active_once_echo, - slow_active_echo, slow_passive_echo, limit_active_echo, - limit_passive_echo, large_limit_active_echo, - large_limit_passive_echo]. + [active_echo, passive_echo, active_once_echo, + slow_active_echo, slow_passive_echo, limit_active_echo, + limit_passive_echo, large_limit_active_echo, + large_limit_passive_echo]. groups() -> []. @@ -49,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index b2a8a309ed..bd554ba486 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -22,7 +22,9 @@ %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, init_per_testcase/2, end_per_testcase/2, @@ -34,14 +36,15 @@ partial_recv_and_close_2/1,partial_recv_and_close_3/1,so_priority/1, % Accept tests primitive_accept/1,multi_accept_close_listen/1,accept_timeout/1, - accept_timeouts_in_order/1,accept_timeouts_in_order2/1,accept_timeouts_in_order3/1, - accept_timeouts_mixed/1, + accept_timeouts_in_order/1,accept_timeouts_in_order2/1, + accept_timeouts_in_order3/1,accept_timeouts_mixed/1, killing_acceptor/1,killing_multi_acceptors/1,killing_multi_acceptors2/1, - several_accepts_in_one_go/1,active_once_closed/1, send_timeout/1, otp_7731/1, - zombie_sockets/1, otp_7816/1, otp_8102/1]). + several_accepts_in_one_go/1,active_once_closed/1, send_timeout/1, + otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1]). %% Internal exports. --export([sender/3, not_owner/1, passive_sockets_server/2, priority_server/1, otp_7731_server/1, zombie_server/2]). +-export([sender/3, not_owner/1, passive_sockets_server/2, priority_server/1, + otp_7731_server/1, zombie_server/2]). init_per_testcase(_Func, Config) when is_list(Config) -> Dog = test_server:timetrap(test_server:seconds(240)), @@ -53,23 +56,23 @@ end_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[controlling_process, no_accept, - close_with_pending_output, data_before_close, - iter_max_socks, passive_sockets, - accept_closed_by_other_process, otp_3924, closed_socket, - shutdown_active, shutdown_passive, shutdown_pending, - default_options, http_bad_packet, busy_send, - busy_disconnect_passive, busy_disconnect_active, - fill_sendq, partial_recv_and_close, - partial_recv_and_close_2, partial_recv_and_close_3, - so_priority, primitive_accept, - multi_accept_close_listen, accept_timeout, - accept_timeouts_in_order, accept_timeouts_in_order2, - accept_timeouts_in_order3, accept_timeouts_mixed, - killing_acceptor, killing_multi_acceptors, - killing_multi_acceptors2, several_accepts_in_one_go, - active_once_closed, send_timeout, otp_7731, - zombie_sockets, otp_7816, otp_8102]. + [controlling_process, no_accept, + close_with_pending_output, data_before_close, + iter_max_socks, passive_sockets, + accept_closed_by_other_process, otp_3924, closed_socket, + shutdown_active, shutdown_passive, shutdown_pending, + default_options, http_bad_packet, busy_send, + busy_disconnect_passive, busy_disconnect_active, + fill_sendq, partial_recv_and_close, + partial_recv_and_close_2, partial_recv_and_close_3, + so_priority, primitive_accept, + multi_accept_close_listen, accept_timeout, + accept_timeouts_in_order, accept_timeouts_in_order2, + accept_timeouts_in_order3, accept_timeouts_mixed, + killing_acceptor, killing_multi_acceptors, + killing_multi_acceptors2, several_accepts_in_one_go, + active_once_closed, send_timeout, otp_7731, + zombie_sockets, otp_7816, otp_8102]. groups() -> []. @@ -81,10 +84,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 266876d3d7..50f8d55630 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -29,7 +29,8 @@ % XXX - we should pick a port that we _know_ is closed. That's pretty hard. -define(CLOSED_PORT, 6666). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, @@ -39,9 +40,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[send_to_closed, buffer_size, binary_passive_recv, - bad_address, read_packets, open_fd, connect, - implicit_inet6]. + [send_to_closed, buffer_size, binary_passive_recv, + bad_address, read_packets, open_fd, connect, + implicit_inet6]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index bb1ea83239..8540897d5b 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -63,26 +63,26 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case init:get_argument(ring_line) of - {ok, _} -> [ring_line]; - _ -> - [names, names_hidden, locks, locks_hidden, bad_input, - names_and_locks, lock_die, name_die, basic_partition, - advanced_partition, basic_name_partition, - stress_partition, simple_ring, simple_line, ring, line, - global_lost_nodes, otp_1849, otp_3162, otp_5640, - otp_5737, otp_6931, simple_disconnect, simple_resolve, - simple_resolve2, simple_resolve3, leftover_name, - re_register_name, name_exit, external_nodes, many_nodes, - sync_0, global_groups_change, register_1, both_known_1, - lost_unregister, mass_death, garbage_messages] -end. + case init:get_argument(ring_line) of + {ok, _} -> [ring_line]; + _ -> + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + advanced_partition, basic_name_partition, + stress_partition, simple_ring, simple_line, ring, line, + global_lost_nodes, otp_1849, otp_3162, otp_5640, + otp_5737, otp_6931, simple_disconnect, simple_resolve, + simple_resolve2, simple_resolve3, leftover_name, + re_register_name, name_exit, external_nodes, many_nodes, + sync_0, global_groups_change, register_1, both_known_1, + lost_unregister, mass_death, garbage_messages] + end. groups() -> [{ttt, [], - [names, names_hidden, locks, locks_hidden, bad_input, - names_and_locks, lock_die, name_die, basic_partition, - ring]}]. + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + ring]}]. init_per_group(_GroupName, Config) -> Config. diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index 651ca08c41..859d0618e7 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -38,8 +38,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, - one_grp, one_grp_x, two_grp, test_exit, hidden_groups]. + [start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, + one_grp, one_grp_x, two_grp, test_exit, hidden_groups]. groups() -> []. @@ -200,8 +200,8 @@ no_gg_proc(Config) when is_list(Config) -> ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn, Cpxnn, Cpynn, Cpznn], ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []), - ?line true = (Own_nodes -- Own_nodes_should) =:= [], - ?line true = (Own_nodes_should -- Own_nodes) =:= [], + ?line [] = (Own_nodes -- Own_nodes_should), + ?line [] = (Own_nodes_should -- Own_nodes), ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]), ?line receive @@ -375,8 +375,8 @@ no_gg_proc_sync(Config) when is_list(Config) -> ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn, Cpxnn, Cpynn, Cpznn], ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []), - ?line true = (Own_nodes -- Own_nodes_should) =:= [], - ?line true = (Own_nodes_should -- Own_nodes) =:= [], + ?line [] = (Own_nodes -- Own_nodes_should), + ?line [] = (Own_nodes_should -- Own_nodes), ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]), ?line receive @@ -549,8 +549,8 @@ compatible(Config) when is_list(Config) -> ?line Own_nodes_should = [node(), Cp1nn, Cp2nn, Cp3nn, Cpxnn, Cpynn, Cpznn], ?line Own_nodes = rpc:call(Cp3, global_group, own_nodes, []), - ?line true = (Own_nodes -- Own_nodes_should) =:= [], - ?line true = (Own_nodes_should -- Own_nodes) =:= [], + ?line [] = (Own_nodes -- Own_nodes_should), + ?line [] = (Own_nodes_should -- Own_nodes), ?line Pid2 = rpc:call(Cp1, global_group, send, [test2, {ping, self()}]), ?line receive diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index e38d6df7c1..24e05b011a 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -20,8 +20,10 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, - dont_drop/1, kill_pid/1, fini/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, start/1, restart/1, + reboot/1, set_cmd/1, clear_cmd/1, + dont_drop/1, kill_pid/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -56,32 +58,26 @@ end_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start, restart, reboot, set_cmd, clear_cmd, kill_pid]. + [start, restart, reboot, set_cmd, clear_cmd, kill_pid]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -ostype(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case os:type() of {win32, windows} -> {skipped, "No use to run on Windows 95/98"}; _ -> Config end. -fini(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> Config. start_check(Type, Name) -> diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 4d673e0814..d4dd98dd1e 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -22,7 +22,8 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_gethostbyaddr/0, t_gethostbyaddr/1, t_getaddr/0, t_getaddr/1, t_gethostbyname/0, t_gethostbyname/1, @@ -79,10 +80,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index a3daf8d053..1e5a62216f 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -24,7 +24,8 @@ -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). -export([basic/1, resolve/1, edns0/1, txt_record/1, files_monitor/1]). -export([ @@ -43,10 +44,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, resolve, edns0, txt_record, files_monitor, - gethostbyaddr, gethostbyaddr_v6, gethostbyname, - gethostbyname_v6, getaddr, getaddr_v6, ipv4_to_ipv6, - host_and_addr]. + [basic, resolve, edns0, txt_record, files_monitor, + gethostbyaddr, gethostbyaddr_v6, gethostbyname, + gethostbyname_v6, getaddr, getaddr_v6, ipv4_to_ipv6, + host_and_addr]. groups() -> []. @@ -58,10 +59,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. zone_dir(basic) -> otptest; diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index 31910b625c..2c192aa383 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -48,7 +48,9 @@ -define(C_QUIT,99). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, doc_examples_raw/1,doc_examples_raw_getbin/1, large_raw/1,large_raw_getbin/1,combined/1,combined_getbin/1, type_errors/1]). @@ -59,10 +61,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[simple, loop_all, simple_raw, simple_raw_getbin, - doc_examples_raw, doc_examples_raw_getbin, large_raw, - large_raw_getbin, combined, combined_getbin, - type_errors]. + [simple, loop_all, simple_raw, simple_raw_getbin, + doc_examples_raw, doc_examples_raw_getbin, large_raw, + large_raw_getbin, combined, combined_getbin, + type_errors]. groups() -> []. @@ -74,10 +76,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index 8c7dc1bb2f..90f1334f1c 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([get_arguments/1, get_argument/1, boot_var/1, restart/1, get_plain_arguments/1, @@ -41,9 +42,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[get_arguments, get_argument, boot_var, - get_plain_arguments, restart, get_status, script_id, - {group, boot}]. + [get_arguments, get_argument, boot_var, + get_plain_arguments, restart, get_status, script_id, + {group, boot}]. groups() -> [{boot, [], [boot1, boot2]}]. @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index 7ef7f80d44..f6fac3983d 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -18,7 +18,9 @@ %% -module(interactive_shell_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, job_control_remote_noshell/1]). @@ -47,8 +49,8 @@ end_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[get_columns_and_rows, exit_initial, job_control_local, - job_control_remote, job_control_remote_noshell]. + [get_columns_and_rows, exit_initial, job_control_local, + job_control_remote, job_control_remote_noshell]. groups() -> []. @@ -60,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %-define(DEBUG,1). diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 801505e683..02bb3ced08 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -27,7 +27,8 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -39,7 +40,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test]. + [app_test]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index a51d1dafd2..554b782797 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -27,16 +27,16 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[sync]. + [sync]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_suite(doc) -> []; diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index 06b60871cc..8541170893 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -18,7 +18,8 @@ %% -module(os_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([space_in_cwd/1, quoting/1, space_in_name/1, bad_command/1, find_executable/1, unix_comment_in_command/1, evil/1]). @@ -27,8 +28,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[space_in_cwd, quoting, space_in_name, bad_command, - find_executable, unix_comment_in_command, evil]. + [space_in_cwd, quoting, space_in_name, bad_command, + find_executable, unix_comment_in_command, evil]. groups() -> []. diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index c296b3b84f..f8091a5d17 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -29,7 +29,8 @@ -define(DEBUGF(A,B), noop). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, simple/1, complicated/1, heavy/1, info/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). @@ -45,7 +46,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[simple, complicated, heavy, info]. + [simple, complicated, heavy, info]. groups() -> []. @@ -57,10 +58,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. simple(doc) -> diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index 25ce71eb00..048a73b8cb 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -24,10 +24,12 @@ -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([ - otp_7277/1, otp_8259/1, otp_8653/1, + otp_7277/1, otp_8259/1, otp_8653/1, compat/1, basic/1]). % Default timetrap timeout (set in init_per_testcase). @@ -52,11 +54,11 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, tickets}]. + [{group, tickets}]. groups() -> [{tickets, [], - [otp_7277, otp_8259, otp_8653, compat, basic]}]. + [otp_7277, otp_8259, otp_8653, compat, basic]}]. init_per_suite(Config) -> Config. @@ -65,10 +67,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 881d6396ed..ad259ec2ec 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -17,9 +17,9 @@ %% %CopyrightEnd% %% -module(prim_file_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - init/1, fini/1, - read_write_file/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + read_write_file/1]). -export([cur_dir_0a/1, cur_dir_0b/1, cur_dir_1a/1, cur_dir_1b/1, make_del_dir_a/1, make_del_dir_b/1, @@ -28,25 +28,25 @@ delete_a/1, delete_b/1]). -export([ open1/1, modes/1]). -export([ - file_info_basic_file_a/1, file_info_basic_file_b/1, - file_info_basic_directory_a/1, file_info_basic_directory_b/1, - file_info_bad_a/1, file_info_bad_b/1, - file_info_times_a/1, file_info_times_b/1, - file_write_file_info_a/1, file_write_file_info_b/1]). + file_info_basic_file_a/1, file_info_basic_file_b/1, + file_info_basic_directory_a/1, file_info_basic_directory_b/1, + file_info_bad_a/1, file_info_bad_b/1, + file_info_times_a/1, file_info_times_b/1, + file_write_file_info_a/1, file_write_file_info_b/1]). -export([rename_a/1, rename_b/1, access/1, truncate/1, datasync/1, sync/1, read_write/1, pread_write/1, append/1, exclusive/1]). -export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). -export([ read_not_really_compressed/1, - read_compressed/1, write_compressed/1, - compress_errors/1]). + read_compressed/1, write_compressed/1, + compress_errors/1]). -export([ - make_link_a/1, make_link_b/1, - read_link_info_for_non_link/1, - symlinks_a/1, symlinks_b/1, - list_dir_limit/1]). + make_link_a/1, make_link_b/1, + read_link_info_for_non_link/1, + symlinks_a/1, symlinks_b/1, + list_dir_limit/1]). -export([advise/1]). @@ -70,50 +70,44 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[read_write_file, {group, dirs}, {group, files}, - delete_a, delete_b, rename_a, rename_b, {group, errors}, - {group, compression}, {group, links}, list_dir_limit]. + [read_write_file, {group, dirs}, {group, files}, + delete_a, delete_b, rename_a, rename_b, {group, errors}, + {group, compression}, {group, links}, list_dir_limit]. groups() -> [{dirs, [], - [make_del_dir_a, make_del_dir_b, cur_dir_0a, cur_dir_0b, - cur_dir_1a, cur_dir_1b]}, - {files, [], - [{group, open}, {group, pos}, {group, file_info}, - truncate, sync, datasync, advise]}, - {open, [], - [open1, modes, close, access, read_write, pread_write, - append, exclusive]}, - {pos, [], [pos1, pos2]}, - {file_info, [], - [file_info_basic_file_a, file_info_basic_file_b, - file_info_basic_directory_a, - file_info_basic_directory_b, file_info_bad_a, - file_info_bad_b, file_info_times_a, file_info_times_b, - file_write_file_info_a, file_write_file_info_b]}, - {errors, [], - [e_delete, e_rename, e_make_dir, e_del_dir]}, - {compression, [], - [read_compressed, read_not_really_compressed, - write_compressed, compress_errors]}, - {links, [], - [make_link_a, make_link_b, read_link_info_for_non_link, - symlinks_a, symlinks_b]}]. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. + [make_del_dir_a, make_del_dir_b, cur_dir_0a, cur_dir_0b, + cur_dir_1a, cur_dir_1b]}, + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, modes, close, access, read_write, pread_write, + append, exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file_a, file_info_basic_file_b, + file_info_basic_directory_a, + file_info_basic_directory_b, file_info_bad_a, + file_info_bad_b, file_info_times_a, file_info_times_b, + file_write_file_info_a, file_write_file_info_b]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed, read_not_really_compressed, + write_compressed, compress_errors]}, + {links, [], + [make_link_a, make_link_b, read_link_info_for_non_link, + symlinks_a, symlinks_b]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -init(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case os:type() of {win32, _} -> Priv = ?config(priv_dir, Config), @@ -130,7 +124,7 @@ init(Config) when is_list(Config) -> Config end. -fini(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> case os:type() of {win32, _} -> os:cmd("subst z: /d"); diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index 5d079d5bee..6cda16f1f2 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -19,7 +19,8 @@ -module(ram_file_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, %% init/1, fini/1, init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, @@ -37,9 +38,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[open_modes, open_old_modes, pread_pwrite, position, - truncate, sync, get_set_file, compress, uuencode, - large_file_errors, large_file_light, large_file_heavy]. + [open_modes, open_old_modes, pread_pwrite, position, + truncate, sync, get_set_file, compress, uuencode, + large_file_errors, large_file_light, large_file_heavy]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 2cced82f4d..6ea2bd194a 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -18,7 +18,8 @@ %% -module(rpc_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([call/1, block_call/1, multicall/1, multicall_timeout/1, multicall_dies/1, multicall_node_dies/1, called_dies/1, called_node_dies/1, @@ -31,10 +32,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[call, block_call, multicall, multicall_timeout, - multicall_dies, multicall_node_dies, called_dies, - called_node_dies, called_throws, call_benchmark, - async_call]. + [call, block_call, multicall, multicall_timeout, + multicall_dies, multicall_node_dies, called_dies, + called_node_dies, called_throws, call_benchmark, + async_call]. groups() -> []. @@ -46,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index b66684f13d..7cb67b261a 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,9 @@ %% -module(seq_trace_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -29,7 +31,7 @@ start_tracer/0, stop_tracer/1, do_match_set_seq_token/1, do_gc_seq_token/1, countdown_start/2]). -%-define(line_trace, 1). + %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -37,10 +39,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[token_set_get, tracer_set_get, print, send, - distributed_send, recv, distributed_recv, trace_exit, - distributed_exit, call, port, match_set_seq_token, - gc_seq_token]. + [token_set_get, tracer_set_get, print, send, + distributed_send, recv, distributed_recv, trace_exit, + distributed_exit, call, port, match_set_seq_token, + gc_seq_token]. groups() -> []. @@ -52,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index a7b63474ec..adf13c2d8f 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -33,7 +33,8 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, no_file/1, one_empty/1, one_filled/1, two_filled/1, @@ -48,13 +49,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[no_file, {group, one}, {group, two}, {group, four}, - {group, wrap}, wrapping, external, error]. + [no_file, {group, one}, {group, two}, {group, four}, + {group, wrap}, wrapping, external, error]. groups() -> [{one, [], [one_empty, one_filled]}, - {two, [], [two_filled]}, {four, [], [four_filled]}, - {wrap, [], [wrap_filled]}]. + {two, [], [two_filled]}, {four, [], [four_filled]}, + {wrap, [], [wrap_filled]}]. init_per_suite(Config) -> Config. @@ -63,10 +64,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index 9a0fa61faa..6ec38ddc86 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -72,23 +72,23 @@ error(Format, Args, File, Line) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, api}, {group, examples}, {group, func}, smp, - otp_7359]. + [{group, api}, {group, examples}, {group, func}, smp, + otp_7359]. groups() -> [{api, [], - [api_open_close, api_deflateInit, - api_deflateSetDictionary, api_deflateReset, - api_deflateParams, api_deflate, api_deflateEnd, - api_inflateInit, api_inflateSetDictionary, - api_inflateSync, api_inflateReset, api_inflate, - api_inflateEnd, api_setBufsz, api_getBufsz, api_crc32, - api_adler32, api_getQSize, api_un_compress, api_un_zip, - api_g_un_zip]}, - {examples, [], [intro]}, - {func, [], - [zip_usage, gz_usage, gz_usage2, compress_usage, - dictionary_usage, large_deflate, crc, adler]}]. + [api_open_close, api_deflateInit, + api_deflateSetDictionary, api_deflateReset, + api_deflateParams, api_deflate, api_deflateEnd, + api_inflateInit, api_inflateSetDictionary, + api_inflateSync, api_inflateReset, api_inflate, + api_inflateEnd, api_setBufsz, api_getBufsz, api_crc32, + api_adler32, api_getQSize, api_un_compress, api_un_zip, + api_g_un_zip]}, + {examples, [], [intro]}, + {func, [], + [zip_usage, gz_usage, gz_usage2, compress_usage, + dictionary_usage, large_deflate, crc, adler]}]. init_per_suite(Config) -> Config. @@ -97,10 +97,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -- cgit v1.2.3 From 0cf2bec9676d42053f15dadb7e6f45c579944bf6 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:43:46 +0100 Subject: Fix formatting and also some migration fixes for megaco --- lib/megaco/test/megaco_SUITE.erl | 66 +++---- lib/megaco/test/megaco_actions_test.erl | 13 +- lib/megaco/test/megaco_app_test.erl | 22 +-- lib/megaco/test/megaco_appup_test.erl | 19 +- lib/megaco/test/megaco_binary_term_id_test.erl | 12 +- lib/megaco/test/megaco_call_flow_test.erl | 14 +- lib/megaco/test/megaco_codec_mini_test.erl | 6 +- lib/megaco/test/megaco_codec_prev3a_test.erl | 243 ++++++++++------------- lib/megaco/test/megaco_codec_prev3b_test.erl | 253 ++++++++++-------------- lib/megaco/test/megaco_codec_prev3c_test.erl | 253 ++++++++++-------------- lib/megaco/test/megaco_codec_test.erl | 20 +- lib/megaco/test/megaco_codec_v1_test.erl | 242 +++++++++-------------- lib/megaco/test/megaco_codec_v2_test.erl | 20 -- lib/megaco/test/megaco_codec_v3_test.erl | 261 ++++++++++--------------- lib/megaco/test/megaco_config_test.erl | 17 +- lib/megaco/test/megaco_digit_map_test.erl | 15 +- lib/megaco/test/megaco_examples_test.erl | 6 +- lib/megaco/test/megaco_flex_test.erl | 22 +-- lib/megaco/test/megaco_load_test.erl | 15 +- lib/megaco/test/megaco_mess_test.erl | 63 +++--- lib/megaco/test/megaco_mib_test.erl | 7 +- lib/megaco/test/megaco_mreq_test.erl | 7 +- lib/megaco/test/megaco_pending_limit_test.erl | 29 +-- lib/megaco/test/megaco_sdp_test.erl | 7 +- lib/megaco/test/megaco_segment_test.erl | 36 ++-- lib/megaco/test/megaco_tcp_test.erl | 28 +-- lib/megaco/test/megaco_timer_test.erl | 33 +--- lib/megaco/test/megaco_trans_test.erl | 65 +++--- lib/megaco/test/megaco_udp_test.erl | 26 +-- 29 files changed, 728 insertions(+), 1092 deletions(-) diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 84ec761fc6..a0b3f1aa01 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -46,42 +46,42 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{suite_callbacks,[{ts_install_scb,[{nodenames,1}]}]}]. all() -> -[{group, app_test}, {group, appup_test}, - {group, config}, {group, flex}, {group, udp}, - {group, tcp}, {group, examples}, {group, digit_map}, - {group, mess}, {group, measure}, - {group, binary_term_id}, {group, codec}, {group, sdp}, - {group, mib}, {group, trans}, {group, actions}, - {group, load}, {group, pending_limit}, - {group, segmented}, {group, timer}]. + [{group, app_test}, {group, appup_test}, + {group, config}, {group, flex}, {group, udp}, + {group, tcp}, {group, examples}, {group, digit_map}, + {group, mess}, {group, measure}, + {group, binary_term_id}, {group, codec}, {group, sdp}, + {group, mib}, {group, trans}, {group, actions}, + {group, load}, {group, pending_limit}, + {group, segmented}, {group, timer}]. groups() -> [{tickets, [], [{group, mess}, {group, codec}]}, - {app_test, [], [{megaco_app_test, all}]}, - {appup_test, [], [{megaco_appup_test, all}]}, - {config, [], [{megaco_config_test, all}]}, - {call_flow, [], [{megaco_call_flow_test, all}]}, - {digit_map, [], [{megaco_digit_map_test, all}]}, - {mess, [], [{megaco_mess_test, all}]}, - {udp, [], [{megaco_udp_test, all}]}, - {tcp, [], [{megaco_tcp_test, all}]}, - {examples, [], [{megaco_examples_test, all}]}, - {measure, [], [{megaco_measure_test, all}]}, - {binary_term_id, [], - [{megaco_binary_term_id_test, all}]}, - {codec, [], [{megaco_codec_test, all}]}, - {sdp, [], [{megaco_sdp_test, all}]}, - {mib, [], [{megaco_mib_test, all}]}, - {trans, [], [{megaco_trans_test, all}]}, - {actions, [], [{megaco_actions_test, all}]}, - {load, [], [{megaco_load_test, all}]}, - {pending_limit, [], [{megaco_pending_limit_test, all}]}, - {segmented, [], [{megaco_segment_test, all}]}, - {timer, [], [{megaco_timer_test, all}]}, - {flex, [], [{megaco_flex_test, all}]}]. + {app_test, [], [{megaco_app_test, all}]}, + {appup_test, [], [{megaco_appup_test, all}]}, + {config, [], [{megaco_config_test, all}]}, + {call_flow, [], [{megaco_call_flow_test, all}]}, + {digit_map, [], [{megaco_digit_map_test, all}]}, + {mess, [], [{megaco_mess_test, all}]}, + {udp, [], [{megaco_udp_test, all}]}, + {tcp, [], [{megaco_tcp_test, all}]}, + {examples, [], [{megaco_examples_test, all}]}, + {measure, [], [{megaco_measure_test, all}]}, + {binary_term_id, [], + [{megaco_binary_term_id_test, all}]}, + {codec, [], [{megaco_codec_test, all}]}, + {sdp, [], [{megaco_sdp_test, all}]}, + {mib, [], [{megaco_mib_test, all}]}, + {trans, [], [{megaco_trans_test, all}]}, + {actions, [], [{megaco_actions_test, all}]}, + {load, [], [{megaco_load_test, all}]}, + {pending_limit, [], [{megaco_pending_limit_test, all}]}, + {segmented, [], [{megaco_segment_test, all}]}, + {timer, [], [{megaco_timer_test, all}]}, + {flex, [], [{megaco_flex_test, all}]}]. init_per_suite(Config) -> Config. @@ -90,10 +90,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_actions_test.erl b/lib/megaco/test/megaco_actions_test.erl index 8e89491893..2efb6e834a 100644 --- a/lib/megaco/test/megaco_actions_test.erl +++ b/lib/megaco/test/megaco_actions_test.erl @@ -79,21 +79,18 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [pretty_text, flex_pretty_text, compact_text, - flex_compact_text, erl_dist, erl_dist_mc, ber_bin, - ber_bin_drv, ber_bin_native, ber_bin_drv_native], - Cases. + [pretty_text, flex_pretty_text, compact_text, + flex_compact_text, erl_dist, erl_dist_mc, ber_bin, + ber_bin_drv, ber_bin_native, ber_bin_drv_native]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl index 7d5994c9b7..0bfa388ef6 100644 --- a/lib/megaco/test/megaco_app_test.erl +++ b/lib/megaco/test/megaco_app_test.erl @@ -45,26 +45,24 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [fields, modules, exportall, app_depend, - undef_funcs], - Cases. + [fields, modules, exportall, app_depend, + undef_funcs]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -app_init(suite) -> []; -app_init(doc) -> []; -app_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> case is_app(megaco) of {ok, AppFile} -> io:format("AppFile: ~n~p~n", [AppFile]), @@ -100,9 +98,9 @@ is_app(App) -> end. -app_fin(suite) -> []; -app_fin(doc) -> []; -app_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl index 552d6049b9..a49ab0a968 100644 --- a/lib/megaco/test/megaco_appup_test.erl +++ b/lib/megaco/test/megaco_appup_test.erl @@ -44,25 +44,24 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [appup], - Cases. + [appup]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -appup_init(suite) -> []; -appup_init(doc) -> []; -appup_init(Config) when is_list(Config) -> +init_per_suite(suite) -> []; +init_per_suite(doc) -> []; +init_per_suite(Config) when is_list(Config) -> AppFile = file_name(?APPLICATION, ".app"), AppupFile = file_name(?APPLICATION, ".appup"), [{app_file, AppFile}, {appup_file, AppupFile}|Config]. @@ -73,9 +72,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -appup_fin(suite) -> []; -appup_fin(doc) -> []; -appup_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/megaco/test/megaco_binary_term_id_test.erl b/lib/megaco/test/megaco_binary_term_id_test.erl index bb9fca951b..47a7a76c1c 100644 --- a/lib/megaco/test/megaco_binary_term_id_test.erl +++ b/lib/megaco/test/megaco_binary_term_id_test.erl @@ -58,21 +58,17 @@ %% Top test case all() -> -[{group, encode_first}, {group, decode_first}]. + [{group, encode_first}, {group, decode_first}]. groups() -> [{encode_first, [], encode_first_cases()}, - {decode_first, [], decode_first_cases()}]. + {decode_first, [], decode_first_cases()}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - + Config. %% Test server callbacks init_per_testcase(Case, Config) -> diff --git a/lib/megaco/test/megaco_call_flow_test.erl b/lib/megaco/test/megaco_call_flow_test.erl index 6d4f000670..b9d64ca8b2 100644 --- a/lib/megaco/test/megaco_call_flow_test.erl +++ b/lib/megaco/test/megaco_call_flow_test.erl @@ -57,22 +57,18 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}]. + [{group, text}, {group, binary}]. groups() -> [{text, [], [pretty, compact]}, - {flex, [], [pretty_flex, compact_flex]}, - {binary, [], [bin, ber, ber_bin, per]}]. + {flex, [], [pretty_flex, compact_flex]}, + {binary, [], [bin, ber, ber_bin, per]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - + Config. pretty(suite) -> []; diff --git a/lib/megaco/test/megaco_codec_mini_test.erl b/lib/megaco/test/megaco_codec_mini_test.erl index f018d3d0d0..ff0c154c7c 100644 --- a/lib/megaco/test/megaco_codec_mini_test.erl +++ b/lib/megaco/test/megaco_codec_mini_test.erl @@ -90,16 +90,16 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, tickets}]. + [{group, tickets}]. groups() -> [{tickets, [], [otp7672_msg01, otp7672_msg02]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_codec_prev3a_test.erl b/lib/megaco/test/megaco_codec_prev3a_test.erl index baaafc729d..d50e72aef1 100644 --- a/lib/megaco/test/megaco_codec_prev3a_test.erl +++ b/lib/megaco/test/megaco_codec_prev3a_test.erl @@ -38,19 +38,13 @@ -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - pretty_test_msgs/1, - compact_test_msgs/1, - flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact_init/1, flex_compact_finish/1, @@ -64,32 +58,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - - bin_test_msgs/1, - ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -132,7 +115,6 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -141,7 +123,6 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -185,7 +166,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, @@ -292,160 +272,133 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. groups() -> [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, - {group, flex_compact_tickets}, {group, pretty_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4299_msg2, compact_otp4359_msg1, - compact_otp4920_msg0, compact_otp4920_msg1, - compact_otp4920_msg2, compact_otp4920_msg3, - compact_otp4920_msg4, compact_otp4920_msg5, - compact_otp4920_msg6, compact_otp4920_msg7, - compact_otp4920_msg8, compact_otp4920_msg9, - compact_otp4920_msg10, compact_otp4920_msg11, - compact_otp4920_msg12, compact_otp4920_msg20, - compact_otp4920_msg21, compact_otp4920_msg22, - compact_otp4920_msg23, compact_otp4920_msg24, - compact_otp4920_msg25, compact_otp5186_msg01, - compact_otp5186_msg02, compact_otp5186_msg03, - compact_otp5186_msg04, compact_otp5186_msg05, - compact_otp5186_msg06, compact_otp5793_msg01, - compact_otp5993_msg01, compact_otp5993_msg02, - compact_otp5993_msg03, compact_otp6017_msg01, - compact_otp6017_msg02, compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5085_msg8, pretty_otp5600_msg1, - pretty_otp5600_msg2, pretty_otp5601_msg1, - pretty_otp5793_msg01, pretty_otp5882_msg01, - pretty_otp6490_msg01, pretty_otp6490_msg02, - pretty_otp6490_msg03, pretty_otp6490_msg04, - pretty_otp6490_msg05, pretty_otp6490_msg06, - pretty_otp7671_msg01, pretty_otp7671_msg02, - pretty_otp7671_msg03, pretty_otp7671_msg04, - pretty_otp7671_msg05, pretty_otp8114_msg01]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(flex_compact_tickets, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_compact, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_pretty, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(flex_pretty_tickets, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(flex_compact_tickets, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_compact, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_pretty, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(_GroupName, Config) -> - Config. - - - - - - - - - + Config. flex_pretty_cases() -> -[flex_pretty_test_msgs]. + [flex_pretty_test_msgs]. flex_compact_cases() -> -[flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, flex_compact_dm_timers7, - flex_compact_dm_timers8]. - - - - - - - - - + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% - - - - - - flex_compact_tickets_cases() -> -[flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07]. - + [flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. - - flex_pretty_tickets_cases() -> -[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_prev3b_test.erl b/lib/megaco/test/megaco_codec_prev3b_test.erl index 563794133a..eaab8f37c1 100644 --- a/lib/megaco/test/megaco_codec_prev3b_test.erl +++ b/lib/megaco/test/megaco_codec_prev3b_test.erl @@ -37,20 +37,14 @@ -export([t/0, t/1]). -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - pretty_test_msgs/1, - compact_test_msgs/1, - flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact_init/1, flex_compact_finish/1, @@ -64,32 +58,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - - bin_test_msgs/1, - ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,7 +116,6 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, @@ -142,7 +124,6 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -190,7 +171,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, @@ -308,164 +288,137 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. groups() -> [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, - {group, flex_compact_tickets}, {group, pretty_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4299_msg2, compact_otp4359_msg1, - compact_otp4920_msg0, compact_otp4920_msg1, - compact_otp4920_msg2, compact_otp4920_msg3, - compact_otp4920_msg4, compact_otp4920_msg5, - compact_otp4920_msg6, compact_otp4920_msg7, - compact_otp4920_msg8, compact_otp4920_msg9, - compact_otp4920_msg10, compact_otp4920_msg11, - compact_otp4920_msg12, compact_otp4920_msg20, - compact_otp4920_msg21, compact_otp4920_msg22, - compact_otp4920_msg23, compact_otp4920_msg24, - compact_otp4920_msg25, compact_otp5186_msg01, - compact_otp5186_msg02, compact_otp5186_msg03, - compact_otp5186_msg04, compact_otp5186_msg05, - compact_otp5186_msg06, compact_otp5793_msg01, - compact_otp5836_msg01, compact_otp5993_msg01, - compact_otp5993_msg02, compact_otp5993_msg03, - compact_otp6017_msg01, compact_otp6017_msg02, - compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5085_msg8, pretty_otp5600_msg1, - pretty_otp5600_msg2, pretty_otp5601_msg1, - pretty_otp5793_msg01, pretty_otp5803_msg01, - pretty_otp5803_msg02, pretty_otp5805_msg01, - pretty_otp5836_msg01, pretty_otp5882_msg01, - pretty_otp6490_msg01, pretty_otp6490_msg02, - pretty_otp6490_msg03, pretty_otp6490_msg04, - pretty_otp6490_msg05, pretty_otp6490_msg06, - pretty_otp7671_msg01, pretty_otp7671_msg02, - pretty_otp7671_msg03, pretty_otp7671_msg04, - pretty_otp7671_msg05, pretty_otp8114_msg01]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5836_msg01, compact_otp5993_msg01, + compact_otp5993_msg02, compact_otp5993_msg03, + compact_otp6017_msg01, compact_otp6017_msg02, + compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(flex_compact_tickets, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_compact, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_pretty, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(flex_pretty_tickets, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(flex_compact_tickets, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_compact, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_pretty, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(_GroupName, Config) -> - Config. - - - - - - - - - + Config. flex_pretty_cases() -> -[flex_pretty_test_msgs]. - + [flex_pretty_test_msgs]. flex_compact_cases() -> -[flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, flex_compact_dm_timers7, - flex_compact_dm_timers8]. - - - - - - - - - + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% - - - - - - flex_compact_tickets_cases() -> -[flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07]. + [flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. - - flex_pretty_tickets_cases() -> -[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_prev3c_test.erl b/lib/megaco/test/megaco_codec_prev3c_test.erl index a2f8e453ac..7f9c0fe4e7 100644 --- a/lib/megaco/test/megaco_codec_prev3c_test.erl +++ b/lib/megaco/test/megaco_codec_prev3c_test.erl @@ -38,15 +38,10 @@ -export([t/0, t/1]). -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - pretty_test_msgs/1, - compact_test_msgs/1, - flex_pretty_init/1, flex_pretty_finish/1, @@ -65,31 +60,20 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - - bin_test_msgs/1, - ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, @@ -133,7 +117,6 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, @@ -143,7 +126,6 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -191,7 +173,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, @@ -312,166 +293,136 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. groups() -> [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, - {group, flex_compact_tickets}, {group, pretty_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4359_msg1, compact_otp4920_msg0, - compact_otp4920_msg1, compact_otp4920_msg2, - compact_otp4920_msg3, compact_otp4920_msg4, - compact_otp4920_msg5, compact_otp4920_msg6, - compact_otp4920_msg7, compact_otp4920_msg8, - compact_otp4920_msg9, compact_otp4920_msg10, - compact_otp4920_msg11, compact_otp4920_msg12, - compact_otp4920_msg20, compact_otp4920_msg21, - compact_otp4920_msg22, compact_otp4920_msg23, - compact_otp4920_msg24, compact_otp4920_msg25, - compact_otp5186_msg01, compact_otp5186_msg02, - compact_otp5186_msg03, compact_otp5186_msg04, - compact_otp5186_msg05, compact_otp5186_msg06, - compact_otp5793_msg01, compact_otp5836_msg01, - compact_otp5993_msg01, compact_otp5993_msg02, - compact_otp5993_msg03, compact_otp6017_msg01, - compact_otp6017_msg02, compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5085_msg8, pretty_otp5600_msg1, - pretty_otp5600_msg2, pretty_otp5601_msg1, - pretty_otp5793_msg01, pretty_otp5803_msg01, - pretty_otp5803_msg02, pretty_otp5805_msg01, - pretty_otp5836_msg01, pretty_otp5882_msg01, - pretty_otp6490_msg01, pretty_otp6490_msg02, - pretty_otp6490_msg03, pretty_otp6490_msg04, - pretty_otp6490_msg05, pretty_otp6490_msg06, - pretty_otp7671_msg01, pretty_otp7671_msg02, - pretty_otp7671_msg03, pretty_otp7671_msg04, - pretty_otp7671_msg05, pretty_otp8114_msg01]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(flex_compact_tickets, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_compact, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_pretty, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(flex_pretty_tickets, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(flex_compact_tickets, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_compact, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_pretty, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(_GroupName, Config) -> - Config. - - - - - - - - - + Config. flex_pretty_cases() -> -[flex_pretty_test_msgs]. - + [flex_pretty_test_msgs]. flex_compact_cases() -> -[flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, flex_compact_dm_timers7, - flex_compact_dm_timers8]. - - - - - - - - - + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% - - - - - - - flex_compact_tickets_cases() -> -[flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. - - - + [flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. - flex_pretty_tickets_cases() -> -[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_test.erl b/lib/megaco/test/megaco_codec_test.erl index 803b927de7..8391024c3f 100644 --- a/lib/megaco/test/megaco_codec_test.erl +++ b/lib/megaco/test/megaco_codec_test.erl @@ -48,23 +48,23 @@ init() -> %% Top test case all() -> -[{group, codec}]. + [{group, codec}]. groups() -> [{codec, [], - [{megaco_codec_mini_test, all}, - {megaco_codec_v1_test, all}, - {megaco_codec_v2_test, all}, - {megaco_codec_prev3a_test, all}, - {megaco_codec_prev3b_test, all}, - {megaco_codec_prev3c_test, all}, - {megaco_codec_v3_test, all}]}]. + [{megaco_codec_mini_test, all}, + {megaco_codec_v1_test, all}, + {megaco_codec_v2_test, all}, + {megaco_codec_prev3a_test, all}, + {megaco_codec_prev3b_test, all}, + {megaco_codec_prev3c_test, all}, + {megaco_codec_v3_test, all}]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 74c70b72ee..7068d005da 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -39,20 +39,14 @@ -export([t/0, t/1]). -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - pretty_test_msgs/1, - compact_test_msgs/1, - flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact_init/1, flex_compact_finish/1, @@ -63,32 +57,21 @@ flex_compact_dm_timers4/1, flex_compact_dm_timers5/1, flex_compact_dm_timers6/1, - - - bin_test_msgs/1, - ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -131,7 +114,6 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_otp7431_msg01a/1, flex_compact_otp7431_msg01b/1, @@ -141,7 +123,6 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -184,7 +165,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, @@ -478,159 +458,131 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. groups() -> [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, {group, pretty_tickets}, - {group, flex_compact_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4299_msg2, compact_otp4359_msg1, - compact_otp4920_msg0, compact_otp4920_msg1, - compact_otp4920_msg2, compact_otp4920_msg3, - compact_otp4920_msg4, compact_otp4920_msg5, - compact_otp4920_msg6, compact_otp4920_msg7, - compact_otp4920_msg8, compact_otp4920_msg9, - compact_otp4920_msg10, compact_otp4920_msg11, - compact_otp4920_msg12, compact_otp4920_msg20, - compact_otp4920_msg21, compact_otp4920_msg22, - compact_otp4920_msg23, compact_otp4920_msg24, - compact_otp4920_msg25, compact_otp5186_msg01, - compact_otp5186_msg02, compact_otp5186_msg03, - compact_otp5186_msg04, compact_otp5186_msg05, - compact_otp5186_msg06, compact_otp5793_msg01, - compact_otp5993_msg01, compact_otp5993_msg02, - compact_otp5993_msg03, compact_otp6017_msg01, - compact_otp6017_msg02, compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5600_msg1, pretty_otp5600_msg2, - pretty_otp5601_msg1, pretty_otp5793_msg01, - pretty_otp5882_msg01, pretty_otp6490_msg01, - pretty_otp6490_msg02, pretty_otp6490_msg03, - pretty_otp6490_msg04, pretty_otp6490_msg05, - pretty_otp6490_msg06, pretty_otp7671_msg01, - pretty_otp7671_msg02, pretty_otp7671_msg03, - pretty_otp7671_msg04, pretty_otp7671_msg05]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4299_msg2, compact_otp4359_msg1, + compact_otp4920_msg0, compact_otp4920_msg1, + compact_otp4920_msg2, compact_otp4920_msg3, + compact_otp4920_msg4, compact_otp4920_msg5, + compact_otp4920_msg6, compact_otp4920_msg7, + compact_otp4920_msg8, compact_otp4920_msg9, + compact_otp4920_msg10, compact_otp4920_msg11, + compact_otp4920_msg12, compact_otp4920_msg20, + compact_otp4920_msg21, compact_otp4920_msg22, + compact_otp4920_msg23, compact_otp4920_msg24, + compact_otp4920_msg25, compact_otp5186_msg01, + compact_otp5186_msg02, compact_otp5186_msg03, + compact_otp5186_msg04, compact_otp5186_msg05, + compact_otp5186_msg06, compact_otp5793_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5600_msg1, pretty_otp5600_msg2, + pretty_otp5601_msg1, pretty_otp5793_msg01, + pretty_otp5882_msg01, pretty_otp6490_msg01, + pretty_otp6490_msg02, pretty_otp6490_msg03, + pretty_otp6490_msg04, pretty_otp6490_msg05, + pretty_otp6490_msg06, pretty_otp7671_msg01, + pretty_otp7671_msg02, pretty_otp7671_msg03, + pretty_otp7671_msg04, pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(flex_compact_tickets, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_compact, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_pretty, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(flex_pretty_tickets, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(flex_compact_tickets, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_compact, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_pretty, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(_GroupName, Config) -> - Config. - - - - - - - - - + Config. flex_pretty_cases() -> -[flex_pretty_test_msgs]. - - + [flex_pretty_test_msgs]. flex_compact_cases() -> -[flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6]. - - - - - - - - - + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6]. %% Support for per_bin was added to ASN.1 as of version %% 1.3.2 (R8). And later merged into 1.3.1.3 (R7). These %% releases are identical (as far as I know). %% - - - - - flex_compact_tickets_cases() -> -[flex_compact_otp7431_msg01a, - flex_compact_otp7431_msg01b, flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, - flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, - flex_compact_otp7431_msg07]. - - - + [flex_compact_otp7431_msg01a, + flex_compact_otp7431_msg01b, flex_compact_otp7431_msg02, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, + flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, + flex_compact_otp7431_msg07]. flex_pretty_tickets_cases() -> -[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, - flex_pretty_otp7431_msg07]. + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_codec_v2_test.erl b/lib/megaco/test/megaco_codec_v2_test.erl index f49522769d..c3a80febba 100644 --- a/lib/megaco/test/megaco_codec_v2_test.erl +++ b/lib/megaco/test/megaco_codec_v2_test.erl @@ -39,19 +39,13 @@ -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - pretty_test_msgs/1, - compact_test_msgs/1, - flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact_init/1, flex_compact_finish/1, @@ -65,32 +59,21 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - - bin_test_msgs/1, - ber_test_msgs/1, - ber_bin_test_msgs/1, - per_test_msgs/1, - per_bin_test_msgs/1, - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -143,7 +126,6 @@ compact_otp7534_msg01/1, compact_otp7576_msg01/1, compact_otp7671_msg01/1, - flex_compact_otp7138_msg01/1, flex_compact_otp7138_msg02/1, @@ -160,7 +142,6 @@ flex_compact_otp7534_msg01/1, flex_compact_otp7573_msg01/1, flex_compact_otp7576_msg01/1, - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -204,7 +185,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, flex_pretty_otp5085_msg2/1, diff --git a/lib/megaco/test/megaco_codec_v3_test.erl b/lib/megaco/test/megaco_codec_v3_test.erl index 383de670e7..2c35ce13b3 100644 --- a/lib/megaco/test/megaco_codec_v3_test.erl +++ b/lib/megaco/test/megaco_codec_v3_test.erl @@ -38,25 +38,14 @@ -export([t/0, t/1]). -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - - - pretty_test_msgs/1, - - compact_test_msgs/1, - - flex_pretty_init/1, flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact_init/1, flex_compact_finish/1, flex_compact_test_msgs/1, - flex_compact_dm_timers1/1, flex_compact_dm_timers2/1, flex_compact_dm_timers3/1, @@ -65,32 +54,15 @@ flex_compact_dm_timers6/1, flex_compact_dm_timers7/1, flex_compact_dm_timers8/1, - - - - bin_test_msgs/1, - - ber_test_msgs/1, - - ber_bin_test_msgs/1, - - per_test_msgs/1, - - per_bin_test_msgs/1, - - - erl_dist_m_test_msgs/1, tickets/0, - - compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, @@ -133,7 +105,6 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, - flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, @@ -143,8 +114,6 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_otp4632_msg1/1, pretty_otp4632_msg2/1, @@ -192,7 +161,6 @@ pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, - flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, @@ -312,128 +280,113 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [{group, text}, {group, binary}, {group, erl_dist}, + {group, tickets}]. groups() -> [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, - {group, flex_compact_tickets}, {group, pretty_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4359_msg1, compact_otp4920_msg0, - compact_otp4920_msg1, compact_otp4920_msg2, - compact_otp4920_msg3, compact_otp4920_msg4, - compact_otp4920_msg5, compact_otp4920_msg6, - compact_otp4920_msg7, compact_otp4920_msg8, - compact_otp4920_msg9, compact_otp4920_msg10, - compact_otp4920_msg11, compact_otp4920_msg12, - compact_otp4920_msg20, compact_otp4920_msg21, - compact_otp4920_msg22, compact_otp4920_msg23, - compact_otp4920_msg24, compact_otp4920_msg25, - compact_otp5186_msg01, compact_otp5186_msg02, - compact_otp5186_msg03, compact_otp5186_msg04, - compact_otp5186_msg05, compact_otp5186_msg06, - compact_otp5793_msg01, compact_otp5836_msg01, - compact_otp5993_msg01, compact_otp5993_msg02, - compact_otp5993_msg03, compact_otp6017_msg01, - compact_otp6017_msg02, compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5085_msg8, pretty_otp5600_msg1, - pretty_otp5600_msg2, pretty_otp5601_msg1, - pretty_otp5793_msg01, pretty_otp5803_msg01, - pretty_otp5803_msg02, pretty_otp5805_msg01, - pretty_otp5836_msg01, pretty_otp5882_msg01, - pretty_otp6490_msg01, pretty_otp6490_msg02, - pretty_otp6490_msg03, pretty_otp6490_msg04, - pretty_otp6490_msg05, pretty_otp6490_msg06, - pretty_otp7671_msg01, pretty_otp7671_msg02, - pretty_otp7671_msg03, pretty_otp7671_msg04, - pretty_otp7671_msg05, pretty_otp8114_msg01]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{group, pretty}, {group, flex_pretty}, + {group, compact}, {group, flex_compact}]}, + {binary, [], + [{group, bin}, {group, ber}, {group, ber_bin}, + {group, per}, {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], + [{group, compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], + [compact_otp4011_msg1, compact_otp4011_msg2, + compact_otp4011_msg3, compact_otp4013_msg1, + compact_otp4085_msg1, compact_otp4085_msg2, + compact_otp4280_msg1, compact_otp4299_msg1, + compact_otp4359_msg1, compact_otp4920_msg0, + compact_otp4920_msg1, compact_otp4920_msg2, + compact_otp4920_msg3, compact_otp4920_msg4, + compact_otp4920_msg5, compact_otp4920_msg6, + compact_otp4920_msg7, compact_otp4920_msg8, + compact_otp4920_msg9, compact_otp4920_msg10, + compact_otp4920_msg11, compact_otp4920_msg12, + compact_otp4920_msg20, compact_otp4920_msg21, + compact_otp4920_msg22, compact_otp4920_msg23, + compact_otp4920_msg24, compact_otp4920_msg25, + compact_otp5186_msg01, compact_otp5186_msg02, + compact_otp5186_msg03, compact_otp5186_msg04, + compact_otp5186_msg05, compact_otp5186_msg06, + compact_otp5793_msg01, compact_otp5836_msg01, + compact_otp5993_msg01, compact_otp5993_msg02, + compact_otp5993_msg03, compact_otp6017_msg01, + compact_otp6017_msg02, compact_otp6017_msg03]}, + {flex_compact_tickets, [], + flex_compact_tickets_cases()}, + {pretty_tickets, [], + [pretty_otp4632_msg1, pretty_otp4632_msg2, + pretty_otp4632_msg3, pretty_otp4632_msg4, + pretty_otp4710_msg1, pretty_otp4710_msg2, + pretty_otp4945_msg1, pretty_otp4945_msg2, + pretty_otp4945_msg3, pretty_otp4945_msg4, + pretty_otp4945_msg5, pretty_otp4945_msg6, + pretty_otp4949_msg1, pretty_otp4949_msg2, + pretty_otp4949_msg3, pretty_otp5042_msg1, + pretty_otp5068_msg1, pretty_otp5085_msg1, + pretty_otp5085_msg2, pretty_otp5085_msg3, + pretty_otp5085_msg4, pretty_otp5085_msg5, + pretty_otp5085_msg6, pretty_otp5085_msg7, + pretty_otp5085_msg8, pretty_otp5600_msg1, + pretty_otp5600_msg2, pretty_otp5601_msg1, + pretty_otp5793_msg01, pretty_otp5803_msg01, + pretty_otp5803_msg02, pretty_otp5805_msg01, + pretty_otp5836_msg01, pretty_otp5882_msg01, + pretty_otp6490_msg01, pretty_otp6490_msg02, + pretty_otp6490_msg03, pretty_otp6490_msg04, + pretty_otp6490_msg05, pretty_otp6490_msg06, + pretty_otp7671_msg01, pretty_otp7671_msg02, + pretty_otp7671_msg03, pretty_otp7671_msg04, + pretty_otp7671_msg05, pretty_otp8114_msg01]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(flex_compact_tickets, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_compact, Config) -> - flex_compact_init(Config); + flex_compact_init(Config); init_per_group(flex_pretty, Config) -> - flex_pretty_init(Config); + flex_pretty_init(Config); init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(flex_pretty_tickets, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(flex_compact_tickets, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_compact, Config) -> - flex_compact_finish(Config); + flex_compact_finish(Config); end_per_group(flex_pretty, Config) -> - flex_pretty_finish(Config); + flex_pretty_finish(Config); end_per_group(_GroupName, Config) -> - Config. - - - - - - - - + Config. flex_pretty_cases() -> -[flex_pretty_test_msgs]. + [flex_pretty_test_msgs]. flex_compact_cases() -> -[flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, flex_compact_dm_timers7, - flex_compact_dm_timers8]. - - - - - - - + [flex_compact_test_msgs, flex_compact_dm_timers1, + flex_compact_dm_timers2, flex_compact_dm_timers3, + flex_compact_dm_timers4, flex_compact_dm_timers5, + flex_compact_dm_timers6, flex_compact_dm_timers7, + flex_compact_dm_timers8]. @@ -443,35 +396,25 @@ flex_compact_cases() -> %% - - - - - - flex_compact_tickets_cases() -> -[flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. - - - + [flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07]. - flex_pretty_tickets_cases() -> -[flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. + [flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07]. %% ---- diff --git a/lib/megaco/test/megaco_config_test.erl b/lib/megaco/test/megaco_config_test.erl index 34ab0f0ba4..1fc4d09d3b 100644 --- a/lib/megaco/test/megaco_config_test.erl +++ b/lib/megaco/test/megaco_config_test.erl @@ -59,23 +59,20 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> -[config, {group, transaction_id_counter}, - {group, tickets}]. + [config, {group, transaction_id_counter}, + {group, tickets}]. groups() -> [{transaction_id_counter, [], - [transaction_id_counter_mg, - transaction_id_counter_mgc]}, - {tickets, [], [otp_7216, otp_8167, otp_8183]}]. + [transaction_id_counter_mg, + transaction_id_counter_mgc]}, + {tickets, [], [otp_7216, otp_8167, otp_8183]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_digit_map_test.erl b/lib/megaco/test/megaco_digit_map_test.erl index fa5ab37936..d16fb679ae 100644 --- a/lib/megaco/test/megaco_digit_map_test.erl +++ b/lib/megaco/test/megaco_digit_map_test.erl @@ -43,17 +43,16 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [{group, tickets}], - Cases. + [{group, tickets}]. groups() -> [{tickets, [], - [{group, otp_5750}, {group, otp_5799}, - {group, otp_5826}, {group, otp_7449}]}, - {otp_5750, [], [otp_5750_01, otp_5750_02]}, - {otp_5799, [], [otp_5799_01]}, - {otp_5826, [], [otp_5826_01, otp_5826_02, otp_5826_03]}, - {otp_7449, [], [otp_7449_1, otp_7449_2]}]. + [{group, otp_5750}, {group, otp_5799}, + {group, otp_5826}, {group, otp_7449}]}, + {otp_5750, [], [otp_5750_01, otp_5750_02]}, + {otp_5799, [], [otp_5799_01]}, + {otp_5826, [], [otp_5826_01, otp_5826_02, otp_5826_03]}, + {otp_7449, [], [otp_7449_1, otp_7449_2]}]. init_per_group(_GroupName, Config) -> Config. diff --git a/lib/megaco/test/megaco_examples_test.erl b/lib/megaco/test/megaco_examples_test.erl index f44a4f1c43..528b61c2af 100644 --- a/lib/megaco/test/megaco_examples_test.erl +++ b/lib/megaco/test/megaco_examples_test.erl @@ -71,16 +71,16 @@ purge_examples() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[simple]. + [simple]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. simple(suite) -> diff --git a/lib/megaco/test/megaco_flex_test.erl b/lib/megaco/test/megaco_flex_test.erl index dfa1d8f34d..d7fc8eacb5 100644 --- a/lib/megaco/test/megaco_flex_test.erl +++ b/lib/megaco/test/megaco_flex_test.erl @@ -35,7 +35,7 @@ init_per_testcase/2, end_per_testcase/2, all/0,groups/0,init_per_group/2,end_per_group/2, - flex_init/1, flex_fin/1, + init_per_suite/1, end_per_suite/1, plain/1, port_exit/1, @@ -62,24 +62,24 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [plain, port_exit, garbage_in], - Cases. + [plain, port_exit, garbage_in]. + groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -flex_init(suite) -> +init_per_suite(suite) -> []; -flex_init(doc) -> +init_per_suite(doc) -> []; -flex_init(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case megaco_flex_scanner:is_enabled() of true -> Config; @@ -87,9 +87,9 @@ flex_init(Config) when is_list(Config) -> ?SKIP(flex_scanner_not_enabled) end. -flex_fin(suite) -> []; -flex_fin(doc) -> []; -flex_fin(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/megaco/test/megaco_load_test.erl b/lib/megaco/test/megaco_load_test.erl index 115a4107e9..5519ca15c6 100644 --- a/lib/megaco/test/megaco_load_test.erl +++ b/lib/megaco/test/megaco_load_test.erl @@ -107,21 +107,20 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [single_user_light_load, - single_user_medium_load, single_user_heavy_load, - single_user_extreme_load, multi_user_light_load, - multi_user_medium_load, multi_user_heavy_load, - multi_user_extreme_load], - Cases. + [single_user_light_load, + single_user_medium_load, single_user_heavy_load, + single_user_extreme_load, multi_user_light_load, + multi_user_medium_load, multi_user_heavy_load, + multi_user_extreme_load]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl index 9eb2d0ed3b..ded1506271 100644 --- a/lib/megaco/test/megaco_mess_test.erl +++ b/lib/megaco/test/megaco_mess_test.erl @@ -34,7 +34,7 @@ %% -compile(export_all). -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, @@ -347,47 +347,40 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[connect, {group, request_and_reply}, - {group, pending_ack}, dist, {group, tickets}]. + [connect, {group, request_and_reply}, + {group, pending_ack}, dist, {group, tickets}]. groups() -> [{request_and_reply, [], - [request_and_reply_plain, request_and_no_reply, - request_and_reply_pending_ack_no_pending, - request_and_reply_pending_ack_one_pending, - single_trans_req_and_reply, - single_trans_req_and_reply_sendopts, - request_and_reply_and_ack, request_and_reply_and_no_ack, - request_and_reply_and_late_ack, - trans_req_and_reply_and_req]}, - {pending_ack, [], - [pending_ack_plain, - request_and_pending_and_late_reply]}, - {tickets, [], - [otp_4359, otp_4836, otp_5805, otp_5881, otp_5887, - otp_6253, otp_6275, otp_6276, {group, otp_6442}, - {group, otp_6865}, otp_7189, otp_7259, otp_7713, - {group, otp_8183}, otp_8212]}, - {otp_6442, [], - [otp_6442_resend_request1, otp_6442_resend_request2, - otp_6442_resend_reply1, otp_6442_resend_reply2]}, - {otp_6865, [], - [otp_6865_request_and_reply_plain_extra1, - otp_6865_request_and_reply_plain_extra2]}, - {otp_8183, [], [otp_8183_request1]}]. + [request_and_reply_plain, request_and_no_reply, + request_and_reply_pending_ack_no_pending, + request_and_reply_pending_ack_one_pending, + single_trans_req_and_reply, + single_trans_req_and_reply_sendopts, + request_and_reply_and_ack, request_and_reply_and_no_ack, + request_and_reply_and_late_ack, + trans_req_and_reply_and_req]}, + {pending_ack, [], + [pending_ack_plain, + request_and_pending_and_late_reply]}, + {tickets, [], + [otp_4359, otp_4836, otp_5805, otp_5881, otp_5887, + otp_6253, otp_6275, otp_6276, {group, otp_6442}, + {group, otp_6865}, otp_7189, otp_7259, otp_7713, + {group, otp_8183}, otp_8212]}, + {otp_6442, [], + [otp_6442_resend_request1, otp_6442_resend_request2, + otp_6442_resend_reply1, otp_6442_resend_reply2]}, + {otp_6865, [], + [otp_6865_request_and_reply_plain_extra1, + otp_6865_request_and_reply_plain_extra2]}, + {otp_8183, [], [otp_8183_request1]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - - - - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_mib_test.erl b/lib/megaco/test/megaco_mib_test.erl index 721887200c..52d99d1442 100644 --- a/lib/megaco/test/megaco_mib_test.erl +++ b/lib/megaco/test/megaco_mib_test.erl @@ -71,17 +71,16 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [plain, connect, traffic], - Cases. + [plain, connect, traffic]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_mreq_test.erl b/lib/megaco/test/megaco_mreq_test.erl index 06ba3ba82d..1d3f38d50d 100644 --- a/lib/megaco/test/megaco_mreq_test.erl +++ b/lib/megaco/test/megaco_mreq_test.erl @@ -76,17 +76,16 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [req_and_rep, req_and_pending, req_and_cancel], - Cases. + [req_and_rep, req_and_pending, req_and_cancel]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_pending_limit_test.erl b/lib/megaco/test/megaco_pending_limit_test.erl index fed572cb28..233c22f4d2 100644 --- a/lib/megaco/test/megaco_pending_limit_test.erl +++ b/lib/megaco/test/megaco_pending_limit_test.erl @@ -28,20 +28,14 @@ -export([t/0, t/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([all/0,groups/0,init_per_group/2,end_per_group/2, - - sent_timer_late_reply/1, sent_timer_exceeded/1, sent_timer_exceeded_long/1, sent_resend_late_reply/1, sent_resend_exceeded/1, sent_resend_exceeded_long/1, - - recv_limit_exceeded1/1, recv_limit_exceeded2/1, - - otp_4956/1, otp_5310/1, otp_5619/1 @@ -146,27 +140,22 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, sent}, {group, recv}, {group, tickets}]. + [{group, sent}, {group, recv}, {group, tickets}]. groups() -> [{sent, [], - [sent_timer_late_reply, sent_timer_exceeded, - sent_timer_exceeded_long, sent_resend_late_reply, - sent_resend_exceeded, sent_resend_exceeded_long]}, - {recv, [], - [recv_limit_exceeded1, recv_limit_exceeded2]}, - {tickets, [], [otp_4956, otp_5310, otp_5619]}]. + [sent_timer_late_reply, sent_timer_exceeded, + sent_timer_exceeded_long, sent_resend_late_reply, + sent_resend_exceeded, sent_resend_exceeded_long]}, + {recv, [], + [recv_limit_exceeded1, recv_limit_exceeded2]}, + {tickets, [], [otp_4956, otp_5310, otp_5619]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% diff --git a/lib/megaco/test/megaco_sdp_test.erl b/lib/megaco/test/megaco_sdp_test.erl index 026a71f34b..796a956f23 100644 --- a/lib/megaco/test/megaco_sdp_test.erl +++ b/lib/megaco/test/megaco_sdp_test.erl @@ -27,7 +27,6 @@ -export([all/0,groups/0,init_per_group/2,end_per_group/2, decode_encode/1, - otp8123/1, init_per_testcase/2, end_per_testcase/2, @@ -56,16 +55,16 @@ end_per_testcase(Case, Config) -> all() -> -[decode_encode, {group, tickets}]. + [decode_encode, {group, tickets}]. groups() -> [{tickets, [], [otp8123]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/megaco/test/megaco_segment_test.erl b/lib/megaco/test/megaco_segment_test.erl index 0761b5437a..e4b568119d 100644 --- a/lib/megaco/test/megaco_segment_test.erl +++ b/lib/megaco/test/megaco_segment_test.erl @@ -40,9 +40,7 @@ recv_segmented_msg_plain/1, recv_segmented_msg_ooo_seg/1, recv_segmented_msg_missing_seg1/1, - recv_segmented_msg_missing_seg2/1, - - tickets/1 + recv_segmented_msg_missing_seg2/1 ]). @@ -74,33 +72,25 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, send}, {group, recv}]. + [{group, send}, {group, recv}]. groups() -> [{send, [], - [send_segmented_msg_plain1, send_segmented_msg_plain2, - send_segmented_msg_plain3, send_segmented_msg_plain4, - send_segmented_msg_ooo1, - send_segmented_msg_missing_seg_reply1, - send_segmented_msg_missing_seg_reply2]}, - {recv, [], - [recv_segmented_msg_plain, recv_segmented_msg_ooo_seg, - recv_segmented_msg_missing_seg1, - recv_segmented_msg_missing_seg2]}]. + [send_segmented_msg_plain1, send_segmented_msg_plain2, + send_segmented_msg_plain3, send_segmented_msg_plain4, + send_segmented_msg_ooo1, + send_segmented_msg_missing_seg_reply1, + send_segmented_msg_missing_seg_reply2]}, + {recv, [], + [recv_segmented_msg_plain, recv_segmented_msg_ooo_seg, + recv_segmented_msg_missing_seg1, + recv_segmented_msg_missing_seg2]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - -tickets(suite) -> - [ - ]. - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_tcp_test.erl b/lib/megaco/test/megaco_tcp_test.erl index 1130d7a651..013096c385 100644 --- a/lib/megaco/test/megaco_tcp_test.erl +++ b/lib/megaco/test/megaco_tcp_test.erl @@ -36,18 +36,12 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, - - + all/0,groups/0,init_per_group/2,end_per_group/2, start_normal/1, start_invalid_opt/1, start_and_stop/1, - - sendreceive/1, block_unblock/1, - - socket_failure/1, accept_process/1, accept_supervisor/1, @@ -122,25 +116,21 @@ end_per_testcase(Case, Config) -> %% Test case definitions %%====================================================================== all() -> -[{group, start}, {group, sending}, {group, errors}]. + [{group, start}, {group, sending}, {group, errors}]. groups() -> [{start, [], - [start_normal, start_invalid_opt, start_and_stop]}, - {sending, [], [sendreceive, block_unblock]}, - {errors, [], - [socket_failure, accept_process, accept_supervisor, - connection_supervisor, tcp_server]}]. + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], + [socket_failure, accept_process, accept_supervisor, + connection_supervisor, tcp_server]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - + Config. %% ------------------ start ------------------------ diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl index 96d2005835..cccf4651ab 100644 --- a/lib/megaco/test/megaco_timer_test.erl +++ b/lib/megaco/test/megaco_timer_test.erl @@ -26,19 +26,12 @@ -export([ t/0, t/1, init_per_testcase/2, end_per_testcase/2, - - all/0,groups/0,init_per_group/2,end_per_group/2, - - + all/0,groups/0,init_per_group/2,end_per_group/2, simple_init/1, simple_usage/1, - - integer_timer_start_and_expire/1, integer_timer_start_and_stop/1%% , - %% incr_timer/1 - ]). -export([ @@ -89,29 +82,21 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -Cases = [{group, simple}, {group, integer_timer}], - Cases. + [{group, simple}, {group, integer_timer}]. groups() -> [{simple, [], - begin Cases = [simple_init, simple_usage], Cases end}, - {integer_timer, [], - begin - Cases = [integer_timer_start_and_expire, - integer_timer_start_and_stop], - Cases - end}]. + [simple_init, simple_usage]}, +%, incr_timer + {integer_timer, [], + [integer_timer_start_and_expire, + integer_timer_start_and_stop]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - - + Config. %% incr_timer(suite) -> diff --git a/lib/megaco/test/megaco_trans_test.erl b/lib/megaco/test/megaco_trans_test.erl index 8166ba8aae..5f564e3bf6 100644 --- a/lib/megaco/test/megaco_trans_test.erl +++ b/lib/megaco/test/megaco_trans_test.erl @@ -103,50 +103,41 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, ack}, {group, trans_req}, - {group, trans_req_and_ack}, {group, pending}, - {group, reply}, {group, tickets}]. + [{group, ack}, {group, trans_req}, + {group, trans_req_and_ack}, {group, pending}, + {group, reply}, {group, tickets}]. groups() -> [{ack, [], - [single_ack, multi_ack_timeout, multi_ack_maxcount]}, - {trans_req, [], - [single_trans_req, multi_trans_req_timeout, - multi_trans_req_maxcount1, multi_trans_req_maxcount2, - multi_trans_req_maxsize1, multi_trans_req_maxsize2]}, - {trans_req_and_ack, [], - [single_trans_req_and_ack, - multi_trans_req_and_ack_timeout, - multi_trans_req_and_ack_ackmaxcount, - multi_trans_req_and_ack_reqmaxcount, - multi_trans_req_and_ack_maxsize1, - multi_trans_req_and_ack_maxsize2]}, - {pending, [], - [single_trans_req_and_pending, - multi_trans_req_and_pending, - multi_trans_req_and_ack_and_pending, - multi_ack_and_pending]}, - {reply, [], - [multi_trans_req_and_reply, - multi_trans_req_and_ack_and_reply, - multi_ack_and_reply]}, - {tickets, [], [{group, otp_7192}]}, - {otp_7192, [], [otp_7192_1, otp_7192_2, otp_7192_3]}]. + [single_ack, multi_ack_timeout, multi_ack_maxcount]}, + {trans_req, [], + [single_trans_req, multi_trans_req_timeout, + multi_trans_req_maxcount1, multi_trans_req_maxcount2, + multi_trans_req_maxsize1, multi_trans_req_maxsize2]}, + {trans_req_and_ack, [], + [single_trans_req_and_ack, + multi_trans_req_and_ack_timeout, + multi_trans_req_and_ack_ackmaxcount, + multi_trans_req_and_ack_reqmaxcount, + multi_trans_req_and_ack_maxsize1, + multi_trans_req_and_ack_maxsize2]}, + {pending, [], + [single_trans_req_and_pending, + multi_trans_req_and_pending, + multi_trans_req_and_ack_and_pending, + multi_ack_and_pending]}, + {reply, [], + [multi_trans_req_and_reply, + multi_trans_req_and_ack_and_reply, + multi_ack_and_reply]}, + {tickets, [], [{group, otp_7192}]}, + {otp_7192, [], [otp_7192_1, otp_7192_2, otp_7192_3]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - - - - - - + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/megaco/test/megaco_udp_test.erl b/lib/megaco/test/megaco_udp_test.erl index 729882424f..ffbff9b762 100644 --- a/lib/megaco/test/megaco_udp_test.erl +++ b/lib/megaco/test/megaco_udp_test.erl @@ -34,22 +34,14 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/0,groups/0,init_per_group/2,end_per_group/2, - - + all/0,groups/0,init_per_group/2,end_per_group/2, start_normal/1, start_invalid_opt/1, start_and_stop/1, - - sendreceive/1, block_unblock/1, - - socket_failure/1, - init_per_testcase/2, end_per_testcase/2, - t/0, t/1 ]). @@ -116,23 +108,19 @@ end_per_testcase(Case, Config) -> %%====================================================================== all() -> -[{group, start}, {group, sending}, {group, errors}]. + [{group, start}, {group, sending}, {group, errors}]. groups() -> [{start, [], - [start_normal, start_invalid_opt, start_and_stop]}, - {sending, [], [sendreceive, block_unblock]}, - {errors, [], [socket_failure]}]. + [start_normal, start_invalid_opt, start_and_stop]}, + {sending, [], [sendreceive, block_unblock]}, + {errors, [], [socket_failure]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - + Config. %% ================================================= -- cgit v1.2.3 From 70f78c22867160067d6f5f8757eb3d6133ba76aa Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:52:01 +0100 Subject: Fix formatting for mnesia --- lib/mnesia/test/mnesia_SUITE.erl | 168 +++++++++---------- lib/mnesia/test/mnesia_atomicity_test.erl | 54 +++---- lib/mnesia/test/mnesia_config_test.erl | 38 ++--- lib/mnesia/test/mnesia_consistency_test.erl | 204 ++++++++++++------------ lib/mnesia/test/mnesia_dirty_access_test.erl | 98 ++++++------ lib/mnesia/test/mnesia_durability_test.erl | 60 +++---- lib/mnesia/test/mnesia_evil_backup.erl | 20 +-- lib/mnesia/test/mnesia_evil_coverage_test.erl | 70 ++++---- lib/mnesia/test/mnesia_examples_test.erl | 12 +- lib/mnesia/test/mnesia_frag_test.erl | 18 +-- lib/mnesia/test/mnesia_install_test.erl | 6 +- lib/mnesia/test/mnesia_isolation_test.erl | 64 ++++---- lib/mnesia/test/mnesia_measure_test.erl | 74 ++++----- lib/mnesia/test/mnesia_nice_coverage_test.erl | 6 +- lib/mnesia/test/mnesia_qlc_test.erl | 28 ++-- lib/mnesia/test/mnesia_recovery_test.erl | 160 +++++++++---------- lib/mnesia/test/mnesia_registry_test.erl | 6 +- lib/mnesia/test/mnesia_schema_recovery_test.erl | 139 ++++++++-------- lib/mnesia/test/mnesia_trans_access_test.erl | 52 +++--- 19 files changed, 640 insertions(+), 637 deletions(-) diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 8be1a549d6..83175b04c3 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -30,68 +30,99 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{suite_callbacks,[{ts_install_scb,[{nodenames,1}]}]}]. + + +%% Verify that Mnesia really is a distributed real-time DBMS. +%% This is the test suite of the Mnesia DBMS. The test suite +%% covers many aspects of usage and is indended to be developed +%% incrementally. The test suite is divided into a hierarchy of test +%% suites where the leafs actually implements the test cases. +%% The intention of each test case and sub test suite can be +%% read in comments where they are implemented or in worst cases +%% from their long mnemonic names. +%% +%% The most simple test case of them all is called 'silly' +%% and is useful to run now and then, e.g. when some new fatal +%% bug has been introduced. It may be run even if Mnesia is in +%% such a bad shape that the test machinery cannot be used. +%% NB! Invoke the function directly with mnesia_SUITE:silly() +%% and do not involve the normal test machinery. all() -> -[{group, light}, {group, medium}, {group, heavy}, - clean_up_suite]. + [{group, light}, {group, medium}, {group, heavy}, + clean_up_suite]. groups() -> + %% The 'light' test suite runs a selected set of test suites and is + %% intended to be the smallest test suite that is meaningful + %% to run. It starts with an installation test (which in essence is the + %% 'silly' test case) and then it covers all functions in the API in + %% various depths. All configuration parameters and examples are also + %% covered. [{light, [], - [{group, install}, {group, nice}, {group, evil}, - {mnesia_frag_test, [{group, light}]}, {group, qlc}, - {group, registry}, {group, config}, {group, examples}]}, - {install, [], [{mnesia_install_test, all}]}, - {nice, [], [{mnesia_nice_coverage_test, all}]}, - {evil, [], [{mnesia_evil_coverage_test, all}]}, - {qlc, [], [{mnesia_qlc_test, all}]}, - {registry, [], [{mnesia_registry_test, all}]}, - {config, [], [{mnesia_config_test, all}]}, - {examples, [], [{mnesia_examples_test, all}]}, - {medium, [], - [{group, install}, {group, atomicity}, - {group, isolation}, {group, durability}, - {group, recovery}, {group, consistency}, - {mnesia_frag_test, [{group, medium}]}]}, - {atomicity, [], [{mnesia_atomicity_test, all}]}, - {isolation, [], [{mnesia_isolation_test, all}]}, - {durability, [], [{mnesia_durability_test, all}]}, - {recovery, [], [{mnesia_recovery_test, all}]}, - {consistency, [], [{mnesia_consistency_test, all}]}, - {heavy, [], [{group, measure}]}, - {measure, [], [{mnesia_measure_test, all}]}, - {prediction, [], - [{mnesia_measure_test, [{group, prediction}]}]}, - {fairness, [], - [{mnesia_measure_test, [{group, fairness}]}]}, - {benchmarks, [], - [{mnesia_measure_test, [{group, benchmarks}]}]}, - {consumption, [], - [{mnesia_measure_test, [{group, consumption}]}]}, - {scalability, [], - [{mnesia_measure_test, [{group, scalability}]}]}, - {otp_r4b, [], - [{mnesia_config_test, access_module}, - {mnesia_config_test, dump_log_load_regulation}, - {mnesia_config_test, embedded_mnemosyne}, - {mnesia_config_test, ignore_fallback_at_startup}, - {mnesia_config_test, max_wait_for_decision}, - {mnesia_consistency_test, consistency_after_restore}, - {mnesia_evil_backup, restore}, - {mnesia_evil_coverage_test, offline_set_master_nodes}, - {mnesia_evil_coverage_test, record_name}, - {mnesia_evil_coverage_test, user_properties}, - {mnesia_registry_test, all}, {group, otp_2363}]}, - {otp_2363, [], - [{mnesia_dirty_access_test, - dirty_index_match_object_disc_only}, - {mnesia_dirty_access_test, dirty_index_read_disc_only}, - {mnesia_dirty_access_test, - dirty_index_update_bag_disc_only}, - {mnesia_dirty_access_test, - dirty_index_update_set_disc_only}, - {mnesia_evil_coverage_test, - create_live_table_index_disc_only}]}]. + [{group, install}, {group, nice}, {group, evil}, + {group, mnesia_frag_test, light}, {group, qlc}, + {group, registry}, {group, config}, {group, examples}]}, + {install, [], [{mnesia_install_test, all}]}, + {nice, [], [{mnesia_nice_coverage_test, all}]}, + {evil, [], [{mnesia_evil_coverage_test, all}]}, + {qlc, [], [{mnesia_qlc_test, all}]}, + {registry, [], [{mnesia_registry_test, all}]}, + {config, [], [{mnesia_config_test, all}]}, + {examples, [], [{mnesia_examples_test, all}]}, + %% The 'medium' test suite verfies the ACID (atomicity, consistency + %% isolation and durability) properties and various recovery scenarios + %% These tests may take quite while to run. + {medium, [], + [{group, install}, {group, atomicity}, + {group, isolation}, {group, durability}, + {group, recovery}, {group, consistency}, + {group, mnesia_frag_test, medium}]}, + {atomicity, [], [{mnesia_atomicity_test, all}]}, + {isolation, [], [{mnesia_isolation_test, all}]}, + {durability, [], [{mnesia_durability_test, all}]}, + {recovery, [], [{mnesia_recovery_test, all}]}, + {consistency, [], [{mnesia_consistency_test, all}]}, + %% The 'heavy' test suite runs some resource consuming tests and + %% benchmarks + {heavy, [], [{group, measure}]}, + {measure, [], [{mnesia_measure_test, all}]}, + {prediction, [], + [{group, mnesia_measure_test, prediction}]}, + {fairness, [], + [{group, mnesia_measure_test, fairness}]}, + {benchmarks, [], + [{group, mnesia_measure_test, benchmarks}]}, + {consumption, [], + [{group, mnesia_measure_test, consumption}]}, + {scalability, [], + [{group, mnesia_measure_test, scalability}]}, + %% This test suite is an extract of the grand Mnesia suite + %% it contains OTP R4B specific test cases + {otp_r4b, [], + [{mnesia_config_test, access_module}, + {mnesia_config_test, dump_log_load_regulation}, + {mnesia_config_test, embedded_mnemosyne}, + {mnesia_config_test, ignore_fallback_at_startup}, + {mnesia_config_test, max_wait_for_decision}, + {mnesia_consistency_test, consistency_after_restore}, + {mnesia_evil_backup, restore}, + {mnesia_evil_coverage_test, offline_set_master_nodes}, + {mnesia_evil_coverage_test, record_name}, + {mnesia_evil_coverage_test, user_properties}, + {mnesia_registry_test, all}, {group, otp_2363}]}, + %% Index on disc only tables + {otp_2363, [], + [{mnesia_dirty_access_test, + dirty_index_match_object_disc_only}, + {mnesia_dirty_access_test, dirty_index_read_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_bag_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_set_disc_only}, + {mnesia_evil_coverage_test, + create_live_table_index_disc_only}]}]. init_per_group(_GroupName, Config) -> Config. @@ -112,29 +143,6 @@ silly() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - - - - - - clean_up_suite(doc) -> ["Not a test case only kills mnesia and nodes, that where" "started during the tests"]; clean_up_suite(suite) -> diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl index 3fe38645d6..cf878fc820 100644 --- a/lib/mnesia/test/mnesia_atomicity_test.erl +++ b/lib/mnesia/test/mnesia_atomicity_test.erl @@ -32,40 +32,40 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[explicit_abort_in_middle_of_trans, - runtime_error_in_middle_of_trans, - kill_self_in_middle_of_trans, throw_in_middle_of_trans, - {group, mnesia_down_in_middle_of_trans}]. + [explicit_abort_in_middle_of_trans, + runtime_error_in_middle_of_trans, + kill_self_in_middle_of_trans, throw_in_middle_of_trans, + {group, mnesia_down_in_middle_of_trans}]. groups() -> [{mnesia_down_in_middle_of_trans, [], - [mnesia_down_during_infinite_trans, - {group, lock_waiter}, {group, restart_check}]}, - {lock_waiter, [], - [lock_waiter_sw_r, lock_waiter_sw_rt, lock_waiter_sw_wt, - lock_waiter_wr_r, lock_waiter_srw_r, lock_waiter_sw_sw, - lock_waiter_sw_w, lock_waiter_sw_wr, lock_waiter_sw_srw, - lock_waiter_wr_wt, lock_waiter_srw_wt, - lock_waiter_wr_sw, lock_waiter_srw_sw, lock_waiter_wr_w, - lock_waiter_srw_w, lock_waiter_r_sw, lock_waiter_r_w, - lock_waiter_r_wt, lock_waiter_rt_sw, lock_waiter_rt_w, - lock_waiter_rt_wt, lock_waiter_wr_wr, - lock_waiter_srw_srw, lock_waiter_wt_r, lock_waiter_wt_w, - lock_waiter_wt_rt, lock_waiter_wt_wt, lock_waiter_wt_wr, - lock_waiter_wt_srw, lock_waiter_wt_sw, lock_waiter_w_wr, - lock_waiter_w_srw, lock_waiter_w_sw, lock_waiter_w_r, - lock_waiter_w_w, lock_waiter_w_rt, lock_waiter_w_wt]}, - {restart_check, [], - [restart_r_one, restart_w_one, restart_rt_one, - restart_wt_one, restart_wr_one, restart_sw_one, - restart_r_two, restart_w_two, restart_rt_two, - restart_wt_two, restart_wr_two, restart_sw_two]}]. + [mnesia_down_during_infinite_trans, + {group, lock_waiter}, {group, restart_check}]}, + {lock_waiter, [], + [lock_waiter_sw_r, lock_waiter_sw_rt, lock_waiter_sw_wt, + lock_waiter_wr_r, lock_waiter_srw_r, lock_waiter_sw_sw, + lock_waiter_sw_w, lock_waiter_sw_wr, lock_waiter_sw_srw, + lock_waiter_wr_wt, lock_waiter_srw_wt, + lock_waiter_wr_sw, lock_waiter_srw_sw, lock_waiter_wr_w, + lock_waiter_srw_w, lock_waiter_r_sw, lock_waiter_r_w, + lock_waiter_r_wt, lock_waiter_rt_sw, lock_waiter_rt_w, + lock_waiter_rt_wt, lock_waiter_wr_wr, + lock_waiter_srw_srw, lock_waiter_wt_r, lock_waiter_wt_w, + lock_waiter_wt_rt, lock_waiter_wt_wt, lock_waiter_wt_wr, + lock_waiter_wt_srw, lock_waiter_wt_sw, lock_waiter_w_wr, + lock_waiter_w_srw, lock_waiter_w_sw, lock_waiter_w_r, + lock_waiter_w_w, lock_waiter_w_rt, lock_waiter_w_wt]}, + {restart_check, [], + [restart_r_one, restart_w_one, restart_rt_one, + restart_wt_one, restart_wr_one, restart_sw_one, + restart_r_two, restart_w_two, restart_rt_two, + restart_wt_two, restart_wr_two, restart_sw_two]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index ac74a69334..93510d539c 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -102,32 +102,32 @@ end_per_testcase(Func, Conf) -> all() -> -[access_module, auto_repair, backup_module, debug, dir, - dump_log_load_regulation, {group, dump_log_thresholds}, - dump_log_update_in_place, embedded_mnemosyne, - event_module, ignore_fallback_at_startup, - inconsistent_database, max_wait_for_decision, - send_compressed, app_test, {group, schema_config}, - unknown_config]. + [access_module, auto_repair, backup_module, debug, dir, + dump_log_load_regulation, {group, dump_log_thresholds}, + dump_log_update_in_place, embedded_mnemosyne, + event_module, ignore_fallback_at_startup, + inconsistent_database, max_wait_for_decision, + send_compressed, app_test, {group, schema_config}, + unknown_config]. groups() -> [{dump_log_thresholds, [], - [dump_log_time_threshold, dump_log_write_threshold]}, - {schema_config, [], - [start_one_disc_full_then_one_disc_less, - start_first_one_disc_less_then_one_disc_full, - start_first_one_disc_less_then_two_more_disc_less, - schema_location_and_extra_db_nodes_combinations, - table_load_to_disc_less_nodes, schema_merge, - {group, dynamic_connect}]}, - {dynamic_connect, [], - [dynamic_basic, dynamic_ext, dynamic_bad]}]. + [dump_log_time_threshold, dump_log_write_threshold]}, + {schema_config, [], + [start_one_disc_full_then_one_disc_less, + start_first_one_disc_less_then_one_disc_full, + start_first_one_disc_less_then_two_more_disc_less, + schema_location_and_extra_db_nodes_combinations, + table_load_to_disc_less_nodes, schema_merge, + {group, dynamic_connect}]}, + {dynamic_connect, [], + [dynamic_basic, dynamic_ext, dynamic_bad]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl index ccd5f416f9..f38e13f3a2 100644 --- a/lib/mnesia/test/mnesia_consistency_test.erl +++ b/lib/mnesia/test/mnesia_consistency_test.erl @@ -32,115 +32,115 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, consistency_after_restart}, - {group, consistency_after_dump_tables}, - {group, consistency_after_add_replica}, - {group, consistency_after_del_replica}, - {group, consistency_after_move_replica}, - {group, consistency_after_transform_table}, - consistency_after_change_table_copy_type, - {group, consistency_after_fallback}, - {group, consistency_after_restore}, - consistency_after_rename_of_node, - {group, checkpoint_retainer_consistency}, - {group, backup_consistency}]. + [{group, consistency_after_restart}, + {group, consistency_after_dump_tables}, + {group, consistency_after_add_replica}, + {group, consistency_after_del_replica}, + {group, consistency_after_move_replica}, + {group, consistency_after_transform_table}, + consistency_after_change_table_copy_type, + {group, consistency_after_fallback}, + {group, consistency_after_restore}, + consistency_after_rename_of_node, + {group, checkpoint_retainer_consistency}, + {group, backup_consistency}]. groups() -> [{consistency_after_restart, [], - [consistency_after_restart_1_ram, - consistency_after_restart_1_disc, - consistency_after_restart_1_disc_only, - consistency_after_restart_2_ram, - consistency_after_restart_2_disc, - consistency_after_restart_2_disc_only]}, - {consistency_after_dump_tables, [], - [consistency_after_dump_tables_1_ram, - consistency_after_dump_tables_2_ram]}, - {consistency_after_add_replica, [], - [consistency_after_add_replica_2_ram, - consistency_after_add_replica_2_disc, - consistency_after_add_replica_2_disc_only, - consistency_after_add_replica_3_ram, - consistency_after_add_replica_3_disc, - consistency_after_add_replica_3_disc_only]}, - {consistency_after_del_replica, [], - [consistency_after_del_replica_2_ram, - consistency_after_del_replica_2_disc, - consistency_after_del_replica_2_disc_only, - consistency_after_del_replica_3_ram, - consistency_after_del_replica_3_disc, - consistency_after_del_replica_3_disc_only]}, - {consistency_after_move_replica, [], - [consistency_after_move_replica_2_ram, - consistency_after_move_replica_2_disc, - consistency_after_move_replica_2_disc_only, - consistency_after_move_replica_3_ram, - consistency_after_move_replica_3_disc, - consistency_after_move_replica_3_disc_only]}, - {consistency_after_transform_table, [], - [consistency_after_transform_table_ram, - consistency_after_transform_table_disc, - consistency_after_transform_table_disc_only]}, - {consistency_after_fallback, [], - [consistency_after_fallback_2_ram, - consistency_after_fallback_2_disc, - consistency_after_fallback_2_disc_only, - consistency_after_fallback_3_ram, - consistency_after_fallback_3_disc, - consistency_after_fallback_3_disc_only]}, - {consistency_after_restore, [], - [consistency_after_restore_clear_ram, - consistency_after_restore_clear_disc, - consistency_after_restore_clear_disc_only, - consistency_after_restore_recreate_ram, - consistency_after_restore_recreate_disc, - consistency_after_restore_recreate_disc_only]}, - {checkpoint_retainer_consistency, [], - [{group, updates_during_checkpoint_activation}, - {group, updates_during_checkpoint_iteration}, - {group, load_table_with_activated_checkpoint}, - {group, - add_table_copy_to_table_with_activated_checkpoint}]}, - {updates_during_checkpoint_activation, [], - [updates_during_checkpoint_activation_2_ram, - updates_during_checkpoint_activation_2_disc, - updates_during_checkpoint_activation_2_disc_only, - updates_during_checkpoint_activation_3_ram, - updates_during_checkpoint_activation_3_disc, - updates_during_checkpoint_activation_3_disc_only]}, - {updates_during_checkpoint_iteration, [], - [updates_during_checkpoint_iteration_2_ram, - updates_during_checkpoint_iteration_2_disc, - updates_during_checkpoint_iteration_2_disc_only]}, - {load_table_with_activated_checkpoint, [], - [load_table_with_activated_checkpoint_ram, - load_table_with_activated_checkpoint_disc, - load_table_with_activated_checkpoint_disc_only]}, - {add_table_copy_to_table_with_activated_checkpoint, [], - [add_table_copy_to_table_with_activated_checkpoint_ram, - add_table_copy_to_table_with_activated_checkpoint_disc, - add_table_copy_to_table_with_activated_checkpoint_disc_only]}, - {backup_consistency, [], - [{group, interupted_install_fallback}, - {group, interupted_uninstall_fallback}, - {group, mnesia_down_during_backup_causes_switch}, - {group, mnesia_down_during_backup_causes_abort}, - {group, schema_transactions_during_backup}]}, - {interupted_install_fallback, [], - [inst_fallback_process_dies, fatal_when_inconsistency]}, - {interupted_uninstall_fallback, [], [after_delete]}, - {mnesia_down_during_backup_causes_switch, [], - [cause_switch_before, cause_switch_after]}, - {mnesia_down_during_backup_causes_abort, [], - [cause_abort_before, cause_abort_after]}, - {schema_transactions_during_backup, [], - [change_schema_before, change_schema_after]}]. + [consistency_after_restart_1_ram, + consistency_after_restart_1_disc, + consistency_after_restart_1_disc_only, + consistency_after_restart_2_ram, + consistency_after_restart_2_disc, + consistency_after_restart_2_disc_only]}, + {consistency_after_dump_tables, [], + [consistency_after_dump_tables_1_ram, + consistency_after_dump_tables_2_ram]}, + {consistency_after_add_replica, [], + [consistency_after_add_replica_2_ram, + consistency_after_add_replica_2_disc, + consistency_after_add_replica_2_disc_only, + consistency_after_add_replica_3_ram, + consistency_after_add_replica_3_disc, + consistency_after_add_replica_3_disc_only]}, + {consistency_after_del_replica, [], + [consistency_after_del_replica_2_ram, + consistency_after_del_replica_2_disc, + consistency_after_del_replica_2_disc_only, + consistency_after_del_replica_3_ram, + consistency_after_del_replica_3_disc, + consistency_after_del_replica_3_disc_only]}, + {consistency_after_move_replica, [], + [consistency_after_move_replica_2_ram, + consistency_after_move_replica_2_disc, + consistency_after_move_replica_2_disc_only, + consistency_after_move_replica_3_ram, + consistency_after_move_replica_3_disc, + consistency_after_move_replica_3_disc_only]}, + {consistency_after_transform_table, [], + [consistency_after_transform_table_ram, + consistency_after_transform_table_disc, + consistency_after_transform_table_disc_only]}, + {consistency_after_fallback, [], + [consistency_after_fallback_2_ram, + consistency_after_fallback_2_disc, + consistency_after_fallback_2_disc_only, + consistency_after_fallback_3_ram, + consistency_after_fallback_3_disc, + consistency_after_fallback_3_disc_only]}, + {consistency_after_restore, [], + [consistency_after_restore_clear_ram, + consistency_after_restore_clear_disc, + consistency_after_restore_clear_disc_only, + consistency_after_restore_recreate_ram, + consistency_after_restore_recreate_disc, + consistency_after_restore_recreate_disc_only]}, + {checkpoint_retainer_consistency, [], + [{group, updates_during_checkpoint_activation}, + {group, updates_during_checkpoint_iteration}, + {group, load_table_with_activated_checkpoint}, + {group, + add_table_copy_to_table_with_activated_checkpoint}]}, + {updates_during_checkpoint_activation, [], + [updates_during_checkpoint_activation_2_ram, + updates_during_checkpoint_activation_2_disc, + updates_during_checkpoint_activation_2_disc_only, + updates_during_checkpoint_activation_3_ram, + updates_during_checkpoint_activation_3_disc, + updates_during_checkpoint_activation_3_disc_only]}, + {updates_during_checkpoint_iteration, [], + [updates_during_checkpoint_iteration_2_ram, + updates_during_checkpoint_iteration_2_disc, + updates_during_checkpoint_iteration_2_disc_only]}, + {load_table_with_activated_checkpoint, [], + [load_table_with_activated_checkpoint_ram, + load_table_with_activated_checkpoint_disc, + load_table_with_activated_checkpoint_disc_only]}, + {add_table_copy_to_table_with_activated_checkpoint, [], + [add_table_copy_to_table_with_activated_checkpoint_ram, + add_table_copy_to_table_with_activated_checkpoint_disc, + add_table_copy_to_table_with_activated_checkpoint_disc_only]}, + {backup_consistency, [], + [{group, interupted_install_fallback}, + {group, interupted_uninstall_fallback}, + {group, mnesia_down_during_backup_causes_switch}, + {group, mnesia_down_during_backup_causes_abort}, + {group, schema_transactions_during_backup}]}, + {interupted_install_fallback, [], + [inst_fallback_process_dies, fatal_when_inconsistency]}, + {interupted_uninstall_fallback, [], [after_delete]}, + {mnesia_down_during_backup_causes_switch, [], + [cause_switch_before, cause_switch_after]}, + {mnesia_down_during_backup_causes_abort, [], + [cause_abort_before, cause_abort_after]}, + {schema_transactions_during_backup, [], + [change_schema_before, change_schema_after]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 16eef3a111..abbdab48c0 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -31,62 +31,62 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, dirty_write}, {group, dirty_read}, - {group, dirty_update_counter}, {group, dirty_delete}, - {group, dirty_delete_object}, - {group, dirty_match_object}, {group, dirty_index}, - {group, dirty_iter}, {group, admin_tests}]. + [{group, dirty_write}, {group, dirty_read}, + {group, dirty_update_counter}, {group, dirty_delete}, + {group, dirty_delete_object}, + {group, dirty_match_object}, {group, dirty_index}, + {group, dirty_iter}, {group, admin_tests}]. groups() -> [{dirty_write, [], - [dirty_write_ram, dirty_write_disc, - dirty_write_disc_only]}, - {dirty_read, [], - [dirty_read_ram, dirty_read_disc, - dirty_read_disc_only]}, - {dirty_update_counter, [], - [dirty_update_counter_ram, dirty_update_counter_disc, - dirty_update_counter_disc_only]}, - {dirty_delete, [], - [dirty_delete_ram, dirty_delete_disc, - dirty_delete_disc_only]}, - {dirty_delete_object, [], - [dirty_delete_object_ram, dirty_delete_object_disc, - dirty_delete_object_disc_only]}, - {dirty_match_object, [], - [dirty_match_object_ram, dirty_match_object_disc, - dirty_match_object_disc_only]}, - {dirty_index, [], - [{group, dirty_index_match_object}, - {group, dirty_index_read}, - {group, dirty_index_update}]}, - {dirty_index_match_object, [], - [dirty_index_match_object_ram, - dirty_index_match_object_disc, - dirty_index_match_object_disc_only]}, - {dirty_index_read, [], - [dirty_index_read_ram, dirty_index_read_disc, - dirty_index_read_disc_only]}, - {dirty_index_update, [], - [dirty_index_update_set_ram, - dirty_index_update_set_disc, - dirty_index_update_set_disc_only, - dirty_index_update_bag_ram, dirty_index_update_bag_disc, - dirty_index_update_bag_disc_only]}, - {dirty_iter, [], - [dirty_iter_ram, dirty_iter_disc, - dirty_iter_disc_only]}, - {admin_tests, [], - [del_table_copy_1, del_table_copy_2, del_table_copy_3, - add_table_copy_1, add_table_copy_2, add_table_copy_3, - add_table_copy_4, move_table_copy_1, move_table_copy_2, - move_table_copy_3, move_table_copy_4]}]. + [dirty_write_ram, dirty_write_disc, + dirty_write_disc_only]}, + {dirty_read, [], + [dirty_read_ram, dirty_read_disc, + dirty_read_disc_only]}, + {dirty_update_counter, [], + [dirty_update_counter_ram, dirty_update_counter_disc, + dirty_update_counter_disc_only]}, + {dirty_delete, [], + [dirty_delete_ram, dirty_delete_disc, + dirty_delete_disc_only]}, + {dirty_delete_object, [], + [dirty_delete_object_ram, dirty_delete_object_disc, + dirty_delete_object_disc_only]}, + {dirty_match_object, [], + [dirty_match_object_ram, dirty_match_object_disc, + dirty_match_object_disc_only]}, + {dirty_index, [], + [{group, dirty_index_match_object}, + {group, dirty_index_read}, + {group, dirty_index_update}]}, + {dirty_index_match_object, [], + [dirty_index_match_object_ram, + dirty_index_match_object_disc, + dirty_index_match_object_disc_only]}, + {dirty_index_read, [], + [dirty_index_read_ram, dirty_index_read_disc, + dirty_index_read_disc_only]}, + {dirty_index_update, [], + [dirty_index_update_set_ram, + dirty_index_update_set_disc, + dirty_index_update_set_disc_only, + dirty_index_update_bag_ram, dirty_index_update_bag_disc, + dirty_index_update_bag_disc_only]}, + {dirty_iter, [], + [dirty_iter_ram, dirty_iter_disc, + dirty_iter_disc_only]}, + {admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index d5b0b978e9..55205d1222 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -36,43 +36,43 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, load_tables}, - {group, durability_of_dump_tables}, - durability_of_disc_copies, - durability_of_disc_only_copies]. + [{group, load_tables}, + {group, durability_of_dump_tables}, + durability_of_disc_copies, + durability_of_disc_only_copies]. groups() -> [{load_tables, [], - [load_latest_data, load_local_contents_directly, - load_directly_when_all_are_ram_copiesA, - load_directly_when_all_are_ram_copiesB, - {group, late_load_when_all_are_ram_copies_on_ram_nodes}, - load_when_last_replica_becomes_available, - load_when_we_have_down_from_all_other_replica_nodes, - late_load_transforms_into_disc_load, - late_load_leads_to_hanging, - force_load_when_nobody_intents_to_load, - force_load_when_someone_has_decided_to_load, - force_load_when_someone_else_already_has_loaded, - force_load_when_we_has_loaded, - force_load_on_a_non_local_table, - force_load_when_the_table_does_not_exist, - {group, load_tables_with_master_tables}]}, - {late_load_when_all_are_ram_copies_on_ram_nodes, [], - [late_load_when_all_are_ram_copies_on_ram_nodes1, - late_load_when_all_are_ram_copies_on_ram_nodes2]}, - {load_tables_with_master_tables, [], - [master_nodes, starting_master_nodes, - master_on_non_local_tables, - remote_force_load_with_local_master_node]}, - {durability_of_dump_tables, [], - [dump_ram_copies, dump_disc_copies, dump_disc_only]}]. + [load_latest_data, load_local_contents_directly, + load_directly_when_all_are_ram_copiesA, + load_directly_when_all_are_ram_copiesB, + {group, late_load_when_all_are_ram_copies_on_ram_nodes}, + load_when_last_replica_becomes_available, + load_when_we_have_down_from_all_other_replica_nodes, + late_load_transforms_into_disc_load, + late_load_leads_to_hanging, + force_load_when_nobody_intents_to_load, + force_load_when_someone_has_decided_to_load, + force_load_when_someone_else_already_has_loaded, + force_load_when_we_has_loaded, + force_load_on_a_non_local_table, + force_load_when_the_table_does_not_exist, + {group, load_tables_with_master_tables}]}, + {late_load_when_all_are_ram_copies_on_ram_nodes, [], + [late_load_when_all_are_ram_copies_on_ram_nodes1, + late_load_when_all_are_ram_copies_on_ram_nodes2]}, + {load_tables_with_master_tables, [], + [master_nodes, starting_master_nodes, + master_on_non_local_tables, + remote_force_load_with_local_master_node]}, + {durability_of_dump_tables, [], + [dump_ram_copies, dump_disc_copies, dump_disc_only]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl index fadeca9660..63f4146d98 100644 --- a/lib/mnesia/test/mnesia_evil_backup.erl +++ b/lib/mnesia/test/mnesia_evil_backup.erl @@ -41,23 +41,23 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[backup, bad_backup, global_backup_checkpoint, - {group, restore_tables}, traverse_backup, - selective_backup_checkpoint, - incremental_backup_checkpoint, install_fallback, - uninstall_fallback, local_fallback, - sops_with_checkpoint]. + [backup, bad_backup, global_backup_checkpoint, + {group, restore_tables}, traverse_backup, + selective_backup_checkpoint, + incremental_backup_checkpoint, install_fallback, + uninstall_fallback, local_fallback, + sops_with_checkpoint]. groups() -> [{restore_tables, [], - [restore_errors, restore_clear, restore_keep, - restore_recreate, restore_clear_ram]}]. + [restore_errors, restore_clear, restore_keep, + restore_recreate, restore_clear_ram]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. backup(doc) -> ["Checking the interface to the function backup", diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 52322dc2a3..668eba176f 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -35,48 +35,48 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[system_info, table_info, error_description, - db_node_lifecycle, evil_delete_db_node, start_and_stop, - checkpoint, table_lifecycle, add_copy_conflict, - add_copy_when_going_down, replica_management, - schema_availability, local_content, - {group, table_access_modifications}, replica_location, - {group, table_sync}, user_properties, unsupp_user_props, - {group, record_name}, {group, snmp_access}, - {group, subscriptions}, {group, iteration}, - {group, debug_support}, sorted_ets, - {mnesia_dirty_access_test, all}, - {mnesia_trans_access_test, all}, - {mnesia_evil_backup, all}]. + [system_info, table_info, error_description, + db_node_lifecycle, evil_delete_db_node, start_and_stop, + checkpoint, table_lifecycle, add_copy_conflict, + add_copy_when_going_down, replica_management, + schema_availability, local_content, + {group, table_access_modifications}, replica_location, + {group, table_sync}, user_properties, unsupp_user_props, + {group, record_name}, {group, snmp_access}, + {group, subscriptions}, {group, iteration}, + {group, debug_support}, sorted_ets, + {mnesia_dirty_access_test, all}, + {mnesia_trans_access_test, all}, + {mnesia_evil_backup, all}]. groups() -> [{table_access_modifications, [], - [change_table_access_mode, change_table_load_order, - set_master_nodes, offline_set_master_nodes]}, - {table_sync, [], - [dump_tables, dump_log, wait_for_tables, - force_load_table]}, - {snmp_access, [], - [snmp_open_table, snmp_close_table, snmp_get_next_index, - snmp_get_row, snmp_get_mnesia_key, snmp_update_counter, - snmp_order]}, - {subscriptions, [], - [subscribe_standard, subscribe_extended]}, - {iteration, [], [foldl]}, - {debug_support, [], - [info, schema_0, schema_1, view_0, view_1, view_2, - lkill, kill]}, - {record_name, [], [{group, record_name_dirty_access}]}, - {record_name_dirty_access, [], - [record_name_dirty_access_ram, - record_name_dirty_access_disc, - record_name_dirty_access_disc_only]}]. + [change_table_access_mode, change_table_load_order, + set_master_nodes, offline_set_master_nodes]}, + {table_sync, [], + [dump_tables, dump_log, wait_for_tables, + force_load_table]}, + {snmp_access, [], + [snmp_open_table, snmp_close_table, snmp_get_next_index, + snmp_get_row, snmp_get_mnesia_key, snmp_update_counter, + snmp_order]}, + {subscriptions, [], + [subscribe_standard, subscribe_extended]}, + {iteration, [], [foldl]}, + {debug_support, [], + [info, schema_0, schema_1, view_0, view_1, view_2, + lkill, kill]}, + {record_name, [], [{group, record_name_dirty_access}]}, + {record_name_dirty_access, [], + [record_name_dirty_access_ram, + record_name_dirty_access_disc, + record_name_dirty_access_disc_only]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index 451f7e8e10..373d47a05a 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -62,19 +62,19 @@ opt_load(Mod) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[bup, company, meter, {group, tpcb}]. + [bup, company, meter, {group, tpcb}]. groups() -> [{tpcb, [], - [replica_test, sticky_replica_test, dist_test, - conflict_test, frag_test, frag2_test, remote_test, - remote_frag2_test]}]. + [replica_test, sticky_replica_test, dist_test, + conflict_test, frag_test, frag2_test, remote_test, + remote_frag2_test]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl index fa9dd17c76..d3f6762af7 100644 --- a/lib/mnesia/test/mnesia_frag_test.erl +++ b/lib/mnesia/test/mnesia_frag_test.erl @@ -38,22 +38,22 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, light}, {group, medium}]. + [{group, light}, {group, medium}]. groups() -> [{light, [], [{group, nice}, {group, evil}]}, - {medium, [], [consistency]}, - {nice, [], - [nice_single, nice_multi, nice_access, iter_access]}, - {evil, [], - [evil_create, evil_delete, evil_change, evil_combine, - evil_loop, evil_delete_db_node]}]. + {medium, [], [consistency]}, + {nice, [], + [nice_single, nice_multi, nice_access, iter_access]}, + {evil, [], + [evil_create, evil_delete, evil_change, evil_combine, + evil_loop, evil_delete_db_node]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index 9c4095262f..5d55fcac0e 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -32,16 +32,16 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[silly_durability, silly_move, silly_upgrade]. + [silly_durability, silly_move, silly_upgrade]. groups() -> [{stress, [], stress_cases()}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index b3c96aed03..3273bc4d40 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -32,45 +32,45 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, locking}, {group, visibility}]. + [{group, locking}, {group, visibility}]. groups() -> [{locking, [], - [no_conflict, simple_queue_conflict, - advanced_queue_conflict, simple_deadlock_conflict, - advanced_deadlock_conflict, lock_burst, - {group, sticky_locks}, {group, unbound_locking}, - {group, admin_conflict}, nasty]}, - {sticky_locks, [], [basic_sticky_functionality]}, - {unbound_locking, [], [unbound1, unbound2]}, - {admin_conflict, [], - [create_table, delete_table, move_table_copy, - add_table_index, del_table_index, transform_table, - snmp_open_table, snmp_close_table, - change_table_copy_type, change_table_access, - add_table_copy, del_table_copy, dump_tables, - {group, extra_admin_tests}]}, - {extra_admin_tests, [], - [del_table_copy_1, del_table_copy_2, del_table_copy_3, - add_table_copy_1, add_table_copy_2, add_table_copy_3, - add_table_copy_4, move_table_copy_1, move_table_copy_2, - move_table_copy_3, move_table_copy_4]}, - {visibility, [], - [dirty_updates_visible_direct, - dirty_reads_regardless_of_trans, - trans_update_invisibible_outside_trans, - trans_update_visible_inside_trans, write_shadows, - delete_shadows, write_delete_shadows_bag, - write_delete_shadows_bag2, {group, iteration}, - shadow_search, snmp_shadows]}, - {removed_resources, [], [rr_kill_copy]}, - {iteration, [], [foldl, first_next]}]. + [no_conflict, simple_queue_conflict, + advanced_queue_conflict, simple_deadlock_conflict, + advanced_deadlock_conflict, lock_burst, + {group, sticky_locks}, {group, unbound_locking}, + {group, admin_conflict}, nasty]}, + {sticky_locks, [], [basic_sticky_functionality]}, + {unbound_locking, [], [unbound1, unbound2]}, + {admin_conflict, [], + [create_table, delete_table, move_table_copy, + add_table_index, del_table_index, transform_table, + snmp_open_table, snmp_close_table, + change_table_copy_type, change_table_access, + add_table_copy, del_table_copy, dump_tables, + {group, extra_admin_tests}]}, + {extra_admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}, + {visibility, [], + [dirty_updates_visible_direct, + dirty_reads_regardless_of_trans, + trans_update_invisibible_outside_trans, + trans_update_visible_inside_trans, write_shadows, + delete_shadows, write_delete_shadows_bag, + write_delete_shadows_bag2, {group, iteration}, + shadow_search, snmp_shadows]}, + {removed_resources, [], [rr_kill_copy]}, + {iteration, [], [foldl, first_next]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index e9be99411c..e63689d83a 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -38,50 +38,50 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, prediction}, {group, consumption}, - {group, scalability}, {group, benchmarks}]. + [{group, prediction}, {group, consumption}, + {group, scalability}, {group, benchmarks}]. groups() -> [{prediction, [], - [reader_disturbed_by_node_down, - writer_disturbed_by_node_down, - reader_disturbed_by_node_up, - writer_disturbed_by_node_up, - reader_disturbed_by_schema_ops, - writer_disturbed_by_schema_ops, - reader_disturbed_by_checkpoint, - writer_disturbed_by_checkpoint, - reader_disturbed_by_dump_log, - writer_disturbed_by_dump_log, - reader_disturbed_by_backup, writer_disturbed_by_backup, - reader_disturbed_by_restore, - writer_disturbed_by_restore, {group, fairness}]}, - {fairness, [], - [reader_competing_with_reader, - reader_competing_with_writer, - writer_competing_with_reader, - writer_competing_with_writer]}, - {consumption, [], - [measure_resource_consumption, - determine_resource_leakage]}, - {scalability, [], - [determine_system_limits, performance_at_min_config, - performance_at_max_config, performance_at_full_load, - resource_consumption_at_min_config, - resource_consumption_at_max_config, - resource_consumption_at_full_load]}, - {benchmarks, [], - [{group, meter}, cost, dbn_meters, - measure_all_api_functions, {group, tpcb}, - mnemosyne_vs_mnesia_kernel]}, - {tpcb, [], [ram_tpcb, disc_tpcb, disc_only_tpcb]}, - {meter, [], [ram_meter, disc_meter, disc_only_meter]}]. + [reader_disturbed_by_node_down, + writer_disturbed_by_node_down, + reader_disturbed_by_node_up, + writer_disturbed_by_node_up, + reader_disturbed_by_schema_ops, + writer_disturbed_by_schema_ops, + reader_disturbed_by_checkpoint, + writer_disturbed_by_checkpoint, + reader_disturbed_by_dump_log, + writer_disturbed_by_dump_log, + reader_disturbed_by_backup, writer_disturbed_by_backup, + reader_disturbed_by_restore, + writer_disturbed_by_restore, {group, fairness}]}, + {fairness, [], + [reader_competing_with_reader, + reader_competing_with_writer, + writer_competing_with_reader, + writer_competing_with_writer]}, + {consumption, [], + [measure_resource_consumption, + determine_resource_leakage]}, + {scalability, [], + [determine_system_limits, performance_at_min_config, + performance_at_max_config, performance_at_full_load, + resource_consumption_at_min_config, + resource_consumption_at_max_config, + resource_consumption_at_full_load]}, + {benchmarks, [], + [{group, meter}, cost, dbn_meters, + measure_all_api_functions, {group, tpcb}, + mnemosyne_vs_mnesia_kernel]}, + {tpcb, [], [ram_tpcb, disc_tpcb, disc_only_tpcb]}, + {meter, [], [ram_meter, disc_meter, disc_only_meter]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl index 7835c44d6a..78eab67b11 100644 --- a/lib/mnesia/test/mnesia_nice_coverage_test.erl +++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl @@ -33,16 +33,16 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[nice]. + [nice]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. nice(doc) -> [""]; diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl index 288bd3c2db..141de71d01 100644 --- a/lib/mnesia/test/mnesia_qlc_test.erl +++ b/lib/mnesia/test/mnesia_qlc_test.erl @@ -35,30 +35,30 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). all() -> -case code:which(qlc) of - non_existing -> []; - _ -> all_qlc() -end. + case code:which(qlc) of + non_existing -> []; + _ -> all_qlc() + end. groups() -> [{dirty, [], - [dirty_nice_ram_copies, dirty_nice_disc_copies, - dirty_nice_disc_only_copies]}, - {trans, [], - [trans_nice_ram_copies, trans_nice_disc_copies, - trans_nice_disc_only_copies, {group, atomic}]}, - {atomic, [], [atomic_eval]}]. + [dirty_nice_ram_copies, dirty_nice_disc_copies, + dirty_nice_disc_only_copies]}, + {trans, [], + [trans_nice_ram_copies, trans_nice_disc_copies, + trans_nice_disc_only_copies, {group, atomic}]}, + {atomic, [], [atomic_eval]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. all_qlc() -> -[{group, dirty}, {group, trans}, frag, info, - mnesia_down]. + [{group, dirty}, {group, trans}, frag, info, + mnesia_down]. init_testcases(Type,Config) -> Nodes = [N1,N2] = ?acquire_nodes(2, Config), diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index 4cb6c38186..625e6e824c 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -43,94 +43,92 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, mnesia_down}, {group, explicit_stop}, - coord_dies, {group, schema_trans}, {group, async_dirty}, - {group, sync_dirty}, {group, sym_trans}, - {group, asym_trans}, after_full_disc_partition, - {group, after_corrupt_files}, disc_less, garb_decision, - system_upgrade]. + [{group, mnesia_down}, {group, explicit_stop}, + coord_dies, {group, schema_trans}, {group, async_dirty}, + {group, sync_dirty}, {group, sym_trans}, + {group, asym_trans}, after_full_disc_partition, + {group, after_corrupt_files}, disc_less, garb_decision, + system_upgrade]. groups() -> [{schema_trans, [], - [{mnesia_schema_recovery_test, all}]}, - {mnesia_down, [], - [{group, mnesia_down_during_startup}, - {group, master_node_tests}, {group, read_during_down}, - {group, with_checkpoint}, delete_during_start]}, - {master_node_tests, [], - [no_master_2, no_master_3, one_master_2, one_master_3, - two_master_2, two_master_3, all_master_2, - all_master_3]}, - {read_during_down, [], - [dirty_read_during_down, trans_read_during_down]}, - {mnesia_down_during_startup, [], - [mnesia_down_during_startup_disk_ram, - mnesia_down_during_startup_init_ram, - mnesia_down_during_startup_init_disc, - mnesia_down_during_startup_init_disc_only, - mnesia_down_during_startup_tm_ram, - mnesia_down_during_startup_tm_disc, - mnesia_down_during_startup_tm_disc_only]}, - {with_checkpoint, [], - [with_checkpoint_same, with_checkpoint_other]}, - {explicit_stop, [], [explicit_stop_during_snmp]}, - {sym_trans, [], - [sym_trans_before_commit_kill_coord_node, - sym_trans_before_commit_kill_coord_pid, - sym_trans_before_commit_kill_part_after_ask, - sym_trans_before_commit_kill_part_before_ask, - sym_trans_after_commit_kill_coord_node, - sym_trans_after_commit_kill_coord_pid, - sym_trans_after_commit_kill_part_after_ask, - sym_trans_after_commit_kill_part_do_commit_pre, - sym_trans_after_commit_kill_part_do_commit_post]}, - {sync_dirty, [], - [sync_dirty_pre_kill_part, - sync_dirty_pre_kill_coord_node, - sync_dirty_pre_kill_coord_pid, - sync_dirty_post_kill_part, - sync_dirty_post_kill_coord_node, - sync_dirty_post_kill_coord_pid]}, - {async_dirty, [], - [async_dirty_pre_kill_part, - async_dirty_pre_kill_coord_node, - async_dirty_pre_kill_coord_pid, - async_dirty_post_kill_part, - async_dirty_post_kill_coord_node, - async_dirty_post_kill_coord_pid]}, - {asym_trans, [], - [asym_trans_kill_part_ask, - asym_trans_kill_part_commit_vote, - asym_trans_kill_part_pre_commit, - asym_trans_kill_part_log_commit, - asym_trans_kill_part_do_commit, - asym_trans_kill_coord_got_votes, - asym_trans_kill_coord_pid_got_votes, - asym_trans_kill_coord_log_commit_rec, - asym_trans_kill_coord_pid_log_commit_rec, - asym_trans_kill_coord_log_commit_dec, - asym_trans_kill_coord_pid_log_commit_dec, - asym_trans_kill_coord_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_rec_acc_pre_commit_done_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]}, - {after_corrupt_files, [], - [after_corrupt_files_decision_log_head, - after_corrupt_files_decision_log_tail, - after_corrupt_files_latest_log_head, - after_corrupt_files_latest_log_tail, - after_corrupt_files_table_dat_head, - after_corrupt_files_table_dat_tail, - after_corrupt_files_schema_dat_head, - after_corrupt_files_schema_dat_tail]}]. + [{mnesia_schema_recovery_test, all}]}, + {mnesia_down, [], + [{group, mnesia_down_during_startup}, + {group, master_node_tests}, {group, read_during_down}, + {group, with_checkpoint}, delete_during_start]}, + {master_node_tests, [], + [no_master_2, no_master_3, one_master_2, one_master_3, + two_master_2, two_master_3, all_master_2, + all_master_3]}, + {read_during_down, [], + [dirty_read_during_down, trans_read_during_down]}, + {mnesia_down_during_startup, [], + [mnesia_down_during_startup_disk_ram, + mnesia_down_during_startup_init_ram, + mnesia_down_during_startup_init_disc, + mnesia_down_during_startup_init_disc_only, + mnesia_down_during_startup_tm_ram, + mnesia_down_during_startup_tm_disc, + mnesia_down_during_startup_tm_disc_only]}, + {with_checkpoint, [], + [with_checkpoint_same, with_checkpoint_other]}, + {explicit_stop, [], [explicit_stop_during_snmp]}, + {sym_trans, [], + [sym_trans_before_commit_kill_coord_node, + sym_trans_before_commit_kill_coord_pid, + sym_trans_before_commit_kill_part_after_ask, + sym_trans_before_commit_kill_part_before_ask, + sym_trans_after_commit_kill_coord_node, + sym_trans_after_commit_kill_coord_pid, + sym_trans_after_commit_kill_part_after_ask, + sym_trans_after_commit_kill_part_do_commit_pre, + sym_trans_after_commit_kill_part_do_commit_post]}, + {sync_dirty, [], + [sync_dirty_pre_kill_part, + sync_dirty_pre_kill_coord_node, + sync_dirty_pre_kill_coord_pid, + sync_dirty_post_kill_part, + sync_dirty_post_kill_coord_node, + sync_dirty_post_kill_coord_pid]}, + {async_dirty, [], + [async_dirty_pre_kill_part, + async_dirty_pre_kill_coord_node, + async_dirty_pre_kill_coord_pid, + async_dirty_post_kill_part, + async_dirty_post_kill_coord_node, + async_dirty_post_kill_coord_pid]}, + {asym_trans, [], + [asym_trans_kill_part_ask, + asym_trans_kill_part_commit_vote, + asym_trans_kill_part_pre_commit, + asym_trans_kill_part_log_commit, + asym_trans_kill_part_do_commit, + asym_trans_kill_coord_got_votes, + asym_trans_kill_coord_pid_got_votes, + asym_trans_kill_coord_log_commit_rec, + asym_trans_kill_coord_pid_log_commit_rec, + asym_trans_kill_coord_log_commit_dec, + asym_trans_kill_coord_pid_log_commit_dec, + asym_trans_kill_coord_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_rec_acc_pre_commit_done_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]}, + {after_corrupt_files, [], + [after_corrupt_files_decision_log_head, + after_corrupt_files_decision_log_tail, + after_corrupt_files_latest_log_head, + after_corrupt_files_latest_log_tail, + after_corrupt_files_table_dat_head, + after_corrupt_files_table_dat_tail, + after_corrupt_files_schema_dat_head, + after_corrupt_files_schema_dat_tail]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - + Config. tpcb_config(ReplicaType, _NodeConfig, Nodes) -> [{n_branches, 5}, diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl index daf6897861..cf8da38632 100644 --- a/lib/mnesia/test/mnesia_registry_test.erl +++ b/lib/mnesia/test/mnesia_registry_test.erl @@ -31,16 +31,16 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[good_dump, bad_dump]. + [good_dump, bad_dump]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl index 0fd9ffb9a4..0fe26efd0b 100644 --- a/lib/mnesia/test/mnesia_schema_recovery_test.erl +++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl @@ -42,84 +42,81 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[{group, interrupted_before_log_dump}, - {group, interrupted_after_log_dump}]. + [{group, interrupted_before_log_dump}, + {group, interrupted_after_log_dump}]. groups() -> [{interrupted_before_log_dump, [], - [interrupted_before_create_ram, - interrupted_before_create_disc, - interrupted_before_create_disc_only, - interrupted_before_create_nostore, - interrupted_before_delete_ram, - interrupted_before_delete_disc, - interrupted_before_delete_disc_only, - interrupted_before_add_ram, interrupted_before_add_disc, - interrupted_before_add_disc_only, - interrupted_before_add_kill_copier, - interrupted_before_move_ram, - interrupted_before_move_disc, - interrupted_before_move_disc_only, - interrupted_before_move_kill_copier, - interrupted_before_delcopy_ram, - interrupted_before_delcopy_disc, - interrupted_before_delcopy_disc_only, - interrupted_before_delcopy_kill_copier, - interrupted_before_addindex_ram, - interrupted_before_addindex_disc, - interrupted_before_addindex_disc_only, - interrupted_before_delindex_ram, - interrupted_before_delindex_disc, - interrupted_before_delindex_disc_only, - interrupted_before_change_type_ram2disc, - interrupted_before_change_type_ram2disc_only, - interrupted_before_change_type_disc2ram, - interrupted_before_change_type_disc2disc_only, - interrupted_before_change_type_disc_only2ram, - interrupted_before_change_type_disc_only2disc, - interrupted_before_change_type_other_node, - interrupted_before_change_schema_type]}, - {interrupted_after_log_dump, [], - [interrupted_after_create_ram, - interrupted_after_create_disc, - interrupted_after_create_disc_only, - interrupted_after_create_nostore, - interrupted_after_delete_ram, - interrupted_after_delete_disc, - interrupted_after_delete_disc_only, - interrupted_after_add_ram, interrupted_after_add_disc, - interrupted_after_add_disc_only, - interrupted_after_add_kill_copier, - interrupted_after_move_ram, interrupted_after_move_disc, - interrupted_after_move_disc_only, - interrupted_after_move_kill_copier, - interrupted_after_delcopy_ram, - interrupted_after_delcopy_disc, - interrupted_after_delcopy_disc_only, - interrupted_after_delcopy_kill_copier, - interrupted_after_addindex_ram, - interrupted_after_addindex_disc, - interrupted_after_addindex_disc_only, - interrupted_after_delindex_ram, - interrupted_after_delindex_disc, - interrupted_after_delindex_disc_only, - interrupted_after_change_type_ram2disc, - interrupted_after_change_type_ram2disc_only, - interrupted_after_change_type_disc2ram, - interrupted_after_change_type_disc2disc_only, - interrupted_after_change_type_disc_only2ram, - interrupted_after_change_type_disc_only2disc, - interrupted_after_change_type_other_node, - interrupted_after_change_schema_type]}]. + [interrupted_before_create_ram, + interrupted_before_create_disc, + interrupted_before_create_disc_only, + interrupted_before_create_nostore, + interrupted_before_delete_ram, + interrupted_before_delete_disc, + interrupted_before_delete_disc_only, + interrupted_before_add_ram, interrupted_before_add_disc, + interrupted_before_add_disc_only, + interrupted_before_add_kill_copier, + interrupted_before_move_ram, + interrupted_before_move_disc, + interrupted_before_move_disc_only, + interrupted_before_move_kill_copier, + interrupted_before_delcopy_ram, + interrupted_before_delcopy_disc, + interrupted_before_delcopy_disc_only, + interrupted_before_delcopy_kill_copier, + interrupted_before_addindex_ram, + interrupted_before_addindex_disc, + interrupted_before_addindex_disc_only, + interrupted_before_delindex_ram, + interrupted_before_delindex_disc, + interrupted_before_delindex_disc_only, + interrupted_before_change_type_ram2disc, + interrupted_before_change_type_ram2disc_only, + interrupted_before_change_type_disc2ram, + interrupted_before_change_type_disc2disc_only, + interrupted_before_change_type_disc_only2ram, + interrupted_before_change_type_disc_only2disc, + interrupted_before_change_type_other_node, + interrupted_before_change_schema_type]}, + {interrupted_after_log_dump, [], + [interrupted_after_create_ram, + interrupted_after_create_disc, + interrupted_after_create_disc_only, + interrupted_after_create_nostore, + interrupted_after_delete_ram, + interrupted_after_delete_disc, + interrupted_after_delete_disc_only, + interrupted_after_add_ram, interrupted_after_add_disc, + interrupted_after_add_disc_only, + interrupted_after_add_kill_copier, + interrupted_after_move_ram, interrupted_after_move_disc, + interrupted_after_move_disc_only, + interrupted_after_move_kill_copier, + interrupted_after_delcopy_ram, + interrupted_after_delcopy_disc, + interrupted_after_delcopy_disc_only, + interrupted_after_delcopy_kill_copier, + interrupted_after_addindex_ram, + interrupted_after_addindex_disc, + interrupted_after_addindex_disc_only, + interrupted_after_delindex_ram, + interrupted_after_delindex_disc, + interrupted_after_delindex_disc_only, + interrupted_after_change_type_ram2disc, + interrupted_after_change_type_ram2disc_only, + interrupted_after_change_type_disc2ram, + interrupted_after_change_type_disc2disc_only, + interrupted_after_change_type_disc_only2ram, + interrupted_after_change_type_disc_only2disc, + interrupted_after_change_type_other_node, + interrupted_after_change_schema_type]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - + Config. interrupted_before_create_ram(suite) -> []; interrupted_before_create_ram(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index 01f1fd026c..55ba4dd761 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -41,39 +41,39 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> -[write, read, wread, delete, delete_object, - match_object, select, select14, all_keys, transaction, - {group, nested_activities}, {group, index_tabs}, - {group, index_lifecycle}]. + [write, read, wread, delete, delete_object, + match_object, select, select14, all_keys, transaction, + {group, nested_activities}, {group, index_tabs}, + {group, index_lifecycle}]. groups() -> [{nested_activities, [], - [basic_nested, {group, nested_transactions}, - mix_of_nested_activities]}, - {nested_transactions, [], - [nested_trans_both_ok, nested_trans_child_dies, - nested_trans_parent_dies, nested_trans_both_dies]}, - {index_tabs, [], - [index_match_object, index_read, {group, index_update}, - index_write]}, - {index_update, [], - [index_update_set, index_update_bag]}, - {index_lifecycle, [], - [add_table_index_ram, add_table_index_disc, - add_table_index_disc_only, create_live_table_index_ram, - create_live_table_index_disc, - create_live_table_index_disc_only, del_table_index_ram, - del_table_index_disc, del_table_index_disc_only, - {group, idx_schema_changes}]}, - {idx_schema_changes, [], - [idx_schema_changes_ram, idx_schema_changes_disc, - idx_schema_changes_disc_only]}]. + [basic_nested, {group, nested_transactions}, + mix_of_nested_activities]}, + {nested_transactions, [], + [nested_trans_both_ok, nested_trans_child_dies, + nested_trans_parent_dies, nested_trans_both_dies]}, + {index_tabs, [], + [index_match_object, index_read, {group, index_update}, + index_write]}, + {index_update, [], + [index_update_set, index_update_bag]}, + {index_lifecycle, [], + [add_table_index_ram, add_table_index_disc, + add_table_index_disc_only, create_live_table_index_ram, + create_live_table_index_disc, + create_live_table_index_disc_only, del_table_index_ram, + del_table_index_disc, del_table_index_disc_only, + {group, idx_schema_changes}]}, + {idx_schema_changes, [], + [idx_schema_changes_ram, idx_schema_changes_disc, + idx_schema_changes_disc_only]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Write records -- cgit v1.2.3 From e0144ad1f84b26badb6a75fdc0b760ff11cffb76 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:53:12 +0100 Subject: Fix formatting for observer --- lib/observer/test/crashdump_viewer_SUITE.erl | 11 ++++++----- lib/observer/test/etop_SUITE.erl | 9 +++++---- lib/observer/test/observer_SUITE.erl | 9 +++++---- lib/observer/test/ttb_SUITE.erl | 16 +++++++++------- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index 73684eb246..6f89fabd13 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -20,7 +20,8 @@ -module(crashdump_viewer_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,translate/1,start/1,fini/1,load_file/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + translate/1,start/1,fini/1,load_file/1, non_existing/1,not_a_crashdump/1,old_crashdump/1]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -49,17 +50,17 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[translate, load_file, non_existing, not_a_crashdump, - old_crashdump]. + [translate, load_file, non_existing, not_a_crashdump, + old_crashdump]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_suite(doc) -> diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index d721913b72..cecea302ea 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -20,7 +20,8 @@ -module(etop_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). -export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). @@ -38,7 +39,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[text, text_tracing_off]. + [text, text_tracing_off]. groups() -> []. @@ -50,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. text(suite) -> diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index f0c99a34c2..05ac562b81 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -42,7 +43,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_file]. + [app_file]. groups() -> []. @@ -54,10 +55,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. app_file(suite) -> diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 18e28e690c..9b5ec88ad6 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -21,7 +21,9 @@ -compile(export_all). %% Test functions --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). @@ -44,10 +46,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[file, file_no_pi, file_fetch, wrap, wrap_merge, - wrap_merge_fetch_format, write_config1, write_config2, - write_config3, history, write_trace_info, seq_trace, - diskless, otp_4967_1, otp_4967_2]. + [file, file_no_pi, file_fetch, wrap, wrap_merge, + wrap_merge_fetch_format, write_config1, write_config2, + write_config3, history, write_trace_info, seq_trace, + diskless, otp_4967_1, otp_4967_2]. groups() -> []. @@ -59,10 +61,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. file(suite) -> -- cgit v1.2.3 From 6a2363e72e81c7ad16bf534f3a7ca7029d7255ce Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:54:32 +0100 Subject: Fix formatting for odbc --- lib/odbc/test/odbc_connect_SUITE.erl | 28 ++++++++-------- lib/odbc/test/odbc_data_type_SUITE.erl | 60 +++++++++++++++++----------------- lib/odbc/test/odbc_query_SUITE.erl | 58 ++++++++++++++++---------------- lib/odbc/test/odbc_start_SUITE.erl | 14 ++++---- 4 files changed, 80 insertions(+), 80 deletions(-) diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index 997ebfd0b6..b0a70fe04c 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -44,27 +44,27 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case odbc_test_lib:odbc_check() of - ok -> - [not_exist_db, commit, rollback, not_explicit_commit, - no_c_node, port_dies, control_process_dies, - {group, client_dies}, connect_timeout, timeout, - many_timeouts, timeout_reset, disconnect_on_timeout, - connection_closed, disable_scrollable_cursors, - return_rows_as_lists, api_missuse]; - Other -> {skip, Other} -end. + case odbc_test_lib:odbc_check() of + ok -> + [not_exist_db, commit, rollback, not_explicit_commit, + no_c_node, port_dies, control_process_dies, + {group, client_dies}, connect_timeout, timeout, + many_timeouts, timeout_reset, disconnect_on_timeout, + connection_closed, disable_scrollable_cursors, + return_rows_as_lists, api_missuse]; + Other -> {skip, Other} + end. groups() -> [{client_dies, [], - [client_dies_normal, client_dies_timeout, - client_dies_error]}]. + [client_dies_normal, client_dies_timeout, + client_dies_error]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%-------------------------------------------------------------------- diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl index 120e9c6154..75484b177e 100644 --- a/lib/odbc/test/odbc_data_type_SUITE.erl +++ b/lib/odbc/test/odbc_data_type_SUITE.erl @@ -42,43 +42,43 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case odbc_test_lib:odbc_check() of - ok -> - [{group, char}, {group, int}, {group, floats}, - {group, dec_and_num}, timestamp]; - Other -> {skip, Other} -end. + case odbc_test_lib:odbc_check() of + ok -> + [{group, char}, {group, int}, {group, floats}, + {group, dec_and_num}, timestamp]; + Other -> {skip, Other} + end. groups() -> [{char, [], - [char_fixed_lower_limit, char_fixed_upper_limit, - char_fixed_padding, varchar_lower_limit, - varchar_upper_limit, varchar_no_padding, - text_lower_limit, text_upper_limit, unicode]}, - {binary_char, [], - [binary_char_fixed_lower_limit, - binary_char_fixed_upper_limit, - binary_char_fixed_padding, binary_varchar_lower_limit, - binary_varchar_upper_limit, binary_varchar_no_padding, - binary_text_lower_limit, binary_text_upper_limit, - unicode]}, - {int, [], - [tiny_int_lower_limit, tiny_int_upper_limit, - small_int_lower_limit, small_int_upper_limit, - int_lower_limit, int_upper_limit, big_int_lower_limit, - big_int_upper_limit, bit_false, bit_true]}, - {floats, [], - [float_lower_limit, float_upper_limit, float_zero, - real_zero]}, - {dec_and_num, [], - [dec_long, dec_double, dec_bignum, num_long, num_double, - num_bignum]}]. + [char_fixed_lower_limit, char_fixed_upper_limit, + char_fixed_padding, varchar_lower_limit, + varchar_upper_limit, varchar_no_padding, + text_lower_limit, text_upper_limit, unicode]}, + {binary_char, [], + [binary_char_fixed_lower_limit, + binary_char_fixed_upper_limit, + binary_char_fixed_padding, binary_varchar_lower_limit, + binary_varchar_upper_limit, binary_varchar_no_padding, + binary_text_lower_limit, binary_text_upper_limit, + unicode]}, + {int, [], + [tiny_int_lower_limit, tiny_int_upper_limit, + small_int_lower_limit, small_int_upper_limit, + int_lower_limit, int_upper_limit, big_int_lower_limit, + big_int_upper_limit, bit_false, bit_true]}, + {floats, [], + [float_lower_limit, float_upper_limit, float_zero, + real_zero]}, + {dec_and_num, [], + [dec_long, dec_double, dec_bignum, num_long, num_double, + num_bignum]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index 49e2239ad4..a4abb3edbb 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -41,42 +41,42 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case odbc_test_lib:odbc_check() of - ok -> - [sql_query, first, last, next, prev, select_count, - select_next, select_relative, select_absolute, - create_table_twice, delete_table_twice, duplicate_key, - not_connection_owner, no_result_set, query_error, - multiple_select_result_sets, multiple_mix_result_sets, - multiple_result_sets_error, - {group, parameterized_queries}, {group, describe_table}, - delete_nonexisting_row]; - Other -> {skip, Other} -end. + case odbc_test_lib:odbc_check() of + ok -> + [sql_query, first, last, next, prev, select_count, + select_next, select_relative, select_absolute, + create_table_twice, delete_table_twice, duplicate_key, + not_connection_owner, no_result_set, query_error, + multiple_select_result_sets, multiple_mix_result_sets, + multiple_result_sets_error, + {group, parameterized_queries}, {group, describe_table}, + delete_nonexisting_row]; + Other -> {skip, Other} + end. groups() -> [{parameterized_queries, [], - [{group, param_integers}, param_insert_decimal, - param_insert_numeric, {group, param_insert_string}, - param_insert_float, param_insert_real, - param_insert_double, param_insert_mix, param_update, - param_delete, param_select]}, - {param_integers, [], - [param_insert_tiny_int, param_insert_small_int, - param_insert_int, param_insert_integer]}, - {param_insert_string, [], - [param_insert_char, param_insert_character, - param_insert_char_varying, - param_insert_character_varying]}, - {describe_table, [], - [describe_integer, describe_string, describe_floating, - describe_dec_num, describe_no_such_table]}]. + [{group, param_integers}, param_insert_decimal, + param_insert_numeric, {group, param_insert_string}, + param_insert_float, param_insert_real, + param_insert_double, param_insert_mix, param_update, + param_delete, param_select]}, + {param_integers, [], + [param_insert_tiny_int, param_insert_small_int, + param_insert_int, param_insert_integer]}, + {param_insert_string, [], + [param_insert_char, param_insert_character, + param_insert_char_varying, + param_insert_character_varying]}, + {describe_table, [], + [describe_integer, describe_string, describe_floating, + describe_dec_num, describe_no_such_table]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl index 7dc827799a..1171408547 100644 --- a/lib/odbc/test/odbc_start_SUITE.erl +++ b/lib/odbc/test/odbc_start_SUITE.erl @@ -101,21 +101,21 @@ end_per_testcase(_TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case odbc_test_lib:odbc_check() of - ok -> [start]; - Other -> {skip, Other} -end. + case odbc_test_lib:odbc_check() of + ok -> [start]; + Other -> {skip, Other} + end. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - %% Test cases starts here. %%-------------------------------------------------------------------- -- cgit v1.2.3 From 132f31884e188cfdb78a79fdfaf7e87e8f3ae010 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 16:59:35 +0100 Subject: Fix formatting for orber --- lib/orber/test/cdrcoding_11_SUITE.erl | 4 +- lib/orber/test/cdrcoding_12_SUITE.erl | 4 +- lib/orber/test/cdrlib_SUITE.erl | 12 ++-- lib/orber/test/corba_SUITE.erl | 20 +++---- lib/orber/test/csiv2_SUITE.erl | 4 +- lib/orber/test/data_types_SUITE.erl | 10 ++-- lib/orber/test/generated_SUITE.erl | 31 +++++----- lib/orber/test/interceptors_SUITE.erl | 9 +-- lib/orber/test/iop_ior_10_SUITE.erl | 9 +-- lib/orber/test/iop_ior_11_SUITE.erl | 9 +-- lib/orber/test/iop_ior_12_SUITE.erl | 9 +-- lib/orber/test/lname_SUITE.erl | 9 +-- lib/orber/test/multi_ORB_SUITE.erl | 73 ++++++++++++------------ lib/orber/test/naming_context_SUITE.erl | 11 ++-- lib/orber/test/orber_SUITE.erl | 11 ++-- lib/orber/test/orber_acl_SUITE.erl | 8 +-- lib/orber/test/orber_firewall_ipv4_in_SUITE.erl | 15 ++--- lib/orber/test/orber_firewall_ipv4_out_SUITE.erl | 15 ++--- lib/orber/test/orber_firewall_ipv6_in_SUITE.erl | 15 ++--- lib/orber/test/orber_firewall_ipv6_out_SUITE.erl | 15 ++--- lib/orber/test/orber_nat_SUITE.erl | 19 +++--- lib/orber/test/orber_web_SUITE.erl | 14 ++--- lib/orber/test/tc_SUITE.erl | 20 +++---- 23 files changed, 180 insertions(+), 166 deletions(-) diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl index d52b5529f3..dc981c70df 100644 --- a/lib/orber/test/cdrcoding_11_SUITE.erl +++ b/lib/orber/test/cdrcoding_11_SUITE.erl @@ -61,10 +61,10 @@ groups() -> exception_type, do_unregister]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl index 5d285369f7..af760c6999 100644 --- a/lib/orber/test/cdrcoding_12_SUITE.erl +++ b/lib/orber/test/cdrcoding_12_SUITE.erl @@ -62,10 +62,10 @@ groups() -> exception_type, do_unregister]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index 873168685c..763b433589 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -32,12 +32,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -48,8 +48,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[short, ushort, long, ulong, longlong, ulonglong, - boolean, character, octet, float, double, enum]. + [short, ushort, long, ulong, longlong, ulonglong, + boolean, character, octet, float, double, enum]. groups() -> []. @@ -61,10 +61,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl index 0f64dcd79d..aadb533fe4 100644 --- a/lib/orber/test/corba_SUITE.erl +++ b/lib/orber/test/corba_SUITE.erl @@ -67,26 +67,26 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[exception_info_api, corba_api, object_api, orber_api, - orber_objectkeys_api, orber_pseudo_objects, - callback_ok_api, callback_arity_api, - callback_module_api, callback_function_api, - callback_precond_api, callback_postcond_api, - callback_exit_api, callback_badarith_api, - callback_case_clause_api, callback_function_clause_api]. + [exception_info_api, corba_api, object_api, orber_api, + orber_objectkeys_api, orber_pseudo_objects, + callback_ok_api, callback_arity_api, + callback_module_api, callback_function_api, + callback_precond_api, callback_postcond_api, + callback_exit_api, callback_badarith_api, + callback_case_clause_api, callback_function_clause_api]. %% boa_api, request, locate_request, locate_reply]. diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index fee1571e02..67cec0dde6 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -326,10 +326,10 @@ groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must bu first since we explicitly set a request diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 09849eb933..534fa8ee98 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -48,12 +48,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -64,7 +64,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[fixed_type, any_type]. + [fixed_type, any_type]. groups() -> []. @@ -76,10 +76,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 12c997312e..28387ad2f8 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -71,7 +71,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -87,18 +88,18 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port, - erlang_ref, 'CosNaming_Binding', - 'CosNaming_BindingList', 'CosNaming_Name', - 'CosNaming_NameComponent', - 'CosNaming_NamingContextExt_InvalidAddress', - 'CosNaming_NamingContext_AlreadyBound', - 'CosNaming_NamingContext_CannotProceed', - 'CosNaming_NamingContext_InvalidName', - 'CosNaming_NamingContext_NotEmpty', - 'CosNaming_NamingContext_NotFound', - 'CosNaming_BindingIterator', 'CosNaming_NamingContext', - 'CosNaming_NamingContextExt']. + ['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port, + erlang_ref, 'CosNaming_Binding', + 'CosNaming_BindingList', 'CosNaming_Name', + 'CosNaming_NameComponent', + 'CosNaming_NamingContextExt_InvalidAddress', + 'CosNaming_NamingContext_AlreadyBound', + 'CosNaming_NamingContext_CannotProceed', + 'CosNaming_NamingContext_InvalidName', + 'CosNaming_NamingContext_NotEmpty', + 'CosNaming_NamingContext_NotFound', + 'CosNaming_BindingIterator', 'CosNaming_NamingContext', + 'CosNaming_NamingContextExt']. groups() -> []. @@ -110,10 +111,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 1157ea8830..3d45c4b047 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -65,7 +65,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -81,7 +82,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[local_pseudo, local_default, local_local, local_global]. + [local_pseudo, local_default, local_local, local_global]. groups() -> []. @@ -93,10 +94,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index ff2cf45160..d232b6d032 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -33,7 +33,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -49,7 +50,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[encoding, create_and_get_ops]. + [encoding, create_and_get_ops]. groups() -> []. @@ -61,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index cacedcd87d..f1f7cbc867 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -33,7 +33,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -49,7 +50,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[encoding, create_and_get_ops]. + [encoding, create_and_get_ops]. groups() -> []. @@ -61,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index 16b5a45f3a..d7e3cf05f6 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -34,7 +34,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -50,7 +51,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[encoding, create_and_get_ops]. + [encoding, create_and_get_ops]. groups() -> []. @@ -62,10 +63,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index e4b13da486..4c973502e3 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -34,7 +34,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports @@ -50,7 +51,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[lname_component, lname]. + [lname_component, lname]. groups() -> []. @@ -62,10 +63,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index 3b2d7de06d..3a11036f13 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -50,7 +50,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, basic_PI_api/1, multi_orber_api/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, basic_PI_api/1, multi_orber_api/1, init_per_testcase/2, end_per_testcase/2, multi_pseudo_orber_api/1, light_orber_api/1, light_orber2_api/1, ssl_1_multi_orber_api/1, ssl_2_multi_orber_api/1, ssl_reconfigure_api/1, @@ -89,54 +90,54 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must be first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. cases() -> -[fragments_server_api, fragments_max_server_api, - fragments_max_server_added_api, fragments_client_api, - flags_added_api, bad_fragment_id_client_api, - bad_giop_header_api, bad_id_cancel_request_api, - implicit_context_api, pseudo_implicit_context_api, - pseudo_two_implicit_context_api, - implicit_context_roundtrip_api, - oneway_implicit_context_api, - oneway_pseudo_implicit_context_api, - oneway_pseudo_two_implicit_context_api, - proxy_interface_api, proxy_interface_ipv6_api, - local_interface_api, local_interface_ctx_override_api, - local_interface_acl_override_api, close_connections_api, - close_connections_local_interface_api, - close_connections_local_interface_ctx_override_api, - close_connections_alt_iiop_addr_api, - close_connections_multiple_profiles_api, - multiple_accept_api, max_requests_api, - max_requests_added_api, max_connections_api, - max_packet_size_exceeded_api, max_packet_size_ok_api, - light_ifr_api, multi_pseudo_orber_api, multi_orber_api, - light_orber_api, light_orber2_api, basic_PI_api, - iiop_timeout_api, iiop_timeout_added_api, - setup_connection_timeout_api, - setup_multi_connection_timeout_api, - setup_multi_connection_timeout_attempts_api, - setup_multi_connection_timeout_random_api, - ssl_1_multi_orber_api, - ssl_1_multi_orber_generation_3_api, - ssl_2_multi_orber_api, - ssl_2_multi_orber_generation_3_api, - ssl_reconfigure_generation_3_api, ssl_reconfigure_api]. + [fragments_server_api, fragments_max_server_api, + fragments_max_server_added_api, fragments_client_api, + flags_added_api, bad_fragment_id_client_api, + bad_giop_header_api, bad_id_cancel_request_api, + implicit_context_api, pseudo_implicit_context_api, + pseudo_two_implicit_context_api, + implicit_context_roundtrip_api, + oneway_implicit_context_api, + oneway_pseudo_implicit_context_api, + oneway_pseudo_two_implicit_context_api, + proxy_interface_api, proxy_interface_ipv6_api, + local_interface_api, local_interface_ctx_override_api, + local_interface_acl_override_api, close_connections_api, + close_connections_local_interface_api, + close_connections_local_interface_ctx_override_api, + close_connections_alt_iiop_addr_api, + close_connections_multiple_profiles_api, + multiple_accept_api, max_requests_api, + max_requests_added_api, max_connections_api, + max_packet_size_exceeded_api, max_packet_size_ok_api, + light_ifr_api, multi_pseudo_orber_api, multi_orber_api, + light_orber_api, light_orber2_api, basic_PI_api, + iiop_timeout_api, iiop_timeout_added_api, + setup_connection_timeout_api, + setup_multi_connection_timeout_api, + setup_multi_connection_timeout_attempts_api, + setup_multi_connection_timeout_random_api, + ssl_1_multi_orber_api, + ssl_1_multi_orber_generation_3_api, + ssl_2_multi_orber_api, + ssl_2_multi_orber_generation_3_api, + ssl_reconfigure_generation_3_api, ssl_reconfigure_api]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl index d9b0f8448b..d9a78861ed 100644 --- a/lib/orber/test/naming_context_SUITE.erl +++ b/lib/orber/test/naming_context_SUITE.erl @@ -43,7 +43,8 @@ -export([name_context/1, check_list/1, name_context_ext/1]). --export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). +-export([init_per_suite/1, end_per_suite/1, init_per_testcase/2, + end_per_testcase/2]). %%----------------------------------------------------------------- @@ -78,20 +79,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[name_context, check_list, name_context_ext]. + [name_context, check_list, name_context_ext]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index 679d6f45b5..f481914ccd 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -25,7 +25,8 @@ -define(application, orber). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -38,8 +39,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test, undefined_functions, install_load_order, - install_local_content]. + [app_test, undefined_functions, install_load_order, + install_local_content]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl index f97facddb2..9af85af1ff 100644 --- a/lib/orber/test/orber_acl_SUITE.erl +++ b/lib/orber/test/orber_acl_SUITE.erl @@ -62,17 +62,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, - ipv6_verify, ipv6_range, ipv6_interfaces, ipv6_bm]. + [ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, + ipv6_verify, ipv6_range, ipv6_interfaces, ipv6_bm]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl index 4cdf483b3d..3a18eb534a 100644 --- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl @@ -49,7 +49,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -63,25 +64,25 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. cases() -> -[deny_port_api, deny_port_range_api, deny_host_api, - deny_peerhost_api, allow_port_range_api, allow_host_api, - allow_peerhost_api, check_address_api]. + [deny_port_api, deny_port_range_api, deny_host_api, + deny_peerhost_api, allow_port_range_api, allow_host_api, + allow_peerhost_api, check_address_api]. init_per_testcase(_Case, Config) -> diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl index a88b2281aa..986cb4549b 100644 --- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl @@ -49,7 +49,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -63,25 +64,25 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. cases() -> -[deny_port_api, deny_port_range_api, deny_host_api, - allow_port_api, allow_port_range_api, allow_host_api, - local_interface_api]. + [deny_port_api, deny_port_range_api, deny_host_api, + allow_port_api, allow_port_range_api, allow_host_api, + local_interface_api]. init_per_testcase(_Case, Config) -> diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl index 7df27a9478..aefd0bcd39 100644 --- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl @@ -49,7 +49,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, deny_peerhost_api/1, allow_port_range_api/1, @@ -63,25 +64,25 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. cases() -> -[deny_port_api, deny_port_range_api, deny_host_api, - deny_peerhost_api, allow_port_range_api, allow_host_api, - allow_peerhost_api, check_address_api]. + [deny_port_api, deny_port_range_api, deny_host_api, + deny_peerhost_api, allow_port_range_api, allow_host_api, + allow_peerhost_api, check_address_api]. init_per_testcase(_Case, Config) -> diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl index 40ae509b90..bcf347dbc7 100644 --- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl @@ -49,7 +49,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, deny_port_api/1, deny_port_range_api/1, deny_host_api/1, allow_port_api/1, allow_port_range_api/1, allow_host_api/1, @@ -63,25 +64,25 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% NOTE - the fragment test cases must bu first since we explicitly set a request %% id. Otherwise, the request-id counter would be increased and we cannot know %% what it is. cases() -> -[deny_port_api, deny_port_range_api, deny_host_api, - allow_port_api, allow_port_range_api, allow_host_api, - local_interface_api]. + [deny_port_api, deny_port_range_api, deny_host_api, + allow_port_api, allow_port_range_api, allow_host_api, + local_interface_api]. init_per_testcase(_Case, Config) -> diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index 8d687aa961..818b67fd8a 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -50,7 +50,8 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, cases/0, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2, nat_ip_address/1, nat_ip_address_multiple/1, nat_ip_address_local/1, nat_ip_address_local_local/1, @@ -71,24 +72,24 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -cases(). + cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. cases() -> -[nat_ip_address, nat_ip_address_multiple, - nat_ip_address_local, nat_iiop_port, - nat_iiop_port_local, nat_ip_address_local_local, - nat_iiop_port_local_local, nat_iiop_ssl_port, - nat_iiop_ssl_port_local]. + [nat_ip_address, nat_ip_address_multiple, + nat_ip_address_local, nat_iiop_port, + nat_iiop_port_local, nat_ip_address_local_local, + nat_iiop_port_local_local, nat_iiop_ssl_port, + nat_iiop_ssl_port_local]. %%----------------------------------------------------------------- %% Init and cleanup functions. diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index 67bef737c2..2c11cf2c21 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -65,12 +65,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -81,9 +81,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[menu, configure, info, nameservice, ifr_select, - ifr_data, create, delete_ctx, add_ctx, delete_obj, - server]. + [menu, configure, info, nameservice, ifr_select, + ifr_data, create, delete_ctx, add_ctx, delete_obj, + server]. groups() -> []. @@ -95,10 +95,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index f1ac9f4ff8..0ae4d989b0 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -128,12 +128,12 @@ %%----------------------------------------------------------------- %% External exports %%----------------------------------------------------------------- --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%----------------------------------------------------------------- %% Internal exports %%----------------------------------------------------------------- --export([]). -compile(export_all). %%----------------------------------------------------------------- @@ -144,12 +144,12 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[null, void, short, ushort, long, ulong, longlong, - ulonglong, boolean, char, wchar, octet, float, double, - longdouble, any, typecode, principal, object_reference, - struct, union, enum, string, wstring, sequence, array, - alias, exception, fixed, value, value_box, native, - abstract_interface, indirection, get_tc]. + [null, void, short, ushort, long, ulong, longlong, + ulonglong, boolean, char, wchar, octet, float, double, + longdouble, any, typecode, principal, object_reference, + struct, union, enum, string, wstring, sequence, array, + alias, exception, fixed, value, value_box, native, + abstract_interface, indirection, get_tc]. groups() -> []. @@ -161,10 +161,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------- -- cgit v1.2.3 From afd8d827f9d1dd3c2a58a29ce3e102b21b8aa6ed Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:04:13 +0100 Subject: Fix formatting for os_mon --- lib/os_mon/test/cpu_sup_SUITE.erl | 26 ++++++++++++++++---------- lib/os_mon/test/disksup_SUITE.erl | 20 ++++++++++---------- lib/os_mon/test/memsup_SUITE.erl | 24 ++++++++++++------------ lib/os_mon/test/os_mon_SUITE.erl | 15 ++++++++------- lib/os_mon/test/os_mon_mib_SUITE.erl | 31 ++++++++++++++++--------------- lib/os_mon/test/os_sup_SUITE.erl | 20 ++++++++++---------- 6 files changed, 72 insertions(+), 64 deletions(-) diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 95c17e61a4..73dc901e8a 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -41,10 +41,16 @@ end_per_suite(Config) when is_list(Config) -> ?line ok = application:stop(os_mon), Config. +init_per_testcase(unavailable, Config) -> + terminate(Config), + init_per_testcase(dummy, Config); init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. +end_per_testcase(unavailable, Config) -> + restart(Config), + end_per_testcase(dummy, Config); end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), @@ -53,23 +59,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:os_type() of - {unix, sunos} -> - [load_api, util_api, util_values, port, unavailable]; - {unix, linux} -> - [load_api, util_api, util_values, port, unavailable]; - {unix, _OSname} -> [load_api]; - _OS -> [unavailable] -end. + case test_server:os_type() of + {unix, sunos} -> + [load_api, util_api, util_values, port, unavailable]; + {unix, linux} -> + [load_api, util_api, util_values, port, unavailable]; + {unix, _OSname} -> [load_api]; + _OS -> [unavailable] + end. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. load_api(suite) -> diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index f33bde21c6..f7fa5bb237 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -53,23 +53,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -Bugs = [otp_5910], - case test_server:os_type() of - {unix, sunos} -> - [api, config, alarm, port, unavailable] ++ Bugs; - {unix, _OSname} -> [api, alarm] ++ Bugs; - {win32, _OSname} -> [api, alarm] ++ Bugs; - _OS -> [unavailable] -end. + Bugs = [otp_5910], + case test_server:os_type() of + {unix, sunos} -> + [api, config, alarm, port, unavailable] ++ Bugs; + {unix, _OSname} -> [api, alarm] ++ Bugs; + {win32, _OSname} -> [api, alarm] ++ Bugs; + _OS -> [unavailable] + end. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. api(suite) -> diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index 96748990de..d3aaa64233 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -52,25 +52,25 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -All = case test_server:os_type() of - {unix, sunos} -> - [api, alarm1, alarm2, process, config, timeout, - unavailable, port]; - {unix, linux} -> - [api, alarm1, alarm2, process, timeout]; - _OS -> [api, alarm1, alarm2, process] - end, - Bugs = [otp_5910], - All ++ Bugs. + All = case test_server:os_type() of + {unix, sunos} -> + [api, alarm1, alarm2, process, config, timeout, + unavailable, port]; + {unix, linux} -> + [api, alarm1, alarm2, process, timeout]; + _OS -> [api, alarm1, alarm2, process] + end, + Bugs = [otp_5910], + All ++ Bugs. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. api(suite) -> diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index ac11475789..a2f5317daf 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -41,10 +42,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:os_type() of - {unix, sunos} -> [app_file, config]; - _OS -> [app_file] -end. + case test_server:os_type() of + {unix, sunos} -> [app_file, config]; + _OS -> [app_file] + end. groups() -> []. @@ -56,10 +57,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. app_file(suite) -> diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl index 8529cf5e0e..5d3ac4b7bd 100644 --- a/lib/os_mon/test/os_mon_mib_SUITE.erl +++ b/lib/os_mon/test/os_mon_mib_SUITE.erl @@ -30,7 +30,8 @@ -endif. % Test server specific exports --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). @@ -80,27 +81,27 @@ end_per_testcase(_Case, Config) when is_list(Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[load_unload, get_mem_sys_mark, get_mem_proc_mark, - get_disk_threshold, get_load_table, - {group, get_next_load_table}, get_disk_table, - {group, get_next_disk_table}, real_snmp_request, - update_load_table, {group, tickets}]. + [load_unload, get_mem_sys_mark, get_mem_proc_mark, + get_disk_threshold, get_load_table, + {group, get_next_load_table}, get_disk_table, + {group, get_next_disk_table}, real_snmp_request, + update_load_table, {group, tickets}]. groups() -> [{tickets, [], [otp_6351, otp_7441]}, - {get_next_load_table, [], - [sys_tot_mem, sys_used_mem, large_erl_process, - large_erl_process_mem, cpu_load, cpu_load5, cpu_load15, - os_wordsize, sys_tot_mem64, sys_used_mem64, - large_erl_process_mem64]}, - {get_next_disk_table, [], - [disk_descr, disk_kbytes, disk_capacity]}]. + {get_next_load_table, [], + [sys_tot_mem, sys_used_mem, large_erl_process, + large_erl_process_mem, cpu_load, cpu_load5, cpu_load15, + os_wordsize, sys_tot_mem64, sys_used_mem64, + large_erl_process_mem64]}, + {get_next_disk_table, [], + [disk_descr, disk_kbytes, disk_capacity]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index 878efedd49..c606001dbd 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -66,23 +66,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:os_type() of - {unix, sunos} -> [message, config, port]; - {win32, _OSname} -> [message]; - OS -> - Str = io_lib:format("os_sup not available for ~p", - [OS]), - {skip, lists:flatten(Str)} -end. + case test_server:os_type() of + {unix, sunos} -> [message, config, port]; + {win32, _OSname} -> [message]; + OS -> + Str = io_lib:format("os_sup not available for ~p", + [OS]), + {skip, lists:flatten(Str)} + end. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. message(suite) -> -- cgit v1.2.3 From 1d8922df60645e0ba374ff62a4774c7bc71f4701 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:05:19 +0100 Subject: Fix formatting for parsetools --- lib/parsetools/test/leex_SUITE.erl | 18 +++++++++------- lib/parsetools/test/yecc_SUITE.erl | 44 ++++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index 23ecc265e9..d57a2acf76 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -35,12 +35,14 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([ - file/1, compile/1, syntax/1, - - pt/1, man/1, ex/1, ex2/1, not_yet/1]). + file/1, compile/1, syntax/1, + + pt/1, man/1, ex/1, ex2/1, not_yet/1]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -57,11 +59,11 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, checks}, {group, examples}]. + [{group, checks}, {group, examples}]. groups() -> [{checks, [], [file, compile, syntax]}, - {examples, [], [pt, man, ex, ex2, not_yet]}]. + {examples, [], [pt, man, ex, ex2, not_yet]}]. init_per_suite(Config) -> Config. @@ -70,10 +72,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index 8d6643590e..961fc0b05f 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -34,19 +34,21 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([app_test/1, - - file/1, syntax/1, compile/1, rules/1, expect/1, - conflicts/1, - - empty/1, prec/1, yeccpre/1, lalr/1, old_yecc/1, - other_examples/1, - - otp_5369/1, otp_6362/1, otp_7945/1, otp_8483/1, otp_8486/1, - - otp_7292/1, otp_7969/1, otp_8919/1]). + + file/1, syntax/1, compile/1, rules/1, expect/1, + conflicts/1, + + empty/1, prec/1, yeccpre/1, lalr/1, old_yecc/1, + other_examples/1, + + otp_5369/1, otp_6362/1, otp_7945/1, otp_8483/1, otp_8486/1, + + otp_7292/1, otp_7969/1, otp_8919/1]). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -63,17 +65,17 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test, {group, checks}, {group, examples}, - {group, bugs}, {group, improvements}]. + [app_test, {group, checks}, {group, examples}, + {group, bugs}, {group, improvements}]. groups() -> [{checks, [], - [file, syntax, compile, rules, expect, conflicts]}, - {examples, [], - [empty, prec, yeccpre, lalr, old_yecc, other_examples]}, - {bugs, [], - [otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]}, - {improvements, [], [otp_7292, otp_7969]}]. + [file, syntax, compile, rules, expect, conflicts]}, + {examples, [], + [empty, prec, yeccpre, lalr, old_yecc, other_examples]}, + {bugs, [], + [otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]}, + {improvements, [], [otp_7292, otp_7969, otp_8919]}]. init_per_suite(Config) -> Config. @@ -82,10 +84,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. app_test(doc) -> -- cgit v1.2.3 From 152ce188b90264483beb806a5c7842bb9e75162d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:05:57 +0100 Subject: Fix formatting for percept --- lib/percept/test/egd_SUITE.erl | 10 +++++----- lib/percept/test/percept_SUITE.erl | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl index c8e01f39e2..948d12a7dd 100644 --- a/lib/percept/test/egd_SUITE.erl +++ b/lib/percept/test/egd_SUITE.erl @@ -57,18 +57,18 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[image_create_and_destroy, image_shape, - image_primitives, image_colors, image_font, - image_png_compliant]. + [image_create_and_destroy, image_shape, + image_primitives, image_colors, image_font, + image_png_compliant]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%---------------------------------------------------------------------- diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index f2b51fa7f2..9909f1ff53 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -54,16 +54,16 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[webserver, profile, analyze, analyze_dist]. + [webserver, profile, analyze, analyze_dist]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%---------------------------------------------------------------------- -- cgit v1.2.3 From a65afc5fd99abc80d8f4b574ef524c5177f14bfb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:06:49 +0100 Subject: Fix formatting for public_key --- lib/public_key/test/pkits_SUITE.erl | 14 +++++++------- lib/public_key/test/public_key_SUITE.erl | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index c181f33dab..c0a09d076a 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -46,20 +46,20 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[signature_verification, validity_periods, - verifying_name_chaining, - verifying_paths_with_self_issued_certificates, - verifying_basic_constraints, key_usage, - name_constraints, private_certificate_extensions]. + [signature_verification, validity_periods, + verifying_name_chaining, + verifying_paths_with_self_issued_certificates, + verifying_basic_constraints, key_usage, + name_constraints, private_certificate_extensions]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. signature_verification(doc) -> [""]; diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 158916cb46..e56f117e83 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -102,17 +102,17 @@ end_per_testcase(_TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app, pk_decode_encode, encrypt_decrypt, sign_verify, - pkix, pkix_path_validation, deprecated]. + [app, pk_decode_encode, encrypt_decrypt, sign_verify, + pkix, pkix_path_validation, deprecated]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. -- cgit v1.2.3 From fa7fe1234c3eb2c27509222d2c012dce58530108 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:07:44 +0100 Subject: Fix formatting for reltool --- lib/reltool/test/reltool_app_SUITE.erl | 6 +++--- lib/reltool/test/reltool_server_SUITE.erl | 13 +++++++------ lib/reltool/test/reltool_wx_SUITE.erl | 9 +++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index 4b020daa19..45709f8e7b 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -63,16 +63,16 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[fields, modules, export_all, app_depend, undef_funcs]. + [fields, modules, export_all, app_depend, undef_funcs]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 49ae4d9425..46374972bc 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -18,7 +18,8 @@ -module(reltool_server_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -49,18 +50,18 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_server, set_config, create_release, - create_script, create_target, create_embedded, - create_standalone, create_old_target]. + [start_server, set_config, create_release, + create_script, create_target, create_embedded, + create_standalone, create_old_target]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index a5e33dd6a7..f34df78fc0 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -18,7 +18,8 @@ -module(reltool_wx_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -41,16 +42,16 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_all_windows]. + [start_all_windows]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases -- cgit v1.2.3 From 8d5f835313d6220f243575a57ec9b02b1ebcb91b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:08:39 +0100 Subject: Fix formatting for runtime_tools --- lib/runtime_tools/test/dbg_SUITE.erl | 16 +++++----- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 10 +++--- lib/runtime_tools/test/inviso_SUITE.erl | 36 +++++++++++----------- lib/runtime_tools/test/runtime_tools_SUITE.erl | 9 +++--- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index 5272c3bb4d..8f31252aa5 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -19,7 +19,9 @@ -module(dbg_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, big/1, tiny/1, simple/1, message/1, distributed/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + big/1, tiny/1, simple/1, message/1, distributed/1, ip_port/1, file_port/1, file_port2/1, file_port_schedfix/1, ip_port_busy/1, wrap_port/1, wrap_port_time/1, with_seq_trace/1, dead_suspend/1, local_trace/1, @@ -42,10 +44,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[big, tiny, simple, message, distributed, ip_port, - file_port, file_port2, file_port_schedfix, ip_port_busy, - wrap_port, wrap_port_time, with_seq_trace, dead_suspend, - local_trace, saved_patterns]. + [big, tiny, simple, message, distributed, ip_port, + file_port, file_port2, file_port_schedfix, ip_port_busy, + wrap_port, wrap_port_time, with_seq_trace, dead_suspend, + local_trace, saved_patterns]. groups() -> []. @@ -57,10 +59,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. big(suite) -> []; diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index 0f141cffed..0af2fb5c5b 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -24,7 +24,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). %% Testcases -export([basic/1]). @@ -37,7 +39,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic]. + [basic]. groups() -> []. @@ -49,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_list(Config) -> diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index b07a70afa8..348813c739 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -37,31 +37,31 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic_dist_trace_1, basic_dist_trace_2, - basic_dist_trace_3, basic_dist_trace_ti_1, - basic_dist_trace_ti_2, basic_dist_trace_ti_3, - suspend_dist_trace_ti_1, suspend_dist_trace_ti_2, - meta_cleanfunc_dist_1, basic_handlerfun_dist_1, - delete_log_dist_1, autostart_dist_1, autostart_dist_2, - autostart_dist_3, running_alone_dist_1, - running_alone_dist_2, running_alone_dist_3, - running_alone_dist_4, running_alone_dist_5, - overload_dist_1, overload_dist_2, overload_dist_3, - overload_dist_4, overload_dist_5, subscribe_dist_1, - lfm_trace_dist_1, lfm_trace_ti_dist_2, - handle_logfile_sort_wrapset, fetch_log_dist_trace_1, - fetch_log_dist_trace_2, fetch_log_dist_trace_3, - fetch_log_dist_error_1, fetch_log_dist_error_2, - expand_regexp_dist_1, only_loaded_dist_1]. + [basic_dist_trace_1, basic_dist_trace_2, + basic_dist_trace_3, basic_dist_trace_ti_1, + basic_dist_trace_ti_2, basic_dist_trace_ti_3, + suspend_dist_trace_ti_1, suspend_dist_trace_ti_2, + meta_cleanfunc_dist_1, basic_handlerfun_dist_1, + delete_log_dist_1, autostart_dist_1, autostart_dist_2, + autostart_dist_3, running_alone_dist_1, + running_alone_dist_2, running_alone_dist_3, + running_alone_dist_4, running_alone_dist_5, + overload_dist_1, overload_dist_2, overload_dist_3, + overload_dist_4, overload_dist_5, subscribe_dist_1, + lfm_trace_dist_1, lfm_trace_ti_dist_2, + handle_logfile_sort_wrapset, fetch_log_dist_trace_1, + fetch_log_dist_trace_2, fetch_log_dist_trace_3, + fetch_log_dist_error_1, fetch_log_dist_error_2, + expand_regexp_dist_1, only_loaded_dist_1]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 030f72a255..61b1d79e54 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -41,7 +42,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_file]. + [app_file]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. app_file(suite) -> -- cgit v1.2.3 From 1578d8084f6a4b6c61057425ed1baaf744f274b7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:33:00 +0100 Subject: Fix formatting for ssl --- lib/ssl/test/old_ssl_active_SUITE.erl | 37 ++--- lib/ssl/test/old_ssl_active_once_SUITE.erl | 39 +++--- lib/ssl/test/old_ssl_dist_SUITE.erl | 6 +- lib/ssl/test/old_ssl_misc_SUITE.erl | 29 ++-- lib/ssl/test/old_ssl_passive_SUITE.erl | 37 ++--- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 29 ++-- lib/ssl/test/old_ssl_protocol_SUITE.erl | 32 ++--- lib/ssl/test/old_ssl_verify_SUITE.erl | 29 ++-- lib/ssl/test/old_transport_accept_SUITE.erl | 9 +- lib/ssl/test/ssl_basic_SUITE.erl | 206 ++++++++++++++++++++++++++-- lib/ssl/test/ssl_packet_SUITE.erl | 78 +++++------ lib/ssl/test/ssl_payload_SUITE.erl | 26 ++-- lib/ssl/test/ssl_session_cache_SUITE.erl | 4 +- lib/ssl/test/ssl_to_openssl_SUITE.erl | 52 +++---- 14 files changed, 372 insertions(+), 241 deletions(-) diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index 98e426435d..096794ec54 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_active_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, cinit_return_chkclose/1, sinit_return_chkclose/1, cinit_big_return_chkclose/1, @@ -56,34 +55,28 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cinit_return_chkclose, sinit_return_chkclose, - cinit_big_return_chkclose, sinit_big_return_chkclose, - cinit_big_echo_chkclose, cinit_huge_echo_chkclose, - sinit_big_echo_chkclose, cinit_few_echo_chkclose, - cinit_many_echo_chkclose, cinit_cnocert]. + [cinit_return_chkclose, sinit_return_chkclose, + cinit_big_return_chkclose, sinit_big_return_chkclose, + cinit_big_echo_chkclose, cinit_huge_echo_chkclose, + sinit_big_echo_chkclose, cinit_few_echo_chkclose, + cinit_many_echo_chkclose, cinit_cnocert]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains, and record the number of available " "file descriptors"; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), case os:type() of {unix, _} -> @@ -104,11 +97,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. cinit_return_chkclose(doc) -> diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 51fb1d913a..16b323e26a 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_active_once_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, server_accept_timeout/1, cinit_return_chkclose/1, sinit_return_chkclose/1, @@ -56,34 +55,28 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[server_accept_timeout, cinit_return_chkclose, - sinit_return_chkclose, cinit_big_return_chkclose, - sinit_big_return_chkclose, cinit_big_echo_chkclose, - cinit_huge_echo_chkclose, sinit_big_echo_chkclose, - cinit_few_echo_chkclose, cinit_many_echo_chkclose, - cinit_cnocert]. + [server_accept_timeout, cinit_return_chkclose, + sinit_return_chkclose, cinit_big_return_chkclose, + sinit_big_return_chkclose, cinit_big_echo_chkclose, + cinit_huge_echo_chkclose, sinit_big_echo_chkclose, + cinit_few_echo_chkclose, cinit_many_echo_chkclose, + cinit_cnocert]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -96,11 +89,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. server_accept_timeout(doc) -> diff --git a/lib/ssl/test/old_ssl_dist_SUITE.erl b/lib/ssl/test/old_ssl_dist_SUITE.erl index e40ac4d594..19a339e81d 100644 --- a/lib/ssl/test/old_ssl_dist_SUITE.erl +++ b/lib/ssl/test/old_ssl_dist_SUITE.erl @@ -49,16 +49,16 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic]. + [basic]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_suite(Config) -> diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index 8c77b46f88..039f766d96 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_misc_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, seed/1, app/1 ]). @@ -47,29 +46,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[seed, app]. + [seed, app]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -82,11 +75,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. seed(doc) -> diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index 5bc13c2f44..80dee2899d 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_passive_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, + end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, server_accept_timeout/1, cinit_return_chkclose/1, sinit_return_chkclose/1, @@ -56,33 +55,27 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[server_accept_timeout, cinit_return_chkclose, - sinit_return_chkclose, cinit_big_return_chkclose, - sinit_big_return_chkclose, cinit_big_echo_chkclose, - sinit_big_echo_chkclose, cinit_few_echo_chkclose, - cinit_many_echo_chkclose, cinit_cnocert]. + [server_accept_timeout, cinit_return_chkclose, + sinit_return_chkclose, cinit_big_return_chkclose, + sinit_big_return_chkclose, cinit_big_echo_chkclose, + sinit_big_echo_chkclose, cinit_few_echo_chkclose, + cinit_many_echo_chkclose, cinit_cnocert]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -95,11 +88,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. server_accept_timeout(doc) -> diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index 3ce155943f..9e9838cf44 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_peer_cert_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, cinit_plain/1, cinit_both_verify/1, cinit_cnocert/1 @@ -47,29 +46,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cinit_plain, cinit_both_verify, cinit_cnocert]. + [cinit_plain, cinit_both_verify, cinit_cnocert]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -82,11 +75,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. cinit_plain(doc) -> diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index 30a7727f49..0a30c4702b 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -20,8 +20,10 @@ %% -module(old_ssl_protocol_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, - finish/1, sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, + sslv2/1, sslv3/1, tlsv1/1, sslv2_sslv3/1, sslv2_tlsv1/1, sslv3_tlsv1/1, sslv2_sslv3_tlsv1/1]). -import(ssl_test_MACHINE, [mk_ssl_cert_opts/1, test_one_listener/7, @@ -41,30 +43,24 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, - sslv3_tlsv1, sslv2_sslv3_tlsv1]. + [sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, + sslv3_tlsv1, sslv2_sslv3_tlsv1]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -77,11 +73,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no other purpose than closing the conf case."; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. %%%%% diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index 1e7d02a04c..2cd7d12f9f 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -20,11 +20,10 @@ %% -module(old_ssl_verify_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - config/1, - finish/1, cinit_both_verify/1, cinit_cnocert/1 ]). @@ -46,29 +45,23 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cinit_both_verify, cinit_cnocert]. + [cinit_both_verify, cinit_cnocert]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -config(doc) -> +init_per_suite(doc) -> "Want to se what Config contains."; -config(suite) -> +init_per_suite(suite) -> []; -config(Config) -> +init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped @@ -81,11 +74,11 @@ config(Config) -> end, Config. -finish(doc) -> +end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; -finish(suite) -> +end_per_suite(suite) -> []; -finish(Config) -> +end_per_suite(Config) -> Config. cinit_both_verify(doc) -> diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index 4075154035..bcb994e8ed 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -26,7 +26,8 @@ -define(default_timeout, ?t:minutes(1)). -define(application, ssh). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, config/1, @@ -50,7 +51,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[config, echo_once, echo_twice, close_before_ssl_accept]. + [config, echo_once, echo_twice, close_before_ssl_accept]. groups() -> []. @@ -62,10 +63,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. config(doc) -> diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index e44211b303..b566fea91d 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -88,6 +88,13 @@ end_per_suite(_Config) -> %% variable, but should NOT alter/remove any existing entries. %% Description: Initialization before each test case %%-------------------------------------------------------------------- +init_per_testcase(session_cache_process_list, Config) -> + init_customized_session_cache(list, Config); + +init_per_testcase(session_cache_process_mnesia, Config) -> + mnesia:start(), + init_customized_session_cache(mnesia, Config); + init_per_testcase(reuse_session_expired, Config0) -> Config = lists:keydelete(watchdog, 1, Config0), Dog = ssl_test_lib:timetrap(?EXPIRE * 1000 * 5), @@ -137,6 +144,16 @@ init_per_testcase(_TestCase, Config0) -> Dog = test_server:timetrap(?TIMEOUT), [{watchdog, Dog} | Config]. +init_customized_session_cache(Type, Config0) -> + Config = lists:keydelete(watchdog, 1, Config0), + Dog = test_server:timetrap(?TIMEOUT), + ssl:stop(), + application:load(ssl), + application:set_env(ssl, session_cb, ?MODULE), + application:set_env(ssl, session_cb_init_args, [Type]), + ssl:start(), + [{watchdog, Dog} | Config]. + %%-------------------------------------------------------------------- %% Function: end_per_testcase(TestCase, Config) -> _ %% Case - atom() @@ -145,6 +162,16 @@ init_per_testcase(_TestCase, Config0) -> %% A list of key/value pairs, holding the test case configuration. %% Description: Cleanup after each test case %%-------------------------------------------------------------------- +end_per_testcase(session_cache_process_list, Config) -> + application:unset_env(ssl, session_cb), + end_per_testcase(default_action, Config); +end_per_testcase(session_cache_process_mnesia, Config) -> + application:unset_env(ssl, session_cb), + application:unset_env(ssl, session_cb_init_args), + mnesia:stop(), + ssl:stop(), + ssl:start(), + end_per_testcase(default_action, Config); end_per_testcase(reuse_session_expired, Config) -> application:unset_env(ssl, session_lifetime), end_per_testcase(default_action, Config); @@ -229,10 +256,10 @@ groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. %%-------------------------------------------------------------------- @@ -1074,6 +1101,8 @@ dummy(_Socket) -> exit(kill). %%-------------------------------------------------------------------- +ipv6() -> + [{require, ipv6_hosts}]. ipv6(doc) -> ["Test ipv6."]; ipv6(suite) -> @@ -1081,7 +1110,7 @@ ipv6(suite) -> ipv6(Config) when is_list(Config) -> {ok, Hostname0} = inet:gethostname(), - case lists:member(list_to_atom(Hostname0), ?config(ipv6_hosts, Config)) of + case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of true -> ClientOpts = ?config(client_opts, Config), ServerOpts = ?config(server_opts, Config), @@ -3292,17 +3321,6 @@ reuseaddr(Config) when is_list(Config) -> %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- -erlang_ssl_receive(Socket, Data) -> - receive - {ssl, Socket, Data} -> - test_server:format("Received ~p~n",[Data]), - ok; - Other -> - test_server:fail({unexpected_message, Other}) - after ?SLEEP * 3 -> - test_server:fail({did_not_get, Data}) - end. - send_recv_result(Socket) -> ssl:send(Socket, "Hello world"), {ok,"Hello world"} = ssl:recv(Socket, 11), @@ -3342,7 +3360,6 @@ renegotiate_reuse_session(Socket, Data) -> test_server:sleep(?SLEEP), renegotiate(Socket, Data). - new_config(PrivDir, ServerOpts0) -> CaCertFile = proplists:get_value(cacertfile, ServerOpts0), CertFile = proplists:get_value(certfile, ServerOpts0), @@ -3362,3 +3379,162 @@ new_config(PrivDir, ServerOpts0) -> [{cacertfile, NewCaCertFile}, {certfile, NewCertFile}, {keyfile, NewKeyFile} | ServerOpts]. + +session_cache_process_list(doc) -> + ["Test reuse of sessions (short handshake)"]; + +session_cache_process_list(suite) -> + []; +session_cache_process_list(Config) when is_list(Config) -> + session_cache_process(list,Config). + +session_cache_process_mnesia(doc) -> + ["Test reuse of sessions (short handshake)"]; + +session_cache_process_mnesia(suite) -> + []; +session_cache_process_mnesia(Config) when is_list(Config) -> + session_cache_process(mnesia,Config). + +session_cache_process(Type,Config) when is_list(Config) -> + reuse_session(Config). + +init([Type]) -> + ets:new(ssl_test, [named_table, public, set]), + ets:insert(ssl_test, {type, Type}), + case Type of + list -> + spawn(fun() -> session_loop([]) end); + mnesia -> + mnesia:start(), + {atomic,ok} = mnesia:create_table(sess_cache, []), + sess_cache + end. + +session_cb() -> + [{type, Type}] = ets:lookup(ssl_test, type), + Type. + +terminate(Cache) -> + case session_cb() of + list -> + Cache ! terminate; + mnesia -> + catch {atomic,ok} = + mnesia:delete_table(sess_cache) + end. + +lookup(Cache, Key) -> + case session_cb() of + list -> + Cache ! {self(), lookup, Key}, + receive {Cache, Res} -> Res end; + mnesia -> + case mnesia:transaction(fun() -> + mnesia:read(sess_cache, + Key, read) + end) of + {atomic, [{sess_cache, Key, Value}]} -> + Value; + _ -> + undefined + end + end. + +update(Cache, Key, Value) -> + case session_cb() of + list -> + Cache ! {update, Key, Value}; + mnesia -> + {atomic, ok} = + mnesia:transaction(fun() -> + mnesia:write(sess_cache, + {sess_cache, Key, Value}, write) + end) + end. + +delete(Cache, Key) -> + case session_cb() of + list -> + Cache ! {delete, Key}; + mnesia -> + {atomic, ok} = + mnesia:transaction(fun() -> + mnesia:delete(sess_cache, Key) + end) + end. + +foldl(Fun, Acc, Cache) -> + case session_cb() of + list -> + Cache ! {self(),foldl,Fun,Acc}, + receive {Cache, Res} -> Res end; + mnesia -> + Foldl = fun() -> + mnesia:foldl(Fun, Acc, sess_cache) + end, + {atomic, Res} = mnesia:transaction(Foldl), + Res + end. + +select_session(Cache, PartialKey) -> + case session_cb() of + list -> + Cache ! {self(),select_session, PartialKey}, + receive + {Cache, Res} -> + Res + end; + mnesia -> + Sel = fun() -> + mnesia:select(Cache, + [{{sess_cache,{PartialKey,'$1'}, '$2'}, + [],['$$']}]) + end, + {atomic, Res} = mnesia:transaction(Sel), + Res + end. + +session_loop(Sess) -> + receive + terminate -> + ok; + {Pid, lookup, Key} -> + case lists:keysearch(Key,1,Sess) of + {value, {Key,Value}} -> + Pid ! {self(), Value}; + _ -> + Pid ! {self(), undefined} + end, + session_loop(Sess); + {update, Key, Value} -> + NewSess = [{Key,Value}| lists:keydelete(Key,1,Sess)], + session_loop(NewSess); + {delete, Key} -> + session_loop(lists:keydelete(Key,1,Sess)); + {Pid,foldl,Fun,Acc} -> + Res = lists:foldl(Fun, Acc,Sess), + Pid ! {self(), Res}, + session_loop(Sess); + {Pid,select_session,PKey} -> + Sel = fun({{PKey0, Id},Session}, Acc) when PKey == PKey0 -> + [[Id, Session]|Acc]; + (_,Acc) -> + Acc + end, + Sessions = lists:foldl(Sel, [], Sess), + Pid ! {self(), Sessions}, + session_loop(Sess) + end. + + +erlang_ssl_receive(Socket, Data) -> + receive + {ssl, Socket, Data} -> + io:format("Received ~p~n",[Data]), + ok; + Other -> + test_server:fail({unexpected_message, Other}) + after ?SLEEP * 3 -> + test_server:fail({did_not_get, Data}) + end. diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index a2f94f83b9..64b80233f7 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -121,52 +121,52 @@ end_per_testcase(_TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[packet_raw_passive_many_small, - packet_0_passive_many_small, - packet_1_passive_many_small, - packet_2_passive_many_small, - packet_4_passive_many_small, - packet_raw_passive_some_big, packet_0_passive_some_big, - packet_1_passive_some_big, packet_2_passive_some_big, - packet_4_passive_some_big, - packet_raw_active_once_many_small, - packet_0_active_once_many_small, - packet_1_active_once_many_small, - packet_2_active_once_many_small, - packet_4_active_once_many_small, - packet_raw_active_once_some_big, - packet_0_active_once_some_big, - packet_1_active_once_some_big, - packet_2_active_once_some_big, - packet_4_active_once_some_big, - packet_raw_active_many_small, - packet_0_active_many_small, packet_1_active_many_small, - packet_2_active_many_small, packet_4_active_many_small, - packet_raw_active_some_big, packet_0_active_some_big, - packet_1_active_some_big, packet_2_active_some_big, - packet_4_active_some_big, packet_send_to_large, - packet_wait_passive, packet_wait_active, - packet_baddata_passive, packet_baddata_active, - packet_size_passive, packet_size_active, - packet_cdr_decode, packet_cdr_decode_list, - packet_http_decode, packet_http_decode_list, - packet_http_bin_decode_multi, packet_http_error_passive, - packet_line_decode, packet_line_decode_list, - packet_asn1_decode, packet_asn1_decode_list, - packet_tpkt_decode, packet_tpkt_decode_list, - packet_sunrm_decode, packet_sunrm_decode_list, - header_decode_one_byte, header_decode_two_bytes, - header_decode_two_bytes_one_sent, - header_decode_two_bytes_two_sent]. + [packet_raw_passive_many_small, + packet_0_passive_many_small, + packet_1_passive_many_small, + packet_2_passive_many_small, + packet_4_passive_many_small, + packet_raw_passive_some_big, packet_0_passive_some_big, + packet_1_passive_some_big, packet_2_passive_some_big, + packet_4_passive_some_big, + packet_raw_active_once_many_small, + packet_0_active_once_many_small, + packet_1_active_once_many_small, + packet_2_active_once_many_small, + packet_4_active_once_many_small, + packet_raw_active_once_some_big, + packet_0_active_once_some_big, + packet_1_active_once_some_big, + packet_2_active_once_some_big, + packet_4_active_once_some_big, + packet_raw_active_many_small, + packet_0_active_many_small, packet_1_active_many_small, + packet_2_active_many_small, packet_4_active_many_small, + packet_raw_active_some_big, packet_0_active_some_big, + packet_1_active_some_big, packet_2_active_some_big, + packet_4_active_some_big, packet_send_to_large, + packet_wait_passive, packet_wait_active, + packet_baddata_passive, packet_baddata_active, + packet_size_passive, packet_size_active, + packet_cdr_decode, packet_cdr_decode_list, + packet_http_decode, packet_http_decode_list, + packet_http_bin_decode_multi, packet_http_error_passive, + packet_line_decode, packet_line_decode_list, + packet_asn1_decode, packet_asn1_decode_list, + packet_tpkt_decode, packet_tpkt_decode_list, + packet_sunrm_decode, packet_sunrm_decode_list, + header_decode_one_byte, header_decode_two_bytes, + header_decode_two_bytes_one_sent, + header_decode_two_bytes_two_sent]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index 36eabff202..8f0553b445 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -102,26 +102,26 @@ end_per_testcase(_TestCase, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[server_echos_passive_small, - server_echos_active_once_small, - server_echos_active_small, client_echos_passive_small, - client_echos_active_once_small, - client_echos_active_small, server_echos_passive_big, - server_echos_active_once_big, server_echos_active_big, - client_echos_passive_big, client_echos_active_once_big, - client_echos_active_big, server_echos_passive_huge, - server_echos_active_once_huge, server_echos_active_huge, - client_echos_passive_huge, - client_echos_active_once_huge, client_echos_active_huge]. + [server_echos_passive_small, + server_echos_active_once_small, + server_echos_active_small, client_echos_passive_small, + client_echos_active_once_small, + client_echos_active_small, server_echos_passive_big, + server_echos_active_once_big, server_echos_active_big, + client_echos_passive_big, client_echos_active_once_big, + client_echos_active_big, server_echos_passive_huge, + server_echos_active_once_huge, server_echos_active_huge, + client_echos_passive_huge, + client_echos_active_once_huge, client_echos_active_huge]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index 9ef8c3bc14..f08838db18 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -155,10 +155,10 @@ groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. session_cache_process_list(doc) -> ["Test reuse of sessions (short handshake)"]; diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index b59f1e19d0..e05dab8d87 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -146,39 +146,39 @@ end_per_testcase(_, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[erlang_client_openssl_server, - erlang_server_openssl_client, - tls1_erlang_client_openssl_server_dsa_cert, - tls1_erlang_server_openssl_client_dsa_cert, - ssl3_erlang_client_openssl_server_dsa_cert, - ssl3_erlang_server_openssl_client_dsa_cert, - erlang_server_openssl_client_reuse_session, - erlang_client_openssl_server_renegotiate, - erlang_client_openssl_server_no_wrap_sequence_number, - erlang_server_openssl_client_no_wrap_sequence_number, - erlang_client_openssl_server_no_server_ca_cert, - ssl3_erlang_client_openssl_server, - ssl3_erlang_server_openssl_client, - ssl3_erlang_client_openssl_server_client_cert, - ssl3_erlang_server_openssl_client_client_cert, - ssl3_erlang_server_erlang_client_client_cert, - tls1_erlang_client_openssl_server, - tls1_erlang_server_openssl_client, - tls1_erlang_client_openssl_server_client_cert, - tls1_erlang_server_openssl_client_client_cert, - tls1_erlang_server_erlang_client_client_cert, - ciphers_rsa_signed_certs, ciphers_dsa_signed_certs, - erlang_client_bad_openssl_server, expired_session, - ssl2_erlang_server_openssl_client]. + [erlang_client_openssl_server, + erlang_server_openssl_client, + tls1_erlang_client_openssl_server_dsa_cert, + tls1_erlang_server_openssl_client_dsa_cert, + ssl3_erlang_client_openssl_server_dsa_cert, + ssl3_erlang_server_openssl_client_dsa_cert, + erlang_server_openssl_client_reuse_session, + erlang_client_openssl_server_renegotiate, + erlang_client_openssl_server_no_wrap_sequence_number, + erlang_server_openssl_client_no_wrap_sequence_number, + erlang_client_openssl_server_no_server_ca_cert, + ssl3_erlang_client_openssl_server, + ssl3_erlang_server_openssl_client, + ssl3_erlang_client_openssl_server_client_cert, + ssl3_erlang_server_openssl_client_client_cert, + ssl3_erlang_server_erlang_client_client_cert, + tls1_erlang_client_openssl_server, + tls1_erlang_server_openssl_client, + tls1_erlang_client_openssl_server_client_cert, + tls1_erlang_server_openssl_client_client_cert, + tls1_erlang_server_erlang_client_client_cert, + ciphers_rsa_signed_certs, ciphers_dsa_signed_certs, + erlang_client_bad_openssl_server, expired_session, + ssl2_erlang_server_openssl_client]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Test cases starts here. -- cgit v1.2.3 From ae493322caac4bb5f118f39c8d1c05203c9f6170 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:47:20 +0100 Subject: Fix formatting for stdlib --- lib/stdlib/test/array_SUITE.erl | 19 ++--- lib/stdlib/test/base64_SUITE.erl | 13 ++-- lib/stdlib/test/beam_lib_SUITE.erl | 12 +-- lib/stdlib/test/binary_module_SUITE.erl | 16 ++-- lib/stdlib/test/c_SUITE.erl | 9 ++- lib/stdlib/test/calendar_SUITE.erl | 13 ++-- lib/stdlib/test/dets_SUITE.erl | 8 +- lib/stdlib/test/dict_SUITE.erl | 10 ++- lib/stdlib/test/digraph_SUITE.erl | 13 ++-- lib/stdlib/test/digraph_utils_SUITE.erl | 11 +-- lib/stdlib/test/edlin_expand_SUITE.erl | 13 +++- lib/stdlib/test/epp_SUITE.erl | 7 +- lib/stdlib/test/erl_eval_SUITE.erl | 17 +++-- lib/stdlib/test/erl_expand_records_SUITE.erl | 16 ++-- lib/stdlib/test/erl_internal_SUITE.erl | 9 ++- lib/stdlib/test/erl_lint_SUITE.erl | 74 +++++++++--------- lib/stdlib/test/erl_pp_SUITE.erl | 42 ++++++----- lib/stdlib/test/erl_scan_SUITE.erl | 9 ++- lib/stdlib/test/escript_SUITE.erl | 7 +- lib/stdlib/test/ets_SUITE.erl | 108 +++++++++++++-------------- lib/stdlib/test/ets_tough_SUITE.erl | 9 ++- lib/stdlib/test/file_sorter_SUITE.erl | 19 ++--- lib/stdlib/test/filelib_SUITE.erl | 12 +-- lib/stdlib/test/filename_SUITE.erl | 7 +- lib/stdlib/test/fixtable_SUITE.erl | 13 ++-- lib/stdlib/test/format_SUITE.erl | 9 ++- lib/stdlib/test/gen_event_SUITE.erl | 17 +++-- lib/stdlib/test/gen_fsm_SUITE.erl | 25 +++---- lib/stdlib/test/gen_server_SUITE.erl | 54 +++++++++----- lib/stdlib/test/id_transform_SUITE.erl | 11 +-- lib/stdlib/test/io_SUITE.erl | 17 +++-- lib/stdlib/test/io_proto_SUITE.erl | 24 +++--- lib/stdlib/test/lists_SUITE.erl | 74 +++++++++--------- lib/stdlib/test/log_mf_h_SUITE.erl | 9 ++- lib/stdlib/test/ms_transform_SUITE.erl | 17 +++-- lib/stdlib/test/proc_lib_SUITE.erl | 14 ++-- lib/stdlib/test/qlc_SUITE.erl | 89 +++++++++++----------- lib/stdlib/test/queue_SUITE.erl | 9 ++- lib/stdlib/test/random_SUITE.erl | 9 ++- lib/stdlib/test/re_SUITE.erl | 22 ++++-- lib/stdlib/test/select_SUITE.erl | 14 ++-- lib/stdlib/test/sets_SUITE.erl | 14 ++-- lib/stdlib/test/shell_SUITE.erl | 59 ++++++++------- lib/stdlib/test/slave_SUITE.erl | 9 ++- lib/stdlib/test/sofs_SUITE.erl | 49 ++++++------ lib/stdlib/test/stdlib_SUITE.erl | 9 ++- lib/stdlib/test/string_SUITE.erl | 15 ++-- lib/stdlib/test/supervisor_SUITE.erl | 65 ++++++++-------- lib/stdlib/test/supervisor_bridge_SUITE.erl | 10 ++- lib/stdlib/test/sys_SUITE.erl | 10 ++- lib/stdlib/test/tar_SUITE.erl | 15 ++-- lib/stdlib/test/timer_SUITE.erl | 6 +- lib/stdlib/test/timer_simple_SUITE.erl | 17 +++-- lib/stdlib/test/unicode_SUITE.erl | 13 ++-- lib/stdlib/test/win32reg_SUITE.erl | 20 ++--- lib/stdlib/test/y2k_SUITE.erl | 13 ++-- lib/stdlib/test/zip_SUITE.erl | 15 ++-- 57 files changed, 656 insertions(+), 583 deletions(-) diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index ddeab1d52e..8846e1dd39 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -27,7 +27,8 @@ -define(default_timeout, ?t:seconds(60)). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([ @@ -67,12 +68,12 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[new_test, fix_test, relax_test, resize_test, - set_get_test, to_list_test, sparse_to_list_test, - from_list_test, to_orddict_test, sparse_to_orddict_test, - from_orddict_test, map_test, sparse_map_test, - foldl_test, sparse_foldl_test, foldr_test, - sparse_foldr_test]. + [new_test, fix_test, relax_test, resize_test, + set_get_test, to_list_test, sparse_to_list_test, + from_list_test, to_orddict_test, sparse_to_orddict_test, + from_orddict_test, map_test, sparse_map_test, + foldl_test, sparse_foldl_test, foldr_test, + sparse_foldr_test]. groups() -> []. @@ -84,10 +85,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index 46ba0fb7dc..bf817b6ff9 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -23,7 +23,9 @@ -include("test_server_line.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. -export([base64_encode/1, base64_decode/1, base64_otp_5635/1, @@ -46,8 +48,9 @@ end_per_testcase(_, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[base64_encode, base64_decode, base64_otp_5635, - base64_otp_6279, big, illegal, mime_decode, mime_decode_to_string, roundtrip]. + [base64_encode, base64_decode, base64_otp_5635, + base64_otp_6279, big, illegal, mime_decode, mime_decode_to_string, + roundtrip]. groups() -> []. @@ -59,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index 033786edee..fbde73d4aa 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -32,7 +32,9 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + normal/1, error/1, cmp/1, cmp_literals/1, strip/1, otp_6711/1, building/1, md5/1, encrypted_abstr/1, encrypted_abstr_file/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -40,8 +42,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[error, normal, cmp, cmp_literals, strip, otp_6711, - building, md5, encrypted_abstr, encrypted_abstr_file]. + [error, normal, cmp, cmp_literals, strip, otp_6711, + building, md5, encrypted_abstr, encrypted_abstr_file]. groups() -> []. @@ -53,10 +55,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index d43a7852a4..8874dfd50a 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -18,7 +18,9 @@ %% -module(binary_module_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, interesting/1,random_ref_comp/1,random_ref_sr_comp/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + interesting/1,random_ref_comp/1,random_ref_sr_comp/1, random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1, copy/1, referenced/1,guard/1,encode_decode/1,badargs/1,longest_common_trap/1]). @@ -65,10 +67,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[interesting, random_ref_fla_comp, random_ref_sr_comp, - random_ref_comp, parts, bin_to_list, list_to_bin, copy, - referenced, guard, encode_decode, badargs, - longest_common_trap]. + [interesting, random_ref_fla_comp, random_ref_sr_comp, + random_ref_comp, parts, bin_to_list, list_to_bin, copy, + referenced, guard, encode_decode, badargs, + longest_common_trap]. groups() -> []. @@ -80,10 +82,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(MASK_ERROR(EXPR),mask_error((catch (EXPR)))). diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index 0b9f15745f..badfe56b5b 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(c_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1, memory/1]). @@ -28,7 +29,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. + [c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. groups() -> []. @@ -40,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%% Write output to a directory other than current directory: diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 51676aa688..438a9b4776 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, gregorian_days/1, gregorian_seconds/1, day_of_the_week/1, @@ -35,9 +36,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[gregorian_days, gregorian_seconds, day_of_the_week, - day_of_the_week_calibrate, leap_years, - last_day_of_the_month, local_time_to_universal_time_dst]. + [gregorian_days, gregorian_seconds, day_of_the_week, + day_of_the_week_calibrate, leap_years, + last_day_of_the_month, local_time_to_universal_time_dst]. groups() -> []. @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. gregorian_days(doc) -> diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index 79f7a07b56..1d4cecb18b 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -34,7 +34,9 @@ -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1, newly_started/1, basic_v8/1, basic_v9/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + not_run/1, newly_started/1, basic_v8/1, basic_v9/1, open_v8/1, open_v9/1, sets_v8/1, sets_v9/1, bags_v8/1, bags_v9/1, duplicate_bags_v8/1, duplicate_bags_v9/1, access_v8/1, access_v9/1, dirty_mark/1, dirty_mark2/1, @@ -123,10 +125,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(suite) -> []; not_run(Conf) when is_list(Conf) -> diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index 4c7f0486e7..6884acd2af 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -22,7 +22,9 @@ -module(dict_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, create/1,store/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,7 +34,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[create, store]. + [create, store]. groups() -> []. @@ -44,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index d027e7521d..07be45596e 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -26,7 +26,8 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([opts/1, degree/1, path/1, cycle/1, vertices/1, edges/1, data/1, otp_3522/1, otp_3630/1, otp_8066/1]). @@ -38,12 +39,12 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[opts, degree, path, cycle, {group, misc}, - {group, tickets}]. + [opts, degree, path, cycle, {group, misc}, + {group, tickets}]. groups() -> [{misc, [], [vertices, edges, data]}, - {tickets, [], [otp_3522, otp_3630, otp_8066]}]. + {tickets, [], [otp_3522, otp_3630, otp_8066]}]. init_per_suite(Config) -> Config. @@ -52,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index 03a3cc3166..f3a9d485c2 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -25,7 +25,8 @@ -include_lib("test_server/include/test_server.hrl"). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([simple/1, loop/1, isolated/1, topsort/1, subgraph/1, condensation/1, tree/1]). @@ -36,8 +37,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[simple, loop, isolated, topsort, subgraph, - condensation, tree]. + [simple, loop, isolated, topsort, subgraph, + condensation, tree]. groups() -> []. @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 84d3497020..1332a261ec 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(edlin_expand_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]). @@ -39,22 +40,26 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[normal, quoted_fun, quoted_module, quoted_both]. + [normal, quoted_fun, quoted_module, quoted_both]. groups() -> []. init_per_suite(Config) -> + true = code:delete(expand_test), + true = code:delete(expand_test1), + true = code:delete('ExpandTestCaps'), + true = code:delete('ExpandTestCaps1'), Config. end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. normal(doc) -> diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index fe5a6bdf71..2b5b1cedc8 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(epp_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([rec_1/1, predef_mac/1, upcase_mac_1/1, upcase_mac_2/1, @@ -79,10 +80,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. rec_1(doc) -> ["Recursive macros hang or crash epp (OTP-1398)."]; diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 577ee14e76..1eb6a22e3c 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(erl_eval_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([guard_1/1, guard_2/1, match_pattern/1, @@ -74,11 +75,11 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[guard_1, guard_2, match_pattern, string_plusplus, - pattern_expr, match_bin, guard_3, guard_4, lc, - simple_cases, unary_plus, apply_atom, otp_5269, - otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, - otp_8133, funs, try_catch, eval_expr_5, zero_width]. + [guard_1, guard_2, match_pattern, string_plusplus, + pattern_expr, match_bin, guard_3, guard_4, lc, + simple_cases, unary_plus, apply_atom, otp_5269, + otp_6539, otp_6543, otp_6787, otp_6977, otp_7550, + otp_8133, funs, try_catch, eval_expr_5, zero_width]. groups() -> []. @@ -90,10 +91,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. guard_1(doc) -> ["(OTP-2405)"]; diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index 3410dd52af..bbd4d916cb 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -31,11 +31,13 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([abstract_module/1, attributes/1, expr/1, guard/1, init/1, pattern/1, strict/1, update/1, - otp_5915/1, otp_7931/1, otp_5990/1, + otp_5915/1, otp_7931/1, otp_5990/1, otp_7078/1, otp_7101/1]). % Default timetrap timeout (set in init_per_testcase). @@ -53,12 +55,12 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[abstract_module, attributes, expr, guard, init, - pattern, strict, update, {group, tickets}]. + [abstract_module, attributes, expr, guard, init, + pattern, strict, update, {group, tickets}]. groups() -> [{tickets, [], - [otp_5915, otp_7931, otp_5990, otp_7078, otp_7101]}]. + [otp_5915, otp_7931, otp_5990, otp_7078, otp_7101]}]. init_per_suite(Config) -> Config. @@ -67,10 +69,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. abstract_module(doc) -> diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index 18dabce2ff..dd57f19547 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -18,7 +18,8 @@ %% -module(erl_internal_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([behav/1]). @@ -29,7 +30,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[behav]. + [behav]. groups() -> []. @@ -41,10 +42,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(default_timeout, ?t:minutes(2)). diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index b85ed01601..96abb8c786 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -32,29 +32,32 @@ -define(privdir, ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([ - unused_vars_warn_basic/1, - unused_vars_warn_lc/1, - unused_vars_warn_rec/1, - unused_vars_warn_fun/1, - unused_vars_OTP_4858/1, - export_vars_warn/1, - shadow_vars/1, - unused_import/1, - unused_function/1, - unsafe_vars/1,unsafe_vars2/1, - unsafe_vars_try/1, - guard/1, otp_4886/1, otp_4988/1, otp_5091/1, otp_5276/1, otp_5338/1, - otp_5362/1, otp_5371/1, otp_7227/1, otp_5494/1, otp_5644/1, otp_5878/1, - otp_5917/1, otp_6585/1, otp_6885/1, export_all/1, - bif_clash/1, - behaviour_basic/1, behaviour_multiple/1, - otp_7550/1, - otp_8051/1, - format_warn/1, - on_load_successful/1, on_load_failing/1, too_many_arguments/1 + unused_vars_warn_basic/1, + unused_vars_warn_lc/1, + unused_vars_warn_rec/1, + unused_vars_warn_fun/1, + unused_vars_OTP_4858/1, + export_vars_warn/1, + shadow_vars/1, + unused_import/1, + unused_function/1, + unsafe_vars/1,unsafe_vars2/1, + unsafe_vars_try/1, + guard/1, otp_4886/1, otp_4988/1, otp_5091/1, otp_5276/1, otp_5338/1, + otp_5362/1, otp_5371/1, otp_7227/1, otp_5494/1, otp_5644/1, otp_5878/1, + otp_5917/1, otp_6585/1, otp_6885/1, export_all/1, + bif_clash/1, + behaviour_basic/1, behaviour_multiple/1, + otp_7550/1, + otp_8051/1, + format_warn/1, + on_load_successful/1, on_load_failing/1, + too_many_arguments/1 ]). % Default timetrap timeout (set in init_per_testcase). @@ -72,21 +75,22 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, unused_vars_warn}, export_vars_warn, - shadow_vars, unused_import, unused_function, - unsafe_vars, unsafe_vars2, unsafe_vars_try, guard, - otp_4886, otp_4988, otp_5091, otp_5276, otp_5338, - otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, - otp_5878, otp_5917, otp_6585, otp_6885, export_all, - bif_clash, behaviour_basic, behaviour_multiple, - otp_7550, otp_8051, format_warn, {group, on_load}, too_many_arguments]. + [{group, unused_vars_warn}, export_vars_warn, + shadow_vars, unused_import, unused_function, + unsafe_vars, unsafe_vars2, unsafe_vars_try, guard, + otp_4886, otp_4988, otp_5091, otp_5276, otp_5338, + otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, + otp_5878, otp_5917, otp_6585, otp_6885, export_all, + bif_clash, behaviour_basic, behaviour_multiple, + otp_7550, otp_8051, format_warn, {group, on_load}, + too_many_arguments]. groups() -> [{unused_vars_warn, [], - [unused_vars_warn_basic, unused_vars_warn_lc, - unused_vars_warn_rec, unused_vars_warn_fun, - unused_vars_OTP_4858]}, - {on_load, [], [on_load_successful, on_load_failing]}]. + [unused_vars_warn_basic, unused_vars_warn_lc, + unused_vars_warn_rec, unused_vars_warn_fun, + unused_vars_OTP_4858]}, + {on_load, [], [on_load_successful, on_load_failing]}]. init_per_suite(Config) -> Config. @@ -95,10 +99,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index 5ad522fdef..0ad979da68 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -35,18 +35,20 @@ -define(privdir, ?config(priv_dir, Config)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([ func/1, call/1, recs/1, try_catch/1, if_then/1, - receive_after/1, bits/1, head_tail/1, package/1, - cond1/1, block/1, case1/1, ops/1, messages/1, - old_mnemosyne_syntax/1, - import_export/1, misc_attrs/1, - hook/1, - neg_indent/1, + receive_after/1, bits/1, head_tail/1, package/1, + cond1/1, block/1, case1/1, ops/1, messages/1, + old_mnemosyne_syntax/1, + import_export/1, misc_attrs/1, + hook/1, + neg_indent/1, - otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1, - otp_8473/1, otp_8522/1, otp_8567/1, otp_8664/1]). + otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1, + otp_8473/1, otp_8522/1, otp_8567/1, otp_8664/1]). %% Internal export. -export([ehook/6]). @@ -66,18 +68,18 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, expr}, {group, attributes}, hook, neg_indent, - {group, tickets}]. + [{group, expr}, {group, attributes}, hook, neg_indent, + {group, tickets}]. groups() -> [{expr, [], - [func, call, recs, try_catch, if_then, receive_after, - bits, head_tail, package, cond1, block, case1, ops, - messages, old_mnemosyne_syntax]}, - {attributes, [], [misc_attrs, import_export]}, - {tickets, [], - [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, - otp_8473, otp_8522, otp_8567, otp_8664]}]. + [func, call, recs, try_catch, if_then, receive_after, + bits, head_tail, package, cond1, block, case1, ops, + messages, old_mnemosyne_syntax]}, + {attributes, [], [misc_attrs, import_export]}, + {tickets, [], + [otp_6321, otp_6911, otp_6914, otp_8150, otp_8238, + otp_8473, otp_8522, otp_8567, otp_8664]}]. init_per_suite(Config) -> Config. @@ -86,10 +88,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index aa7843eaaa..bbd704fbea 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(erl_scan_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([ error_1/1, error_2/1, iso88591/1, otp_7810/1]). @@ -58,7 +59,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, error}, iso88591, otp_7810]. + [{group, error}, iso88591, otp_7810]. groups() -> [{error, [], [error_1, error_2]}]. @@ -70,10 +71,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 73c1fb9726..2c2edf1a4e 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -18,7 +18,8 @@ -module(escript_SUITE). -export([ - all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, + all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, basic/1, @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?t:minutes(1)), diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 9e77447fe2..b1a847f331 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -18,7 +18,8 @@ %% -module(ets_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1, privacy/1,privacy_owner/2]). -export([empty/1,badinsert/1]). @@ -31,7 +32,7 @@ -export([slot/1]). -export([ match1/1, match2/1, match_object/1, match_object2/1]). -export([ dups/1, misc1/1, safe_fixtable/1, info/1, tab2list/1]). --export([ tab2file2/1, tabfile_ext1/1, +-export([ tab2file/1, tab2file2/1, tabfile_ext1/1, tabfile_ext2/1, tabfile_ext3/1, tabfile_ext4/1]). -export([ heavy_lookup/1, heavy_lookup_element/1, heavy_concurrent/1]). -export([ lookup_element_mult/1]). @@ -72,7 +73,7 @@ -export([write_concurrency/1, heir/1, give_away/1, setopts/1]). -export([bad_table/1, types/1]). --export([init_per_testcase/2, end_per_testcase/2, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Convenience for manual testing -export([random_test/0]). @@ -112,72 +113,69 @@ end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), wait_for_test_procs(true), test_server:timetrap_cancel(Dog). - - -end_per_suite(_Config) -> - stop_spawn_logger(), - catch erts_debug:set_internal_state(available_internal_state, false). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, new}, {group, insert}, {group, lookup}, - {group, delete}, firstnext, firstnext_concurrent, slot, - {group, match}, t_match_spec_run, - {group, lookup_element}, {group, misc}, {group, files}, - {group, heavy}, ordered, ordered_match, - interface_equality, fixtable_next, fixtable_insert, - rename, rename_unnamed, evil_rename, update_element, - update_counter, evil_update_counter, partly_bound, - match_heavy, {group, fold}, member, t_delete_object, - t_init_table, t_whitebox, t_delete_all_objects, - t_insert_list, t_test_ms, t_select_delete, t_ets_dets, - memory, t_select_reverse, t_bucket_disappears, - select_fail, t_insert_new, t_repair_continuation, - otp_5340, otp_6338, otp_6842_select_1000, otp_7665, - otp_8732, meta_wb, grow_shrink, grow_pseudo_deleted, - shrink_pseudo_deleted, {group, meta_smp}, smp_insert, - smp_fixed_delete, smp_unfix_fix, smp_select_delete, - otp_8166, exit_large_table_owner, - exit_many_large_table_owner, exit_many_tables_owner, - exit_many_many_tables_owner, write_concurrency, heir, - give_away, setopts, bad_table, types]. + [{group, new}, {group, insert}, {group, lookup}, + {group, delete}, firstnext, firstnext_concurrent, slot, + {group, match}, t_match_spec_run, + {group, lookup_element}, {group, misc}, {group, files}, + {group, heavy}, ordered, ordered_match, + interface_equality, fixtable_next, fixtable_insert, + rename, rename_unnamed, evil_rename, update_element, + update_counter, evil_update_counter, partly_bound, + match_heavy, {group, fold}, member, t_delete_object, + t_init_table, t_whitebox, t_delete_all_objects, + t_insert_list, t_test_ms, t_select_delete, t_ets_dets, + memory, t_select_reverse, t_bucket_disappears, + select_fail, t_insert_new, t_repair_continuation, + otp_5340, otp_6338, otp_6842_select_1000, otp_7665, + otp_8732, meta_wb, grow_shrink, grow_pseudo_deleted, + shrink_pseudo_deleted, {group, meta_smp}, smp_insert, + smp_fixed_delete, smp_unfix_fix, smp_select_delete, + otp_8166, exit_large_table_owner, + exit_many_large_table_owner, exit_many_tables_owner, + exit_many_many_tables_owner, write_concurrency, heir, + give_away, setopts, bad_table, types]. groups() -> [{new, [], - [default, setbag, badnew, verybadnew, named, keypos2, - privacy]}, - {insert, [], [empty, badinsert]}, - {lookup, [], [time_lookup, badlookup, lookup_order]}, - {lookup_element, [], [lookup_element_mult]}, - {delete, [], - [delete_elem, delete_tab, delete_large_tab, - delete_large_named_table, evil_delete, table_leak, - baddelete, match_delete, match_delete3]}, - {match, [], - [match1, match2, match_object, match_object2]}, - {misc, [], - [misc1, safe_fixtable, info, dups, tab2list]}, - {files, [], - [tab2file, tab2file2, tab2file3, tabfile_ext1, - tabfile_ext2, tabfile_ext3, tabfile_ext4]}, - {heavy, [], - [heavy_lookup, heavy_lookup_element, heavy_concurrent]}, - {fold, [], - [foldl_ordered, foldr_ordered, foldl, foldr, - fold_empty]}, - {meta_smp, [], - [meta_lookup_unnamed_read, meta_lookup_unnamed_write, - meta_lookup_named_read, meta_lookup_named_write, - meta_newdel_unnamed, meta_newdel_named]}]. + [default, setbag, badnew, verybadnew, named, keypos2, + privacy]}, + {insert, [], [empty, badinsert]}, + {lookup, [], [time_lookup, badlookup, lookup_order]}, + {lookup_element, [], [lookup_element_mult]}, + {delete, [], + [delete_elem, delete_tab, delete_large_tab, + delete_large_named_table, evil_delete, table_leak, + baddelete, match_delete, match_delete3]}, + {match, [], + [match1, match2, match_object, match_object2]}, + {misc, [], + [misc1, safe_fixtable, info, dups, tab2list]}, + {files, [], + [tab2file, tab2file2, tabfile_ext1, + tabfile_ext2, tabfile_ext3, tabfile_ext4]}, + {heavy, [], + [heavy_lookup, heavy_lookup_element, heavy_concurrent]}, + {fold, [], + [foldl_ordered, foldr_ordered, foldl, foldr, + fold_empty]}, + {meta_smp, [], + [meta_lookup_unnamed_read, meta_lookup_unnamed_write, + meta_lookup_named_read, meta_lookup_named_write, + meta_newdel_unnamed, meta_newdel_named]}]. init_per_suite(Config) -> Config. end_per_suite(_Config) -> - ok. + stop_spawn_logger(), + catch erts_debug:set_internal_state(available_internal_state, false). init_per_group(_GroupName, Config) -> Config. diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index 4fda9bbbf2..00bac13680 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(ets_tough_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,ex1/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,ex1/1]). -export([init/1,terminate/2,handle_call/3,handle_info/2]). -export([init_per_testcase/2, end_per_testcase/2]). -compile([export_all]). @@ -26,7 +27,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ex1]. + [ex1]. groups() -> []. @@ -38,10 +39,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index ccb9a26976..9c960c0aa4 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -32,7 +32,8 @@ -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1, badarg/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, basic/1, badarg/1, term_sort/1, term_keysort/1, binary_term_sort/1, binary_term_keysort/1, binary_sort/1, @@ -58,12 +59,12 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, badarg, term_sort, term_keysort, - binary_term_sort, binary_term_keysort, binary_sort, - term_merge, term_keymerge, binary_term_merge, - binary_term_keymerge, binary_merge, term_check, - binary_term_keycheck, binary_term_check, - binary_term_keycheck, binary_check, inout, misc, many]. + [basic, badarg, term_sort, term_keysort, + binary_term_sort, binary_term_keysort, binary_sort, + term_merge, term_keymerge, binary_term_merge, + binary_term_keymerge, binary_merge, term_check, + binary_term_keycheck, binary_term_check, + binary_term_keycheck, binary_check, inout, misc, many]. groups() -> []. @@ -75,10 +76,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. basic(doc) -> diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index d853eaf6c6..da957fd238 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -19,7 +19,9 @@ -module(filelib_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, wildcard_one/1,wildcard_two/1,wildcard_errors/1, fold_files/1,otp_5960/1,ensure_dir_eexist/1]). @@ -40,8 +42,8 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[wildcard_one, wildcard_two, wildcard_errors, - fold_files, otp_5960, ensure_dir_eexist]. + [wildcard_one, wildcard_two, wildcard_errors, + fold_files, otp_5960, ensure_dir_eexist]. groups() -> []. @@ -53,10 +55,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. wildcard_one(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl index bd6db97289..ad38c013c5 100644 --- a/lib/stdlib/test/filename_SUITE.erl +++ b/lib/stdlib/test/filename_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(filename_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([absname/1, absname_2/1, basename_1/1, basename_2/1, dirname/1, extension/1, join/1, t_nativename/1]). @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index 66b142fceb..e0e3d2f66b 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -21,7 +21,8 @@ %%%---------------------------------------------------------------------- -module(fixtable_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %%% Test cases -export([multiple_fixes/1, multiple_processes/1, other_process_deletes/1, owner_dies/1, @@ -34,9 +35,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[multiple_fixes, multiple_processes, - other_process_deletes, owner_dies, other_process_closes, - insert_same_key, fixbag]. + [multiple_fixes, multiple_processes, + other_process_deletes, owner_dies, other_process_closes, + insert_same_key, fixbag]. groups() -> []. @@ -48,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -include_lib("test_server/include/test_server.hrl"). diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 7fff294448..712147ff66 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(format_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([hang_1/1]). @@ -39,7 +40,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[hang_1]. + [hang_1]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. hang_1(doc) -> diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index f22f171d1d..cb2ffa8cf4 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([start/1, add_handler/1, add_sup_handler/1, delete_handler/1, swap_handler/1, swap_sup_handler/1, notify/1, sync_notify/1, call/1, info/1, hibernate/1, @@ -29,14 +30,14 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start, {group, test_all}, hibernate, - call_format_status, error_format_status]. + [start, {group, test_all}, hibernate, + call_format_status, error_format_status]. groups() -> [{test_all, [], - [add_handler, add_sup_handler, delete_handler, - swap_handler, swap_sup_handler, notify, sync_notify, - call, info]}]. + [add_handler, add_sup_handler, delete_handler, + swap_handler, swap_sup_handler, notify, sync_notify, + call, info]}]. init_per_suite(Config) -> Config. @@ -45,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% -------------------------------------- diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index 1f190bdaaa..58545117fb 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test cases --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([ start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1, start7/1, start8/1, start9/1, start10/1, start11/1]). @@ -56,16 +57,16 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, start}, {group, abnormal}, shutdown, - {group, sys}, hibernate, enter_loop]. + [{group, start}, {group, abnormal}, shutdown, + {group, sys}, hibernate, enter_loop]. groups() -> [{start, [], - [start1, start2, start3, start4, start5, start6, start7, - start8, start9, start10, start11]}, - {abnormal, [], [abnormal1, abnormal2]}, - {sys, [], - [sys1, call_format_status, error_format_status]}]. + [start1, start2, start3, start4, start5, start6, start7, + start8, start9, start10, start11]}, + {abnormal, [], [abnormal1, abnormal2]}, + {sys, [], + [sys1, call_format_status, error_format_status]}]. init_per_suite(Config) -> Config. @@ -74,14 +75,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - - - + Config. %% anonymous start1(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index c64674246e..8615d5476e 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -23,7 +23,8 @@ -export([init_per_testcase/2, end_per_testcase/2]). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([start/1, crash/1, call/1, cast/1, cast_fast/1, info/1, abcast/1, multicall/1, multicall_down/1, call_remote1/1, call_remote2/1, call_remote3/1, @@ -48,14 +49,14 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start, crash, call, cast, cast_fast, info, abcast, - multicall, multicall_down, call_remote1, call_remote2, - call_remote3, call_remote_n1, call_remote_n2, - call_remote_n3, spec_init, - spec_init_local_registered_parent, - spec_init_global_registered_parent, otp_5854, hibernate, - otp_7669, call_format_status, error_format_status, - call_with_huge_message_queue]. + [start, crash, call, cast, cast_fast, info, abcast, + multicall, multicall_down, call_remote1, call_remote2, + call_remote3, call_remote_n1, call_remote_n2, + call_remote_n3, spec_init, + spec_init_local_registered_parent, + spec_init_global_registered_parent, otp_5854, hibernate, + otp_7669, call_format_status, error_format_status, + call_with_huge_message_queue]. groups() -> []. @@ -67,18 +68,33 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(default_timeout, ?t:minutes(1)). +init_per_testcase(Case, Config) when Case == call_remote1; + Case == call_remote2; + Case == call_remote3; + Case == call_remote_n1; + Case == call_remote_n2; + Case == call_remote_n3 -> + {ok,N} = start_node(hubba), + ?line Dog = ?t:timetrap(?default_timeout), + [{node,N},{watchdog, Dog} | Config]; init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), [{watchdog, Dog} | Config]. end_per_testcase(_Case, Config) -> + case proplists:get_value(node, Config) of + undefined -> + ok; + N -> + test_server:stop_node(N) + end, Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -311,8 +327,8 @@ start_node(Name) -> call_remote1(suite) -> []; call_remote1(Config) when is_list(Config) -> - ?line N = hubba, - ?line {ok, Node} = start_node(N), + N = hubba, + ?line Node = proplists:get_value(node,Config), ?line {ok, Pid} = rpc:call(Node, gen_server, start, [{global, N}, ?MODULE, [], []]), ?line ok = (catch gen_server:call({global, N}, started_p, infinity)), @@ -325,7 +341,7 @@ call_remote1(Config) when is_list(Config) -> call_remote2(suite) -> []; call_remote2(Config) when is_list(Config) -> ?line N = hubba, - ?line {ok, Node} = start_node(N), + ?line Node = proplists:get_value(node,Config), ?line {ok, Pid} = rpc:call(Node, gen_server, start, [{global, N}, ?MODULE, [], []]), @@ -338,8 +354,7 @@ call_remote2(Config) when is_list(Config) -> call_remote3(suite) -> []; call_remote3(Config) when is_list(Config) -> - ?line N = hubba, - ?line {ok, Node} = start_node(N), + ?line Node = proplists:get_value(node,Config), ?line {ok, Pid} = rpc:call(Node, gen_server, start, [{local, piller}, ?MODULE, [], []]), @@ -357,7 +372,7 @@ call_remote3(Config) when is_list(Config) -> call_remote_n1(suite) -> []; call_remote_n1(Config) when is_list(Config) -> ?line N = hubba, - ?line {ok, Node} = start_node(N), + ?line Node = proplists:get_value(node,Config), ?line {ok, _Pid} = rpc:call(Node, gen_server, start, [{global, N}, ?MODULE, [], []]), ?line _ = test_server:stop_node(Node), @@ -369,7 +384,7 @@ call_remote_n1(Config) when is_list(Config) -> call_remote_n2(suite) -> []; call_remote_n2(Config) when is_list(Config) -> ?line N = hubba, - ?line {ok, Node} = start_node(N), + ?line Node = proplists:get_value(node,Config), ?line {ok, Pid} = rpc:call(Node, gen_server, start, [{global, N}, ?MODULE, [], []]), @@ -381,8 +396,7 @@ call_remote_n2(Config) when is_list(Config) -> call_remote_n3(suite) -> []; call_remote_n3(Config) when is_list(Config) -> - ?line N = hubba, - ?line {ok, Node} = start_node(N), + ?line Node = proplists:get_value(node,Config), ?line {ok, _Pid} = rpc:call(Node, gen_server, start, [{local, piller}, ?MODULE, [], []]), diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 739749ee7d..6ecacb4dd6 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -21,20 +21,21 @@ -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, id_transform/1]). -export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1, t5/1,t6/1,apa/1,new_fun/0]). -% Serves as test... + % Serves as test... -hej(hopp). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[id_transform]. + [id_transform]. groups() -> []. @@ -46,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. id_transform(doc) -> "Test erl_id_trans."; diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 1704f5f216..98322c0b9c 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -18,7 +18,8 @@ %% -module(io_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -57,11 +58,11 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[error_1, float_g, otp_5403, otp_5813, otp_6230, - otp_6282, otp_6354, otp_6495, otp_6517, otp_6502, - manpage, otp_6708, otp_7084, otp_7421, - io_lib_collect_line_3_wb, cr_whitespace_in_string, - io_fread_newlines]. + [error_1, float_g, otp_5403, otp_5813, otp_6230, + otp_6282, otp_6354, otp_6495, otp_6517, otp_6502, + manpage, otp_6708, otp_7084, otp_7421, + io_lib_collect_line_3_wb, cr_whitespace_in_string, + io_fread_newlines]. groups() -> []. @@ -73,10 +74,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. error_1(doc) -> diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 5ce589773d..5456001f5c 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -19,15 +19,19 @@ -module(io_proto_SUITE). -compile(r12). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). --export([setopts_getopts/1,unicode_options/1,unicode_options_gen/1, binary_options/1, bc_with_r12/1, - bc_with_r12_gl/1, read_modes_gl/1,bc_with_r12_ogl/1, read_modes_ogl/1, broken_unicode/1,eof_on_pipe/1,unicode_prompt/1]). +-export([setopts_getopts/1,unicode_options/1,unicode_options_gen/1, + binary_options/1, bc_with_r12/1, + bc_with_r12_gl/1, read_modes_gl/1,bc_with_r12_ogl/1, + read_modes_ogl/1, broken_unicode/1,eof_on_pipe/1,unicode_prompt/1]). --export([io_server_proxy/1,start_io_server_proxy/0, proxy_getall/1, proxy_setnext/2, proxy_quit/1]). +-export([io_server_proxy/1,start_io_server_proxy/0, proxy_getall/1, + proxy_setnext/2, proxy_quit/1]). %% For spawn -export([toerl_server/3,hold_the_line/3,answering_machine1/3, answering_machine2/3]). @@ -83,10 +87,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[setopts_getopts, unicode_options, unicode_options_gen, - binary_options, bc_with_r12, bc_with_r12_gl, - bc_with_r12_ogl, read_modes_gl, read_modes_ogl, - broken_unicode, eof_on_pipe, unicode_prompt]. + [setopts_getopts, unicode_options, unicode_options_gen, + binary_options, bc_with_r12, bc_with_r12_gl, + bc_with_r12_ogl, read_modes_gl, read_modes_ogl, + broken_unicode, eof_on_pipe, unicode_prompt]. groups() -> []. @@ -98,10 +102,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index 95ef4b1e9f..1658446220 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -30,7 +30,8 @@ -define(default_timeout, ?t:minutes(4)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -43,8 +44,8 @@ sublist_2/1, sublist_3/1, sublist_2_e/1, sublist_3_e/1, flatten_1/1, flatten_2/1, flatten_1_e/1, flatten_2_e/1, dropwhile/1, - sort/1, sort_1/1, sort_stable/1, merge/1, rmerge/1, sort_rand/1, - usort_1/1, usort_stable/1, umerge/1, rumerge/1,usort_rand/1, + sort_1/1, sort_stable/1, merge/1, rmerge/1, sort_rand/1, + usort_1/1, usort_stable/1, umerge/1, rumerge/1,usort_rand/1, keymerge/1, rkeymerge/1, keysort_1/1, keysort_i/1, keysort_stable/1, keysort_rand/1, keysort_error/1, @@ -59,7 +60,7 @@ ufunsort_error/1, zip_unzip/1, zip_unzip3/1, zipwith/1, zipwith3/1, filter_partition/1, - otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1, + otp_5939/1, otp_6023/1, otp_6606/1, otp_7230/1, suffix/1, subtract/1]). %% Sort randomized lists until stopped. @@ -79,36 +80,37 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, append}, reverse, member, keymember, - keysearch_keyfind, keystore, keytake, dropwhile, sort, - {group, usort}, {group, keysort}, {group, ukeysort}, - {group, funsort}, {group, ufunsort}, {group, sublist}, - {group, flatten}, {group, seq}, zip_unzip, zip_unzip3, - zipwith, zipwith3, filter_partition, {group, tickets}, - suffix, subtract]. + [{group, append}, reverse, member, keymember, + keysearch_keyfind, keystore, keytake, dropwhile, {group,sort}, + {group, usort}, {group, keysort}, {group, ukeysort}, + {group, funsort}, {group, ufunsort}, {group, sublist}, + {group, flatten}, {group, seq}, zip_unzip, zip_unzip3, + zipwith, zipwith3, filter_partition, {group, tickets}, + suffix, subtract]. groups() -> [{append, [], [append_1, append_2]}, - {usort, [], - [umerge, rumerge, usort_1, usort_rand, usort_stable]}, - {keysort, [], - [keymerge, rkeymerge, keysort_1, keysort_rand, - keysort_i, keysort_stable, keysort_error]}, - {ukeysort, [], - [ukeymerge, rukeymerge, ukeysort_1, ukeysort_rand, - ukeysort_i, ukeysort_stable, ukeysort_error]}, - {funsort, [], - [funmerge, rfunmerge, funsort_1, funsort_stable, - funsort_error, funsort_rand]}, - {ufunsort, [], - [ufunmerge, rufunmerge, ufunsort_1, ufunsort_stable, - ufunsort_error, ufunsort_rand]}, - {seq, [], [seq_loop, seq_2, seq_3, seq_2_e, seq_3_e]}, - {sublist, [], - [sublist_2, sublist_3, sublist_2_e, sublist_3_e]}, - {flatten, [], - [flatten_1, flatten_2, flatten_1_e, flatten_2_e]}, - {tickets, [], [otp_5939, otp_6023, otp_6606, otp_7230]}]. + {usort, [], + [umerge, rumerge, usort_1, usort_rand, usort_stable]}, + {keysort, [], + [keymerge, rkeymerge, keysort_1, keysort_rand, + keysort_i, keysort_stable, keysort_error]}, + {sort,[],[merge, rmerge, sort_1, sort_rand]}, + {ukeysort, [], + [ukeymerge, rukeymerge, ukeysort_1, ukeysort_rand, + ukeysort_i, ukeysort_stable, ukeysort_error]}, + {funsort, [], + [funmerge, rfunmerge, funsort_1, funsort_stable, + funsort_error, funsort_rand]}, + {ufunsort, [], + [ufunmerge, rufunmerge, ufunsort_1, ufunsort_stable, + ufunsort_error, ufunsort_rand]}, + {seq, [], [seq_loop, seq_2, seq_3, seq_2_e, seq_3_e]}, + {sublist, [], + [sublist_2, sublist_3, sublist_2_e, sublist_3_e]}, + {flatten, [], + [flatten_1, flatten_2, flatten_1_e, flatten_2_e]}, + {tickets, [], [otp_5939, otp_6023, otp_6606, otp_7230]}]. init_per_suite(Config) -> Config. @@ -117,10 +119,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> @@ -379,12 +381,6 @@ keytake(Config) when is_list(Config) -> ?line false = lists:keytake(4, 2, L), ok. -sort(doc) -> - ["Tests merge functions and lists:sort/1"]; -sort(suite) -> - %% [merge, rmerge, sort_1, sort_rand, sort_stable]. - [merge, rmerge, sort_1, sort_rand]. - merge(doc) -> ["merge functions"]; merge(suite) -> []; merge(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index 1aa3e47921..b17a54fe6c 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -21,12 +21,13 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test]. + [test]. groups() -> []. @@ -38,10 +39,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 68f1547184..6212cc8641 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([basic_ets/1]). -export([basic_dbg/1]). -export([from_shell/1]). @@ -51,11 +52,11 @@ end_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[from_shell, basic_ets, basic_dbg, records, - record_index, multipass, bitsyntax, record_defaults, - andalso_orelse, float_1_function, action_function, - warnings, top_match, old_guards, autoimported, - semicolon]. + [from_shell, basic_ets, basic_dbg, records, + record_index, multipass, bitsyntax, record_defaults, + andalso_orelse, float_1_function, action_function, + warnings, top_match, old_guards, autoimported, + semicolon]. groups() -> []. @@ -67,10 +68,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% This may be subject to change diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index 41c9c6093d..8edc8a8098 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -23,7 +23,9 @@ %% %%-define(STANDALONE,1). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, crash/1, sync_start_nolink/1, sync_start_link/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + crash/1, sync_start_nolink/1, sync_start_link/1, spawn_opt/1, sp1/0, sp2/0, sp3/1, sp4/2, sp5/1, hibernate/1]). -export([ otp_6345/1]). @@ -46,12 +48,12 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[crash, {group, sync_start}, spawn_opt, hibernate, - {group, tickets}]. + [crash, {group, sync_start}, spawn_opt, hibernate, + {group, tickets}]. groups() -> [{tickets, [], [otp_6345]}, - {sync_start, [], [sync_start_nolink, sync_start_link]}]. + {sync_start, [], [sync_start_nolink, sync_start_link]}]. init_per_suite(Config) -> Config. @@ -60,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index 2faf43503f..f42ffe338c 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -51,36 +51,33 @@ -include_lib("stdlib/include/ms_transform.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([ - badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, - filter_var/1, single/1, exported_var/1, generator_vars/1, - nomatch/1, errors/1, pattern/1, + badarg/1, nested_qlc/1, unused_var/1, lc/1, fun_clauses/1, + filter_var/1, single/1, exported_var/1, generator_vars/1, + nomatch/1, errors/1, pattern/1, - - eval/1, cursor/1, fold/1, eval_unique/1, eval_cache/1, append/1, - evaluator/1, string_to_handle/1, table/1, process_dies/1, - sort/1, keysort/1, filesort/1, cache/1, cache_list/1, filter/1, - info/1, nested_info/1, lookup1/1, lookup2/1, lookup_rec/1, - indices/1, pre_fun/1, skip_filters/1, - - - ets/1, dets/1, - - - join_option/1, join_filter/1, join_lookup/1, join_merge/1, - join_sort/1, join_complex/1, + eval/1, cursor/1, fold/1, eval_unique/1, eval_cache/1, append/1, + evaluator/1, string_to_handle/1, table/1, process_dies/1, + sort/1, keysort/1, filesort/1, cache/1, cache_list/1, filter/1, + info/1, nested_info/1, lookup1/1, lookup2/1, lookup_rec/1, + indices/1, pre_fun/1, skip_filters/1, + ets/1, dets/1, - otp_5644/1, otp_5195/1, otp_6038_bug/1, otp_6359/1, otp_6562/1, - otp_6590/1, otp_6673/1, otp_6964/1, otp_7114/1, otp_7238/1, - otp_7232/1, otp_7552/1, otp_6674/1, otp_7714/1, + join_option/1, join_filter/1, join_lookup/1, join_merge/1, + join_sort/1, join_complex/1, - manpage/1, + otp_5644/1, otp_5195/1, otp_6038_bug/1, otp_6359/1, otp_6562/1, + otp_6590/1, otp_6673/1, otp_6964/1, otp_7114/1, otp_7238/1, + otp_7232/1, otp_7552/1, otp_6674/1, otp_7714/1, + manpage/1, - backward/1, forward/1]). + backward/1, forward/1]). %% Internal exports. -export([bad_table_throw/1, bad_table_exit/1, default_table/1, bad_table/1, @@ -122,30 +119,30 @@ end_per_testcase(_Case, _Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, parse_transform}, {group, evaluation}, - {group, table_impls}, {group, join}, {group, tickets}, - manpage, {group, compat}]. + [{group, parse_transform}, {group, evaluation}, + {group, table_impls}, {group, join}, {group, tickets}, + manpage, {group, compat}]. groups() -> [{parse_transform, [], - [badarg, nested_qlc, unused_var, lc, fun_clauses, - filter_var, single, exported_var, generator_vars, - nomatch, errors, pattern]}, - {evaluation, [], - [eval, cursor, fold, eval_unique, eval_cache, append, - evaluator, string_to_handle, table, process_dies, sort, - keysort, filesort, cache, cache_list, filter, info, - nested_info, lookup1, lookup2, lookup_rec, indices, - pre_fun, skip_filters]}, - {table_impls, [], [ets, dets]}, - {join, [], - [join_option, join_filter, join_lookup, join_merge, - join_sort, join_complex]}, - {tickets, [], - [otp_5644, otp_5195, otp_6038_bug, otp_6359, otp_6562, - otp_6590, otp_6673, otp_6964, otp_7114, otp_7232, - otp_7238, otp_7552, otp_6674, otp_7714]}, - {compat, [], [backward, forward]}]. + [badarg, nested_qlc, unused_var, lc, fun_clauses, + filter_var, single, exported_var, generator_vars, + nomatch, errors, pattern]}, + {evaluation, [], + [eval, cursor, fold, eval_unique, eval_cache, append, + evaluator, string_to_handle, table, process_dies, sort, + keysort, filesort, cache, cache_list, filter, info, + nested_info, lookup1, lookup2, lookup_rec, indices, + pre_fun, skip_filters]}, + {table_impls, [], [ets, dets]}, + {join, [], + [join_option, join_filter, join_lookup, join_merge, + join_sort, join_complex]}, + {tickets, [], + [otp_5644, otp_5195, otp_6038_bug, otp_6359, otp_6562, + otp_6590, otp_6673, otp_6964, otp_7114, otp_7232, + otp_7238, otp_7552, otp_6674, otp_7714]}, + {compat, [], [backward, forward]}]. init_per_suite(Config) -> Config. @@ -154,12 +151,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. - - + Config. badarg(doc) -> "Badarg."; diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index e494c46196..d4deb7f000 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% %% -module(queue_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([do/1, to_list/1, io_test/1, op_test/1, error/1, oops/1]). @@ -39,7 +40,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[do, to_list, io_test, op_test, error, oops]. + [do, to_list, io_test, op_test, error, oops]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. do(doc) -> diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index 801d059aef..40df9e9de3 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(random_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([interval_1/1, seed0/1, seed/1]). @@ -39,7 +40,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[interval_1, seed0, seed]. + [interval_1, seed0, seed]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. seed0(doc) -> diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index de921f03f5..5124e8aed9 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -18,7 +18,13 @@ %% -module(re_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, pcre/1,compile_options/1, + run_options/1,combined_options/1,replace_autogen/1, + global_capture/1,replace_input_types/1,replace_return/1, + split_autogen/1,split_options/1,split_specials/1, + error_handling/1,pcre_cve_2008_2371/1, + pcre_compile_workspace_overflow/1,re_infinite_loop/1]). -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). @@ -26,11 +32,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[pcre, compile_options, run_options, combined_options, - replace_autogen, global_capture, replace_input_types, - replace_return, split_autogen, split_options, - split_specials, error_handling, pcre_cve_2008_2371, - pcre_compile_workspace_overflow, re_infinite_loop]. + [pcre, compile_options, run_options, combined_options, + replace_autogen, global_capture, replace_input_types, + replace_return, split_autogen, split_options, + split_specials, error_handling, pcre_cve_2008_2371, + pcre_compile_workspace_overflow, re_infinite_loop]. groups() -> []. @@ -42,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. pcre(doc) -> diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index 589fdbed0f..c46975c3b8 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -58,13 +58,15 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,select_test/1,init_per_testcase/2, end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,select_test/1, + init_per_testcase/2, end_per_testcase/2, return_values/1]). init_per_testcase(_Case, Config) when is_list(Config) -> ?line Dog=test_server:timetrap(test_server:seconds(1200)), [{watchdog, Dog}|Config]. - + end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), @@ -73,7 +75,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[return_values, select_test]. + [return_values, select_test]. groups() -> []. @@ -85,12 +87,12 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - select_test(suite) -> []; select_test(doc) -> diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index 003c9d9daa..eef1817bf1 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -22,7 +22,9 @@ -module(sets_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, create/1,add_element/1,del_element/1, subtract/1,intersection/1,union/1,is_subset/1, is_set/1,fold/1,filter/1, @@ -44,9 +46,9 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[create, add_element, del_element, subtract, - intersection, union, is_subset, is_set, fold, filter, - take_smallest, take_largest]. + [create, add_element, del_element, subtract, + intersection, union, is_subset, is_set, fold, filter, + take_smallest, take_largest]. groups() -> []. @@ -58,10 +60,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. create(Config) when is_list(Config) -> diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index a95b7effac..d44779e950 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -17,21 +17,22 @@ %% %CopyrightEnd% %% -module(shell_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([forget/1, records/1, known_bugs/1, otp_5226/1, otp_5327/1, - otp_5435/1, otp_5195/1, otp_5915/1, otp_5916/1, - bs_match_misc_SUITE/1, bs_match_int_SUITE/1, - bs_match_tail_SUITE/1, bs_match_bin_SUITE/1, - bs_construct_SUITE/1, - refman_bit_syntax/1, - progex_bit_syntax/1, progex_records/1, - progex_lc/1, progex_funs/1, - otp_5990/1, otp_6166/1, otp_6554/1, otp_6785/1, - otp_7184/1, otp_7232/1, otp_8393/1]). + otp_5435/1, otp_5195/1, otp_5915/1, otp_5916/1, + bs_match_misc_SUITE/1, bs_match_int_SUITE/1, + bs_match_tail_SUITE/1, bs_match_bin_SUITE/1, + bs_construct_SUITE/1, + refman_bit_syntax/1, + progex_bit_syntax/1, progex_records/1, + progex_lc/1, progex_funs/1, + otp_5990/1, otp_6166/1, otp_6554/1, otp_6785/1, + otp_7184/1, otp_7232/1, otp_8393/1]). -export([ start_restricted_from_shell/1, - start_restricted_on_command_line/1,restricted_local/1]). + start_restricted_on_command_line/1,restricted_local/1]). %% Internal export. -export([otp_5435_2/0, prompt1/1, prompt2/1, prompt3/1, prompt4/1, @@ -74,25 +75,25 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[forget, records, known_bugs, otp_5226, otp_5327, - otp_5435, otp_5195, otp_5915, otp_5916, {group, bits}, - {group, refman}, {group, progex}, {group, tickets}, - {group, restricted}]. + [forget, records, known_bugs, otp_5226, otp_5327, + otp_5435, otp_5195, otp_5915, otp_5916, {group, bits}, + {group, refman}, {group, progex}, {group, tickets}, + {group, restricted}]. groups() -> [{restricted, [], - [start_restricted_from_shell, - start_restricted_on_command_line, restricted_local]}, - {bits, [], - [bs_match_misc_SUITE, bs_match_tail_SUITE, - bs_match_bin_SUITE, bs_construct_SUITE]}, - {refman, [], [refman_bit_syntax]}, - {progex, [], - [progex_bit_syntax, progex_records, progex_lc, - progex_funs]}, - {tickets, [], - [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, - otp_7232, otp_8393]}]. + [start_restricted_from_shell, + start_restricted_on_command_line, restricted_local]}, + {bits, [], + [bs_match_misc_SUITE, bs_match_tail_SUITE, + bs_match_bin_SUITE, bs_construct_SUITE]}, + {refman, [], [refman_bit_syntax]}, + {progex, [], + [progex_bit_syntax, progex_records, progex_lc, + progex_funs]}, + {tickets, [], + [otp_5990, otp_6166, otp_6554, otp_6785, otp_7184, + otp_7232, otp_8393]}]. init_per_suite(Config) -> Config. @@ -101,10 +102,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -record(state, {bin, reply, leader}). diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl index eafff8893e..e5acef0513 100644 --- a/lib/stdlib/test/slave_SUITE.erl +++ b/lib/stdlib/test/slave_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_start/1, t_start_link/1, start_link_nodedown/1, errors/1]). %% Internal exports. @@ -30,7 +31,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[t_start_link, start_link_nodedown, t_start, errors]. + [t_start_link, start_link_nodedown, t_start, errors]. groups() -> []. @@ -42,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. t_start_link(suite) -> []; diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index 69b852077b..5136e9f2e0 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -30,7 +30,8 @@ -define(format(S, A), ok). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([ from_term_1/1, set_1/1, from_sets_1/1, relation_1/1, a_function_1/1, family_1/1, projection/1, @@ -88,30 +89,30 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, sofs}, {group, sofs_family}]. + [{group, sofs}, {group, sofs_family}]. groups() -> [{sofs, [], - [from_term_1, set_1, from_sets_1, relation_1, - a_function_1, family_1, relation_to_family_1, domain_1, - range_1, image, inverse_image, inverse_1, converse_1, - no_elements_1, substitution, restriction, drestriction, - projection, strict_relation_1, extension, - weak_relation_1, to_sets_1, specification, union_1, - intersection_1, difference, symdiff, - symmetric_partition, is_sofs_set_1, is_set_1, is_equal, - is_subset, is_a_function_1, is_disjoint, join, - canonical, composite_1, relative_product_1, - relative_product_2, product_1, partition_1, partition_3, - multiple_relative_product, digraph, constant_function, - misc]}, - {sofs_family, [], - [family_specification, family_domain_1, family_range_1, - family_to_relation_1, union_of_family_1, - intersection_of_family_1, family_projection, - family_difference, family_intersection_1, - family_intersection_2, family_union_1, family_union_2, - partition_family]}]. + [from_term_1, set_1, from_sets_1, relation_1, + a_function_1, family_1, relation_to_family_1, domain_1, + range_1, image, inverse_image, inverse_1, converse_1, + no_elements_1, substitution, restriction, drestriction, + projection, strict_relation_1, extension, + weak_relation_1, to_sets_1, specification, union_1, + intersection_1, difference, symdiff, + symmetric_partition, is_sofs_set_1, is_set_1, is_equal, + is_subset, is_a_function_1, is_disjoint, join, + canonical, composite_1, relative_product_1, + relative_product_2, product_1, partition_1, partition_3, + multiple_relative_product, digraph, constant_function, + misc]}, + {sofs_family, [], + [family_specification, family_domain_1, family_range_1, + family_to_relation_1, union_of_family_1, + intersection_of_family_1, family_projection, + family_difference, family_intersection_1, + family_intersection_2, family_union_1, family_union_2, + partition_family]}]. init_per_suite(Config) -> Config. @@ -120,10 +121,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index f203e810ba..cf59f34f52 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -28,7 +28,8 @@ -define(application, stdlib). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -41,7 +42,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[[app_test]]. + [app_test]. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index 766ccda6db..1a7466759a 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -27,7 +27,8 @@ -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -43,10 +44,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[len, equal, concat, chr_rchr, str_rstr, span_cspan, - substr, tokens, chars, copies, words, strip, sub_word, - left_right, sub_string, centre, join, to_integer, - to_float, to_upper_to_lower]. + [len, equal, concat, chr_rchr, str_rstr, span_cspan, + substr, tokens, chars, copies, words, strip, sub_word, + left_right, sub_string, centre, join, to_integer, + to_float, to_upper_to_lower]. groups() -> []. @@ -58,10 +59,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index ac47d2ebad..f751b06189 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -23,7 +23,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Testserver specific export --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %% Indirect spawn export -export([init/1]). @@ -57,38 +58,38 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, sup_start}, {group, sup_stop}, child_adm, - child_adm_simple, extra_return, child_specs, - {group, restart_one_for_one}, - {group, restart_one_for_all}, - {group, restart_simple_one_for_one}, - {group, restart_rest_for_one}, - {group, normal_termination}, - {group, abnormal_termination}, child_unlink, tree, - count_children_memory]. + [{group, sup_start}, {group, sup_stop}, child_adm, + child_adm_simple, extra_return, child_specs, + {group, restart_one_for_one}, + {group, restart_one_for_all}, + {group, restart_simple_one_for_one}, + {group, restart_rest_for_one}, + {group, normal_termination}, + {group, abnormal_termination}, child_unlink, tree, + count_children_memory]. groups() -> [{sup_start, [], - [sup_start_normal, sup_start_ignore_init, - sup_start_ignore_child, sup_start_error_return, - sup_start_fail]}, - {sup_stop, [], - [sup_stop_infinity, sup_stop_timeout, - sup_stop_brutal_kill]}, - {normal_termination, [], - [permanent_normal, transient_normal, temporary_normal]}, - {abnormal_termination, [], - [permanent_abnormal, transient_abnormal, - temporary_abnormal]}, - {restart_one_for_one, [], - [one_for_one, one_for_one_escalation]}, - {restart_one_for_all, [], - [one_for_all, one_for_all_escalation]}, - {restart_simple_one_for_one, [], - [simple_one_for_one, simple_one_for_one_extra, - simple_one_for_one_escalation]}, - {restart_rest_for_one, [], - [rest_for_one, rest_for_one_escalation]}]. + [sup_start_normal, sup_start_ignore_init, + sup_start_ignore_child, sup_start_error_return, + sup_start_fail]}, + {sup_stop, [], + [sup_stop_infinity, sup_stop_timeout, + sup_stop_brutal_kill]}, + {normal_termination, [], + [permanent_normal, transient_normal, temporary_normal]}, + {abnormal_termination, [], + [permanent_abnormal, transient_abnormal, + temporary_abnormal]}, + {restart_one_for_one, [], + [one_for_one, one_for_one_escalation]}, + {restart_one_for_all, [], + [one_for_all, one_for_all_escalation]}, + {restart_simple_one_for_one, [], + [simple_one_for_one, simple_one_for_one_extra, + simple_one_for_one_escalation]}, + {restart_rest_for_one, [], + [rest_for_one, rest_for_one_escalation]}]. init_per_suite(Config) -> Config. @@ -97,10 +98,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index 502bb1e7a7..79259cd4d5 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -17,7 +17,9 @@ %% %CopyrightEnd% %% -module(supervisor_bridge_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,starting/1,mini_terminate/1,mini_die/1,badstart/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,starting/1, + mini_terminate/1,mini_die/1,badstart/1]). -export([client/1,init/1,internal_loop_init/1,terminate/2]). -include_lib("test_server/include/test_server.hrl"). @@ -29,7 +31,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[starting, mini_terminate, mini_die, badstart]. + [starting, mini_terminate, mini_die, badstart]. groups() -> []. @@ -41,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index 83ee9815b5..065494c6d7 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -17,7 +17,9 @@ %% %CopyrightEnd% %% -module(sys_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,log/1,log_to_file/1,stats/1,trace/1,suspend/1,install/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,log/1,log_to_file/1, + stats/1,trace/1,suspend/1,install/1]). -export([handle_call/3,terminate/2,init/1]). -include_lib("test_server/include/test_server.hrl"). @@ -32,7 +34,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[log, log_to_file, stats, trace, suspend, install]. + [log, log_to_file, stats, trace, suspend, install]. groups() -> []. @@ -44,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index d524ab4b3d..8e4aff5403 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -18,7 +18,8 @@ %% -module(tar_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1, create_long_names/1, bad_tar/1, errors/1, extract_from_binary/1, extract_from_binary_compressed/1, extract_from_open_file/1, symlinks/1, open_add_close/1, cooked_compressed/1, @@ -30,10 +31,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[borderline, atomic, long_names, create_long_names, - bad_tar, errors, extract_from_binary, - extract_from_binary_compressed, extract_from_open_file, - symlinks, open_add_close, cooked_compressed, memory]. + [borderline, atomic, long_names, create_long_names, + bad_tar, errors, extract_from_binary, + extract_from_binary_compressed, extract_from_open_file, + symlinks, open_add_close, cooked_compressed, memory]. groups() -> []. @@ -45,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. borderline(doc) -> diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl index a23b546aee..b07d3edb66 100644 --- a/lib/stdlib/test/timer_SUITE.erl +++ b/lib/stdlib/test/timer_SUITE.erl @@ -54,7 +54,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[do_big_test]. + [do_big_test]. groups() -> []. @@ -66,10 +66,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% ------------------------------------------------------- %% diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index 652ea67ef3..bd978bfc25 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -21,7 +21,8 @@ -module(timer_simple_SUITE). %% external --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, apply_after/1, send_after1/1, @@ -57,11 +58,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[apply_after, send_after1, send_after2, send_after3, - exit_after1, exit_after2, kill_after1, kill_after2, - apply_interval, send_interval1, send_interval2, - send_interval3, send_interval4, cancel1, cancel2, tc, - unique_refs, timer_perf]. + [apply_after, send_after1, send_after2, send_after3, + exit_after1, exit_after2, kill_after1, kill_after2, + apply_interval, send_interval1, send_interval2, + send_interval3, send_interval4, cancel1, cancel2, tc, + unique_refs, timer_perf]. groups() -> []. @@ -73,10 +74,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_, Config) when is_list(Config) -> diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index 41e10c74b7..6050a619f6 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, utf8_illegal_sequences_bif/1, @@ -41,9 +42,9 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[utf8_illegal_sequences_bif, - utf16_illegal_sequences_bif, random_lists, roundtrips, - latin1, exceptions]. + [utf8_illegal_sequences_bif, + utf16_illegal_sequences_bif, random_lists, roundtrips, + latin1, exceptions]. groups() -> []. @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl index a8d3b207cc..8ba9142e57 100644 --- a/lib/stdlib/test/win32reg_SUITE.erl +++ b/lib/stdlib/test/win32reg_SUITE.erl @@ -18,40 +18,34 @@ %% -module(win32reg_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,long/1,evil_write/1]). --export([ostype/1,fini/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,long/1,evil_write/1]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[long, evil_write]. + [long, evil_write]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -ostype(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> case os:type() of {win32, _} -> Config; _ -> {skip,"Doesn't run on UNIX."} end. -fini(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> Config. long(doc) -> "Test long keys and entries (OTP-3446)."; diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index 98e2721810..ad364d8f34 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -23,7 +23,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, date_1999_01_01/1, date_1999_02_28/1, date_1999_09_09/1, date_2000_01_01/1, date_2000_02_29/1, date_2001_01_01/1, @@ -33,9 +34,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[date_1999_01_01, date_1999_02_28, date_1999_09_09, - date_2000_01_01, date_2000_02_29, date_2001_01_01, - date_2001_02_29, date_2004_02_29]. + [date_1999_01_01, date_1999_02_28, date_1999_09_09, + date_2000_01_01, date_2000_02_29, date_2001_01_01, + date_2001_02_29, date_2004_02_29]. groups() -> []. @@ -47,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. date_1999_01_01(doc) -> diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl index a427067412..96c27cb13c 100644 --- a/lib/stdlib/test/zip_SUITE.erl +++ b/lib/stdlib/test/zip_SUITE.erl @@ -18,7 +18,8 @@ %% -module(zip_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, borderline/1, atomic/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, borderline/1, atomic/1, bad_zip/1, unzip_from_binary/1, unzip_to_binary/1, zip_to_binary/1, unzip_options/1, zip_options/1, list_dir_options/1, aliases/1, @@ -34,10 +35,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[borderline, atomic, bad_zip, unzip_from_binary, - unzip_to_binary, zip_to_binary, unzip_options, - zip_options, list_dir_options, aliases, openzip_api, - zip_api, unzip_jar, compress_control, foldl]. + [borderline, atomic, bad_zip, unzip_from_binary, + unzip_to_binary, zip_to_binary, unzip_options, + zip_options, list_dir_options, aliases, openzip_api, + zip_api, unzip_jar, compress_control, foldl]. groups() -> []. @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. borderline(doc) -> -- cgit v1.2.3 From dc8aa5d93676ac46e1d95598cfec767051a88d9a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:48:59 +0100 Subject: Fix formatting for syntax_tools --- lib/syntax_tools/test/syntax_tools_SUITE.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index 6ef3d28f06..a4cfd89dd5 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -20,7 +20,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). %% Test cases -export([smoke_test/1]). @@ -28,7 +29,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[smoke_test]. + [smoke_test]. groups() -> []. @@ -40,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Read and parse all source in the OTP release. -- cgit v1.2.3 From 307dc266144daa134fc37495362af55a95c06f74 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:52:01 +0100 Subject: Fix formatting for tools --- lib/tools/test/cover_SUITE.erl | 29 +++++++++++++++-------------- lib/tools/test/cprof_SUITE.erl | 17 ++++++++++------- lib/tools/test/emem_SUITE.erl | 29 +++++++++++++++-------------- lib/tools/test/eprof_SUITE.erl | 9 +++++---- lib/tools/test/fprof_SUITE.erl | 21 +++++++++++---------- lib/tools/test/instrument_SUITE.erl | 10 ++++++---- lib/tools/test/lcnt_SUITE.erl | 6 +++--- lib/tools/test/make_SUITE.erl | 13 +++++++------ lib/tools/test/tools_SUITE.erl | 9 +++++---- lib/tools/test/xref_SUITE.erl | 31 ++++++++++++++++--------------- 10 files changed, 93 insertions(+), 81 deletions(-) diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index fe3e987790..ce88e973ce 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -18,7 +18,8 @@ %% -module(cover_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([start/1, compile/1, analyse/1, misc/1, stop/1, distribution/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, @@ -40,17 +41,17 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case whereis(cover_server) of - undefined -> - [start, compile, analyse, misc, stop, distribution, - export_import, otp_5031, eif, otp_5305, otp_5418, - otp_6115, otp_7095, otp_8188, otp_8270, otp_8273, - otp_8340]; - _pid -> - {skip, - "It looks like the test server is running " - "cover. Can't run cover test."} -end. + case whereis(cover_server) of + undefined -> + [start, compile, analyse, misc, stop, distribution, + export_import, otp_5031, eif, otp_5305, otp_5418, + otp_6115, otp_7095, otp_8188, otp_8270, otp_8273, + otp_8340]; + _pid -> + {skip, + "It looks like the test server is running " + "cover. Can't run cover test."} + end. groups() -> []. @@ -62,10 +63,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. start(suite) -> []; diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index 64287c8ba1..158a4c696a 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -63,7 +63,10 @@ config(data_dir, _) -> "cprof_SUITE_data". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, + not_run/1]). -export([basic/1, on_load/1, modules/1]). init_per_testcase(_Case, Config) -> @@ -81,10 +84,10 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(cprof_SUITE) of - true -> [not_run]; - false -> [basic, on_load, modules] -end. + case test_server:is_native(cprof_SUITE) of + true -> [not_run]; + false -> [basic, on_load, modules] + end. groups() -> []. @@ -96,10 +99,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index 6c67375e53..b0812922ac 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -24,7 +24,8 @@ receive_and_save_trace/2, send_trace/2]). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([live_node/1, 'sparc_sunos5.8_32b_emt2.0'/1, @@ -77,23 +78,23 @@ groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - test_cases() -> -[live_node, 'sparc_sunos5.8_32b_emt2.0', - 'pc_win2000_32b_emt2.0', - 'pc.smp_linux2.2.19pre17_32b_emt2.0', - 'powerpc_darwin7.7.0_32b_emt2.0', - 'alpha_osf1v5.1_64b_emt2.0', - 'sparc_sunos5.8_64b_emt2.0', - 'sparc_sunos5.8_32b_emt1.0', 'pc_win2000_32b_emt1.0', - 'powerpc_darwin7.7.0_32b_emt1.0', - 'alpha_osf1v5.1_64b_emt1.0', - 'sparc_sunos5.8_64b_emt1.0']. + [live_node, 'sparc_sunos5.8_32b_emt2.0', + 'pc_win2000_32b_emt2.0', + 'pc.smp_linux2.2.19pre17_32b_emt2.0', + 'powerpc_darwin7.7.0_32b_emt2.0', + 'alpha_osf1v5.1_64b_emt2.0', + 'sparc_sunos5.8_64b_emt2.0', + 'sparc_sunos5.8_32b_emt1.0', 'pc_win2000_32b_emt1.0', + 'powerpc_darwin7.7.0_32b_emt1.0', + 'alpha_osf1v5.1_64b_emt1.0', + 'sparc_sunos5.8_64b_emt1.0']. init_per_testcase(Case, Config) when is_list(Config) -> case maybe_skip(Config) of diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index 492e613a3f..4f1ec94e3d 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -20,12 +20,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, tiny, eed]. + [basic, tiny, eed]. groups() -> []. @@ -37,10 +38,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. basic(suite) -> []; diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 3cfff2473f..82a7e81d44 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). %% Test server framework exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, not_run/1]). %% Test suites -export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1, @@ -57,13 +58,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(fprof_SUITE) of - true -> [not_run]; - false -> - [stack_seq, tail_seq, create_file_slow, spawn_simple, - imm_tail_seq, imm_create_file_slow, imm_compile, - cpu_create_file_slow] -end. + case test_server:is_native(fprof_SUITE) of + true -> [not_run]; + false -> + [stack_seq, tail_seq, create_file_slow, spawn_simple, + imm_tail_seq, imm_create_file_slow, imm_compile, + cpu_create_file_slow] + end. groups() -> []. @@ -75,10 +76,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index 4ce5965d6f..30a7b2b6df 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -18,7 +18,9 @@ %% -module(instrument_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export(['+Mim true'/1, '+Mis true'/1]). @@ -36,7 +38,7 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -['+Mim true', '+Mis true']. + ['+Mim true', '+Mis true']. groups() -> []. @@ -48,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. '+Mim true'(doc) -> ["Check that memory data can be read and processed"]; diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index 3de25766fb..2df78ee63b 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -54,16 +54,16 @@ end_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[load_v1, conflicts, locations, swap_keys]. + [load_v1, conflicts, locations, swap_keys]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%---------------------------------------------------------------------- diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index 5c6d388843..fa88a65443 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -18,7 +18,8 @@ %% -module(make_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, make_all/1, make_files/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, make_all/1, make_files/1]). -export([otp_6057_init/1, otp_6057_a/1, otp_6057_b/1, otp_6057_c/1, otp_6057_end/1]). @@ -38,11 +39,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[make_all, make_files, otp_6057_a, otp_6057_b, - otp_6057_c]. + [make_all, make_files, {group, otp_6057}]. groups() -> - []. + [{otp_6057,[],[otp_6057_a, otp_6057_b, + otp_6057_c]}]. init_per_suite(Config) -> Config. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + otp_6057_init(Config). end_per_group(_GroupName, Config) -> - Config. + otp_6057_end(Config). test_files() -> ["test1", "test2", "test3", "test4"]. diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index ee50283895..2ef69ce9e7 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -25,7 +25,8 @@ -define(application, tools). %% Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases must be exported. @@ -34,7 +35,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[app_test]. + [app_test]. groups() -> []. @@ -46,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index 7dccc7aab4..e3e8ac3924 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -36,7 +36,8 @@ -define(copydir, ?config(copy_dir, Conf)). -endif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init/1, fini/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init/1, fini/1]). -export([ addrem/1, convert/1, intergraph/1, lines/1, loops/1, @@ -71,32 +72,32 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, xref}, {group, files}, {group, analyses}, - {group, misc}]. + [{group, xref}, {group, files}, {group, analyses}, + {group, misc}]. groups() -> [{xref, [], - [addrem, convert, intergraph, lines, loops, no_data, - modules]}, - {files, [], - [add, default, info, lib, read, read2, remove, replace, - update, deprecated, trycatch, abstract_modules, fun_mfa, - qlc]}, - {analyses, [], - [analyze, basic, md, q, variables, unused_locals]}, - {misc, [], [format_error, otp_7423, otp_7831]}]. + [addrem, convert, intergraph, lines, loops, no_data, + modules]}, + {files, [], + [add, default, info, lib, read, read2, remove, replace, + update, deprecated, trycatch, abstract_modules, fun_mfa, + qlc]}, + {analyses, [], + [analyze, basic, md, q, variables, unused_locals]}, + {misc, [], [format_error, otp_7423, otp_7831]}]. init_per_suite(Config) -> - Config. + init(Config). end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init(Conf) when is_list(Conf) -> -- cgit v1.2.3 From 14bcebfe8c0e71f450b4fa4d5d92c8e5e86fd870 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 17:53:33 +0100 Subject: Fix formatting for wx --- lib/wx/test/wx_app_SUITE.erl | 6 +++--- lib/wx/test/wx_basic_SUITE.erl | 11 ++++++----- lib/wx/test/wx_class_SUITE.erl | 13 +++++++------ lib/wx/test/wx_event_SUITE.erl | 11 ++++++----- lib/wx/test/wx_opengl_SUITE.erl | 11 ++++++----- lib/wx/test/wx_xtra_SUITE.erl | 11 ++++++----- 6 files changed, 34 insertions(+), 29 deletions(-) diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index 0dacb7d5ac..1bf5ca2224 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -50,7 +50,7 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[fields, modules, exportall, app_depend, undef_funcs]. + [fields, modules, exportall, app_depend, undef_funcs]. groups() -> []. @@ -62,10 +62,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index 85e3dee315..5b4c65827c 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -23,7 +23,8 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_basic_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -46,17 +47,17 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[create_window, several_apps, wx_api, wx_misc, - data_types]. + [create_window, several_apps, wx_api, wx_misc, + data_types]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index 6693587b5e..e3e4bdc646 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -24,7 +24,8 @@ %%%------------------------------------------------------------------- -module(wx_class_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -47,18 +48,18 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[calendarCtrl, treeCtrl, notebook, staticBoxSizer, - clipboard, helpFrame, htmlWindow, listCtrlSort, - radioBox, systemSettings]. + [calendarCtrl, treeCtrl, notebook, staticBoxSizer, + clipboard, helpFrame, htmlWindow, listCtrlSort, + radioBox, systemSettings]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index dd2ca4b4dc..21f928587b 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -22,7 +22,8 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_event_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -45,17 +46,17 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[connect, disconnect, connect_msg_20, connect_cb_20, - mouse_on_grid, spin_event, connect_in_callback]. + [connect, disconnect, connect_msg_20, connect_cb_20, + mouse_on_grid, spin_event, connect_in_callback]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 87de58bfa8..03fe291577 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -22,7 +22,8 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_opengl_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -53,18 +54,18 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[canvas, glu_tesselation]. + [canvas, glu_tesselation]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. + - %% The test cases -define(VS, {{ 0.5, 0.5, -0.5}, %1 diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index b554d44b59..ecb43e4162 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -23,7 +23,8 @@ %%% Created : 3 Nov 2008 by Dan Gudmundsson %%%------------------------------------------------------------------- -module(wx_xtra_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -46,17 +47,17 @@ end_per_testcase(Func,Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[destroy_app, multiple_add_in_sizer, app_dies, - menu_item_debug]. + [destroy_app, multiple_add_in_sizer, app_dies, + menu_item_debug]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% The test cases -- cgit v1.2.3 From 865a1019f742b6a5b24116926a4cbaee1cb7a60f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 18:00:29 +0100 Subject: Fix formatting for system --- erts/test/autoimport_SUITE.erl | 13 ++++++++----- erts/test/erl_print_SUITE.erl | 19 +++++++++++-------- erts/test/erlc_SUITE.erl | 7 ++++--- erts/test/erlexec_SUITE.erl | 10 ++++++---- erts/test/ethread_SUITE.erl | 16 +++++++++------- erts/test/install_SUITE.erl | 27 ++++++++++++++------------- erts/test/nt_SUITE.erl | 24 +++++++++++++----------- erts/test/otp_SUITE.erl | 13 +++++++------ erts/test/run_erl_SUITE.erl | 12 +++++++----- erts/test/z_SUITE.erl | 12 +++++++----- 10 files changed, 86 insertions(+), 67 deletions(-) diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl index 8c4d2ac2d0..a6270e373a 100644 --- a/erts/test/autoimport_SUITE.erl +++ b/erts/test/autoimport_SUITE.erl @@ -20,13 +20,16 @@ -module(autoimport_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,autoimports/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + autoimports/1]). -define(TEST_TIMEOUT, ?t:seconds(180)). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[autoimports]. + [autoimports]. groups() -> []. @@ -38,17 +41,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(?TEST_TIMEOUT), [{watchdog, Dog} | Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), catch test_server:timetrap_cancel(Dog), ok. diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl index 5820ae6aad..e6154aec2b 100644 --- a/erts/test/erl_print_SUITE.erl +++ b/erts/test/erl_print_SUITE.erl @@ -32,16 +32,19 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, fin_per_testcase/2]). --export([erlang_display/1, integer/1, float/1, string/1, character/1, snprintf/1, quote/1]). +-export([erlang_display/1, integer/1, float/1, + string/1, character/1, snprintf/1, quote/1]). -include_lib("test_server/include/test_server.hrl"). - + suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_cases(). + test_cases(). groups() -> []. @@ -53,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% @@ -66,8 +69,8 @@ end_per_group(_GroupName, Config) -> %% test_cases() -> -[erlang_display, integer, float, string, character, - snprintf, quote]. + [erlang_display, integer, float, string, character, + snprintf, quote]. erlang_display(doc) -> []; erlang_display(suite) -> []; diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index 0dcf712638..e8531bac8b 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -20,7 +20,8 @@ %% Tests the erlc command by compiling various types of files. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, compile_erl/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, compile_erl/1, compile_yecc/1, compile_script/1, compile_mib/1, good_citizen/1, deep_cwd/1, arg_overflow/1]). @@ -42,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Copy from erlc_SUITE_data/include/erl_test.hrl. diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl index f9b7a07069..bc95d7feb5 100644 --- a/erts/test/erlexec_SUITE.erl +++ b/erts/test/erlexec_SUITE.erl @@ -31,7 +31,9 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(1)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([args_file/1, evil_args_file/1, env/1, args_file_env/1, otp_7461/1, otp_7461_remote/1, otp_8209/1, zdbbl_dist_buf_busy_limit/1]). @@ -43,7 +45,7 @@ init_per_testcase(Case, Config) -> SavedEnv = save_env(), [{testcase, Case}, {watchdog, Dog}, {erl_flags_env, SavedEnv} |Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), SavedEnv = ?config(erl_flags_env, Config), restore_env(SavedEnv), @@ -67,10 +69,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. otp_8209(doc) -> ["Test that plain first argument does not " diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl index a44b34f317..52edfd254b 100644 --- a/erts/test/ethread_SUITE.erl +++ b/erts/test/ethread_SUITE.erl @@ -31,7 +31,9 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, fin_per_testcase/2]). -export([create_join_thread/1, equal_tids/1, @@ -50,14 +52,14 @@ -include_lib("test_server/include/test_server.hrl"). tests() -> -[create_join_thread, equal_tids, mutex, try_lock_mutex, - cond_wait, broadcast, detached_thread, - max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic]. + [create_join_thread, equal_tids, mutex, try_lock_mutex, + cond_wait, broadcast, detached_thread, + max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic]. suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -tests(). + tests(). groups() -> []. @@ -69,10 +71,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% %% diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl index 8797d62cfa..c9f0fb5343 100644 --- a/erts/test/install_SUITE.erl +++ b/erts/test/install_SUITE.erl @@ -29,8 +29,9 @@ %-define(line_trace, 1). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -export([bin_default/1, bin_default_dirty/1, @@ -65,29 +66,29 @@ bindir_symlinks = ""}). need_symlink_cases() -> -[bin_unreachable_absolute, bin_unreachable_relative, - bin_same_dir, bin_ok_symlink, bin_dirname_fail, - bin_no_use_dirname_fail]. + [bin_unreachable_absolute, bin_unreachable_relative, + bin_same_dir, bin_ok_symlink, bin_dirname_fail, + bin_no_use_dirname_fail]. dont_need_symlink_cases() -> -[bin_default, bin_default_dirty, bin_outside_eprfx, - bin_outside_eprfx_dirty, bin_not_abs, - bin_unreasonable_path, 'bin white space', - bin_no_srcfile]. + [bin_default, bin_default_dirty, bin_outside_eprfx, + bin_outside_eprfx_dirty, bin_not_abs, + bin_unreasonable_path, 'bin white space', + bin_no_srcfile]. suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -dont_need_symlink_cases() ++ need_symlink_cases(). + dont_need_symlink_cases() ++ need_symlink_cases(). groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% @@ -590,7 +591,7 @@ init_per_testcase_aux(true, _OsType, Case, Config) -> {test_dir, make_dirs(?config(priv_dir, Config), atom_to_list(Case))} | Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl index 833275009f..f06a5c2190 100644 --- a/erts/test/nt_SUITE.erl +++ b/erts/test/nt_SUITE.erl @@ -22,7 +22,9 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,nt/1,handle_eventlog/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,init_per_testcase/2, + end_per_testcase/2,nt/1,handle_eventlog/2, middleman/1,service_basic/1, service_env/1, user_env/1, synced/1, service_prio/1, logout/1, debug/1, restart/1, restart_always/1,stopaction/1, @@ -34,13 +36,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case os:type() of - {win32, nt} -> - [nt, service_basic, service_env, user_env, synced, - service_prio, logout, debug, restart, restart_always, - stopaction]; - _ -> [nt] -end. + case os:type() of + {win32, nt} -> + [nt, service_basic, service_env, user_env, synced, + service_prio, logout, debug, restart, restart_always, + stopaction]; + _ -> [nt] + end. groups() -> []. @@ -52,17 +54,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(?TEST_TIMEOUT), [{watchdog, Dog} | Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> lists:foreach(fun(X) -> catch remove_service("test_service_" ++ integer_to_list(X)) end, diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index afc089408a..0dc6074d12 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -19,7 +19,8 @@ -module(otp_SUITE). --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,init_per_suite/1,end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1,end_per_suite/1]). -export([undefined_functions/1,deprecated_not_in_obsolete/1, obsolete_but_not_deprecated/1,call_to_deprecated/1, call_to_size_1/1,strong_components/1]). @@ -31,18 +32,18 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[undefined_functions, deprecated_not_in_obsolete, - obsolete_but_not_deprecated, call_to_deprecated, - call_to_size_1, strong_components]. + [undefined_functions, deprecated_not_in_obsolete, + obsolete_but_not_deprecated, call_to_deprecated, + call_to_size_1, strong_components]. groups() -> []. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_suite(Config) -> diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index 9ddb9d0084..a76f8d877e 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -19,7 +19,9 @@ -module(run_erl_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1,heavy/1,heavier/1,defunct/1]). -export([ping_me_back/1]). @@ -29,7 +31,7 @@ init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. @@ -37,7 +39,7 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, heavy, heavier, defunct]. + [basic, heavy, heavier, defunct]. groups() -> []. @@ -49,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. basic(Config) when is_list(Config) -> diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index 8ed79c04ce..c88b7e84d0 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -35,7 +35,9 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([search_for_core_files/1, core_files/1]). @@ -46,7 +48,7 @@ init_per_testcase(Case, Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), [{testcase, Case}, {watchdog, Dog} |Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. @@ -54,7 +56,7 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[core_files]. + [core_files]. groups() -> []. @@ -66,10 +68,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -- cgit v1.2.3 From 9c2305c5e388e966a47205fa70542e46a0f90913 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 18:01:16 +0100 Subject: Fix formatting for epmd --- erts/epmd/test/epmd_SUITE.erl | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index d7b0806b95..a5d7b24345 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -35,7 +35,9 @@ -record(node_info, {port, node_type, prot, lvsn, hvsn, node_name, extra}). % Test server specific exports --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export( [ @@ -104,21 +106,21 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[register_name, register_names_1, register_names_2, - register_duplicate_name, get_port_nr, slow_get_port_nr, - unregister_others_name_1, unregister_others_name_2, - register_overflow, name_with_null_inside, - name_null_terminated, stupid_names_req, no_data, - one_byte, two_bytes, partial_packet, zero_length, - too_large, alive_req_too_small_1, alive_req_too_small_2, - alive_req_too_large, returns_valid_empty_extra, - returns_valid_populated_extra_with_nulls, - {group, buffer_overrun}, no_nonlocal_register, - no_nonlocal_kill, no_live_killing]. + [register_name, register_names_1, register_names_2, + register_duplicate_name, get_port_nr, slow_get_port_nr, + unregister_others_name_1, unregister_others_name_2, + register_overflow, name_with_null_inside, + name_null_terminated, stupid_names_req, no_data, + one_byte, two_bytes, partial_packet, zero_length, + too_large, alive_req_too_small_1, alive_req_too_small_2, + alive_req_too_large, returns_valid_empty_extra, + returns_valid_populated_extra_with_nulls, + {group, buffer_overrun}, no_nonlocal_register, + no_nonlocal_kill, no_live_killing]. groups() -> [{buffer_overrun, [], - [buffer_overrun_1, buffer_overrun_2]}]. + [buffer_overrun_1, buffer_overrun_2]}]. init_per_suite(Config) -> Config. @@ -127,10 +129,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% @@ -142,7 +144,7 @@ init_per_testcase(_Func, Config) -> cleanup(), [{watchdog, Dog} | Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> cleanup(), Dog = ?config(watchdog, Config), catch test_server:timetrap_cancel(Dog), % We may have canceled already -- cgit v1.2.3 From d8a27daee264991e14def9b2e40f10c8f6d8e4d3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Dec 2010 18:21:28 +0100 Subject: Fix formatting for emulator --- erts/emulator/test/a_SUITE.erl | 9 ++-- erts/emulator/test/after_SUITE.erl | 18 ++++---- erts/emulator/test/alloc_SUITE.erl | 15 ++++--- erts/emulator/test/beam_SUITE.erl | 12 ++--- erts/emulator/test/beam_literals_SUITE.erl | 21 ++++----- erts/emulator/test/bif_SUITE.erl | 16 ++++--- erts/emulator/test/big_SUITE.erl | 17 +++---- erts/emulator/test/binary_SUITE.erl | 41 ++++++++--------- erts/emulator/test/bs_bincomp_SUITE.erl | 11 ++--- erts/emulator/test/bs_bit_binaries_SUITE.erl | 15 ++++--- erts/emulator/test/bs_construct_SUITE.erl | 15 ++++--- erts/emulator/test/bs_match_bin_SUITE.erl | 10 +++-- erts/emulator/test/bs_match_int_SUITE.erl | 12 ++--- erts/emulator/test/bs_match_misc_SUITE.erl | 16 ++++--- erts/emulator/test/bs_match_tail_SUITE.erl | 9 ++-- erts/emulator/test/bs_utf_SUITE.erl | 16 ++++--- erts/emulator/test/busy_port_SUITE.erl | 14 +++--- erts/emulator/test/call_trace_SUITE.erl | 28 ++++++------ erts/emulator/test/code_SUITE.erl | 15 ++++--- erts/emulator/test/crypto_SUITE.erl | 11 ++--- erts/emulator/test/ddll_SUITE.erl | 31 ++++++------- erts/emulator/test/decode_packet_SUITE.erl | 12 ++--- erts/emulator/test/distribution_SUITE.erl | 11 ++--- erts/emulator/test/driver_SUITE.erl | 59 ++++++++++++------------ erts/emulator/test/efile_SUITE.erl | 9 ++-- erts/emulator/test/erl_drv_thread_SUITE.erl | 9 ++-- erts/emulator/test/erl_link_SUITE.erl | 24 +++++----- erts/emulator/test/erts_debug_SUITE.erl | 15 ++++--- erts/emulator/test/estone_SUITE.erl | 13 +++--- erts/emulator/test/evil_SUITE.erl | 18 ++++---- erts/emulator/test/exception_SUITE.erl | 14 +++--- erts/emulator/test/float_SUITE.erl | 14 +++--- erts/emulator/test/fun_SUITE.erl | 18 ++++---- erts/emulator/test/fun_r12_SUITE.erl | 12 ++--- erts/emulator/test/gc_SUITE.erl | 9 ++-- erts/emulator/test/guard_SUITE.erl | 12 ++--- erts/emulator/test/hash_SUITE.erl | 16 ++++--- erts/emulator/test/hibernate_SUITE.erl | 14 +++--- erts/emulator/test/list_bif_SUITE.erl | 14 +++--- erts/emulator/test/match_spec_SUITE.erl | 27 +++++------ erts/emulator/test/module_info_SUITE.erl | 20 ++++++--- erts/emulator/test/monitor_SUITE.erl | 21 ++++----- erts/emulator/test/nested_SUITE.erl | 12 ++--- erts/emulator/test/nif_SUITE.erl | 40 +++++++++-------- erts/emulator/test/nif_SUITE_data/nif_mod.erl | 2 +- erts/emulator/test/nif_SUITE_data/tester.erl | 2 +- erts/emulator/test/node_container_SUITE.erl | 25 +++++------ erts/emulator/test/nofrag_SUITE.erl | 14 +++--- erts/emulator/test/num_bif_SUITE.erl | 15 ++++--- erts/emulator/test/old_scheduler_SUITE.erl | 28 ++++++------ erts/emulator/test/op_SUITE.erl | 14 +++--- erts/emulator/test/port_SUITE.erl | 41 +++++++++-------- erts/emulator/test/port_bif_SUITE.erl | 19 ++++---- erts/emulator/test/process_SUITE.erl | 64 +++++++++++++-------------- erts/emulator/test/pseudoknot_SUITE.erl | 9 ++-- erts/emulator/test/receive_SUITE.erl | 13 +++--- erts/emulator/test/ref_SUITE.erl | 12 ++--- erts/emulator/test/register_SUITE.erl | 12 ++--- erts/emulator/test/save_calls_SUITE.erl | 9 ++-- erts/emulator/test/scheduler_SUITE.erl | 35 +++++++-------- erts/emulator/test/send_term_SUITE.erl | 13 +++--- erts/emulator/test/sensitive_SUITE.erl | 18 ++++---- erts/emulator/test/signal_SUITE.erl | 38 ++++++++-------- erts/emulator/test/statistics_SUITE.erl | 25 ++++++----- erts/emulator/test/system_info_SUITE.erl | 14 +++--- erts/emulator/test/system_profile_SUITE.erl | 18 ++++---- erts/emulator/test/time_SUITE.erl | 13 +++--- erts/emulator/test/timer_bif_SUITE.erl | 29 ++++++------ erts/emulator/test/trace_SUITE.erl | 25 ++++++----- erts/emulator/test/trace_bif_SUITE.erl | 24 +++++----- erts/emulator/test/trace_call_count_SUITE.erl | 20 +++++---- erts/emulator/test/trace_call_time_SUITE.erl | 25 ++++++----- erts/emulator/test/trace_local_SUITE.erl | 41 ++++++++--------- erts/emulator/test/trace_meta_SUITE.erl | 6 ++- erts/emulator/test/trace_nif_SUITE.erl | 21 ++++----- erts/emulator/test/trace_port_SUITE.erl | 24 +++++----- erts/emulator/test/tuple_SUITE.erl | 16 ++++--- erts/emulator/test/z_SUITE.erl | 14 +++--- 78 files changed, 784 insertions(+), 679 deletions(-) diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl index a52777a7e1..ff1e959c83 100644 --- a/erts/emulator/test/a_SUITE.erl +++ b/erts/emulator/test/a_SUITE.erl @@ -28,12 +28,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[long_timers, pollset_size]. + [long_timers, pollset_size]. groups() -> []. @@ -45,10 +46,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. long_timers(doc) -> diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl index 95fc8c22b8..cab8e55054 100644 --- a/erts/emulator/test/after_SUITE.erl +++ b/erts/emulator/test/after_SUITE.erl @@ -23,11 +23,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_after/1, receive_after/1, receive_after_big/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + t_after/1, receive_after/1, receive_after_big/1, receive_after_errors/1, receive_var_zero/1, receive_zero/1, multi_timeout/1, receive_after_32bit/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Internal exports. @@ -36,9 +38,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[t_after, receive_after, receive_after_big, - receive_after_errors, receive_var_zero, receive_zero, - multi_timeout, receive_after_32bit]. + [t_after, receive_after, receive_after_big, + receive_after_errors, receive_var_zero, receive_zero, + multi_timeout, receive_after_32bit]. groups() -> []. @@ -50,17 +52,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl index 98f282f9cd..3bceb03033 100644 --- a/erts/emulator/test/alloc_SUITE.erl +++ b/erts/emulator/test/alloc_SUITE.erl @@ -18,7 +18,8 @@ -module(alloc_SUITE). -author('rickard.green@uab.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([basic/1, coalesce/1, @@ -29,7 +30,7 @@ rbtree/1, mseg_clear_cache/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). @@ -38,8 +39,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, coalesce, threads, realloc_copy, bucket_index, - bucket_mask, rbtree, mseg_clear_cache]. + [basic, coalesce, threads, realloc_copy, bucket_index, + bucket_mask, rbtree, mseg_clear_cache]. groups() -> []. @@ -51,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. @@ -62,7 +63,7 @@ init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?t:seconds(?DEFAULT_TIMETRAP_SECS)), [{watchdog, Dog},{testcase, Case}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index 8fd1c8a5be..e275fa8ad9 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -19,7 +19,9 @@ -module(beam_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, packed_registers/1, apply_last/1, apply_last_bif/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + packed_registers/1, apply_last/1, apply_last_bif/1, buildo_mucho/1, heap_sizes/1, big_lists/1, fconv/1, select_val/1]). @@ -30,8 +32,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[packed_registers, apply_last, apply_last_bif, - buildo_mucho, heap_sizes, big_lists, select_val]. + [packed_registers, apply_last, apply_last_bif, + buildo_mucho, heap_sizes, big_lists, select_val]. groups() -> []. @@ -43,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index a9154f117b..680c0eda48 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -18,7 +18,8 @@ %% -module(beam_literals_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([putting/1, matching_smalls/1, matching_smalls_jt/1, matching_bigs/1, matching_more_bigs/1, matching_bigs_and_smalls/1, badmatch/1, case_clause/1, @@ -31,11 +32,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[putting, matching_smalls, matching_smalls_jt, - matching_bigs, matching_more_bigs, - matching_bigs_and_smalls, badmatch, case_clause, - receiving, literal_type_tests, put_list, fconv, - literal_case_expression, increment]. + [putting, matching_smalls, matching_smalls_jt, + matching_bigs, matching_more_bigs, + matching_bigs_and_smalls, badmatch, case_clause, + receiving, literal_type_tests, put_list, fconv, + literal_case_expression, increment]. groups() -> []. @@ -47,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. putting(doc) -> "Test creating lists and tuples containing big number literals."; @@ -256,14 +257,14 @@ make_test([{T,L}|Ts]) -> make_test([]) -> []. test(T, L) -> - S = lists:flatten(io_lib:format("begin io:format(\"~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T, L, T, L])), + S = lists:flatten(io_lib:format("begin io:format(\"~~p~n\", [{~p,~p}]), if ~w(~w) -> true; true -> false end end. ", [T, L, T, L])), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), {value,Val,_Bs} = erl_eval:exprs(E, []), {match,0,{atom,0,Val},hd(E)}. test(T, A, L) -> - S = lists:flatten(io_lib:format("begin io:format(\"~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", + S = lists:flatten(io_lib:format("begin io:format(\"~~p~n\", [{~p,~p,~p}]), if ~w(~w, ~w) -> true; true -> false end end. ", [T,L,A,T,L,A])), {ok,Toks,_Line} = erl_scan:string(S), {ok,E} = erl_parse:parse_exprs(Toks), diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 7313d25c8e..cdbceae239 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, types/1, t_list_to_existing_atom/1,os_env/1,otp_7526/1, binary_to_atom/1,binary_to_existing_atom/1, @@ -30,9 +32,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[types, t_list_to_existing_atom, os_env, otp_7526, - atom_to_binary, binary_to_atom, binary_to_existing_atom, - min_max]. + [types, t_list_to_existing_atom, os_env, otp_7526, + atom_to_binary, binary_to_atom, binary_to_existing_atom, + min_max]. groups() -> []. @@ -44,17 +46,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index a42d91ef13..b0df2ff18b 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -19,7 +19,8 @@ -module(big_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([t_div/1, eq_28/1, eq_32/1, eq_big/1, eq_math/1, big_literals/1, borders/1, negative/1, big_float_1/1, big_float_2/1, shift_limit_1/1, powmod/1, system_limit/1, otp_6692/1]). @@ -30,16 +31,16 @@ -export([fac/1, fib/1, pow/2, gcd/2, lcm/2]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[t_div, eq_28, eq_32, eq_big, eq_math, big_literals, - borders, negative, {group, big_float}, shift_limit_1, - powmod, system_limit, otp_6692]. + [t_div, eq_28, eq_32, eq_big, eq_math, big_literals, + borders, negative, {group, big_float}, shift_limit_1, + powmod, system_limit, otp_6692]. groups() -> [{big_float, [], [big_float_1, big_float_2]}]. @@ -51,17 +52,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index cd9e8c71fc..1abdc91f9c 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -42,7 +42,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, copy_terms/1, conversions/1, deep_lists/1, deep_bitstr_lists/1, bad_list_to_binary/1, bad_binary_to_list/1, t_split_binary/1, bad_split/1, t_concat_binary/1, @@ -61,19 +63,20 @@ %% Internal exports. -export([sleeper/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{suite_callbacks,[ts_install_scb]}, + {timetrap,{minutes,2}}]. all() -> -[copy_terms, conversions, deep_lists, deep_bitstr_lists, - t_split_binary, bad_split, t_concat_binary, - bad_list_to_binary, bad_binary_to_list, terms, - terms_float, external_size, t_iolist_size, - bad_binary_to_term_2, safe_binary_to_term2, - bad_binary_to_term, bad_terms, t_hash, bad_size, - bad_term_to_binary, more_bad_terms, otp_5484, otp_5933, - ordering, unaligned_order, gc_test, - bit_sized_binary_sizes, otp_6817, otp_8117, deep, - obsolete_funs, robustness, otp_8180]. + [copy_terms, conversions, deep_lists, deep_bitstr_lists, + t_split_binary, bad_split, t_concat_binary, + bad_list_to_binary, bad_binary_to_list, terms, + terms_float, external_size, t_iolist_size, + bad_binary_to_term_2, safe_binary_to_term2, + bad_binary_to_term, bad_terms, t_hash, bad_size, + bad_term_to_binary, more_bad_terms, otp_5484, otp_5933, + ordering, unaligned_order, gc_test, + bit_sized_binary_sizes, otp_6817, otp_8117, deep, + obsolete_funs, robustness, otp_8180]. groups() -> []. @@ -85,19 +88,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> - Dog=?t:timetrap(?t:minutes(2)), - [{watchdog, Dog}|Config]. + Config. -fin_per_testcase(_Func, Config) -> - Dog=?config(watchdog, Config), - ?t:timetrap_cancel(Dog). +end_per_testcase(_Func, _Config) -> + ok. -define(heap_binary_size, 64). @@ -1060,7 +1061,7 @@ test_terms(Test_Func) -> ?line Test_Func(F = fun(A) -> 42*A end), ?line Test_Func(lists:duplicate(32, F)), - ?line Test_Func(FF = fun binary_SUITE:all/1), + ?line Test_Func(FF = fun binary_SUITE:all/0), ?line Test_Func(lists:duplicate(32, FF)), ok. diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl index 51412d2e4f..e221f519cf 100644 --- a/erts/emulator/test/bs_bincomp_SUITE.erl +++ b/erts/emulator/test/bs_bincomp_SUITE.erl @@ -22,7 +22,8 @@ -module(bs_bincomp_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, byte_aligned/1,bit_aligned/1,extended_byte_aligned/1, extended_bit_aligned/1,mixed/1,tracing/1]). @@ -31,8 +32,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[byte_aligned, bit_aligned, extended_byte_aligned, - extended_bit_aligned, mixed, tracing]. + [byte_aligned, bit_aligned, extended_byte_aligned, + extended_bit_aligned, mixed, tracing]. groups() -> []. @@ -44,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl index 4216ff0325..eaf2f99027 100644 --- a/erts/emulator/test/bs_bit_binaries_SUITE.erl +++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl @@ -22,7 +22,8 @@ -module(bs_bit_binaries_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, misc/1,horrid_match/1,test_bitstr/1,test_bit_size/1,asymmetric_tests/1, big_asymmetric_tests/1,binary_to_and_from_list/1, big_binary_to_and_from_list/1,send_and_receive/1, @@ -33,10 +34,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[misc, horrid_match, test_bitstr, test_bit_size, - asymmetric_tests, big_asymmetric_tests, - binary_to_and_from_list, big_binary_to_and_from_list, - send_and_receive, send_and_receive_alot, append]. + [misc, horrid_match, test_bitstr, test_bit_size, + asymmetric_tests, big_asymmetric_tests, + binary_to_and_from_list, big_binary_to_and_from_list, + send_and_receive, send_and_receive_alot, append]. groups() -> []. @@ -48,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. misc(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 9c2e67ce65..e23d0c6e26 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -21,7 +21,8 @@ -module(bs_construct_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, test1/1, test2/1, test3/1, test4/1, test5/1, testf/1, not_used/1, in_guard/1, mem_leak/1, coerce_to_float/1, bjorn/1, @@ -34,10 +35,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test1, test2, test3, test4, test5, testf, not_used, - in_guard, mem_leak, coerce_to_float, bjorn, - huge_float_field, huge_binary, system_limit, badarg, - copy_writable_binary, kostis, dynamic, bs_add, otp_7422, zero_width]. + [test1, test2, test3, test4, test5, testf, not_used, + in_guard, mem_leak, coerce_to_float, bjorn, + huge_float_field, huge_binary, system_limit, badarg, + copy_writable_binary, kostis, dynamic, bs_add, otp_7422, zero_width]. groups() -> []. @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. big(1) -> 57285702734876389752897683. diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl index b60e735ae4..2530fbd43c 100644 --- a/erts/emulator/test/bs_match_bin_SUITE.erl +++ b/erts/emulator/test/bs_match_bin_SUITE.erl @@ -19,14 +19,16 @@ -module(bs_match_bin_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[byte_split_binary, bit_split_binary, match_huge_bin]. + [byte_split_binary, bit_split_binary, match_huge_bin]. groups() -> []. @@ -38,10 +40,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. byte_split_binary(doc) -> "Tries to split a binary at all byte-aligned positions."; diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl index cb3cd89e3a..f454e5d3e9 100644 --- a/erts/emulator/test/bs_match_int_SUITE.erl +++ b/erts/emulator/test/bs_match_int_SUITE.erl @@ -18,7 +18,9 @@ -module(bs_match_int_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1, match_huge_int/1,bignum/1,unaligned_32_bit/1]). -include_lib("test_server/include/test_server.hrl"). @@ -28,8 +30,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[integer, signed_integer, dynamic, more_dynamic, mml, - match_huge_int, bignum, unaligned_32_bit]. + [integer, signed_integer, dynamic, more_dynamic, mml, + match_huge_int, bignum, unaligned_32_bit]. groups() -> []. @@ -41,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. integer(Config) when is_list(Config) -> diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl index a32a530e80..31379eccd6 100644 --- a/erts/emulator/test/bs_match_misc_SUITE.erl +++ b/erts/emulator/test/bs_match_misc_SUITE.erl @@ -18,7 +18,9 @@ %% -module(bs_match_misc_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + bound_var/1,bound_tail/1,t_float/1,little_float/1,sean/1, kenneth/1,encode_binary/1,native/1,happi/1, size_var/1,wiger/1,x0_context/1,huge_float_field/1, writable_binary_matched/1,otp_7198/1]). @@ -28,10 +30,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[bound_var, bound_tail, t_float, little_float, sean, - kenneth, encode_binary, native, happi, size_var, wiger, - x0_context, huge_float_field, writable_binary_matched, - otp_7198]. + [bound_var, bound_tail, t_float, little_float, sean, + kenneth, encode_binary, native, happi, size_var, wiger, + x0_context, huge_float_field, writable_binary_matched, + otp_7198]. groups() -> []. @@ -43,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. bound_var(doc) -> "Test matching of bound variables."; diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl index 02709d7c3e..34e711b014 100644 --- a/erts/emulator/test/bs_match_tail_SUITE.erl +++ b/erts/emulator/test/bs_match_tail_SUITE.erl @@ -20,14 +20,15 @@ -module(bs_match_tail_SUITE). -author('bjorn@erix.ericsson.se'). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,aligned/1,unaligned/1,zero_tail/1]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[aligned, unaligned, zero_tail]. + [aligned, unaligned, zero_tail]. groups() -> []. @@ -39,10 +40,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. aligned(doc) -> "Test aligned tails."; diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl index a72afd0d7c..6e660b12b0 100644 --- a/erts/emulator/test/bs_utf_SUITE.erl +++ b/erts/emulator/test/bs_utf_SUITE.erl @@ -19,7 +19,9 @@ -module(bs_utf_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, utf8_roundtrip/1,utf16_roundtrip/1,utf32_roundtrip/1, utf8_illegal_sequences/1,utf16_illegal_sequences/1, utf32_illegal_sequences/1, @@ -33,16 +35,16 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[utf8_roundtrip, utf16_roundtrip, utf32_roundtrip, - utf8_illegal_sequences, utf16_illegal_sequences, - utf32_illegal_sequences, bad_construction]. + [utf8_roundtrip, utf16_roundtrip, utf32_roundtrip, + utf8_illegal_sequences, utf16_illegal_sequences, + utf32_illegal_sequences, bad_construction]. groups() -> []. @@ -54,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. utf8_roundtrip(Config) when is_list(Config) -> diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index 4d11fe1377..f14dec4908 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -19,7 +19,9 @@ -module(busy_port_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, io_to_busy/1, message_order/1, send_3/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + io_to_busy/1, message_order/1, send_3/1, system_monitor/1, no_trap_exit/1, no_trap_exit_unlinked/1, trap_exit/1, multiple_writers/1, hard_busy_driver/1, soft_busy_driver/1]). @@ -32,9 +34,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[io_to_busy, message_order, send_3, system_monitor, - no_trap_exit, no_trap_exit_unlinked, trap_exit, - multiple_writers, hard_busy_driver, soft_busy_driver]. + [io_to_busy, message_order, send_3, system_monitor, + no_trap_exit, no_trap_exit_unlinked, trap_exit, + multiple_writers, hard_busy_driver, soft_busy_driver]. groups() -> []. @@ -46,10 +48,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% Tests I/O operations to a busy port, to make sure a suspended send diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl index 9cfc9364df..2b35fbe80d 100644 --- a/erts/emulator/test/call_trace_SUITE.erl +++ b/erts/emulator/test/call_trace_SUITE.erl @@ -20,7 +20,9 @@ -module(call_trace_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, hipe/1,process_specs/1,basic/1,flags/1,errors/1,pam/1,change_pam/1, return_trace/1,exception_trace/1,on_load/1,deep_exception/1, exception_nocatch/1,bit_syntax/1]). @@ -42,15 +44,15 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -Common = [errors, on_load], - NotHipe = [process_specs, basic, flags, pam, change_pam, - return_trace, exception_trace, deep_exception, - exception_nocatch, bit_syntax], - Hipe = [hipe], - case test_server:is_native(call_trace_SUITE) of - true -> Hipe ++ Common; - false -> NotHipe ++ Common -end. + Common = [errors, on_load], + NotHipe = [process_specs, basic, flags, pam, change_pam, + return_trace, exception_trace, deep_exception, + exception_nocatch, bit_syntax], + Hipe = [hipe], + case test_server:is_native(call_trace_SUITE) of + true -> Hipe ++ Common; + false -> NotHipe ++ Common + end. groups() -> []. @@ -62,17 +64,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:seconds(30)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 986ad02074..07a8b04cb4 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -18,7 +18,8 @@ %% -module(code_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, new_binary_types/1,t_check_process_code/1,t_check_process_code_ets/1, external_fun/1,get_chunk/1,module_md5/1,make_stub/1, make_stub_many_funs/1,constant_pools/1, @@ -29,10 +30,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[new_binary_types, t_check_process_code, - t_check_process_code_ets, external_fun, get_chunk, - module_md5, make_stub, make_stub_many_funs, - constant_pools, false_dependency, coverage]. + [new_binary_types, t_check_process_code, + t_check_process_code_ets, external_fun, get_chunk, + module_md5, make_stub, make_stub_many_funs, + constant_pools, false_dependency, coverage]. groups() -> []. @@ -44,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. new_binary_types(Config) when is_list(Config) -> diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl index 057f44a041..d967694d61 100644 --- a/erts/emulator/test/crypto_SUITE.erl +++ b/erts/emulator/test/crypto_SUITE.erl @@ -21,15 +21,16 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_md5/1,t_md5_update/1,error/1,unaligned_context/1,random_lists/1, misc_errors/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[t_md5, t_md5_update, error, unaligned_context, - random_lists, misc_errors]. + [t_md5, t_md5_update, error, unaligned_context, + random_lists, misc_errors]. groups() -> []. @@ -41,10 +42,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl index 3eeffba418..2166b4ab76 100644 --- a/erts/emulator/test/ddll_SUITE.erl +++ b/erts/emulator/test/ddll_SUITE.erl @@ -30,7 +30,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, ddll_test/1, errors/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, ddll_test/1, errors/1, reference_count/1, kill_port/1, dont_kill_port/1]). -export([unload_on_process_exit/1, delayed_unload_with_ports/1, @@ -55,18 +56,18 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[ddll_test, errors, reference_count, kill_port, - dont_kill_port, properties, load_and_unload, - unload_on_process_exit, delayed_unload_with_ports, - unload_due_to_process_exit, - no_unload_due_to_process_exit, - no_unload_due_to_process_exit_2, unload_reload_thingie, - unload_reload_thingie_2, unload_reload_thingie_3, - reload_pending, load_fail_init, - reload_pending_fail_init, reload_pending_kill, - more_error_codes, forced_port_killing, - no_trap_exit_and_kill_ports, monitor_demonitor, - monitor_demonitor_load, new_interface, lock_driver]. + [ddll_test, errors, reference_count, kill_port, + dont_kill_port, properties, load_and_unload, + unload_on_process_exit, delayed_unload_with_ports, + unload_due_to_process_exit, + no_unload_due_to_process_exit, + no_unload_due_to_process_exit_2, unload_reload_thingie, + unload_reload_thingie_2, unload_reload_thingie_3, + reload_pending, load_fail_init, + reload_pending_fail_init, reload_pending_kill, + more_error_codes, forced_port_killing, + no_trap_exit_and_kill_ports, monitor_demonitor, + monitor_demonitor_load, new_interface, lock_driver]. groups() -> []. @@ -78,10 +79,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. unload_on_process_exit(suite) -> diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index aac08b5f63..a26e2340d0 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -23,13 +23,15 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, packet_size, neg, http, line, ssl, otp_8536]. + [basic, packet_size, neg, http, line, ssl, otp_8536]. groups() -> []. @@ -41,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> @@ -54,7 +56,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 8f0eaf2aa2..f1e7468860 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -24,7 +24,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, ping/1, bulk_send_small/1, bulk_send_big/1, bulk_send_bigbig/1, local_send_small/1, local_send_big/1, @@ -44,7 +45,7 @@ bad_dist_ext_control/1, bad_dist_ext_connection_id/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Internal exports. -export([sender/3, receiver2/2, dummy_waiter/0, dead_process/0, @@ -82,10 +83,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(DEFAULT_TIMETRAP, 4*60*1000). @@ -93,7 +94,7 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?DEFAULT_TIMETRAP), [{watchdog, Dog},{testcase, Func}|Config]. -fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> +end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 46732d4d05..9da7ad671d 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -27,10 +27,10 @@ %%% - queueing -module(driver_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, + end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, - fin_per_testcase/2, - end_per_suite/1, + end_per_testcase/2, outputv_echo/1, timer_measure/1, @@ -120,53 +120,50 @@ init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?line 0 = erts_debug:get_internal_state(check_io_debug), [{watchdog, Dog},{testcase, Case}|Config]. -fin_per_testcase(Case, Config) -> +end_per_testcase(Case, Config) -> Dog = ?config(watchdog, Config), - erlang:display({fin_per_testcase, Case}), + erlang:display({end_per_testcase, Case}), ?line 0 = erts_debug:get_internal_state(check_io_debug), ?t:timetrap_cancel(Dog). -end_per_suite(_Config) -> - catch erts_debug:set_internal_state(available_internal_state, false). - suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[fun_to_port, outputv_echo, queue_echo, {group, timer}, - driver_unloaded, io_ready_exit, use_fallback_pollset, - bad_fd_in_pollset, driver_event, fd_change, - steal_control, otp_6602, 'driver_system_info_ver1.0', - 'driver_system_info_ver1.1', - driver_system_info_current_ver, driver_monitor, - {group, ioq_exit}, zero_extended_marker_garb_drv, - invalid_extended_marker_drv, larger_major_vsn_drv, - larger_minor_vsn_drv, smaller_major_vsn_drv, - smaller_minor_vsn_drv, peek_non_existing_queue, - otp_6879, caller, many_events, missing_callbacks, - smp_select, driver_select_use, - thread_mseg_alloc_cache_clean]. + [fun_to_port, outputv_echo, queue_echo, {group, timer}, + driver_unloaded, io_ready_exit, use_fallback_pollset, + bad_fd_in_pollset, driver_event, fd_change, + steal_control, otp_6602, 'driver_system_info_ver1.0', + 'driver_system_info_ver1.1', + driver_system_info_current_ver, driver_monitor, + {group, ioq_exit}, zero_extended_marker_garb_drv, + invalid_extended_marker_drv, larger_major_vsn_drv, + larger_minor_vsn_drv, smaller_major_vsn_drv, + smaller_minor_vsn_drv, peek_non_existing_queue, + otp_6879, caller, many_events, missing_callbacks, + smp_select, driver_select_use, + thread_mseg_alloc_cache_clean]. groups() -> [{timer, [], - [timer_measure, timer_cancel, timer_delay, - timer_change]}, - {ioq_exit, [], - [ioq_exit_ready_input, ioq_exit_ready_output, - ioq_exit_timeout, ioq_exit_ready_async, ioq_exit_event, - ioq_exit_ready_input_async, ioq_exit_ready_output_async, - ioq_exit_timeout_async, ioq_exit_event_async]}]. + [timer_measure, timer_cancel, timer_delay, + timer_change]}, + {ioq_exit, [], + [ioq_exit_ready_input, ioq_exit_ready_output, + ioq_exit_timeout, ioq_exit_ready_async, ioq_exit_event, + ioq_exit_ready_input_async, ioq_exit_ready_output_async, + ioq_exit_timeout_async, ioq_exit_event_async]}]. init_per_suite(Config) -> Config. end_per_suite(_Config) -> - ok. + catch erts_debug:set_internal_state(available_internal_state, false). init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. fun_to_port(doc) -> "Test sending a fun to port with an outputv-capable driver."; diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl index a91aa8c16a..d6bd4e3581 100644 --- a/erts/emulator/test/efile_SUITE.erl +++ b/erts/emulator/test/efile_SUITE.erl @@ -17,7 +17,8 @@ %% %CopyrightEnd% -module(efile_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([iter_max_files/1]). -include_lib("test_server/include/test_server.hrl"). @@ -25,7 +26,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[iter_max_files]. + [iter_max_files]. groups() -> []. @@ -37,10 +38,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl index d68891f3b0..eef7fb75b8 100644 --- a/erts/emulator/test/erl_drv_thread_SUITE.erl +++ b/erts/emulator/test/erl_drv_thread_SUITE.erl @@ -19,7 +19,8 @@ -module(erl_drv_thread_SUITE). -author('rickard.s.green@ericsson.com'). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([basic/1, rwlock/1, tsd/1]). @@ -30,7 +31,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, rwlock, tsd]. + [basic, rwlock, tsd]. groups() -> []. @@ -42,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index 81e3f6baa2..e0b122b007 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -30,7 +30,8 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). % Test cases -export([links/1, @@ -46,7 +47,7 @@ otp_5772_dist_monitor/1, otp_7946/1]). --export([init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2]). % Internal exports -export([test_proc/0]). @@ -80,10 +81,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[links, dist_links, monitor_nodes, process_monitors, - dist_process_monitors, busy_dist_port_monitor, - busy_dist_port_link, otp_5772_link, otp_5772_dist_link, - otp_5772_monitor, otp_5772_dist_monitor, otp_7946]. + [links, dist_links, monitor_nodes, process_monitors, + dist_process_monitors, busy_dist_port_monitor, + busy_dist_port_link, otp_5772_link, otp_5772_dist_link, + otp_5772_monitor, otp_5772_dist_monitor, otp_7946]. groups() -> []. @@ -92,13 +93,13 @@ init_per_suite(Config) -> Config. end_per_suite(_Config) -> - ok. + catch erts_debug:set_internal_state(available_internal_state, false). init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. links(doc) -> ["Tests node local links"]; @@ -696,13 +697,10 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> end, ?line [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> ?line Dog = ?config(watchdog, Config), ?line ?t:timetrap_cancel(Dog). -end_per_suite(_Config) -> - catch erts_debug:set_internal_state(available_internal_state, false). - tp_call(Tp, Fun) -> ?line R = make_ref(), ?line Tp ! {call, self(), R, Fun}, diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index 1188341127..f34904d537 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -20,13 +20,16 @@ -module(erts_debug_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, - flat_size/1,flat_size_big/1,df/1, instructions/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, + flat_size/1,flat_size_big/1,df/1, + instructions/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[flat_size, flat_size_big, df, instructions]. + [flat_size, flat_size_big, df, instructions]. groups() -> []. @@ -38,17 +41,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index c6994612d2..41b785b0c6 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -18,8 +18,9 @@ -module(estone_SUITE). %% Test functions --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,estone/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,estone/1]). +-export([init_per_testcase/2, end_per_testcase/2]). %% Internal exports for EStone tests -export([lists/1, @@ -68,7 +69,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. @@ -76,7 +77,7 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[estone]. + [estone]. groups() -> []. @@ -88,10 +89,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. estone(suite) -> diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index 031387fc82..9dc22e04a2 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -18,7 +18,9 @@ -module(evil_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, heap_frag/1, encode_decode_ext/1, decode_integer_ext/1, @@ -35,10 +37,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[heap_frag, encode_decode_ext, decode_integer_ext, - decode_small_big_ext, decode_large_big_ext, - decode_small_big_ext_neg, decode_large_big_ext_neg, - decode_too_small, decode_pos_neg_zero]. + [heap_frag, encode_decode_ext, decode_integer_ext, + decode_small_big_ext, decode_large_big_ext, + decode_small_big_ext_neg, decode_large_big_ext_neg, + decode_too_small, decode_pos_neg_zero]. groups() -> []. @@ -50,17 +52,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?t:minutes(0.5)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl index 740c5f2cab..b398914df5 100644 --- a/erts/emulator/test/exception_SUITE.erl +++ b/erts/emulator/test/exception_SUITE.erl @@ -19,7 +19,9 @@ -module(exception_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, badmatch/1, pending_errors/1, nil_arith/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + badmatch/1, pending_errors/1, nil_arith/1, stacktrace/1, nested_stacktrace/1, raise/1, gunilla/1, per/1, exception_with_heap_frag/1]). @@ -31,9 +33,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[badmatch, pending_errors, nil_arith, stacktrace, - nested_stacktrace, raise, gunilla, per, - exception_with_heap_frag]. + [badmatch, pending_errors, nil_arith, stacktrace, + nested_stacktrace, raise, gunilla, per, + exception_with_heap_frag]. groups() -> []. @@ -45,10 +47,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(try_match(E), diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl index 41f7395a9e..5cf4370e83 100644 --- a/erts/emulator/test/float_SUITE.erl +++ b/erts/emulator/test/float_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, fpe/1,fp_drv/1,fp_drv_thread/1,denormalized/1,match/1, bad_float_unpack/1]). -export([otp_7178/1]). @@ -31,15 +33,15 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), [{watchdog, Dog},{testcase,Func}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[fpe, fp_drv, fp_drv_thread, otp_7178, denormalized, - match, bad_float_unpack]. + [fpe, fp_drv, fp_drv_thread, otp_7178, denormalized, + match, bad_float_unpack]. groups() -> []. @@ -51,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index cfb4d59f39..734177a3db 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -22,7 +22,9 @@ -define(default_timeout, ?t:minutes(1)). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, bad_apply/1,bad_fun_call/1,badarity/1,ext_badarity/1, equality/1,ordering/1, fun_to_port/1,t_hash/1,t_phash/1,t_phash2/1,md5/1, @@ -37,10 +39,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[bad_apply, bad_fun_call, badarity, ext_badarity, - equality, ordering, fun_to_port, t_hash, t_phash, - t_phash2, md5, refc, refc_ets, refc_dist, - const_propagation, t_arity, t_is_function2, t_fun_info]. + [bad_apply, bad_fun_call, badarity, ext_badarity, + equality, ordering, fun_to_port, t_hash, t_phash, + t_phash2, md5, refc, refc_ets, refc_dist, + const_propagation, t_arity, t_is_function2, t_fun_info]. groups() -> []. @@ -52,17 +54,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/fun_r12_SUITE.erl b/erts/emulator/test/fun_r12_SUITE.erl index 1faa8bfa1b..a1126ba5f4 100644 --- a/erts/emulator/test/fun_r12_SUITE.erl +++ b/erts/emulator/test/fun_r12_SUITE.erl @@ -20,7 +20,9 @@ -module(fun_r12_SUITE). -compile(r12). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,dist_old_release/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2,dist_old_release/1]). -define(default_timeout, ?t:minutes(1)). -include_lib("test_server/include/test_server.hrl"). @@ -28,7 +30,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[dist_old_release]. + [dist_old_release]. groups() -> []. @@ -40,17 +42,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl index 7aa1a40371..95a23da39a 100644 --- a/erts/emulator/test/gc_SUITE.erl +++ b/erts/emulator/test/gc_SUITE.erl @@ -22,7 +22,8 @@ -module(gc_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -define(default_timeout, ?t:minutes(10)). @@ -31,7 +32,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[grow_heap, grow_stack, grow_stack_heap]. + [grow_heap, grow_stack, grow_stack_heap]. groups() -> []. @@ -43,10 +44,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. grow_heap(doc) -> ["Produce a growing list of elements, ", diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl index e316daec92..0536112e3a 100644 --- a/erts/emulator/test/guard_SUITE.erl +++ b/erts/emulator/test/guard_SUITE.erl @@ -19,7 +19,9 @@ -module(guard_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, test_heap_guards/1, guard_bifs/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, bad_arith/1, bad_tuple/1, + test_heap_guards/1, guard_bifs/1, type_tests/1,guard_bif_binary_part/1]). -include_lib("test_server/include/test_server.hrl"). @@ -30,8 +32,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[bad_arith, bad_tuple, test_heap_guards, guard_bifs, - type_tests, guard_bif_binary_part]. + [bad_arith, bad_tuple, test_heap_guards, guard_bifs, + type_tests, guard_bif_binary_part]. groups() -> []. @@ -43,10 +45,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. bad_arith(doc) -> "Test that a bad arithmetic operation in a guard works correctly."; diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl index 49ab9a3cb1..46231757ad 100644 --- a/erts/emulator/test/hash_SUITE.erl +++ b/erts/emulator/test/hash_SUITE.erl @@ -69,22 +69,24 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,test_basic/1,test_cmp/1,test_range/1,test_spread/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + test_basic/1,test_cmp/1,test_range/1,test_spread/1, test_phash2/1,otp_5292/1,bit_level_binaries/1,otp_7127/1, - fin_per_testcase/2,init_per_testcase/2]). + end_per_testcase/2,init_per_testcase/2]). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:minutes(10)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test_basic, test_cmp, test_range, test_spread, - test_phash2, otp_5292, bit_level_binaries, otp_7127]. + [test_basic, test_cmp, test_range, test_spread, + test_phash2, otp_5292, bit_level_binaries, otp_7127]. groups() -> []. @@ -96,10 +98,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. test_basic(suite) -> diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index 0b1151a7fa..17d1a23d59 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, basic/1,min_heap_size/1,bad_args/1, messages_in_queue/1,undefined_mfa/1, no_heap/1]). @@ -31,8 +33,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, min_heap_size, bad_args, messages_in_queue, - undefined_mfa, no_heap]. + [basic, min_heap_size, bad_args, messages_in_queue, + undefined_mfa, no_heap]. groups() -> []. @@ -44,17 +46,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 46141c72a8..8153fcf016 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -20,7 +20,9 @@ -module(list_bif_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export([hd_test/1,tl_test/1,t_length/1,t_list_to_pid/1, t_list_to_float/1,t_list_to_integer/1]). @@ -28,8 +30,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[hd_test, tl_test, t_length, t_list_to_pid, - t_list_to_float, t_list_to_integer]. + [hd_test, tl_test, t_length, t_list_to_pid, + t_list_to_float, t_list_to_integer]. groups() -> []. @@ -41,17 +43,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index 8ff8925981..0953908c3d 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -19,7 +19,8 @@ -module(match_spec_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, not_run/1]). -export([test_1/1, test_2/1, test_3/1, bad_match_spec_bin/1, trace_control_word/1, silent/1, silent_no_ms/1, ms_trace2/1, ms_trace3/1, boxed_and_small/1, @@ -36,13 +37,13 @@ -include_lib("test_server/include/test_server.hrl"). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(10)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). @@ -50,15 +51,15 @@ fin_per_testcase(_Func, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(match_spec_SUITE) of - false -> - [test_1, test_2, test_3, bad_match_spec_bin, - trace_control_word, silent, silent_no_ms, ms_trace2, - ms_trace3, boxed_and_small, destructive_in_test_bif, - guard_exceptions, unary_plus, unary_minus, fpe, - moving_labels]; - true -> [not_run] -end. + case test_server:is_native(match_spec_SUITE) of + false -> + [test_1, test_2, test_3, bad_match_spec_bin, + trace_control_word, silent, silent_no_ms, ms_trace2, + ms_trace3, boxed_and_small, destructive_in_test_bif, + guard_exceptions, unary_plus, unary_minus, fpe, + moving_labels]; + true -> [not_run] + end. groups() -> []. @@ -70,7 +71,7 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> Config. diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index 3e1682d97e..02a95b5fc5 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, exports/1,functions/1,native/1]). %%-compile(native). @@ -32,7 +34,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -modules(). + modules(). groups() -> []. @@ -44,14 +46,14 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. modules() -> -[exports, functions, native]. + [exports, functions, native]. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(3)), @@ -64,13 +66,17 @@ end_per_testcase(_Func, Config) -> %% Should return all functions exported from this module. (local) all_exported() -> All = add_arity(modules()), - lists:sort([{all,1},{init_per_testcase,2},{end_per_testcase,2}, + lists:sort([{all,0},{suite,0},{groups,0}, + {init_per_suite,1},{end_per_suite,1}, + {init_per_group,2},{end_per_group,2}, + {init_per_testcase,2},{end_per_testcase,2}, {module_info,0},{module_info,1},{native_proj,1}, {native_filter,1}|All]). %% Should return all functions in this module. (local) all_functions() -> - Locals = [{add_arity,1},{add_arity,2},{all_exported,0},{all_functions,0}], + Locals = [{add_arity,1},{add_arity,2},{all_exported,0},{all_functions,0}, + {modules,0}], lists:sort(Locals++all_exported()). %% Test that the list of exported functions from this module is correct. diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl index c5950a6bab..d19284890e 100644 --- a/erts/emulator/test/monitor_SUITE.erl +++ b/erts/emulator/test/monitor_SUITE.erl @@ -21,27 +21,28 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, case_1/1, case_1a/1, case_2/1, case_2a/1, mon_e_1/1, demon_e_1/1, demon_1/1, demon_2/1, demon_3/1, demonitor_flush/1, local_remove_monitor/1, remote_remove_monitor/1, mon_1/1, mon_2/1, large_exit/1, list_cleanup/1, mixer/1, named_down/1, otp_5827/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([y2/1, g/1, g0/0, g1/0, large_exit_sub/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, - demon_1, mon_1, mon_2, demon_2, demon_3, - demonitor_flush, {group, remove_monitor}, large_exit, - list_cleanup, mixer, named_down, otp_5827]. + [case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, + demon_1, mon_1, mon_2, demon_2, demon_3, + demonitor_flush, {group, remove_monitor}, large_exit, + list_cleanup, mixer, named_down, otp_5827]. groups() -> [{remove_monitor, [], - [local_remove_monitor, remote_remove_monitor]}]. + [local_remove_monitor, remote_remove_monitor]}]. init_per_suite(Config) -> Config. @@ -50,17 +51,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(15)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl index 8a69ee6859..249a02ae52 100644 --- a/erts/emulator/test/nested_SUITE.erl +++ b/erts/emulator/test/nested_SUITE.erl @@ -19,15 +19,17 @@ -module(nested_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + case_in_case/1, case_in_after/1, catch_in_catch/1, bif_in_bif/1]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[case_in_case, case_in_after, catch_in_catch, - bif_in_bif]. + [case_in_case, case_in_after, catch_in_catch, + bif_in_bif]. groups() -> []. @@ -39,10 +41,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. case_in_case(suite) -> []; diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 1ac3e7f4e7..fb78aa9150 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -25,12 +25,16 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, - %%init_per_testcase/2, - fin_per_testcase/2, basic/1, reload/1, upgrade/1, heap_frag/1, - types/1, many_args/1, binaries/1, get_string/1, get_atom/1, api_macros/1, - from_array/1, iolist_as_binary/1, resource/1, resource_binary/1, resource_takeover/1, - threading/1, send/1, send2/1, send3/1, send_threaded/1, neg/1, is_checks/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, + end_per_testcase/2, basic/1, reload/1, upgrade/1, heap_frag/1, + types/1, many_args/1, binaries/1, get_string/1, get_atom/1, + api_macros/1, + from_array/1, iolist_as_binary/1, resource/1, resource_binary/1, + resource_takeover/1, + threading/1, send/1, send2/1, send3/1, send_threaded/1, neg/1, + is_checks/1, get_length/1, make_atom/1, make_string/1]). -export([many_args_100/100]). @@ -51,12 +55,12 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic, reload, upgrade, heap_frag, types, many_args, - binaries, get_string, get_atom, api_macros, from_array, - iolist_as_binary, resource, resource_binary, - resource_takeover, threading, send, send2, send3, - send_threaded, neg, is_checks, get_length, make_atom, - make_string]. + [basic, reload, upgrade, heap_frag, types, many_args, + binaries, get_string, get_atom, api_macros, from_array, + iolist_as_binary, resource, resource_binary, + resource_takeover, threading, send, send2, send3, + send_threaded, neg, is_checks, get_length, make_atom, + make_string]. groups() -> []. @@ -68,17 +72,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -%%init_per_testcase(_Case, Config) -> -%% ?line Dog = ?t:timetrap(?t:seconds(60*60*24)), -%% [{watchdog, Dog}|Config]. +init_per_testcase(_Case, Config) -> +% ?line Dog = ?t:timetrap(?t:seconds(60*60*24)), + Config. -fin_per_testcase(_Func, _Config) -> +end_per_testcase(_Func, _Config) -> %%Dog = ?config(watchdog, Config), %%?t:timetrap_cancel(Dog), P1 = code:purge(nif_mod), diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.erl b/erts/emulator/test/nif_SUITE_data/nif_mod.erl index 7888a589e7..b99a2c90ee 100644 --- a/erts/emulator/test/nif_SUITE_data/nif_mod.erl +++ b/erts/emulator/test/nif_SUITE_data/nif_mod.erl @@ -19,7 +19,7 @@ -module(nif_mod). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([load_nif_lib/2, load_nif_lib/3, start/0, lib_version/0, call_history/0, get_priv_data_ptr/0, make_new_resource/2, get_resource/2]). diff --git a/erts/emulator/test/nif_SUITE_data/tester.erl b/erts/emulator/test/nif_SUITE_data/tester.erl index 9df2158200..b393e29b82 100644 --- a/erts/emulator/test/nif_SUITE_data/tester.erl +++ b/erts/emulator/test/nif_SUITE_data/tester.erl @@ -1,6 +1,6 @@ -module(tester). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -export([load_nif_lib/2, run/0]). diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index 0955c70cfc..c78d249e6b 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -32,7 +32,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, + end_per_testcase/2, node_container_refc_check/1]). -export([term_to_binary_to_term_eq/1, @@ -58,11 +60,11 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[term_to_binary_to_term_eq, round_trip_eq, cmp, ref_eq, - node_table_gc, dist_link_refc, dist_monitor_refc, - node_controller_refc, ets_refc, match_spec_refc, - timer_refc, otp_4715, pid_wrap, port_wrap, bad_nc, - unique_pid, iter_max_procs]. + [term_to_binary_to_term_eq, round_trip_eq, cmp, ref_eq, + node_table_gc, dist_link_refc, dist_monitor_refc, + node_controller_refc, ets_refc, match_spec_refc, + timer_refc, otp_4715, pid_wrap, port_wrap, bad_nc, + unique_pid, iter_max_procs]. groups() -> []. @@ -71,13 +73,13 @@ init_per_suite(Config) -> Config. end_per_suite(_Config) -> - ok. + available_internal_state(false). init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. available_internal_state(Bool) when Bool == true; Bool == false -> @@ -100,14 +102,11 @@ init_per_testcase(_Case, Config) when is_list(Config) -> available_internal_state(true), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. -end_per_suite(_Config) -> - available_internal_state(false). - %%% %%% The test cases ------------------------------------------------------------- %%% diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl index 62ab123c01..add733dd89 100644 --- a/erts/emulator/test/nofrag_SUITE.erl +++ b/erts/emulator/test/nofrag_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, error_handler/1,error_handler_apply/1, error_handler_fixed_apply/1,error_handler_fun/1, error_handler_tuple_fun/1, @@ -33,9 +35,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[error_handler, error_handler_apply, - error_handler_fixed_apply, error_handler_fun, - error_handler_tuple_fun, debug_breakpoint]. + [error_handler, error_handler_apply, + error_handler_fixed_apply, error_handler_fun, + error_handler_tuple_fun, debug_breakpoint]. groups() -> []. @@ -47,10 +49,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index b51ee01a5c..9a9d4d93f1 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -31,7 +31,8 @@ %% round/1 %% trunc/1 --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_abs/1, t_float/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, t_abs/1, t_float/1, t_float_to_list/1, t_integer_to_list/1, t_list_to_integer/1, t_list_to_float_safe/1, t_list_to_float_risky/1, @@ -40,13 +41,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[t_abs, t_float, t_float_to_list, t_integer_to_list, - {group, t_list_to_float}, t_list_to_integer, t_round, - t_trunc]. + [t_abs, t_float, t_float_to_list, t_integer_to_list, + {group, t_list_to_float}, t_list_to_integer, t_round, + t_trunc]. groups() -> [{t_list_to_float, [], - [t_list_to_float_safe, t_list_to_float_risky]}]. + [t_list_to_float_safe, t_list_to_float_risky]}]. init_per_suite(Config) -> Config. @@ -55,10 +56,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. t_abs(Config) when is_list(Config) -> diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl index fb9e9dcd64..51a4943dd9 100644 --- a/erts/emulator/test/old_scheduler_SUITE.erl +++ b/erts/emulator/test/old_scheduler_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([equal/1, many_low/1, few_low/1, max/1, high/1]). -define(default_timeout, ?t:minutes(11)). @@ -29,15 +31,15 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case catch erlang:system_info(modified_timing_level) of - Level when is_integer(Level) -> - {skipped, - "Modified timing (level " ++ - integer_to_list(Level) ++ - ") is enabled. Testcases gets messed " - "up by modfied timing."}; - _ -> [equal, many_low, few_low, max, high] -end. + case catch erlang:system_info(modified_timing_level) of + Level when is_integer(Level) -> + {skipped, + "Modified timing (level " ++ + integer_to_list(Level) ++ + ") is enabled. Testcases gets messed " + "up by modfied timing."}; + _ -> [equal, many_low, few_low, max, high] + end. groups() -> []. @@ -49,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %%----------------------------------------------------------------------------------- @@ -81,7 +83,7 @@ init_per_testcase(_Case, Config) -> ?line MS = erlang:system_flag(multi_scheduling, block), [{prio,Prio},{watchdog,Dog},{multi_scheduling, MS}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> erlang:system_flag(multi_scheduling, unblock), Dog=?config(watchdog, Config), Prio=?config(prio, Config), diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl index bea851e141..f49986023b 100644 --- a/erts/emulator/test/op_SUITE.erl +++ b/erts/emulator/test/op_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, bsl_bsr/1,logical/1,t_not/1,relop_simple/1,relop/1,complex_relop/1]). -export([]). @@ -30,8 +32,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[bsl_bsr, logical, t_not, relop_simple, relop, - complex_relop]. + [bsl_bsr, logical, t_not, relop_simple, relop, + complex_relop]. groups() -> []. @@ -43,17 +45,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index 8315e2a9a6..fdfab6e27c 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -73,7 +73,8 @@ %% --export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, init_per_suite/1, end_per_suite/1, stream_small/1, stream_big/1, basic_ping/1, slow_writes/1, bad_packet/1, bad_port_messages/1, @@ -104,28 +105,28 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[otp_6224, {group, stream}, basic_ping, slow_writes, - bad_packet, bad_port_messages, {group, options}, - {group, multiple_packets}, parallell, dying_port, - port_program_with_path, open_input_file_port, - open_output_file_port, name1, env, bad_env, cd, - exit_status, iter_max_ports, t_exit, {group, tps}, line, - stderr_to_stdout, otp_3906, otp_4389, win_massive, - mix_up_ports, otp_5112, otp_5119, - exit_status_multi_scheduling_block, ports, spawn_driver, - spawn_executable, close_deaf_port, unregister_name]. + [otp_6224, {group, stream}, basic_ping, slow_writes, + bad_packet, bad_port_messages, {group, options}, + {group, multiple_packets}, parallell, dying_port, + port_program_with_path, open_input_file_port, + open_output_file_port, name1, env, bad_env, cd, + exit_status, iter_max_ports, t_exit, {group, tps}, line, + stderr_to_stdout, otp_3906, otp_4389, win_massive, + mix_up_ports, otp_5112, otp_5119, + exit_status_multi_scheduling_block, ports, spawn_driver, + spawn_executable, close_deaf_port, unregister_name]. groups() -> [{stream, [], [stream_small, stream_big]}, - {options, [], [t_binary, eof, input_only, output_only]}, - {multiple_packets, [], [mul_basic, mul_slow_writes]}, - {tps, [], [tps_16_bytes, tps_1K]}]. + {options, [], [t_binary, eof, input_only, output_only]}, + {multiple_packets, [], [mul_basic, mul_slow_writes]}, + {tps, [], [tps_16_bytes, tps_1K]}]. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. -define(DEFAULT_TIMEOUT, ?t:minutes(5)). @@ -133,7 +134,7 @@ end_per_group(_GroupName, Config) -> init_per_testcase(Case, Config) -> [{testcase, Case} |Config]. -fin_per_testcase(_Case, _Config) -> +end_per_testcase(_Case, _Config) -> ok. init_per_suite(Config) when is_list(Config) -> @@ -1056,8 +1057,10 @@ otp_3906(Config) when is_list(Config) -> -define(OTP_3906_MAX_CONC_OSP, 50). otp_3906(Config, OSName) -> - ?line TSDir = filename:dirname(code:which(test_server)), - ?line {ok, Variables} = file:consult(filename:join(TSDir, "variables")), + ?line DataDir = filename:dirname(proplists:get_value(data_dir,Config)), + ?line {ok, Variables} = file:consult( + filename:join([DataDir,"..","..", + "test_server","variables"])), case lists:keysearch('CC', 1, Variables) of {value,{'CC', CC}} -> SuiteDir = filename:dirname(code:which(?MODULE)), diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl index 0489572221..9d6e813cd4 100644 --- a/erts/emulator/test/port_bif_SUITE.erl +++ b/erts/emulator/test/port_bif_SUITE.erl @@ -20,27 +20,28 @@ -module(port_bif_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, command/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, command/1, command_e_1/1, command_e_2/1, command_e_3/1, command_e_4/1, port_info1/1, port_info2/1, connect/1, control/1, echo_to_busy/1]). -export([do_command_e_1/1, do_command_e_2/1, do_command_e_4/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -include_lib("test_server/include/test_server.hrl"). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[command, {group, port_info}, connect, control, - echo_to_busy]. + [command, {group, port_info}, connect, control, + echo_to_busy]. groups() -> [{command_e, [], - [command_e_1, command_e_2, command_e_3, command_e_4]}, - {port_info, [], [port_info1, port_info2]}]. + [command_e_1, command_e_2, command_e_3, command_e_4]}, + {port_info, [], [port_info1, port_info2]}]. init_per_suite(Config) -> Config. @@ -49,17 +50,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Func, Config) when is_list(Config) -> Dog=test_server:timetrap(test_server:minutes(10)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) when is_list(Config) -> +end_per_testcase(_Func, Config) when is_list(Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index e057f19e46..8a71a6d7e4 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -29,7 +29,8 @@ -define(heap_binary_size, 64). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, spawn_with_binaries/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, spawn_with_binaries/1, t_exit_1/1, t_exit_2_other/1, t_exit_2_other_normal/1, self_exit/1, normal_suicide_exit/1, abnormal_suicide_exit/1, t_exit_2_catch/1, trap_exit_badarg/1, trap_exit_badarg_in_bif/1, @@ -51,7 +52,7 @@ otp_7738_resume/1]). -export([prio_server/2, prio_client/2]). --export([init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([hangaround/2, processes_bif_test/0, do_processes/1, processes_term_proc_list_test/1]). @@ -59,57 +60,54 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[spawn_with_binaries, t_exit_1, {group, t_exit_2}, - trap_exit_badarg, trap_exit_badarg_in_bif, - t_process_info, process_info_other_msg, - process_info_other_dist_msg, process_info_2_list, - process_info_lock_reschedule, - process_info_lock_reschedule2, process_status_exiting, - bump_reductions, low_prio, yield, yield2, otp_4725, - bad_register, garbage_collect, process_info_messages, - process_flag_badarg, process_flag_heap_size, - spawn_opt_heap_size, otp_6237, {group, processes_bif}, - {group, otp_7738}]. + [spawn_with_binaries, t_exit_1, {group, t_exit_2}, + trap_exit_badarg, trap_exit_badarg_in_bif, + t_process_info, process_info_other_msg, + process_info_other_dist_msg, process_info_2_list, + process_info_lock_reschedule, + process_info_lock_reschedule2, process_status_exiting, + bump_reductions, low_prio, yield, yield2, otp_4725, + bad_register, garbage_collect, process_info_messages, + process_flag_badarg, process_flag_heap_size, + spawn_opt_heap_size, otp_6237, {group, processes_bif}, + {group, otp_7738}]. groups() -> [{t_exit_2, [], - [t_exit_2_other, t_exit_2_other_normal, self_exit, - normal_suicide_exit, abnormal_suicide_exit, - t_exit_2_catch, exit_and_timeout, exit_twice]}, - {processes_bif, [], - [processes_large_tab, processes_default_tab, - processes_small_tab, processes_this_tab, - processes_last_call_trap, processes_apply_trap, - processes_gc_trap, processes_term_proc_list]}, - {otp_7738, [], - [otp_7738_waiting, otp_7738_suspended, - otp_7738_resume]}]. + [t_exit_2_other, t_exit_2_other_normal, self_exit, + normal_suicide_exit, abnormal_suicide_exit, + t_exit_2_catch, exit_and_timeout, exit_twice]}, + {processes_bif, [], + [processes_large_tab, processes_default_tab, + processes_small_tab, processes_this_tab, + processes_last_call_trap, processes_apply_trap, + processes_gc_trap, processes_term_proc_list]}, + {otp_7738, [], + [otp_7738_waiting, otp_7738_suspended, + otp_7738_resume]}]. init_per_suite(Config) -> Config. -end_per_suite(_Config) -> - ok. +end_per_suite(Config) -> + catch erts_debug:set_internal_state(available_internal_state, false), + Config. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(10)), [{watchdog, Dog},{testcase, Func}|Config]. -fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> +end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). -end_per_suite(Config) -> - catch erts_debug:set_internal_state(available_internal_state, false), - Config. - fun_spawn(Fun) -> spawn_link(erlang, apply, [Fun, []]). diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index 73d0a9ff2c..06ff5f8e04 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -19,12 +19,13 @@ -module(pseudoknot_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,test/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,test/1]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[test]. + [test]. groups() -> []. @@ -36,10 +37,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. test(Config) when is_list(Config) -> diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl index 1d7394b817..0eda2a50d8 100644 --- a/erts/emulator/test/receive_SUITE.erl +++ b/erts/emulator/test/receive_SUITE.erl @@ -23,15 +23,16 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, call_with_huge_message_queue/1,receive_in_between/1]). --export([init_per_testcase/2,fin_per_testcase/2]). +-export([init_per_testcase/2,end_per_testcase/2]). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[call_with_huge_message_queue, receive_in_between]. + [call_with_huge_message_queue, receive_in_between]. groups() -> []. @@ -43,17 +44,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl index fbf51b2397..b455632c4e 100644 --- a/erts/emulator/test/ref_SUITE.erl +++ b/erts/emulator/test/ref_SUITE.erl @@ -19,7 +19,9 @@ -module(ref_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export([wrap_1/1]). -export([loop_ref/1]). @@ -30,7 +32,7 @@ init_per_testcase(_, Config) -> ?line Dog=test_server:timetrap(test_server:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_, Config) -> +end_per_testcase(_, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -38,7 +40,7 @@ fin_per_testcase(_, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[wrap_1]. + [wrap_1]. groups() -> []. @@ -50,10 +52,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. wrap_1(doc) -> "Check that refs don't wrap around easily."; diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl index a3fa27473e..58e23de5eb 100644 --- a/erts/emulator/test/register_SUITE.erl +++ b/erts/emulator/test/register_SUITE.erl @@ -25,7 +25,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([otp_8099/1]). @@ -34,7 +36,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[otp_8099]. + [otp_8099]. groups() -> []. @@ -46,17 +48,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), [{watchdog, Dog}, {testcase, Case} | Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl index 31faf537b6..594421b687 100644 --- a/erts/emulator/test/save_calls_SUITE.erl +++ b/erts/emulator/test/save_calls_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([save_calls_1/1,dont_break_reductions/1]). @@ -30,7 +31,7 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[save_calls_1, dont_break_reductions]. + [save_calls_1, dont_break_reductions]. groups() -> []. @@ -42,10 +43,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. dont_break_reductions(suite) -> diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index 1855ec65cb..dd7d95c5eb 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -33,7 +33,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, end_per_suite/1]). -export([equal/1, few_low/1, @@ -60,29 +62,30 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[equal, few_low, many_low, equal_with_part_time_high, - equal_with_part_time_max, - equal_and_high_with_part_time_max, equal_with_high, - equal_with_high_max, bound_process, - {group, scheduler_bind}, scheduler_suspend, - reader_groups]. + [equal, few_low, many_low, equal_with_part_time_high, + equal_with_part_time_max, + equal_and_high_with_part_time_max, equal_with_high, + equal_with_high_max, bound_process, + {group, scheduler_bind}, scheduler_suspend, + reader_groups]. groups() -> [{scheduler_bind, [], - [scheduler_bind_types, cpu_topology, update_cpu_info, - sct_cmd, sbt_cmd]}]. + [scheduler_bind_types, cpu_topology, update_cpu_info, + sct_cmd, sbt_cmd]}]. init_per_suite(Config) -> Config. -end_per_suite(_Config) -> - ok. +end_per_suite(Config) -> + catch erts_debug:set_internal_state(available_internal_state, false), + Config. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Case, Config) when is_list(Config) -> @@ -92,15 +95,11 @@ init_per_testcase(Case, Config) when is_list(Config) -> OkRes = ok, [{watchdog, Dog}, {testcase, Case}, {ok_res, OkRes} |Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. -end_per_suite(Config) -> - catch erts_debug:set_internal_state(available_internal_state, false), - Config. - -define(ERTS_RUNQ_CHECK_BALANCE_REDS_PER_SCHED, (2000*2000)). -define(DEFAULT_TEST_REDS_PER_SCHED, 200000000). diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl index 11c947f06b..7c1aa159f6 100644 --- a/erts/emulator/test/send_term_SUITE.erl +++ b/erts/emulator/test/send_term_SUITE.erl @@ -19,8 +19,9 @@ -module(send_term_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,basic/1]). --export([init_per_testcase/2,fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,basic/1]). +-export([init_per_testcase/2,end_per_testcase/2]). -export([generate_external_terms_files/1]). @@ -30,14 +31,14 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[basic]. + [basic]. groups() -> []. @@ -49,10 +50,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. basic(Config) when is_list(Config) -> diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl index 579cdc509d..69dd2c9072 100644 --- a/erts/emulator/test/sensitive_SUITE.erl +++ b/erts/emulator/test/sensitive_SUITE.erl @@ -21,7 +21,9 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, stickiness/1,send_trace/1,recv_trace/1,proc_trace/1,call_trace/1, meta_trace/1,running_trace/1,gc_trace/1,seq_trace/1, t_process_info/1,t_process_display/1,save_calls/1]). @@ -34,17 +36,17 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:minutes(5)), [{watchdog,Dog}|Config]. -fin_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> +end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[stickiness, send_trace, recv_trace, proc_trace, - call_trace, meta_trace, running_trace, gc_trace, - seq_trace, t_process_info, t_process_display, - save_calls]. + [stickiness, send_trace, recv_trace, proc_trace, + call_trace, meta_trace, running_trace, gc_trace, + seq_trace, t_process_info, t_process_display, + save_calls]. groups() -> []. @@ -56,10 +58,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. stickiness(Config) when is_list(Config) -> diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index 6e3cab22e2..5503400da4 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -31,7 +31,8 @@ %-define(line_trace, 1). -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). % Test cases -export([xm_sig_order/1, @@ -49,17 +50,20 @@ pending_exit_group_leader/1, exit_before_pending_exit/1]). --export([init_per_testcase/2, fin_per_testcase/2, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2]). init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> ?line Dog = ?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SECONDS)), available_internal_state(true), ?line [{testcase, Func},{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> ?line Dog = ?config(watchdog, Config), ?line ?t:timetrap_cancel(Dog). +init_per_suite(Config) -> + Config. + end_per_suite(_Config) -> available_internal_state(true), erts_debug:set_internal_state(not_running_optimization, true), @@ -68,30 +72,24 @@ end_per_suite(_Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[xm_sig_order, pending_exit_unlink_process, - pending_exit_unlink_dist_process, - pending_exit_unlink_port, pending_exit_trap_exit, - pending_exit_receive, pending_exit_trap_exit, - pending_exit_gc, pending_exit_is_process_alive, - pending_exit_process_display, - pending_exit_process_info_1, - pending_exit_process_info_2, pending_exit_group_leader, - exit_before_pending_exit]. + [xm_sig_order, pending_exit_unlink_process, + pending_exit_unlink_dist_process, + pending_exit_unlink_port, pending_exit_trap_exit, + pending_exit_receive, pending_exit_trap_exit, + pending_exit_gc, pending_exit_is_process_alive, + pending_exit_process_display, + pending_exit_process_info_1, + pending_exit_process_info_2, pending_exit_group_leader, + exit_before_pending_exit]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. xm_sig_order(doc) -> ["Test that exit signals and messages are received " diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl index 4ad3f37e1b..582acb5495 100644 --- a/erts/emulator/test/statistics_SUITE.erl +++ b/erts/emulator/test/statistics_SUITE.erl @@ -21,9 +21,10 @@ %% Tests the statistics/1 bif. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, - fin_per_testcase/2, + end_per_testcase/2, wall_clock_zero_diff/1, wall_clock_update/1, runtime_zero_diff/1, runtime_update/1, runtime_diff/1, @@ -41,7 +42,7 @@ init_per_testcase(_, Config) -> ?line Dog = test_server:timetrap(test_server:seconds(300)), [{watchdog, Dog}|Config]. -fin_per_testcase(_, Config) -> +end_per_testcase(_, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -49,16 +50,16 @@ fin_per_testcase(_, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[{group, wall_clock}, {group, runtime}, reductions, - reductions_big, {group, run_queue}, garbage_collection, - io, badarg]. + [{group, wall_clock}, {group, runtime}, reductions, + reductions_big, {group, run_queue}, garbage_collection, + io, badarg]. groups() -> [{wall_clock, [], - [wall_clock_zero_diff, wall_clock_update]}, - {runtime, [], - [runtime_zero_diff, runtime_update, runtime_diff]}, - {run_queue, [], [run_queue_one]}]. + [wall_clock_zero_diff, wall_clock_update]}, + {runtime, [], + [runtime_zero_diff, runtime_update, runtime_diff]}, + {run_queue, [], [run_queue_one]}]. init_per_suite(Config) -> Config. @@ -67,10 +68,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index 47d96861cd..865a8fbe45 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -33,7 +33,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1, wordsize/1]). @@ -42,8 +44,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[process_count, system_version, misc_smoke_tests, - heap_size, wordsize]. + [process_count, system_version, misc_smoke_tests, + heap_size, wordsize]. groups() -> []. @@ -55,17 +57,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl index 672b8cbceb..b74613f6b4 100644 --- a/erts/emulator/test/system_profile_SUITE.erl +++ b/erts/emulator/test/system_profile_SUITE.erl @@ -22,16 +22,18 @@ -module(system_profile_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, system_profile_on_and_off/1, runnable_procs/1, runnable_ports/1, scheduler/1 ]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). --export([profiler_process/1, ring_loop/1, port_echo_start/0, list_load/0, run_load/2]). +-export([profiler_process/1, ring_loop/1, port_echo_start/0, + list_load/0, run_load/2]). -include_lib("test_server/include/test_server.hrl"). @@ -40,7 +42,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=?t:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. @@ -48,8 +50,8 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[system_profile_on_and_off, runnable_procs, - runnable_ports, scheduler]. + [system_profile_on_and_off, runnable_procs, + runnable_ports, scheduler]. groups() -> []. @@ -61,10 +63,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. %% No specification clause needed for an init function in a conf case!!! diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl index d249e07006..6c2b85815c 100644 --- a/erts/emulator/test/time_SUITE.erl +++ b/erts/emulator/test/time_SUITE.erl @@ -29,7 +29,8 @@ %% now/0 %% --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, univ_to_local/1, local_to_univ/1, bad_univ_to_local/1, bad_local_to_univ/1, consistency/1, now_unique/1, now_update/1, timestamp/1]). @@ -57,9 +58,9 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[univ_to_local, local_to_univ, local_to_univ_utc, - bad_univ_to_local, bad_local_to_univ, consistency, - {group, now}, timestamp]. + [univ_to_local, local_to_univ, local_to_univ_utc, + bad_univ_to_local, bad_local_to_univ, consistency, + {group, now}, timestamp]. groups() -> [{now, [], [now_unique, now_update]}]. @@ -71,10 +72,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. local_to_univ_utc(suite) -> diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index b3f7cadc27..233455cae5 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -19,7 +19,9 @@ -module(timer_bif_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2,end_per_suite/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2]). -export([start_timer_1/1, send_after_1/1, send_after_2/1, send_after_3/1, cancel_timer_1/1, start_timer_big/1, send_after_big/1, @@ -37,37 +39,34 @@ init_per_testcase(_Case, Config) -> end, [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. +init_per_suite(Config) -> + Config. + end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[start_timer_1, send_after_1, send_after_2, - cancel_timer_1, start_timer_e, send_after_e, - cancel_timer_e, start_timer_big, send_after_big, - read_timer_trivial, read_timer, cleanup, evil_timers, - registered_process]. + [start_timer_1, send_after_1, send_after_2, + cancel_timer_1, start_timer_e, send_after_e, + cancel_timer_e, start_timer_big, send_after_big, + read_timer_trivial, read_timer, cleanup, evil_timers, + registered_process]. groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. start_timer_1(doc) -> ["Basic start_timer/3 functionality"]; diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl index 455a159d57..16f4d91a2d 100644 --- a/erts/emulator/test/trace_SUITE.erl +++ b/erts/emulator/test/trace_SUITE.erl @@ -23,7 +23,8 @@ %%% Tests the trace BIF. %%% --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, receive_trace/1, self_send/1, timeout_trace/1, send_trace/1, procs_trace/1, dist_procs_trace/1, suspend/1, mutual_suspend/1, suspend_exit/1, suspender_exit/1, @@ -43,15 +44,15 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[cpu_timestamp, receive_trace, self_send, timeout_trace, - send_trace, procs_trace, dist_procs_trace, suspend, - mutual_suspend, suspend_exit, suspender_exit, - suspend_system_limit, suspend_opts, suspend_waiting, - new_clear, existing_clear, set_on_spawn, - set_on_first_spawn, system_monitor_args, - more_system_monitor_args, system_monitor_long_gc_1, - system_monitor_long_gc_2, system_monitor_large_heap_1, - system_monitor_large_heap_2, bad_flag, trace_delivered]. + [cpu_timestamp, receive_trace, self_send, timeout_trace, + send_trace, procs_trace, dist_procs_trace, suspend, + mutual_suspend, suspend_exit, suspender_exit, + suspend_system_limit, suspend_opts, suspend_waiting, + new_clear, existing_clear, set_on_spawn, + set_on_first_spawn, system_monitor_args, + more_system_monitor_args, system_monitor_long_gc_1, + system_monitor_long_gc_2, system_monitor_large_heap_1, + system_monitor_large_heap_2, bad_flag, trace_delivered]. groups() -> []. @@ -63,10 +64,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl index 485dcc9e73..3e14ceff43 100644 --- a/erts/emulator/test/trace_bif_SUITE.erl +++ b/erts/emulator/test/trace_bif_SUITE.erl @@ -21,8 +21,10 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). --export([trace_bif/1, trace_bif_timestamp/1, trace_on_and_off/1, trace_bif_local/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). +-export([trace_bif/1, trace_bif_timestamp/1, trace_on_and_off/1, + trace_bif_local/1, trace_bif_timestamp_local/1, trace_bif_return/1, not_run/1, trace_info_old_code/1]). @@ -31,13 +33,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(trace_bif_SUITE) of - true -> [not_run]; - false -> - [trace_bif, trace_bif_timestamp, trace_on_and_off, - trace_bif_local, trace_bif_timestamp_local, - trace_bif_return, trace_info_old_code] -end. + case test_server:is_native(trace_bif_SUITE) of + true -> [not_run]; + false -> + [trace_bif, trace_bif_timestamp, trace_on_and_off, + trace_bif_local, trace_bif_timestamp_local, + trace_bif_return, trace_info_old_code] + end. groups() -> []. @@ -49,10 +51,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl index c78f2ffdc8..c45d11f770 100644 --- a/erts/emulator/test/trace_call_count_SUITE.erl +++ b/erts/emulator/test/trace_call_count_SUITE.erl @@ -62,7 +62,9 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, pause_and_restart/1, combo/1]). @@ -70,7 +72,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:seconds(30)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> erlang:trace_pattern({'_','_','_'}, false, [local,meta,call_count]), erlang:trace_pattern(on_load, false, [local,meta,call_count]), erlang:trace(all, false, [all]), @@ -81,11 +83,11 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(trace_call_count_SUITE) of - true -> [not_run]; - false -> - [basic, on_and_off, info, pause_and_restart, combo] -end. + case test_server:is_native(trace_call_count_SUITE) of + true -> [not_run]; + false -> + [basic, on_and_off, info, pause_and_restart, combo] + end. groups() -> []. @@ -97,10 +99,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 31bd7dd9c0..2dbc8345a7 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -60,9 +60,12 @@ -include_lib("test_server/include/test_server.hrl"). %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, on_and_off/1, info/1, - pause_and_restart/1, scheduling/1, called_function/1, combo/1, bif/1, nif/1]). + pause_and_restart/1, scheduling/1, called_function/1, combo/1, + bif/1, nif/1]). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:seconds(400)), @@ -71,7 +74,7 @@ init_per_testcase(_Case, Config) -> timer:now_diff(now(),now()), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> erlang:trace_pattern({'_','_','_'}, false, [local,meta,call_time,call_count]), erlang:trace_pattern(on_load, false, [local,meta,call_time,call_count]), erlang:trace(all, false, [all]), @@ -82,12 +85,12 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(trace_call_time_SUITE) of - true -> [not_run]; - false -> - [basic, on_and_off, info, pause_and_restart, scheduling, - combo, bif, nif, called_function] -end. + case test_server:is_native(trace_call_time_SUITE) of + true -> [not_run]; + false -> + [basic, on_and_off, info, pause_and_restart, scheduling, + combo, bif, nif, called_function] + end. groups() -> []. @@ -99,10 +102,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index ceffcb4b40..ffd1a80bc8 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -68,7 +68,8 @@ config(priv_dir,_) -> %%% When run in test server %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, basic/1, bit_syntax/1, return/1, on_and_off/1, stack_grow/1,info/1, delete/1, exception/1, exception_apply/1, exception_function/1, exception_apply_function/1, @@ -79,12 +80,12 @@ config(priv_dir,_) -> exception_meta_nocatch/1, exception_meta_nocatch_apply/1, exception_meta_nocatch_function/1, exception_meta_nocatch_apply_function/1, - init_per_testcase/2, fin_per_testcase/2]). + init_per_testcase/2, end_per_testcase/2]). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> shutdown(), Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), @@ -92,21 +93,21 @@ fin_per_testcase(_Case, Config) -> suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(trace_local_SUITE) of - true -> [not_run]; - false -> - [basic, bit_syntax, return, on_and_off, stack_grow, - info, delete, exception, exception_apply, - exception_function, exception_apply_function, - exception_nocatch, exception_nocatch_apply, - exception_nocatch_function, - exception_nocatch_apply_function, exception_meta, - exception_meta_apply, exception_meta_function, - exception_meta_apply_function, exception_meta_nocatch, - exception_meta_nocatch_apply, - exception_meta_nocatch_function, - exception_meta_nocatch_apply_function] -end. + case test_server:is_native(trace_local_SUITE) of + true -> [not_run]; + false -> + [basic, bit_syntax, return, on_and_off, stack_grow, + info, delete, exception, exception_apply, + exception_function, exception_apply_function, + exception_nocatch, exception_nocatch_apply, + exception_nocatch_function, + exception_nocatch_apply_function, exception_meta, + exception_meta_apply, exception_meta_function, + exception_meta_apply_function, exception_meta_nocatch, + exception_meta_nocatch_apply, + exception_meta_nocatch_function, + exception_meta_nocatch_apply_function] + end. groups() -> []. @@ -118,10 +119,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index 6ab29fe2a6..444f07e17f 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -65,7 +65,9 @@ config(priv_dir,_) -> ".". -else. %% When run in test server. --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2, not_run/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2, not_run/1]). -export([basic/1, return/1, on_and_off/1, stack_grow/1, info/1, tracer/1, combo/1, nosilent/1]). @@ -73,7 +75,7 @@ init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(test_server:minutes(5)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> shutdown(), Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 6a96e35c51..3b6496e0cc 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -21,7 +21,8 @@ -include_lib("test_server/include/test_server.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([trace_nif/1, trace_nif_timestamp/1, trace_nif_local/1, @@ -35,13 +36,13 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -case test_server:is_native(trace_nif_SUITE) of - true -> [not_run]; - false -> - [trace_nif, trace_nif_timestamp, trace_nif_local, - trace_nif_meta, trace_nif_timestamp_local, - trace_nif_return] -end. + case test_server:is_native(trace_nif_SUITE) of + true -> [not_run]; + false -> + [trace_nif, trace_nif_timestamp, trace_nif_local, + trace_nif_meta, trace_nif_timestamp_local, + trace_nif_return] + end. groups() -> []. @@ -53,10 +54,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. not_run(Config) when is_list(Config) -> diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl index 640f67f3ca..2429f729fd 100644 --- a/erts/emulator/test/trace_port_SUITE.erl +++ b/erts/emulator/test/trace_port_SUITE.erl @@ -20,7 +20,9 @@ -module(trace_port_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,init_per_testcase/2,fin_per_testcase/2, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2,end_per_testcase/2, call_trace/1, return_trace/1, send/1, @@ -37,17 +39,17 @@ -include_lib("test_server/include/test_server.hrl"). test_cases() -> -[call_trace, return_trace, send, receive_trace, - process_events, schedule, fake_schedule, - fake_schedule_after_register, - fake_schedule_after_getting_linked, - fake_schedule_after_getting_unlinked, gc, - default_tracer]. + [call_trace, return_trace, send, receive_trace, + process_events, schedule, fake_schedule, + fake_schedule_after_register, + fake_schedule_after_getting_linked, + fake_schedule_after_getting_unlinked, gc, + default_tracer]. suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -test_cases(). + test_cases(). groups() -> []. @@ -59,17 +61,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?t:timetrap(?t:seconds(30)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index 3fe0f18376..a5c38bc239 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -17,7 +17,9 @@ %% %CopyrightEnd% %% -module(tuple_SUITE). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + t_size/1, t_tuple_size/1, t_element/1, t_setelement/1, t_list_to_tuple/1, t_tuple_to_list/1, t_make_tuple_2/1, t_make_tuple_3/1, t_append_element/1, build_and_match/1, tuple_with_case/1, tuple_in_guard/1]). @@ -36,10 +38,10 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[build_and_match, t_size, t_tuple_size, t_list_to_tuple, - t_tuple_to_list, t_element, t_setelement, - t_make_tuple_2, t_make_tuple_3, t_append_element, - tuple_with_case, tuple_in_guard]. + [build_and_match, t_size, t_tuple_size, t_list_to_tuple, + t_tuple_to_list, t_element, t_setelement, + t_make_tuple_2, t_make_tuple_3, t_append_element, + tuple_with_case, tuple_in_guard]. groups() -> []. @@ -51,10 +53,10 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. build_and_match(Config) when is_list(Config) -> diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl index 476ac18566..ff5075956b 100644 --- a/erts/emulator/test/z_SUITE.erl +++ b/erts/emulator/test/z_SUITE.erl @@ -32,7 +32,9 @@ -include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, init_per_testcase/2, + end_per_testcase/2]). -export([schedulers_alive/1, node_container_refc_check/1, long_timers/1, pollset_size/1, @@ -43,8 +45,8 @@ suite() -> [{suite_callbacks,[ts_install_scb]}]. all() -> -[schedulers_alive, node_container_refc_check, - long_timers, pollset_size, check_io_debug]. + [schedulers_alive, node_container_refc_check, + long_timers, pollset_size, check_io_debug]. groups() -> []. @@ -56,17 +58,17 @@ end_per_suite(_Config) -> ok. init_per_group(_GroupName, Config) -> - Config. + Config. end_per_group(_GroupName, Config) -> - Config. + Config. init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) when is_list(Config) -> +end_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. -- cgit v1.2.3 From 5fef403779c4894189abf6fd18e6c8e5d54064c5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 7 Dec 2010 17:52:12 +0100 Subject: Update all test specs --- erts/emulator/test/emulator.spec | 2 +- erts/epmd/test/epmd.spec | 2 +- erts/test/system.spec | 2 +- lib/asn1/test/asn1.spec | 2 +- lib/common_test/test/common_test.spec | 2 +- lib/compiler/test/Makefile | 2 +- lib/compiler/test/compiler.dynspec | 10 ------ lib/compiler/test/compiler.spec | 2 ++ lib/cosEvent/test/cosEvent.spec | 2 +- lib/cosEventDomain/test/cosEventDomain.spec | 2 +- lib/cosFileTransfer/test/cosFileTransfer.spec | 2 +- lib/cosNotification/test/cosNotification.spec | 2 +- lib/cosProperty/test/cosProperty.spec | 2 +- lib/cosTime/test/cosTime.spec | 2 +- lib/cosTransactions/test/cosTransactions.spec | 2 +- lib/crypto/test/crypto.spec | 2 +- lib/debugger/test/debugger.spec | 2 +- lib/edoc/test/edoc.spec | 2 +- lib/erl_interface/test/erl_interface.spec | 2 +- lib/et/test/et.spec | 2 +- lib/eunit/test/Makefile | 2 +- lib/eunit/test/eunit.dynspec | 6 ---- lib/eunit/test/eunit.spec | 3 ++ lib/ic/test/ic.spec | 2 +- lib/inets/test/inets.spec | 2 +- lib/inviso/test/inviso.spec | 2 +- lib/jinterface/test/Makefile | 2 +- lib/jinterface/test/jinterface.dynspec | 32 ------------------- lib/jinterface/test/jinterface.spec | 20 ++++++++++++ lib/jinterface/test/jinterface_SUITE.erl | 9 +++++- lib/jinterface/test/nc_SUITE.erl | 13 +++++--- lib/kernel/test/kernel.spec | 2 +- lib/megaco/test/megaco.spec | 4 +-- lib/mnesia/test/mnesia.spec | 44 +++++++++++++-------------- lib/observer/test/observer.spec | 2 +- lib/odbc/test/odbc.spec | 18 +++++------ lib/orber/test/orber.spec | 2 +- lib/os_mon/test/os_mon.spec | 2 +- lib/parsetools/test/parsetools.spec | 2 +- lib/percept/test/percept.spec | 2 +- lib/public_key/test/public_key.spec | 2 +- lib/reltool/test/reltool.spec | 2 +- lib/runtime_tools/test/runtime_tools.spec | 2 +- lib/snmp/test/snmp.spec | 2 +- lib/ssl/test/ssl.spec | 2 +- lib/stdlib/test/stdlib.spec | 2 +- lib/syntax_tools/test/Makefile | 2 +- lib/syntax_tools/test/syntax_tools.dynspec | 5 --- lib/syntax_tools/test/syntax_tools.spec | 2 ++ lib/tools/test/tools.spec | 2 +- lib/wx/test/wx.spec | 2 +- 51 files changed, 114 insertions(+), 130 deletions(-) delete mode 100644 lib/compiler/test/compiler.dynspec create mode 100644 lib/compiler/test/compiler.spec delete mode 100644 lib/eunit/test/eunit.dynspec create mode 100644 lib/eunit/test/eunit.spec delete mode 100644 lib/jinterface/test/jinterface.dynspec create mode 100644 lib/jinterface/test/jinterface.spec delete mode 100644 lib/syntax_tools/test/syntax_tools.dynspec create mode 100644 lib/syntax_tools/test/syntax_tools.spec diff --git a/erts/emulator/test/emulator.spec b/erts/emulator/test/emulator.spec index 533252219f..1ea751cc3b 100644 --- a/erts/emulator/test/emulator.spec +++ b/erts/emulator/test/emulator.spec @@ -1 +1 @@ -{suites,"emulator_test",all}. +{suites,"../emulator_test",all}. diff --git a/erts/epmd/test/epmd.spec b/erts/epmd/test/epmd.spec index d77bc4afb9..e72272cf94 100644 --- a/erts/epmd/test/epmd.spec +++ b/erts/epmd/test/epmd.spec @@ -1 +1 @@ -{suites,"epmd_test",all}. +{suites,"../epmd_test",all}. diff --git a/erts/test/system.spec b/erts/test/system.spec index 7da3cfc64a..e0561ba0b2 100644 --- a/erts/test/system.spec +++ b/erts/test/system.spec @@ -1 +1 @@ -{suites,"system_test",all}. +{suites,"../system_test",all}. diff --git a/lib/asn1/test/asn1.spec b/lib/asn1/test/asn1.spec index 2a29db10ff..ae96de3a58 100644 --- a/lib/asn1/test/asn1.spec +++ b/lib/asn1/test/asn1.spec @@ -1 +1 @@ -{suites,"asn1_test",all}. +{suites,"../asn1_test",all}. diff --git a/lib/common_test/test/common_test.spec b/lib/common_test/test/common_test.spec index e1b4fa8d39..8755b08117 100644 --- a/lib/common_test/test/common_test.spec +++ b/lib/common_test/test/common_test.spec @@ -1 +1 @@ -{suites,"common_test_test",all}. \ No newline at end of file +{suites,"../common_test_test",all}. \ No newline at end of file diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile index 2d08e71e09..934bf39393 100644 --- a/lib/compiler/test/Makefile +++ b/lib/compiler/test/Makefile @@ -153,7 +153,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) compiler.dynspec compiler.cover \ + $(INSTALL_DATA) compiler.spec compiler.cover \ $(EMAKEFILE) $(ERL_FILES) $(CORE_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(NO_OPT_ERL_FILES) $(POST_OPT_ERL_FILES) \ $(INLINE_ERL_FILES) $(RELSYSDIR) diff --git a/lib/compiler/test/compiler.dynspec b/lib/compiler/test/compiler.dynspec deleted file mode 100644 index 7e452cef6c..0000000000 --- a/lib/compiler/test/compiler.dynspec +++ /dev/null @@ -1,10 +0,0 @@ -%% -*- erlang -*- -%% You can test this file using this command. -%% file:script("compiler.dynspec", [{'Os',"Unix"}]). - -case Os of - "VxWorks" -> - [{skip,{compile_SUITE,listings,"VxWorks filesystem too slow"}}]; - _ -> - [] -end. diff --git a/lib/compiler/test/compiler.spec b/lib/compiler/test/compiler.spec new file mode 100644 index 0000000000..f2546c3ced --- /dev/null +++ b/lib/compiler/test/compiler.spec @@ -0,0 +1,2 @@ +%% -*- erlang -*- +{suites,"../compiler_test",all}. diff --git a/lib/cosEvent/test/cosEvent.spec b/lib/cosEvent/test/cosEvent.spec index 202cba887f..f793693779 100644 --- a/lib/cosEvent/test/cosEvent.spec +++ b/lib/cosEvent/test/cosEvent.spec @@ -1 +1 @@ -{suites,"cosEvent_test",all}. +{suites,"../cosEvent_test",all}. diff --git a/lib/cosEventDomain/test/cosEventDomain.spec b/lib/cosEventDomain/test/cosEventDomain.spec index 0d31e32419..bcee74c5f1 100644 --- a/lib/cosEventDomain/test/cosEventDomain.spec +++ b/lib/cosEventDomain/test/cosEventDomain.spec @@ -1 +1 @@ -{suites,"cosEventDomain_test",all}. +{suites,"../cosEventDomain_test",all}. diff --git a/lib/cosFileTransfer/test/cosFileTransfer.spec b/lib/cosFileTransfer/test/cosFileTransfer.spec index 80fe919f2a..290b27d048 100644 --- a/lib/cosFileTransfer/test/cosFileTransfer.spec +++ b/lib/cosFileTransfer/test/cosFileTransfer.spec @@ -1 +1 @@ -{topcase, {dir, "../cosFileTransfer_test"}}. +{suites,"../cosFileTransfer_test", all}. diff --git a/lib/cosNotification/test/cosNotification.spec b/lib/cosNotification/test/cosNotification.spec index 01c245cec2..8ec1baca33 100644 --- a/lib/cosNotification/test/cosNotification.spec +++ b/lib/cosNotification/test/cosNotification.spec @@ -1 +1 @@ -{suites,"cosNotification_test",all}. +{suites,"../cosNotification_test",all}. diff --git a/lib/cosProperty/test/cosProperty.spec b/lib/cosProperty/test/cosProperty.spec index 662150fb86..d3d44321c8 100644 --- a/lib/cosProperty/test/cosProperty.spec +++ b/lib/cosProperty/test/cosProperty.spec @@ -1 +1 @@ -{suites,"cosProperty_test",all}. +{suites,"../cosProperty_test",all}. diff --git a/lib/cosTime/test/cosTime.spec b/lib/cosTime/test/cosTime.spec index 66af3e7941..8bf6f740fe 100644 --- a/lib/cosTime/test/cosTime.spec +++ b/lib/cosTime/test/cosTime.spec @@ -1 +1 @@ -{suites,"cosTime_test",all}. +{suites,"../cosTime_test",all}. diff --git a/lib/cosTransactions/test/cosTransactions.spec b/lib/cosTransactions/test/cosTransactions.spec index da226271c3..9918c8ca16 100644 --- a/lib/cosTransactions/test/cosTransactions.spec +++ b/lib/cosTransactions/test/cosTransactions.spec @@ -1 +1 @@ -{suites,"cosTransactions_test",all}. +{suites,"../cosTransactions_test",all}. diff --git a/lib/crypto/test/crypto.spec b/lib/crypto/test/crypto.spec index 52fb4c1c98..cc09970cb3 100644 --- a/lib/crypto/test/crypto.spec +++ b/lib/crypto/test/crypto.spec @@ -1 +1 @@ -{suites,"crypto_test",all}. +{suites,"../crypto_test",all}. diff --git a/lib/debugger/test/debugger.spec b/lib/debugger/test/debugger.spec index 426b2757ac..7aef026e77 100644 --- a/lib/debugger/test/debugger.spec +++ b/lib/debugger/test/debugger.spec @@ -1 +1 @@ -{suites,"debugger_test",all}. +{suites,"../debugger_test",all}. diff --git a/lib/edoc/test/edoc.spec b/lib/edoc/test/edoc.spec index 02e3eca8fe..8371427270 100644 --- a/lib/edoc/test/edoc.spec +++ b/lib/edoc/test/edoc.spec @@ -1 +1 @@ -{suites,"edoc_test",all}. +{suites,"../edoc_test",all}. diff --git a/lib/erl_interface/test/erl_interface.spec b/lib/erl_interface/test/erl_interface.spec index 59542b6558..a0a7acfa50 100644 --- a/lib/erl_interface/test/erl_interface.spec +++ b/lib/erl_interface/test/erl_interface.spec @@ -1 +1 @@ -{suites,"erl_interface_test",all}. +{suites,"../erl_interface_test",all}. diff --git a/lib/et/test/et.spec b/lib/et/test/et.spec index f363993ab7..09993a217a 100644 --- a/lib/et/test/et.spec +++ b/lib/et/test/et.spec @@ -1 +1 @@ -{suites,"et_test",all}. +{suites,"../et_test",all}. diff --git a/lib/eunit/test/Makefile b/lib/eunit/test/Makefile index 74d485d1cc..a2d276f619 100644 --- a/lib/eunit/test/Makefile +++ b/lib/eunit/test/Makefile @@ -75,7 +75,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) eunit.dynspec $(EMAKEFILE) \ + $(INSTALL_DATA) eunit.spec $(EMAKEFILE) \ $(COVERFILE) $(ERL_FILES) \ $(RELSYSDIR) diff --git a/lib/eunit/test/eunit.dynspec b/lib/eunit/test/eunit.dynspec deleted file mode 100644 index c1d345ac14..0000000000 --- a/lib/eunit/test/eunit.dynspec +++ /dev/null @@ -1,6 +0,0 @@ -%% -*- erlang -*- -%% You can test this file using this command. -%% file:script("eunit.dynspec", [{'Os',"Unix"}]). - -[]. - diff --git a/lib/eunit/test/eunit.spec b/lib/eunit/test/eunit.spec new file mode 100644 index 0000000000..2db7731a7e --- /dev/null +++ b/lib/eunit/test/eunit.spec @@ -0,0 +1,3 @@ +%% -*- erlang -*- +{suites,"../eunit_test",all}. + diff --git a/lib/ic/test/ic.spec b/lib/ic/test/ic.spec index 4fafc1b681..22905dcee4 100644 --- a/lib/ic/test/ic.spec +++ b/lib/ic/test/ic.spec @@ -1 +1 @@ -{suites,"ic_test",all}. +{suites,"../ic_test",all}. diff --git a/lib/inets/test/inets.spec b/lib/inets/test/inets.spec index 44c7c98916..ed102f8219 100644 --- a/lib/inets/test/inets.spec +++ b/lib/inets/test/inets.spec @@ -1 +1 @@ -{suites,"inets_test",all}. +{suites,"../inets_test",all}. diff --git a/lib/inviso/test/inviso.spec b/lib/inviso/test/inviso.spec index 49b3f67096..49f9b0b460 100644 --- a/lib/inviso/test/inviso.spec +++ b/lib/inviso/test/inviso.spec @@ -1 +1 @@ -{suites,"inviso_test",all}. +{suites,"../inviso_test",all}. diff --git a/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile index 36955d1e91..b2ddffea42 100644 --- a/lib/jinterface/test/Makefile +++ b/lib/jinterface/test/Makefile @@ -32,7 +32,7 @@ RELSYSDIR = $(RELEASE_PATH)/jinterface_test # ---------------------------------------------------- # Target Specs # ---------------------------------------------------- -TEST_SPEC_FILE = jinterface.dynspec +TEST_SPEC_FILE = jinterface.spec MODULES = nc_SUITE \ jinterface_SUITE diff --git a/lib/jinterface/test/jinterface.dynspec b/lib/jinterface/test/jinterface.dynspec deleted file mode 100644 index 44712521df..0000000000 --- a/lib/jinterface/test/jinterface.dynspec +++ /dev/null @@ -1,32 +0,0 @@ -%% -*- erlang -*- -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% -%% You can test this file using this command. -%% file:script("jinterface.dynspec", [{'Os',"Unix"}]). - -case case code:priv_dir(jinterface) of - {error,bad_name} -> false; - P -> filelib:is_dir(P) end of - true -> - []; - false -> - NoApp = "No jinterface application", - [{skip,{nc_SUITE,NoApp}}, - {skip,{jinterface_SUITE,NoApp}}] -end. diff --git a/lib/jinterface/test/jinterface.spec b/lib/jinterface/test/jinterface.spec new file mode 100644 index 0000000000..99bc0f4005 --- /dev/null +++ b/lib/jinterface/test/jinterface.spec @@ -0,0 +1,20 @@ +%% -*- erlang -*- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +{suites,"../jinterface_test",all}. diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index db33059af5..b42101908e 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -163,7 +163,14 @@ status_handler() -> init_per_suite(Config) when is_list(Config) -> - jitu:init_all(Config). + case case code:priv_dir(jinterface) of + {error,bad_name} -> false; + P -> filelib:is_dir(P) end of + true -> + jitu:init_all(Config); + false -> + {skip,"No jinterface application"} + end. end_per_suite(Config) when is_list(Config) -> jitu:finish_all(Config). diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index fde2fd5071..f9a588f32c 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -69,12 +69,15 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - - - - init_per_suite(Config) when is_list(Config) -> - jitu:init_all(Config). + case case code:priv_dir(jinterface) of + {error,bad_name} -> false; + P -> filelib:is_dir(P) end of + true -> + jitu:init_all(Config); + false -> + {skip,"No jinterface application"} + end. end_per_suite(Config) -> jitu:finish_all(Config). diff --git a/lib/kernel/test/kernel.spec b/lib/kernel/test/kernel.spec index 9bb95f9ada..62afc9f97b 100644 --- a/lib/kernel/test/kernel.spec +++ b/lib/kernel/test/kernel.spec @@ -1,4 +1,4 @@ {config, "../test_server/ts.config"}. {config, "../test_server/ts.unix.config"}. -{suites, "kernel_test", all}. +{suites,"../kernel_test", all}. diff --git a/lib/megaco/test/megaco.spec b/lib/megaco/test/megaco.spec index 6f8ee92c3c..cab8499835 100644 --- a/lib/megaco/test/megaco.spec +++ b/lib/megaco/test/megaco.spec @@ -1,2 +1,2 @@ -{suites,"megaco_test",all}. -{skip_cases,"megaco_test",megaco_measure_test,[all],"Not yet implemented"}. +{suites,"../megaco_test",all}. +{skip_cases,"../megaco_test",megaco_measure_test,[all],"Not yet implemented"}. diff --git a/lib/mnesia/test/mnesia.spec b/lib/mnesia/test/mnesia.spec index d24873eed0..204d1519cb 100644 --- a/lib/mnesia/test/mnesia.spec +++ b/lib/mnesia/test/mnesia.spec @@ -1,21 +1,21 @@ -{suites,"mnesia_test",all}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{suites,"../mnesia_test",all}. +{skip_cases,"../mnesia_test",mnesia_measure_test, [ram_meter], "Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [disc_meter], "Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [disc_only_meter], "Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test,[cost],"Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test,[cost],"Takes to long time"}. +{skip_cases,"../mnesia_test",mnesia_measure_test, [dbn_meters], "Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [ram_tpcb,disc_tpcb,disc_only_tpcb], "Takes to long time"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [reader_disturbed_by_node_down,writer_disturbed_by_node_down, reader_disturbed_by_node_up,writer_disturbed_by_node_up, reader_disturbed_by_schema_ops,writer_disturbed_by_schema_ops, @@ -26,51 +26,51 @@ reader_competing_with_reader,reader_competing_with_writer, writer_competing_with_reader,writer_competing_with_writer], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [measure_resource_consumption,determine_resource_leakage], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [determine_system_limits,performance_at_min_config, performance_at_max_config,performance_at_full_load, resource_consumption_at_min_config, resource_consumption_at_max_config, resource_consumption_at_full_load], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [ram_tpcb,disc_tpcb,disc_only_tpcb], "Takes too much time and memory"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [measure_all_api_functions], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_measure_test, +{skip_cases,"../mnesia_test",mnesia_measure_test, [mnemosyne_vs_mnesia_kernel], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_examples_test, +{skip_cases,"../mnesia_test",mnesia_examples_test, [company], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_config_test, +{skip_cases,"../mnesia_test",mnesia_config_test, [ignore_fallback_at_startup], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_evil_backup, +{skip_cases,"../mnesia_test",mnesia_evil_backup, [local_backup_checkpoint], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_config_test, +{skip_cases,"../mnesia_test",mnesia_config_test, [max_wait_for_decision], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_recovery_test, +{skip_cases,"../mnesia_test",mnesia_recovery_test, [after_full_disc_partition], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_recovery_test, +{skip_cases,"../mnesia_test",mnesia_recovery_test, [system_upgrade], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_consistency_test, +{skip_cases,"../mnesia_test",mnesia_consistency_test, [consistency_after_change_table_copy_type], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_consistency_test, +{skip_cases,"../mnesia_test",mnesia_consistency_test, [consistency_after_transform_table_ram, consistency_after_transform_table_disc, consistency_after_transform_table_disc_only], "Not yet implemented"}. -{skip_cases,"mnesia_test",mnesia_consistency_test, +{skip_cases,"../mnesia_test",mnesia_consistency_test, [consistency_after_rename_of_node], "Not yet implemented"}. diff --git a/lib/observer/test/observer.spec b/lib/observer/test/observer.spec index 065be46fef..3b4b5da28c 100644 --- a/lib/observer/test/observer.spec +++ b/lib/observer/test/observer.spec @@ -1 +1 @@ -{suites,"observer_test",all}. +{suites,"../observer_test",all}. diff --git a/lib/odbc/test/odbc.spec b/lib/odbc/test/odbc.spec index 2151406901..edaf821c91 100644 --- a/lib/odbc/test/odbc.spec +++ b/lib/odbc/test/odbc.spec @@ -1,25 +1,25 @@ -{suites,"odbc_test",all}. -{skip_cases,"odbc_test",odbc_data_type_SUITE, +{suites,"../odbc_test",all}. +{skip_cases,"../odbc_test",odbc_data_type_SUITE, [varchar_upper_limit], "Known bug in database"}. -{skip_cases,"odbc_test",odbc_data_type_SUITE, +{skip_cases,"../odbc_test",odbc_data_type_SUITE, [text_upper_limit], "Consumes too much resources"}. -{skip_cases,"odbc_test",odbc_data_type_SUITE, +{skip_cases,"../odbc_test",odbc_data_type_SUITE, [bit_true], "Not supported by driver"}. -{skip_cases,"odbc_test",odbc_data_type_SUITE, +{skip_cases,"../odbc_test",odbc_data_type_SUITE, [bit_false], "Not supported by driver"}. -{skip_cases,"odbc_test",odbc_query_SUITE, +{skip_cases,"../odbc_test",odbc_query_SUITE, [multiple_select_result_sets], "Not supported by driver"}. -{skip_cases,"odbc_test",odbc_query_SUITE, +{skip_cases,"../odbc_test",odbc_query_SUITE, [multiple_mix_result_sets], "Not supported by driver"}. -{skip_cases,"odbc_test",odbc_query_SUITE, +{skip_cases,"../odbc_test",odbc_query_SUITE, [multiple_result_sets_error], "Not supported by driver"}. -{skip_cases,"odbc_test",odbc_query_SUITE, +{skip_cases,"../odbc_test",odbc_query_SUITE, [param_insert_tiny_int], "Not supported by driver"}. diff --git a/lib/orber/test/orber.spec b/lib/orber/test/orber.spec index a5f48a3611..0dd30deade 100644 --- a/lib/orber/test/orber.spec +++ b/lib/orber/test/orber.spec @@ -1 +1 @@ -{suites,"orber_test",all}. +{suites,"../orber_test",all}. diff --git a/lib/os_mon/test/os_mon.spec b/lib/os_mon/test/os_mon.spec index 859859c587..d292b258f3 100644 --- a/lib/os_mon/test/os_mon.spec +++ b/lib/os_mon/test/os_mon.spec @@ -1 +1 @@ -{suites,"os_mon_test",all}. +{suites,"../os_mon_test",all}. diff --git a/lib/parsetools/test/parsetools.spec b/lib/parsetools/test/parsetools.spec index 97dfe58f97..870d57baf1 100644 --- a/lib/parsetools/test/parsetools.spec +++ b/lib/parsetools/test/parsetools.spec @@ -1 +1 @@ -{suites,"parsetools_test",all}. +{suites,"../parsetools_test",all}. diff --git a/lib/percept/test/percept.spec b/lib/percept/test/percept.spec index 10b3037283..f3ef76bd60 100644 --- a/lib/percept/test/percept.spec +++ b/lib/percept/test/percept.spec @@ -1 +1 @@ -{suites,"percept_test",all}. +{suites,"../percept_test",all}. diff --git a/lib/public_key/test/public_key.spec b/lib/public_key/test/public_key.spec index d4a63b5dd4..1749822c2d 100644 --- a/lib/public_key/test/public_key.spec +++ b/lib/public_key/test/public_key.spec @@ -1 +1 @@ -{suites,"public_key_test",all}. +{suites,"../public_key_test",all}. diff --git a/lib/reltool/test/reltool.spec b/lib/reltool/test/reltool.spec index d613ebd97d..2995720105 100644 --- a/lib/reltool/test/reltool.spec +++ b/lib/reltool/test/reltool.spec @@ -1 +1 @@ -{suites,"reltool_test",all}. +{suites,"../reltool_test",all}. diff --git a/lib/runtime_tools/test/runtime_tools.spec b/lib/runtime_tools/test/runtime_tools.spec index 008c84de5e..0a24232be8 100644 --- a/lib/runtime_tools/test/runtime_tools.spec +++ b/lib/runtime_tools/test/runtime_tools.spec @@ -1 +1 @@ -{suites,"runtime_tools_test",all}. +{suites,"../runtime_tools_test",all}. diff --git a/lib/snmp/test/snmp.spec b/lib/snmp/test/snmp.spec index 07492337fb..88ae0145f0 100644 --- a/lib/snmp/test/snmp.spec +++ b/lib/snmp/test/snmp.spec @@ -1 +1 @@ -{suites,"snmp_test",all}. +{suites,"../snmp_test",all}. diff --git a/lib/ssl/test/ssl.spec b/lib/ssl/test/ssl.spec index 65adb51d36..fc7c1bbb82 100644 --- a/lib/ssl/test/ssl.spec +++ b/lib/ssl/test/ssl.spec @@ -1 +1 @@ -{suites,"ssl_test",all}. +{suites,"../ssl_test",all}. diff --git a/lib/stdlib/test/stdlib.spec b/lib/stdlib/test/stdlib.spec index e67ac71c2f..3768e494b2 100644 --- a/lib/stdlib/test/stdlib.spec +++ b/lib/stdlib/test/stdlib.spec @@ -1 +1 @@ -{suites,"stdlib_test",all}. +{suites,"../stdlib_test",all}. diff --git a/lib/syntax_tools/test/Makefile b/lib/syntax_tools/test/Makefile index 621c76f5a5..f08bf319f1 100644 --- a/lib/syntax_tools/test/Makefile +++ b/lib/syntax_tools/test/Makefile @@ -59,7 +59,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) - $(INSTALL_DATA) syntax_tools.dynspec $(RELSYSDIR) + $(INSTALL_DATA) syntax_tools.spec $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) release_docs_spec: diff --git a/lib/syntax_tools/test/syntax_tools.dynspec b/lib/syntax_tools/test/syntax_tools.dynspec deleted file mode 100644 index 981cb8175e..0000000000 --- a/lib/syntax_tools/test/syntax_tools.dynspec +++ /dev/null @@ -1,5 +0,0 @@ -%% -*- erlang -*- -%% You can test this file using this command. -%% file:script("syntax_tools.dynspec", [{'Os',"Unix"}]). - -[]. diff --git a/lib/syntax_tools/test/syntax_tools.spec b/lib/syntax_tools/test/syntax_tools.spec new file mode 100644 index 0000000000..e7ddbf7586 --- /dev/null +++ b/lib/syntax_tools/test/syntax_tools.spec @@ -0,0 +1,2 @@ +%% -*- erlang -*- +{suites,"../syntax_tools_test",all}. diff --git a/lib/tools/test/tools.spec b/lib/tools/test/tools.spec index 05a5b8fca6..1b07cf1cb6 100644 --- a/lib/tools/test/tools.spec +++ b/lib/tools/test/tools.spec @@ -1 +1 @@ -{suites,"tools_test",all}. +{suites,"../tools_test",all}. diff --git a/lib/wx/test/wx.spec b/lib/wx/test/wx.spec index 7181a01ab7..21e4a8c064 100644 --- a/lib/wx/test/wx.spec +++ b/lib/wx/test/wx.spec @@ -1 +1 @@ -{suites,"wx_test",all}. +{suites,"../wx_test",all}. -- cgit v1.2.3 From cfa01c9bd748df38750dc4841030e6520610538a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 12 Jan 2011 14:56:23 +0100 Subject: Update and add cover spec files to work with common_test --- lib/asn1/test/Makefile | 2 +- lib/asn1/test/asn1.cover | 2 ++ lib/compiler/test/compiler.cover | 4 ++- lib/cosEvent/test/Makefile | 3 ++- lib/cosEvent/test/cosEvent.cover | 2 ++ lib/cosEventDomain/test/Makefile | 3 ++- lib/cosEventDomain/test/cosEventDomain.cover | 2 ++ lib/cosFileTransfer/test/Makefile | 3 ++- lib/cosFileTransfer/test/cosFileTransfer.cover | 2 ++ lib/cosNotification/test/Makefile | 3 ++- lib/cosNotification/test/cosNotification.cover | 2 ++ lib/cosProperty/test/Makefile | 3 ++- lib/cosProperty/test/cosProperty.cover | 2 ++ lib/cosTime/test/Makefile | 3 ++- lib/cosTime/test/cosTime.cover | 2 ++ lib/cosTransactions/test/Makefile | 3 ++- lib/cosTransactions/test/cosTransactions.cover | 2 ++ lib/crypto/test/Makefile | 2 +- lib/crypto/test/crypto.cover | 2 ++ lib/debugger/test/Makefile | 2 +- lib/debugger/test/debugger.cover | 2 ++ lib/docbuilder/test/Makefile | 2 +- lib/docbuilder/test/docb.cover | 2 ++ lib/edoc/test/Makefile | 2 +- lib/edoc/test/edoc.cover | 2 ++ lib/erl_interface/test/Makefile | 8 +++--- lib/erl_interface/test/erl_interface.cover | 2 ++ lib/et/test/Makefile | 2 +- lib/et/test/et.cover | 2 ++ lib/eunit/test/eunit.cover | 4 ++- lib/ic/test/Makefile | 4 +-- lib/ic/test/ic.cover | 2 ++ lib/inets/test/Makefile | 7 ++--- lib/inets/test/inets.cover | 2 ++ lib/inviso/test/Makefile | 2 +- lib/inviso/test/inviso.cover | 2 ++ lib/jinterface/test/Makefile | 3 ++- lib/jinterface/test/jinterface.cover | 2 ++ lib/kernel/test/kernel.cover | 3 +-- lib/megaco/test/megaco.cover | 4 ++- lib/mnesia/test/Makefile | 2 +- lib/mnesia/test/mnesia.cover | 2 ++ lib/observer/test/Makefile | 2 +- lib/observer/test/observer.cover | 6 +++-- lib/odbc/test/Makefile | 6 ++--- lib/odbc/test/odbc.cover | 2 ++ lib/orber/test/Makefile | 3 ++- lib/orber/test/orber.cover | 2 ++ lib/os_mon/test/Makefile | 2 +- lib/os_mon/test/os_mon.cover | 2 ++ lib/parsetools/test/Makefile | 2 +- lib/parsetools/test/parsetools.cover | 2 ++ lib/percept/test/Makefile | 2 +- lib/percept/test/percept.cover | 2 ++ lib/public_key/test/public_key.cover | 4 ++- lib/reltool/test/Makefile | 2 +- lib/reltool/test/reltool.cover | 2 ++ lib/runtime_tools/test/Makefile | 2 +- lib/runtime_tools/test/runtime_tools.cover | 4 ++- lib/snmp/test/snmp.cover | 4 ++- lib/ssl/test/Makefile | 2 +- lib/ssl/test/ssl.cover | 36 ++++++++++++++------------ lib/stdlib/test/Makefile | 2 +- lib/stdlib/test/stdlib.cover | 25 +++++++++++------- lib/syntax_tools/test/Makefile | 2 +- lib/syntax_tools/test/syntax_tools.cover | 2 ++ lib/test_server/test/Makefile | 2 +- lib/test_server/test/test_server.cover | 34 ++++++++++++------------ lib/tools/test/Makefile | 6 +++-- lib/tools/test/tools.cover | 2 ++ lib/wx/test/Makefile | 2 +- lib/wx/test/wx.cover | 2 ++ 72 files changed, 186 insertions(+), 94 deletions(-) create mode 100644 lib/asn1/test/asn1.cover create mode 100644 lib/cosEvent/test/cosEvent.cover create mode 100644 lib/cosEventDomain/test/cosEventDomain.cover create mode 100644 lib/cosFileTransfer/test/cosFileTransfer.cover create mode 100644 lib/cosNotification/test/cosNotification.cover create mode 100644 lib/cosProperty/test/cosProperty.cover create mode 100644 lib/cosTime/test/cosTime.cover create mode 100644 lib/cosTransactions/test/cosTransactions.cover create mode 100644 lib/crypto/test/crypto.cover create mode 100644 lib/debugger/test/debugger.cover create mode 100644 lib/docbuilder/test/docb.cover create mode 100644 lib/edoc/test/edoc.cover create mode 100644 lib/erl_interface/test/erl_interface.cover create mode 100644 lib/et/test/et.cover create mode 100644 lib/ic/test/ic.cover create mode 100644 lib/inets/test/inets.cover create mode 100644 lib/inviso/test/inviso.cover create mode 100644 lib/jinterface/test/jinterface.cover create mode 100644 lib/mnesia/test/mnesia.cover create mode 100644 lib/odbc/test/odbc.cover create mode 100644 lib/orber/test/orber.cover create mode 100644 lib/os_mon/test/os_mon.cover create mode 100644 lib/parsetools/test/parsetools.cover create mode 100644 lib/percept/test/percept.cover create mode 100644 lib/reltool/test/reltool.cover create mode 100644 lib/syntax_tools/test/syntax_tools.cover create mode 100644 lib/tools/test/tools.cover create mode 100644 lib/wx/test/wx.cover diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile index e8f65ec70b..8a23f8e869 100644 --- a/lib/asn1/test/Makefile +++ b/lib/asn1/test/Makefile @@ -193,7 +193,7 @@ release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_SUITE_data $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_v2_SUITE_data $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) - $(INSTALL_DATA) asn1.spec $(INSTALL_PROGS) $(RELSYSDIR) + $(INSTALL_DATA) asn1.spec asn1.cover $(INSTALL_PROGS) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) cd asn1_SUITE_data; tar cfh $(RELSYSDIR)/asn1_SUITE_data.tar * cd $(RELSYSDIR)/asn1_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar diff --git a/lib/asn1/test/asn1.cover b/lib/asn1/test/asn1.cover new file mode 100644 index 0000000000..589a8b7e3d --- /dev/null +++ b/lib/asn1/test/asn1.cover @@ -0,0 +1,2 @@ +{incl_app,asn1,details}. + diff --git a/lib/compiler/test/compiler.cover b/lib/compiler/test/compiler.cover index 69d284ea6c..9fc4c7dd43 100644 --- a/lib/compiler/test/compiler.cover +++ b/lib/compiler/test/compiler.cover @@ -1,3 +1,5 @@ +{incl_app,compiler,details}. + %% -*- erlang -*- -{exclude,[sys_pre_attributes,core_scan,core_parse]}. +{excl_mods,[sys_pre_attributes,core_scan,core_parse]}. diff --git a/lib/cosEvent/test/Makefile b/lib/cosEvent/test/Makefile index 3d95075ee1..d37d3e4e3c 100644 --- a/lib/cosEvent/test/Makefile +++ b/lib/cosEvent/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosEvent_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosEvent.spec +COVER_FILE = cosEvent.cover IDL_FILES = \ @@ -146,7 +147,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ diff --git a/lib/cosEvent/test/cosEvent.cover b/lib/cosEvent/test/cosEvent.cover new file mode 100644 index 0000000000..df12ea3ca9 --- /dev/null +++ b/lib/cosEvent/test/cosEvent.cover @@ -0,0 +1,2 @@ +{incl_app,cosEvent,details}. + diff --git a/lib/cosEventDomain/test/Makefile b/lib/cosEventDomain/test/Makefile index 9893b05b8c..5b53690c6b 100644 --- a/lib/cosEventDomain/test/Makefile +++ b/lib/cosEventDomain/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosEventDomain_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosEventDomain.spec +COVER_FILE = cosEventDomain.cover MODULES = \ @@ -99,6 +100,6 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) diff --git a/lib/cosEventDomain/test/cosEventDomain.cover b/lib/cosEventDomain/test/cosEventDomain.cover new file mode 100644 index 0000000000..f87f6d97bf --- /dev/null +++ b/lib/cosEventDomain/test/cosEventDomain.cover @@ -0,0 +1,2 @@ +{incl_app,cosEventDomain,details}. + diff --git a/lib/cosFileTransfer/test/Makefile b/lib/cosFileTransfer/test/Makefile index 60f72644bd..cb181bdb66 100644 --- a/lib/cosFileTransfer/test/Makefile +++ b/lib/cosFileTransfer/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosFileTransfer_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosFileTransfer.spec +COVER_FILE = cosFileTransfer.cover IDL_FILES = @@ -127,6 +128,6 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) diff --git a/lib/cosFileTransfer/test/cosFileTransfer.cover b/lib/cosFileTransfer/test/cosFileTransfer.cover new file mode 100644 index 0000000000..063dd66990 --- /dev/null +++ b/lib/cosFileTransfer/test/cosFileTransfer.cover @@ -0,0 +1,2 @@ +{incl_app,cosFileTransfer,details}. + diff --git a/lib/cosNotification/test/Makefile b/lib/cosNotification/test/Makefile index df8f9e919b..d29c9c3245 100644 --- a/lib/cosNotification/test/Makefile +++ b/lib/cosNotification/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosNotification_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosNotification.spec +COVER_FILE = cosNotification.cover IDL_FILES = @@ -182,7 +183,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ $(RELSYSDIR)/$(IDLOUTDIR) diff --git a/lib/cosNotification/test/cosNotification.cover b/lib/cosNotification/test/cosNotification.cover new file mode 100644 index 0000000000..604f313521 --- /dev/null +++ b/lib/cosNotification/test/cosNotification.cover @@ -0,0 +1,2 @@ +{incl_app,cosNotification,details}. + diff --git a/lib/cosProperty/test/Makefile b/lib/cosProperty/test/Makefile index ac0f4e298d..d4ae5cad3d 100644 --- a/lib/cosProperty/test/Makefile +++ b/lib/cosProperty/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosProperty_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosProperty.spec +COVER_FILE = cosProperty.cover IDL_FILES = @@ -121,7 +122,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) # $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) # $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ diff --git a/lib/cosProperty/test/cosProperty.cover b/lib/cosProperty/test/cosProperty.cover new file mode 100644 index 0000000000..a0f5f17671 --- /dev/null +++ b/lib/cosProperty/test/cosProperty.cover @@ -0,0 +1,2 @@ +{incl_app,cosProperty,details}. + diff --git a/lib/cosTime/test/Makefile b/lib/cosTime/test/Makefile index fde5c4facc..96f469afcd 100644 --- a/lib/cosTime/test/Makefile +++ b/lib/cosTime/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosTime_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosTime.spec +COVER_FILE = cosTime.cover IDL_FILES = @@ -127,7 +128,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) # $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) # $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ diff --git a/lib/cosTime/test/cosTime.cover b/lib/cosTime/test/cosTime.cover new file mode 100644 index 0000000000..81a05b8cfd --- /dev/null +++ b/lib/cosTime/test/cosTime.cover @@ -0,0 +1,2 @@ +{incl_app,cosTime,details}. + diff --git a/lib/cosTransactions/test/Makefile b/lib/cosTransactions/test/Makefile index 8b1264d404..6bc532aa82 100644 --- a/lib/cosTransactions/test/Makefile +++ b/lib/cosTransactions/test/Makefile @@ -38,6 +38,7 @@ RELSYSDIR = $(RELEASE_PATH)/cosTransactions_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = cosTransactions.spec +COVER_FILE = cosTransactions.cover IDL_FILES = \ @@ -142,7 +143,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ - $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ diff --git a/lib/cosTransactions/test/cosTransactions.cover b/lib/cosTransactions/test/cosTransactions.cover new file mode 100644 index 0000000000..b27bae999d --- /dev/null +++ b/lib/cosTransactions/test/cosTransactions.cover @@ -0,0 +1,2 @@ +{incl_app,cosTransactions,details}. + diff --git a/lib/crypto/test/Makefile b/lib/crypto/test/Makefile index e728875027..f4689a23df 100644 --- a/lib/crypto/test/Makefile +++ b/lib/crypto/test/Makefile @@ -76,7 +76,7 @@ release_spec: release_tests_spec: $(TEST_TARGET) $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) crypto.spec $(RELTEST_FILES) $(RELSYSDIR) + $(INSTALL_DATA) crypto.spec crypto.cover $(RELTEST_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) release_docs_spec: diff --git a/lib/crypto/test/crypto.cover b/lib/crypto/test/crypto.cover new file mode 100644 index 0000000000..61ee372ec5 --- /dev/null +++ b/lib/crypto/test/crypto.cover @@ -0,0 +1,2 @@ +{incl_app,crypto,details}. + diff --git a/lib/debugger/test/Makefile b/lib/debugger/test/Makefile index ac929038f7..47e307fcf9 100644 --- a/lib/debugger/test/Makefile +++ b/lib/debugger/test/Makefile @@ -99,7 +99,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) - $(INSTALL_DATA) debugger.spec $(RELSYSDIR) + $(INSTALL_DATA) debugger.spec debugger.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/debugger/test/debugger.cover b/lib/debugger/test/debugger.cover new file mode 100644 index 0000000000..509ddc0ec1 --- /dev/null +++ b/lib/debugger/test/debugger.cover @@ -0,0 +1,2 @@ +{incl_app,debugger,details}. + diff --git a/lib/docbuilder/test/Makefile b/lib/docbuilder/test/Makefile index 080479ee71..96b940033e 100644 --- a/lib/docbuilder/test/Makefile +++ b/lib/docbuilder/test/Makefile @@ -71,7 +71,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(SPEC_FILES) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(SPEC_FILES) docb.cover $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/docbuilder/test/docb.cover b/lib/docbuilder/test/docb.cover new file mode 100644 index 0000000000..80bab6eba7 --- /dev/null +++ b/lib/docbuilder/test/docb.cover @@ -0,0 +1,2 @@ +{incl_app,docbuilder,details} + diff --git a/lib/edoc/test/Makefile b/lib/edoc/test/Makefile index 4ce9799f6d..f77bbaa09b 100644 --- a/lib/edoc/test/Makefile +++ b/lib/edoc/test/Makefile @@ -59,7 +59,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) - $(INSTALL_DATA) edoc.spec $(RELSYSDIR) + $(INSTALL_DATA) edoc.spec edoc.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/edoc/test/edoc.cover b/lib/edoc/test/edoc.cover new file mode 100644 index 0000000000..50140fafde --- /dev/null +++ b/lib/edoc/test/edoc.cover @@ -0,0 +1,2 @@ +{incl_app,edoc,details}. + diff --git a/lib/erl_interface/test/Makefile b/lib/erl_interface/test/Makefile index 07404fda4d..c8aa6f5a6d 100644 --- a/lib/erl_interface/test/Makefile +++ b/lib/erl_interface/test/Makefile @@ -42,9 +42,9 @@ MODULES= \ runner SPEC_FILES = \ - erl_interface.spec \ - erl_interface.dynspec \ - erl_interface.spec.vxworks + erl_interface.spec + +COVER_FILE = erl_interface.cover ERL_FILES = $(MODULES:%=%.erl) @@ -72,7 +72,7 @@ release_spec: release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(SPEC_FILES) $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/erl_interface/test/erl_interface.cover b/lib/erl_interface/test/erl_interface.cover new file mode 100644 index 0000000000..879201a3cd --- /dev/null +++ b/lib/erl_interface/test/erl_interface.cover @@ -0,0 +1,2 @@ +{incl_app,erl_interface,details}. + diff --git a/lib/et/test/Makefile b/lib/et/test/Makefile index 7227ae8fd8..2125f9622a 100644 --- a/lib/et/test/Makefile +++ b/lib/et/test/Makefile @@ -71,7 +71,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) et.spec $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) et.spec et.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) $(INSTALL_SCRIPT) ett $(RELSYSDIR) $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR) # chmod -f -R u+w $(RELSYSDIR) diff --git a/lib/et/test/et.cover b/lib/et/test/et.cover new file mode 100644 index 0000000000..471e6d985d --- /dev/null +++ b/lib/et/test/et.cover @@ -0,0 +1,2 @@ +{incl_app,et,details}. + diff --git a/lib/eunit/test/eunit.cover b/lib/eunit/test/eunit.cover index d1eaf770b6..00c09127a8 100644 --- a/lib/eunit/test/eunit.cover +++ b/lib/eunit/test/eunit.cover @@ -1,3 +1,5 @@ +{incl_app,eunit,details}. + %% -*- erlang -*- -{exclude,[eunit_test]}. +{excl_mods,eunit,[eunit_test]}. diff --git a/lib/ic/test/Makefile b/lib/ic/test/Makefile index 1142159d19..988e7e7985 100644 --- a/lib/ic/test/Makefile +++ b/lib/ic/test/Makefile @@ -33,7 +33,7 @@ RELSYSDIR = $(RELEASE_PATH)/ic_test # ---------------------------------------------------- # Target Specs # ---------------------------------------------------- -TEST_SPEC_FILE = ic.spec ic.spec.vxworks +TEST_SPEC_FILE = ic.spec IDL_FILES = @@ -251,7 +251,7 @@ release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_SUITE_data $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_proto_SUITE_data $(INSTALL_DIR) $(RELSYSDIR)/java_client_erl_server_SUITE_data - $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) $(ERL_FILES) \ + $(INSTALL_DATA) $(IDL_FILES) ic.cover $(TEST_SPEC_FILE) $(ERL_FILES) \ $(RELSYSDIR) $(INSTALL_DATA) $(COMPILER_TEST_FILES) $(RELSYSDIR)/ic_SUITE_data $(INSTALL_DATA) $(COMPILER_TEST_FILES2) \ diff --git a/lib/ic/test/ic.cover b/lib/ic/test/ic.cover new file mode 100644 index 0000000000..5a679c8b6f --- /dev/null +++ b/lib/ic/test/ic.cover @@ -0,0 +1,2 @@ +{incl_app,ic,details}. + diff --git a/lib/inets/test/Makefile b/lib/inets/test/Makefile index 0492d33eab..4b803cfbe2 100644 --- a/lib/inets/test/Makefile +++ b/lib/inets/test/Makefile @@ -200,7 +200,8 @@ SOURCE = $(ERL_FILES) $(HRL_FILES) TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) -INETS_SPECS = inets.spec inets.spec.vxworks +INETS_SPECS = inets.spec +COVER_FILE = inets.cover INETS_FILES = inets.config $(INETS_SPECS) # SUB_SUITES = \ @@ -222,10 +223,10 @@ MAKE_EMAKE = $(wildcard $(ERL_TOP)/make/make_emakefile) ifeq ($(MAKE_EMAKE),) BUILDTARGET = $(TARGET_FILES) -RELTEST_FILES = $(INETS_SPECS) $(SOURCE) +RELTEST_FILES = $(COVER_FILE) $(INETS_SPECS) $(SOURCE) else BUILDTARGET = emakebuild -RELTEST_FILES = $(EMAKEFILE) $(INETS_SPECS) $(SOURCE) +RELTEST_FILES = $(EMAKEFILE) $(COVER_FILE) $(INETS_SPECS) $(SOURCE) endif diff --git a/lib/inets/test/inets.cover b/lib/inets/test/inets.cover new file mode 100644 index 0000000000..fd0ca41db3 --- /dev/null +++ b/lib/inets/test/inets.cover @@ -0,0 +1,2 @@ +{incl_app,inets,details}. + diff --git a/lib/inviso/test/Makefile b/lib/inviso/test/Makefile index 27fe99703a..cd372624b5 100644 --- a/lib/inviso/test/Makefile +++ b/lib/inviso/test/Makefile @@ -52,7 +52,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) inviso.spec $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) inviso.spec inviso.cover $(ERL_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/inviso/test/inviso.cover b/lib/inviso/test/inviso.cover new file mode 100644 index 0000000000..e23b9fa59b --- /dev/null +++ b/lib/inviso/test/inviso.cover @@ -0,0 +1,2 @@ +{incl_app,inviso,details}. + diff --git a/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile index b2ddffea42..ac9556c2f7 100644 --- a/lib/jinterface/test/Makefile +++ b/lib/jinterface/test/Makefile @@ -33,6 +33,7 @@ RELSYSDIR = $(RELEASE_PATH)/jinterface_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = jinterface.spec +COVER_FILE = jinterface.cover MODULES = nc_SUITE \ jinterface_SUITE @@ -80,5 +81,5 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(TEST_SPEC_FILE) $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/jinterface/test/jinterface.cover b/lib/jinterface/test/jinterface.cover new file mode 100644 index 0000000000..d4edcd99d2 --- /dev/null +++ b/lib/jinterface/test/jinterface.cover @@ -0,0 +1,2 @@ +{incl_app,jinterface,details}. + diff --git a/lib/kernel/test/kernel.cover b/lib/kernel/test/kernel.cover index 228dafc565..f6967ca651 100644 --- a/lib/kernel/test/kernel.cover +++ b/lib/kernel/test/kernel.cover @@ -1,4 +1,3 @@ %% -*- erlang -*- -{exclude,all}. -{include,[gen_udp,inet6_udp,inet_res,inet_dns]}. +{incl_mods,[gen_udp,inet6_udp,inet_res,inet_dns]}. diff --git a/lib/megaco/test/megaco.cover b/lib/megaco/test/megaco.cover index e7764017d4..be21216c24 100644 --- a/lib/megaco/test/megaco.cover +++ b/lib/megaco/test/megaco.cover @@ -1,5 +1,7 @@ +{incl_app,megaco,details}. + %% -*- erlang -*- -{exclude, +{excl_mods, megaco, [megaco_encoder, megaco_edist_compress, megaco_filter, diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile index 4f98efaed1..bce2467a5f 100644 --- a/lib/mnesia/test/Makefile +++ b/lib/mnesia/test/Makefile @@ -108,7 +108,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) mnesia.spec mnesia.spec.vxworks $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) mnesia.spec mnesia.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) $(INSTALL_SCRIPT) mt $(INSTALL_PROGS) $(RELSYSDIR) # chmod -f -R u+w $(RELSYSDIR) # @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/mnesia/test/mnesia.cover b/lib/mnesia/test/mnesia.cover new file mode 100644 index 0000000000..66ffc06e89 --- /dev/null +++ b/lib/mnesia/test/mnesia.cover @@ -0,0 +1,2 @@ +{incl_app,mnesia,details}. + diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile index 6f1430b00a..e15bde7346 100644 --- a/lib/observer/test/Makefile +++ b/lib/observer/test/Makefile @@ -80,7 +80,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) observer.spec observer.dynspec $(EMAKEFILE) \ + $(INSTALL_DATA) observer.spec $(EMAKEFILE) \ $(COVERFILE) $(ERL_FILES) \ $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/observer/test/observer.cover b/lib/observer/test/observer.cover index 47770ba839..fafb718840 100644 --- a/lib/observer/test/observer.cover +++ b/lib/observer/test/observer.cover @@ -1,2 +1,4 @@ -{exclude,[multitrace]}. -{include,[observer_backend]}. +{incl_app,observer,details}. + +{excl_mods,observer,[multitrace]}. +{incl_mods,observer,[observer_backend]}. diff --git a/lib/odbc/test/Makefile b/lib/odbc/test/Makefile index 935ecbf5a7..ab3cdea543 100644 --- a/lib/odbc/test/Makefile +++ b/lib/odbc/test/Makefile @@ -45,8 +45,8 @@ HRL_FILES= odbc_test.hrl\ TARGET_FILES= \ $(MODULES:%=$(EBIN)/%.$(EMULATOR)) -SPEC_FILES = odbc.spec odbc.dynspec \ - odbc.spec.win +SPEC_FILES = odbc.spec +COVER_FILE = odbc.cover EMAKEFILE = Emakefile MAKE_EMAKE = $(wildcard $(ERL_TOP)/make/make_emakefile) @@ -101,7 +101,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(SPEC_FILES) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) release_docs_spec: diff --git a/lib/odbc/test/odbc.cover b/lib/odbc/test/odbc.cover new file mode 100644 index 0000000000..1acca281fb --- /dev/null +++ b/lib/odbc/test/odbc.cover @@ -0,0 +1,2 @@ +{incl_app,odbc,details}. + diff --git a/lib/orber/test/Makefile b/lib/orber/test/Makefile index 5495735318..4fad44dd7d 100644 --- a/lib/orber/test/Makefile +++ b/lib/orber/test/Makefile @@ -34,6 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/orber_test # Target Specs # ---------------------------------------------------- TEST_SPEC_FILE = orber.spec +COVER_FILE = orber.cover IDL_FILES = \ @@ -222,7 +223,7 @@ release_docs_spec: release_tests_spec: tests $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ + $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) $(COVER_FILE) \ $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) diff --git a/lib/orber/test/orber.cover b/lib/orber/test/orber.cover new file mode 100644 index 0000000000..807a7c2c6e --- /dev/null +++ b/lib/orber/test/orber.cover @@ -0,0 +1,2 @@ +{incl_app,orber,details}. + diff --git a/lib/os_mon/test/Makefile b/lib/os_mon/test/Makefile index c87285e38b..f14a791806 100644 --- a/lib/os_mon/test/Makefile +++ b/lib/os_mon/test/Makefile @@ -85,7 +85,7 @@ release_spec: release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) os_mon.spec $(EMAKEFILE) $(SOURCE) $(RELSYSDIR) + $(INSTALL_DATA) os_mon.spec os_mon.cover $(EMAKEFILE) $(SOURCE) $(RELSYSDIR) ## tar chf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/os_mon/test/os_mon.cover b/lib/os_mon/test/os_mon.cover new file mode 100644 index 0000000000..aa07391351 --- /dev/null +++ b/lib/os_mon/test/os_mon.cover @@ -0,0 +1,2 @@ +{incl_app,os_mon,details}. + diff --git a/lib/parsetools/test/Makefile b/lib/parsetools/test/Makefile index 19354b87b2..2d9d0a71e5 100644 --- a/lib/parsetools/test/Makefile +++ b/lib/parsetools/test/Makefile @@ -71,7 +71,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) parsetools.spec $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) parsetools.spec parsetools.cover $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) # @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/parsetools/test/parsetools.cover b/lib/parsetools/test/parsetools.cover new file mode 100644 index 0000000000..13f84e3ba6 --- /dev/null +++ b/lib/parsetools/test/parsetools.cover @@ -0,0 +1,2 @@ +{incl_app,parsetools,details}. + diff --git a/lib/percept/test/Makefile b/lib/percept/test/Makefile index 0984b02c81..0420ce40f2 100644 --- a/lib/percept/test/Makefile +++ b/lib/percept/test/Makefile @@ -82,7 +82,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) percept.spec $(EMAKEFILE) $(SOURCE) $(RELSYSDIR) + $(INSTALL_DATA) percept.spec percept.cover $(EMAKEFILE) $(SOURCE) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/percept/test/percept.cover b/lib/percept/test/percept.cover new file mode 100644 index 0000000000..8a5ad0a55e --- /dev/null +++ b/lib/percept/test/percept.cover @@ -0,0 +1,2 @@ +{incl_app,percept,details}. + diff --git a/lib/public_key/test/public_key.cover b/lib/public_key/test/public_key.cover index 8477c76ef6..ec00814578 100644 --- a/lib/public_key/test/public_key.cover +++ b/lib/public_key/test/public_key.cover @@ -1,2 +1,4 @@ +{incl_app,public_key,details}. -{exclude, ['OTP-PUB-KEY']}. \ No newline at end of file + +{excl_mods, public_key, ['OTP-PUB-KEY']}. diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile index 5109058797..e4ab216298 100644 --- a/lib/reltool/test/Makefile +++ b/lib/reltool/test/Makefile @@ -73,7 +73,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) reltool.spec $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) reltool.spec reltool.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) $(INSTALL_SCRIPT) rtt $(INSTALL_PROGS) $(RELSYSDIR) $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR) # chmod -f -R u+w $(RELSYSDIR) diff --git a/lib/reltool/test/reltool.cover b/lib/reltool/test/reltool.cover new file mode 100644 index 0000000000..ca425b9f98 --- /dev/null +++ b/lib/reltool/test/reltool.cover @@ -0,0 +1,2 @@ +{incl_app,reltool,details}. + diff --git a/lib/runtime_tools/test/Makefile b/lib/runtime_tools/test/Makefile index 873d395277..7dc7a015e1 100644 --- a/lib/runtime_tools/test/Makefile +++ b/lib/runtime_tools/test/Makefile @@ -57,7 +57,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) runtime_tools.spec $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) runtime_tools.spec runtime_tools.cover $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) runtime_tools.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/runtime_tools/test/runtime_tools.cover b/lib/runtime_tools/test/runtime_tools.cover index 2d62ebe6ac..ef850bc377 100644 --- a/lib/runtime_tools/test/runtime_tools.cover +++ b/lib/runtime_tools/test/runtime_tools.cover @@ -1 +1,3 @@ -{exclude,[observer_backend]}. +{incl_app,runtime_tools,details}. + +{excl_mods, runtime_tools, [observer_backend]}. diff --git a/lib/snmp/test/snmp.cover b/lib/snmp/test/snmp.cover index 027dce68c1..a2e7dd978f 100644 --- a/lib/snmp/test/snmp.cover +++ b/lib/snmp/test/snmp.cover @@ -1,5 +1,7 @@ %% -*- erlang -*- -{exclude, +{incl_app,snmp,details}. + +{excl_mods,snmp, [snmp_index, snmpa_error_io, snmpa_authentication_service, diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile index c0a7f8d257..823401c863 100644 --- a/lib/ssl/test/Makefile +++ b/lib/ssl/test/Makefile @@ -126,7 +126,7 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(HRL_FILES_NEEDED_IN_TEST) $(COVER_FILE) $(RELSYSDIR) - $(INSTALL_DATA) ssl.spec $(RELSYSDIR) + $(INSTALL_DATA) ssl.spec ssl.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/ssl/test/ssl.cover b/lib/ssl/test/ssl.cover index e8daa363c5..60774cc0f1 100644 --- a/lib/ssl/test/ssl.cover +++ b/lib/ssl/test/ssl.cover @@ -1,19 +1,21 @@ -{exclude, [ssl_pkix_oid, - 'PKIX1Algorithms88', - 'PKIX1Explicit88', - 'PKIX1Implicit88', - 'PKIXAttributeCertificate', - 'SSL-PKIX', - ssl_pem, - ssl_pkix, - ssl_base64, - ssl_broker, - ssl_broker_int, - ssl_broker_sup, - ssl_debug, - ssl_server, - ssl_prim, - inet_ssl_dist, - 'OTP-PKIX' +{incl_app,ssl,details}. + +{excl_mods, ssl, [ssl_pkix_oid, + 'PKIX1Algorithms88', + 'PKIX1Explicit88', + 'PKIX1Implicit88', + 'PKIXAttributeCertificate', + 'SSL-PKIX', + ssl_pem, + ssl_pkix, + ssl_base64, + ssl_broker, + ssl_broker_int, + ssl_broker_sup, + ssl_debug, + ssl_server, + ssl_prim, + inet_ssl_dist, + 'OTP-PKIX' ]}. diff --git a/lib/stdlib/test/Makefile b/lib/stdlib/test/Makefile index 3bbd9ce318..3dd0a91870 100644 --- a/lib/stdlib/test/Makefile +++ b/lib/stdlib/test/Makefile @@ -133,7 +133,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) stdlib.spec stdlib.spec.vxworks $(EMAKEFILE) \ + $(INSTALL_DATA) stdlib.spec $(EMAKEFILE) \ $(ERL_FILES) $(COVERFILE) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/stdlib/test/stdlib.cover b/lib/stdlib/test/stdlib.cover index b98d949889..61f4f064b9 100644 --- a/lib/stdlib/test/stdlib.cover +++ b/lib/stdlib/test/stdlib.cover @@ -1,10 +1,17 @@ %% -*- erlang -*- -{exclude, - [erl_parse, - ets, - filename, - gen_event, - gen_server, - gen, - lists, - proc_lib]}. +{incl_app,stdlib,details}. + +{excl_mods,stdlib, + [erl_parse, + erl_eval, + ets, + filename, + gen_event, + gen_server, + gen, + lists, + io, + io_lib, + io_lib_format, + io_lib_pretty, + proc_lib]}. diff --git a/lib/syntax_tools/test/Makefile b/lib/syntax_tools/test/Makefile index f08bf319f1..e793dec566 100644 --- a/lib/syntax_tools/test/Makefile +++ b/lib/syntax_tools/test/Makefile @@ -59,7 +59,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) - $(INSTALL_DATA) syntax_tools.spec $(RELSYSDIR) + $(INSTALL_DATA) syntax_tools.spec syntax_tools.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) release_docs_spec: diff --git a/lib/syntax_tools/test/syntax_tools.cover b/lib/syntax_tools/test/syntax_tools.cover new file mode 100644 index 0000000000..fd30f66cc4 --- /dev/null +++ b/lib/syntax_tools/test/syntax_tools.cover @@ -0,0 +1,2 @@ +{incl_app,syntax_tools,details}. + diff --git a/lib/test_server/test/Makefile b/lib/test_server/test/Makefile index fcb1282d16..9fe5aee3bb 100644 --- a/lib/test_server/test/Makefile +++ b/lib/test_server/test/Makefile @@ -88,7 +88,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(COVERFILE) $(RELSYSDIR) - $(INSTALL_DATA) test_server.spec $(RELSYSDIR) + $(INSTALL_DATA) test_server.spec test_server.cover $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/test_server/test/test_server.cover b/lib/test_server/test/test_server.cover index c2366db166..5c59bab494 100644 --- a/lib/test_server/test/test_server.cover +++ b/lib/test_server/test/test_server.cover @@ -1,20 +1,22 @@ -{exclude,[test_server, - test_server_ctrl, - ts_selftest]}. +{incl_app,test_server,details}. -%% Using include list here because the test_server might not find +{excl_mods, test_server, [test_server, + test_server_ctrl, + ts_selftest]}. + +%% Using incl_mods list here because the test_server might not find %% lib_dir for test_server - and so it will not find which modules to %% compile. -{include,[erl2html2, - test_server_node, - test_server_sup, - ts, - ts_autoconf_vxworks, - ts_autoconf_win32, - ts_erl_config, - ts_install, - ts_lib, - ts_make, - ts_run, - vxworks_client]}. +{incl_mods, test_server, [erl2html2, + test_server_node, + test_server_sup, + ts, + ts_autoconf_vxworks, + ts_autoconf_win32, + ts_erl_config, + ts_install, + ts_lib, + ts_make, + ts_run, + vxworks_client]}. diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile index 3a59be758a..826a8f3ee8 100644 --- a/lib/tools/test/Makefile +++ b/lib/tools/test/Makefile @@ -39,7 +39,8 @@ INSTALL_PROGS= $(TARGET_FILES) EMAKEFILE=Emakefile -SPEC_FILES= tools.spec tools.spec.win +SPEC_FILES= tools.spec +COVER_FILE = tools.cover # ---------------------------------------------------- # Release directory specification @@ -84,7 +85,8 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) $(SPEC_FILES) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(EMAKEFILE) \ + $(ERL_FILES) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/tools/test/tools.cover b/lib/tools/test/tools.cover new file mode 100644 index 0000000000..1053be4f0f --- /dev/null +++ b/lib/tools/test/tools.cover @@ -0,0 +1,2 @@ +{incl_app,tools,details}. + diff --git a/lib/wx/test/Makefile b/lib/wx/test/Makefile index dfec4bb695..90272372b2 100644 --- a/lib/wx/test/Makefile +++ b/lib/wx/test/Makefile @@ -62,7 +62,7 @@ release_spec: release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) wx.spec wx_test_lib.hrl $(ErlSrc) $(ErlTargets) $(RELSYSDIR) + $(INSTALL_DATA) wx.spec wx.cover wx_test_lib.hrl $(ErlSrc) $(ErlTargets) $(RELSYSDIR) $(INSTALL_SCRIPT) wxt $(RELSYSDIR) release_docs_spec: diff --git a/lib/wx/test/wx.cover b/lib/wx/test/wx.cover new file mode 100644 index 0000000000..47e162ba7d --- /dev/null +++ b/lib/wx/test/wx.cover @@ -0,0 +1,2 @@ +{incl_app,wx,details}. + -- cgit v1.2.3 From 1df38b2a16d604d6e850f3c95bb41744da3d19bd Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 21 Jan 2011 19:03:00 +0100 Subject: Update init_per_testcase to kill all slaves when called. This is to prevent testcases which fail to before to chain with the ones run after. --- lib/kernel/test/global_SUITE.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 8540897d5b..3cd47927c9 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -122,9 +122,16 @@ end_per_suite(_Config) -> init_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ok = gen_server:call(global_name_server, high_level_trace_start,infinity), + + %% Make sure that everything is dead and done. Otherwise there are problems + %% on platforms on which it takes a long time to shut down a node. + stop_nodes(nodes()), + timer:sleep(1000), + [{?TESTCASE, Case}, {registered, registered()} | Config]. end_per_testcase(_Case, Config) -> + ct:log("Calling end_per_testcase!",[]), ?line write_high_level_trace(Config), ?line _ = gen_server:call(global_name_server, high_level_trace_stop, infinity), @@ -136,6 +143,7 @@ end_per_testcase(_Case, Config) -> {What, N} <- [{"Added", Registered -- InitRegistered}, {"Removed", InitRegistered -- Registered}], N =/= []], + ok. %%% General comments: -- cgit v1.2.3 From f35da4a31a95501e76b803e871483f88a367bba5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 21 Jan 2011 19:09:22 +0100 Subject: Update end_per_suite so that it does not crash on non-smp emulators --- erts/emulator/test/signal_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index 5503400da4..5db4f2eba5 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -66,7 +66,7 @@ init_per_suite(Config) -> end_per_suite(_Config) -> available_internal_state(true), - erts_debug:set_internal_state(not_running_optimization, true), + catch erts_debug:set_internal_state(not_running_optimization, true), available_internal_state(false). suite() -> [{suite_callbacks,[ts_install_scb]}]. -- cgit v1.2.3 From fe7ebc1e78bb0c91c74403047802c5061e918b0d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 21 Jan 2011 19:09:52 +0100 Subject: Update so that tests are skipped if odbc:connect fails --- lib/odbc/test/odbc_connect_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index b0a70fe04c..b080984f4a 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -78,7 +78,7 @@ end_per_group(_GroupName, Config) -> %%-------------------------------------------------------------------- init_per_suite(Config) -> application:start(odbc), - case odbc:connect(?RDBMS:connection_string(), + case catch odbc:connect(?RDBMS:connection_string(), [{auto_commit, off}]) of {ok, Ref} -> odbc:disconnect(Ref), -- cgit v1.2.3 From ede974119a7642cf3b85dc370090e80862191dd7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 21 Jan 2011 19:10:42 +0100 Subject: Update so that count_children_memory is skipped on +Meamin emulators --- lib/stdlib/test/supervisor_SUITE.erl | 44 ++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index f751b06189..714db26fa3 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -24,7 +24,8 @@ %% Testserver specific export -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2]). + init_per_group/2,end_per_group/2, init_per_testcase/2, + end_per_testcase/2]). %% Indirect spawn export -export([init/1]). @@ -103,6 +104,18 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. +init_per_testcase(count_children_memory, Config) -> + MemoryState = erlang:system_info(allocator), + case count_children_allocator_test(MemoryState) of + true -> Config; + false -> + {skip, "+Meamin used during test; erlang:memory/1 not available"} + end; +init_per_testcase(_Case, Config) -> + Config. + +end_per_testcase(_Case, _Config) -> + ok. start(InitResult) -> @@ -1273,26 +1286,8 @@ tree(Config) when is_list(Config) -> ok. %------------------------------------------------------------------------- -count_children_allocator_test(MemoryState) -> - Allocators = [temp_alloc, eheap_alloc, binary_alloc, ets_alloc, - driver_alloc, sl_alloc, ll_alloc, fix_alloc, std_alloc, - sys_alloc], - MemoryStateList = element(4, MemoryState), - AllocTypes = [lists:keyfind(Alloc, 1, MemoryStateList) - || Alloc <- Allocators], - AllocStates = [lists:keyfind(e, 1, AllocValue) - || {_Type, AllocValue} <- AllocTypes], - lists:all(fun(State) -> State == {e, true} end, AllocStates). - count_children_memory(doc) -> ["Test that which_children eats memory, but count_children does not."]; -count_children_memory(suite) -> - MemoryState = erlang:system_info(allocator), - case count_children_allocator_test(MemoryState) of - true -> []; - false -> - {skip, "+Meamin used during test; erlang:memory/1 not available"} - end; count_children_memory(Config) when is_list(Config) -> process_flag(trap_exit, true), Child = {child, {supervisor_1, start_child, []}, temporary, 1000, @@ -1358,3 +1353,14 @@ count_children_memory(Config) when is_list(Config) -> ?line [1,0,0,0] = get_child_counts(sup_test), ok. + +count_children_allocator_test(MemoryState) -> + Allocators = [temp_alloc, eheap_alloc, binary_alloc, ets_alloc, + driver_alloc, sl_alloc, ll_alloc, fix_alloc, std_alloc, + sys_alloc], + MemoryStateList = element(4, MemoryState), + AllocTypes = [lists:keyfind(Alloc, 1, MemoryStateList) + || Alloc <- Allocators], + AllocStates = [lists:keyfind(e, 1, AllocValue) + || {_Type, AllocValue} <- AllocTypes], + lists:all(fun(State) -> State == {e, true} end, AllocStates). -- cgit v1.2.3 From 3d3251d2f371499e7af7b77335b4392f4ffaa465 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 24 Jan 2011 14:01:06 +0100 Subject: Update init_per_suite to skip all tests if crypto does not exist --- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 59 ++++++++++++++----------- lib/crypto/test/blowfish_SUITE.erl | 8 +++- lib/ssl/test/old_ssl_active_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_active_once_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_misc_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_passive_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_protocol_SUITE.erl | 21 +++++---- lib/ssl/test/old_ssl_verify_SUITE.erl | 21 +++++---- 9 files changed, 129 insertions(+), 85 deletions(-) diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index 3e27d7b83b..63eeb517bf 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -131,33 +131,38 @@ end_per_testcase(_Case, Config) -> ok. init_per_suite(Config) -> - orber:jump_start(), - cosProperty:install(), - cosProperty:start(), - Dir = filename:join([code:lib_dir(ssl), "examples", "certs", "etc"]), - %% Client - cosFileTransferApp:configure(ssl_client_certfile, - filename:join([Dir, "client", "cert.pem"])), - cosFileTransferApp:configure(ssl_client_cacertfile, - filename:join([Dir, "client", "cacerts.pem"])), - cosFileTransferApp:configure(ssl_client_verify, 1), - cosFileTransferApp:configure(ssl_client_depth, 0), - %% Server - cosFileTransferApp:configure(ssl_server_certfile, - filename:join([Dir, "server", "cert.pem"])), - cosFileTransferApp:configure(ssl_server_cacertfile, - filename:join([Dir, "server", "cacerts.pem"])), - cosFileTransferApp:configure(ssl_server_verify, 1), - cosFileTransferApp:configure(ssl_server_depth, 0), - crypto:start(), - ssl:start(), - cosFileTransferApp:install(), - cosFileTransferApp:start(), - if - is_list(Config) -> - Config; - true -> - exit("Config not a list") + case code:which(crypto) of + Res when is_atom(Res) -> + {skip,"Could not start crypto!"}; + _Else -> + orber:jump_start(), + cosProperty:install(), + cosProperty:start(), + Dir = filename:join([code:lib_dir(ssl), "examples", "certs", "etc"]), + %% Client + cosFileTransferApp:configure(ssl_client_certfile, + filename:join([Dir, "client", "cert.pem"])), + cosFileTransferApp:configure(ssl_client_cacertfile, + filename:join([Dir, "client", "cacerts.pem"])), + cosFileTransferApp:configure(ssl_client_verify, 1), + cosFileTransferApp:configure(ssl_client_depth, 0), + %% Server + cosFileTransferApp:configure(ssl_server_certfile, + filename:join([Dir, "server", "cert.pem"])), + cosFileTransferApp:configure(ssl_server_cacertfile, + filename:join([Dir, "server", "cacerts.pem"])), + cosFileTransferApp:configure(ssl_server_verify, 1), + cosFileTransferApp:configure(ssl_server_depth, 0), + crypto:start(), + ssl:start(), + cosFileTransferApp:install(), + cosFileTransferApp:start(), + if + is_list(Config) -> + Config; + true -> + exit("Config not a list") + end end. end_per_suite(Config) -> diff --git a/lib/crypto/test/blowfish_SUITE.erl b/lib/crypto/test/blowfish_SUITE.erl index 4ebcb2c7a0..36fbc59f00 100644 --- a/lib/crypto/test/blowfish_SUITE.erl +++ b/lib/crypto/test/blowfish_SUITE.erl @@ -45,8 +45,12 @@ %% variable, but should NOT alter/remove any existing entries. %%-------------------------------------------------------------------- init_per_suite(Config) -> - crypto:start(), - Config. + case catch crypto:start() of + ok -> + Config; + _Else -> + {skip,"Could not start crypto!"} + end. %%-------------------------------------------------------------------- %% Function: end_per_suite(Config) -> _ diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index 096794ec54..3b8326895d 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -88,20 +88,25 @@ init_per_suite(Config) -> %% operating system, version of OTP, Erts, kernel and stdlib. %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto!"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. cinit_return_chkclose(doc) -> diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 16b323e26a..9f2eef4d49 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -80,20 +80,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. server_accept_timeout(doc) -> diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index 039f766d96..04760008c5 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -66,20 +66,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto!"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. seed(doc) -> diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index 80dee2899d..d7ed42148c 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -79,20 +79,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. server_accept_timeout(doc) -> diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index 9e9838cf44..56404af1c3 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -66,20 +66,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. cinit_plain(doc) -> diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index 0a30c4702b..a957680e20 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -64,20 +64,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto"} + end. end_per_suite(doc) -> "This test case has no other purpose than closing the conf case."; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. %%%%% diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index 2cd7d12f9f..2bde2865f5 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -65,20 +65,25 @@ init_per_suite(Config) -> io:format("Config: ~p~n", [Config]), %% Check if SSL exists. If this case fails, all other cases are skipped - crypto:start(), - application:start(public_key), - case ssl:start() of - ok -> ssl:stop(); - {error, {already_started, _}} -> ssl:stop(); - Error -> ?t:fail({failed_starting_ssl,Error}) - end, - Config. + case catch crypto:start() of + ok -> + application:start(public_key), + case ssl:start() of + ok -> ssl:stop(); + {error, {already_started, _}} -> ssl:stop(); + Error -> ?t:fail({failed_starting_ssl,Error}) + end, + Config; + _Else -> + {skip,"Could not start crypto"} + end. end_per_suite(doc) -> "This test case has no mission other than closing the conf case"; end_per_suite(suite) -> []; end_per_suite(Config) -> + crypto:stop(), Config. cinit_both_verify(doc) -> -- cgit v1.2.3 From d86fa83d1fce77fc1b7bc8adc723480e79535a80 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 26 Jan 2011 16:53:56 +0100 Subject: Update ssl orber tests to be skipped if there is no ssl installed --- lib/orber/test/csiv2_SUITE.erl | 10 +- lib/orber/test/multi_ORB_SUITE.erl | 225 +++++++++++++++++-------------------- lib/orber/test/orber_nat_SUITE.erl | 198 ++++++++++++++++---------------- lib/orber/test/orber_test_lib.erl | 25 +++-- 4 files changed, 225 insertions(+), 233 deletions(-) diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 67cec0dde6..b95302e47f 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -361,11 +361,11 @@ end_per_testcase(_Case, Config) -> ok. init_per_suite(Config) -> - if - is_list(Config) -> - Config; - true -> - exit("Config not a list") + case orber_test_lib:ssl_version() of + no_ssl -> + {skip,"SSL is not installed!"}; + _ -> + Config end. end_per_suite(Config) -> diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index 3a11036f13..9946f55bc2 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -142,8 +142,38 @@ cases() -> %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- - +init_per_testcase(TC,Config) + when TC =:= ssl_1_multi_orber_api; + TC =:= ssl_2_multi_orber_api; + TC =:= ssl_reconfigure_api -> + init_ssl(Config); +init_per_testcase(TC,Config) + when TC =:= ssl_1_multi_orber_generation_3_api; + TC =:= ssl_2_multi_orber_generation_3_api; + TC =:= ssl_reconfigure_generation_3_api -> + init_ssl_3(Config); init_per_testcase(_Case, Config) -> + init_all(Config). + +init_ssl(Config) -> + case orber_test_lib:ssl_version() of + no_ssl -> + {skip,"SSL is not installed!"}; + _ -> + init_all(Config) + end. + +init_ssl_3(Config) -> + case orber_test_lib:ssl_version() of + 3 -> + init_all(Config); + 2 -> + {skip,"Could not find the correct SSL version!"}; + no_ssl -> + {skip,"SSL is not installed!"} + end. + +init_all(Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), Dog=test_server:timetrap(?default_timeout), @@ -1569,17 +1599,11 @@ ssl_1_multi_orber_api(doc) -> ["SECURE MULTI ORB API tests (SSL depth 1)", "secure orbs which must raise a NO_PERMISSION exception."]; ssl_1_multi_orber_api(suite) -> []; ssl_1_multi_orber_api(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 1, [{iiop_ssl_port, 0}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 1, [{iiop_ssl_port, 0}]), - ssl_suite(ServerOptions, ClientOptions), - ok - end. + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 1, [{iiop_ssl_port, 0}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 1, [{iiop_ssl_port, 0}]), + ssl_suite(ServerOptions, ClientOptions). ssl_1_multi_orber_generation_3_api(doc) -> ["SECURE MULTI ORB API tests (SSL depth 1)", "This case set up two secure orbs and test if they can", @@ -1587,24 +1611,14 @@ ssl_1_multi_orber_generation_3_api(doc) -> ["SECURE MULTI ORB API tests (SSL dep "secure orbs which must raise a NO_PERMISSION exception."]; ssl_1_multi_orber_generation_3_api(suite) -> []; ssl_1_multi_orber_generation_3_api(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - case orber_test_lib:ssl_version() of - 3 -> - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 1, [{ssl_generation, 3}, - {iiop_ssl_port, 0}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 1, [{ssl_generation, 3}, - {iiop_ssl_port, 0}]), - ssl_suite(ServerOptions, ClientOptions), - ok; - _ -> - {skipped, "Required SSL generation not available"} - end - end. + + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 1, [{ssl_generation, 3}, + {iiop_ssl_port, 0}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 1, [{ssl_generation, 3}, + {iiop_ssl_port, 0}]), + ssl_suite(ServerOptions, ClientOptions). %%----------------------------------------------------------------- @@ -1617,17 +1631,12 @@ ssl_2_multi_orber_api(doc) -> ["SECURE MULTI ORB API tests (SSL depth 2)", "secure orbs which must raise a NO_PERMISSION exception."]; ssl_2_multi_orber_api(suite) -> []; ssl_2_multi_orber_api(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 2, [{iiop_ssl_port, 0}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 2, [{iiop_ssl_port, 0}]), - ssl_suite(ServerOptions, ClientOptions), - ok - end. + + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 2, [{iiop_ssl_port, 0}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 2, [{iiop_ssl_port, 0}]), + ssl_suite(ServerOptions, ClientOptions). ssl_2_multi_orber_generation_3_api(doc) -> ["SECURE MULTI ORB API tests (SSL depth 2)", "This case set up two secure orbs and test if they can", @@ -1635,24 +1644,14 @@ ssl_2_multi_orber_generation_3_api(doc) -> ["SECURE MULTI ORB API tests (SSL dep "secure orbs which must raise a NO_PERMISSION exception."]; ssl_2_multi_orber_generation_3_api(suite) -> []; ssl_2_multi_orber_generation_3_api(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - case orber_test_lib:ssl_version() of - 3 -> - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 2, [{ssl_generation, 3}, - {iiop_ssl_port, 0}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 2, [{ssl_generation, 3}, - {iiop_ssl_port, 0}]), - ssl_suite(ServerOptions, ClientOptions), - ok; - _ -> - {skipped, "Required SSL generation not available"} - end - end. + + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 2, [{ssl_generation, 3}, + {iiop_ssl_port, 0}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 2, [{ssl_generation, 3}, + {iiop_ssl_port, 0}]), + ssl_suite(ServerOptions, ClientOptions). %%----------------------------------------------------------------- %% API tests for ORB to ORB, ssl security depth 2 %%----------------------------------------------------------------- @@ -1671,69 +1670,57 @@ ssl_reconfigure_generation_3_api(doc) -> ["SECURE MULTI ORB API tests (SSL depth "secure orbs which must raise a NO_PERMISSION exception."]; ssl_reconfigure_generation_3_api(suite) -> []; ssl_reconfigure_generation_3_api(_Config) -> - case orber_test_lib:ssl_version() of - 3 -> - ssl_reconfigure([{ssl_generation, 3}]); - - _ -> - {skipped, "Required SSL generation not available"} - end. + ssl_reconfigure([{ssl_generation, 3}]). ssl_reconfigure(ExtraSSLOptions) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - IP = orber_test_lib:get_host(), - Loopback = orber_test_lib:get_loopback_interface(), - {ok, ServerNode, _ServerHost} = - ?match({ok,_,_}, - orber_test_lib:js_node([{iiop_port, 0}, - {flags, ?ORB_ENV_LOCAL_INTERFACE}, - {ip_address, IP}|ExtraSSLOptions])), - orber_test_lib:remote_apply(ServerNode, ssl, start, []), - orber_test_lib:remote_apply(ServerNode, crypto, start, []), - orber_test_lib:remote_apply(ServerNode, ssl, seed, ["testing"]), - ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, - install_test_data, - [ssl])), - ?match({ok, _}, - orber_test_lib:remote_apply(ServerNode, orber, - add_listen_interface, - [Loopback, normal, [{iiop_port, 5648}, - {iiop_ssl_port, 5649}, - {interceptors, {native, [orber_iiop_tracer_silent]}}|ExtraSSLOptions]])), - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 2, [{flags, ?ORB_ENV_LOCAL_INTERFACE}, - {iiop_port, 5648}, + + IP = orber_test_lib:get_host(), + Loopback = orber_test_lib:get_loopback_interface(), + {ok, ServerNode, _ServerHost} = + ?match({ok,_,_}, + orber_test_lib:js_node([{iiop_port, 0}, + {flags, ?ORB_ENV_LOCAL_INTERFACE}, + {ip_address, IP}|ExtraSSLOptions])), + orber_test_lib:remote_apply(ServerNode, ssl, start, []), + orber_test_lib:remote_apply(ServerNode, crypto, start, []), + orber_test_lib:remote_apply(ServerNode, ssl, seed, ["testing"]), + ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, + install_test_data, + [ssl])), + ?match({ok, _}, + orber_test_lib:remote_apply(ServerNode, orber, + add_listen_interface, + [Loopback, normal, [{iiop_port, 5648}, {iiop_ssl_port, 5649}, - {interceptors, {native, [orber_iiop_tracer_silent]}}|ExtraSSLOptions]), - ?match({ok, _}, - orber_test_lib:remote_apply(ServerNode, orber, - add_listen_interface, - [Loopback, ssl, ServerOptions])), - - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 2, [{iiop_ssl_port, 0}|ExtraSSLOptions]), - {ok, ClientNode, _ClientHost} = - ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), - - ?match(ok, orber_test_lib:remote_apply(ClientNode, orber_test_lib, - install_test_data, - [ssl])), - orber_test_lib:remote_apply(ClientNode, ssl, start, []), - orber_test_lib:remote_apply(ServerNode, crypto, start, []), - orber_test_lib:remote_apply(ClientNode, ssl, seed, ["testing"]), - Obj = ?match(#'IOP_IOR'{}, - orber_test_lib:remote_apply(ClientNode, corba, - string_to_object, ["corbaname:iiop:1.1@"++Loopback++":5648/NameService#mamba", - [{context, [#'IOP_ServiceContext'{context_id=?ORBER_GENERIC_CTX_ID, - context_data = {configuration, ClientOptions}}]}]])), - ?match(ok, orber_test_lib:remote_apply(ClientNode, orber_test_server, - print, [Obj])), - - ok - end. + {interceptors, {native, [orber_iiop_tracer_silent]}}|ExtraSSLOptions]])), + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 2, [{flags, ?ORB_ENV_LOCAL_INTERFACE}, + {iiop_port, 5648}, + {iiop_ssl_port, 5649}, + {interceptors, {native, [orber_iiop_tracer_silent]}}|ExtraSSLOptions]), + ?match({ok, _}, + orber_test_lib:remote_apply(ServerNode, orber, + add_listen_interface, + [Loopback, ssl, ServerOptions])), + + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 2, [{iiop_ssl_port, 0}|ExtraSSLOptions]), + {ok, ClientNode, _ClientHost} = + ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), + + ?match(ok, orber_test_lib:remote_apply(ClientNode, orber_test_lib, + install_test_data, + [ssl])), + orber_test_lib:remote_apply(ClientNode, ssl, start, []), + orber_test_lib:remote_apply(ServerNode, crypto, start, []), + orber_test_lib:remote_apply(ClientNode, ssl, seed, ["testing"]), + Obj = ?match(#'IOP_IOR'{}, + orber_test_lib:remote_apply(ClientNode, corba, + string_to_object, ["corbaname:iiop:1.1@"++Loopback++":5648/NameService#mamba", + [{context, [#'IOP_ServiceContext'{context_id=?ORBER_GENERIC_CTX_ID, + context_data = {configuration, ClientOptions}}]}]])), + ?match(ok, orber_test_lib:remote_apply(ClientNode, orber_test_server, + print, [Obj])). diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index 818b67fd8a..7a1cfa5db3 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -94,7 +94,15 @@ cases() -> %%----------------------------------------------------------------- %% Init and cleanup functions. %%----------------------------------------------------------------- - +init_per_testcase(TC, Config) + when TC =:= nat_iiop_ssl_port; + TC =:= nat_iiop_ssl_port_local -> + case orber_test_lib:ssl_version() of + no_ssl -> + {skip,"SSL not installed!"}; + _ -> + init_per_testcase(dummy_tc, Config) + end; init_per_testcase(_Case, Config) -> Path = code:which(?MODULE), code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), @@ -267,107 +275,99 @@ nat_iiop_ssl_port(doc) -> ["SECURE MULTI ORB API tests (SSL depth 1)", "Make sure NAT works for SSL"]; nat_iiop_ssl_port(suite) -> []; nat_iiop_ssl_port(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - IP = orber_test_lib:get_host(), - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 1, [{iiop_ssl_port, 0}, - {flags, ?ORB_ENV_ENABLE_NAT}, - {ip_address, IP}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 1, [{iiop_ssl_port, 0}]), - {ok, ServerNode, _ServerHost} = - ?match({ok,_,_}, orber_test_lib:js_node(ServerOptions)), - ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_port, []), - SSLServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []), - NATSSLServerPort = SSLServerPort+1, - {ok, Ref} = ?match({ok, _}, - orber_test_lib:remote_apply(ServerNode, orber, - add_listen_interface, - [IP, ssl, NATSSLServerPort])), - orber_test_lib:remote_apply(ServerNode, orber_env, configure_override, - [nat_iiop_ssl_port, - {local, NATSSLServerPort, [{4001, 43}]}]), - - {ok, ClientNode, _ClientHost} = - ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), - ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, - install_test_data, - [ssl])), - - IOR1 = ?match(#'IOP_IOR'{}, - orber_test_lib:remote_apply(ClientNode, corba, - string_to_object, - ["corbaname::1.2@"++IP++":"++ - integer_to_list(ServerPort)++"/NameService#mamba"])), - - ?match({'external', {_IP, _Port, _ObjectKey, _Counter, _TP, - #host_data{protocol = ssl, - ssl_data = #'SSLIOP_SSL'{port = NATSSLServerPort}}}}, - iop_ior:get_key(IOR1)), - ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, - uninstall_test_data, - [ssl])), - ?match(ok, - orber_test_lib:remote_apply(ServerNode, orber, - remove_listen_interface, [Ref])), - ok - end. + + IP = orber_test_lib:get_host(), + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 1, [{iiop_ssl_port, 0}, + {flags, ?ORB_ENV_ENABLE_NAT}, + {ip_address, IP}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 1, [{iiop_ssl_port, 0}]), + {ok, ServerNode, _ServerHost} = + ?match({ok,_,_}, orber_test_lib:js_node(ServerOptions)), + ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_port, []), + SSLServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []), + NATSSLServerPort = SSLServerPort+1, + {ok, Ref} = ?match({ok, _}, + orber_test_lib:remote_apply(ServerNode, orber, + add_listen_interface, + [IP, ssl, NATSSLServerPort])), + orber_test_lib:remote_apply(ServerNode, orber_env, configure_override, + [nat_iiop_ssl_port, + {local, NATSSLServerPort, [{4001, 43}]}]), + + {ok, ClientNode, _ClientHost} = + ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), + ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, + install_test_data, + [ssl])), + + IOR1 = ?match(#'IOP_IOR'{}, + orber_test_lib:remote_apply(ClientNode, corba, + string_to_object, + ["corbaname::1.2@"++IP++":"++ + integer_to_list(ServerPort)++"/NameService#mamba"])), + + ?match({'external', {_IP, _Port, _ObjectKey, _Counter, _TP, + #host_data{protocol = ssl, + ssl_data = #'SSLIOP_SSL'{port = NATSSLServerPort}}}}, + iop_ior:get_key(IOR1)), + ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, + uninstall_test_data, + [ssl])), + ?match(ok, + orber_test_lib:remote_apply(ServerNode, orber, + remove_listen_interface, [Ref])), + ok. nat_iiop_ssl_port_local(doc) -> ["SECURE MULTI ORB API tests (SSL depth 1)", "Make sure NAT works for SSL"]; nat_iiop_ssl_port_local(suite) -> []; nat_iiop_ssl_port_local(_Config) -> - case os:type() of - vxworks -> - {skipped, "No SSL-support for VxWorks."}; - _ -> - IP = orber_test_lib:get_host(), - ServerOptions = orber_test_lib:get_options(iiop_ssl, server, - 1, [{iiop_ssl_port, 0}, - {flags, - (?ORB_ENV_LOCAL_INTERFACE bor - ?ORB_ENV_ENABLE_NAT)}, - {ip_address, IP}]), - ClientOptions = orber_test_lib:get_options(iiop_ssl, client, - 1, [{iiop_ssl_port, 0}]), - {ok, ServerNode, _ServerHost} = - ?match({ok,_,_}, orber_test_lib:js_node(ServerOptions)), - ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_port, []), - SSLServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []), - NATSSLServerPort = SSLServerPort+1, - {ok, Ref} = ?match({ok, _}, - orber_test_lib:remote_apply(ServerNode, orber, - add_listen_interface, - [IP, ssl, NATSSLServerPort])), - orber_test_lib:remote_apply(ServerNode, orber_env, configure_override, - [nat_iiop_ssl_port, - {local, NATSSLServerPort, [{NATSSLServerPort, NATSSLServerPort}]}]), - - {ok, ClientNode, _ClientHost} = - ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), - ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, - install_test_data, - [ssl])), - - IOR1 = ?match(#'IOP_IOR'{}, - orber_test_lib:remote_apply(ClientNode, corba, - string_to_object, - ["corbaname::1.2@"++IP++":"++ - integer_to_list(ServerPort)++"/NameService#mamba"])), - - ?match({'external', {_IP, _Port, _ObjectKey, _Counter, _TP, - #host_data{protocol = ssl, - ssl_data = #'SSLIOP_SSL'{port = NATSSLServerPort}}}}, - iop_ior:get_key(IOR1)), - ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, - uninstall_test_data, - [ssl])), - ?match(ok, - orber_test_lib:remote_apply(ServerNode, orber, - remove_listen_interface, [Ref])), - ok - end. + + IP = orber_test_lib:get_host(), + ServerOptions = orber_test_lib:get_options(iiop_ssl, server, + 1, [{iiop_ssl_port, 0}, + {flags, + (?ORB_ENV_LOCAL_INTERFACE bor + ?ORB_ENV_ENABLE_NAT)}, + {ip_address, IP}]), + ClientOptions = orber_test_lib:get_options(iiop_ssl, client, + 1, [{iiop_ssl_port, 0}]), + {ok, ServerNode, _ServerHost} = + ?match({ok,_,_}, orber_test_lib:js_node(ServerOptions)), + ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_port, []), + SSLServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []), + NATSSLServerPort = SSLServerPort+1, + {ok, Ref} = ?match({ok, _}, + orber_test_lib:remote_apply(ServerNode, orber, + add_listen_interface, + [IP, ssl, NATSSLServerPort])), + orber_test_lib:remote_apply(ServerNode, orber_env, configure_override, + [nat_iiop_ssl_port, + {local, NATSSLServerPort, [{NATSSLServerPort, NATSSLServerPort}]}]), + + {ok, ClientNode, _ClientHost} = + ?match({ok,_,_}, orber_test_lib:js_node(ClientOptions)), + ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, + install_test_data, + [ssl])), + + IOR1 = ?match(#'IOP_IOR'{}, + orber_test_lib:remote_apply(ClientNode, corba, + string_to_object, + ["corbaname::1.2@"++IP++":"++ + integer_to_list(ServerPort)++"/NameService#mamba"])), + + ?match({'external', {_IP, _Port, _ObjectKey, _Counter, _TP, + #host_data{protocol = ssl, + ssl_data = #'SSLIOP_SSL'{port = NATSSLServerPort}}}}, + iop_ior:get_key(IOR1)), + ?match(ok, orber_test_lib:remote_apply(ServerNode, orber_test_lib, + uninstall_test_data, + [ssl])), + ?match(ok, + orber_test_lib:remote_apply(ServerNode, orber, + remove_listen_interface, [Ref])), + ok. diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl index 132f02bb78..5053a5fddc 100644 --- a/lib/orber/test/orber_test_lib.erl +++ b/lib/orber/test/orber_test_lib.erl @@ -95,16 +95,21 @@ %% %%------------------------------------------------------------ ssl_version() -> - case catch erlang:system_info(otp_release) of - Version when is_list(Version) -> - if - "R12B" < Version -> - 3; - true -> - 2 - end; - _ -> - 2 + try + ssl:module_info(), + case catch erlang:system_info(otp_release) of + Version when is_list(Version) -> + if + "R12B" < Version -> + 3; + true -> + 2 + end; + _ -> + 2 + end + catch error:undef -> + no_ssl end. %%------------------------------------------------------------ -- cgit v1.2.3 From fc27948ba4bb9d7de8e0099f5b7d07602dd2806c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 4 Feb 2011 17:22:41 +0100 Subject: Strip ts.config of internal addresses. --- lib/test_server/src/Makefile | 2 +- lib/test_server/src/ts.config | 83 ++++++++++++++++++----------------- lib/test_server/src/ts.unix.config | 2 +- lib/test_server/src/ts.vxworks.config | 19 -------- lib/test_server/src/ts.win32.config | 15 ++----- 5 files changed, 48 insertions(+), 73 deletions(-) delete mode 100644 lib/test_server/src/ts.vxworks.config diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile index ba264a5748..0858d24fce 100644 --- a/lib/test_server/src/Makefile +++ b/lib/test_server/src/Makefile @@ -72,7 +72,7 @@ C_FILES = AUTOCONF_FILES = configure.in conf_vars.in COVER_FILES = cross.cover PROGRAMS = configure config.sub config.guess install-sh -CONFIG = ts.config ts.unix.config ts.win32.config ts.vxworks.config +CONFIG = ts.config ts.unix.config ts.win32.config TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) \ $(APP_TARGET) $(APPUP_TARGET) diff --git a/lib/test_server/src/ts.config b/lib/test_server/src/ts.config index 30ef25a0b8..f021f5958b 100644 --- a/lib/test_server/src/ts.config +++ b/lib/test_server/src/ts.config @@ -1,45 +1,46 @@ %% -*- erlang -*- -{ipv6_hosts,[otptest06,otptest08,sauron,iluvatar]}. -%%% Change these to suite the environment. -%%% test_hosts are looked up using "ypmatch xx yy zz hosts" -{test_hosts, - [bingo, hurin, turin, gandalf, super, - merry, nenya, sam, elrond, isildur]}. +%%% Change these to suite the environment. See the inet_SUITE for info about +%%% what they are used for. +%%% test_hosts are looked up using "ypmatch xx yy zz hosts.byname" +%{test_hosts,[my_ip4_host]}. %% IPv4 host only - no ipv6 entry must exist! -{test_host_ipv4_only, - {"isildur", %Short hostname - "isildur.du.uab.ericsson.se", %Long hostname - "134.138.177.24", %IP string - {134,138,177,24}, %IP tuple - ["isildur"], %Any aliases - "::ffff:134.138.177.24", %IPv6 string (compatibilty addr) - {0,0,0,0,0,65535,34442,45336} %IPv6 tuple - }}. - -{test_host_ipv6_only, - {"otptest06", %Short hostname - "otptest06.du.uab.ericsson.se", %Long hostname - "fec0::a00:20ff:feb2:b4a9", %IPv6 string - {65216,0,0,0,2560,8447,65202,46249}, %IPv6 tuple - ["otptest06-ip6"] %Aliases. - }}. - - - -{test_dummy_host, {"dummy", - "dummy.du.uab.ericsson.se", - "192.138.177.1", - {192,138,177,1}, - ["dummy"], - "::ffff:192.138.177.1", - {0,0,0,0,0,65535,49290,45313} - }}. - -{test_dummy_ipv6_host, {"dummy6", - "dummy6.du.uab.ericsson.se", - "fec0::a00:20ff:feb2:6666", - {65216,0,0,0,2560,8447,65202,26214}, - ["dummy6-ip6"] - }}. +%{test_host_ipv4_only, +% {"my_ip4_host", %Short hostname +% "my_ip4_host.mydomain.com", %Long hostname +% "10.10.0.1", %IP string +% {10,10,0,1}, %IP tuple +% ["my_ip4_host"], %Any aliases +% "::ffff:10.10.0.1", %IPv6 string (compatibilty addr) +% {0,0,0,0,0,65535,2570,1} %IPv6 tuple +% }}. + +%{test_dummy_host, {"dummy", +% "dummy.mydomain.com", +% "192.168.0.1", +% {192,168,0,1}, +% ["dummy"], +% "::ffff:192.168.0.1", +% {0,0,0,0,0,65535,49320,1} +% }}. + + +%%% test_hosts are looked up using "ypmatch xx yy zz ipnodes.byname" +%{ipv6_hosts,[my_ip6_host]}. + + +%{test_host_ipv6_only, +% {"my_ip6_host", %Short hostname +% "my_ip6_host.mydomain.com", %Long hostname +% "::2eff:f2b0:1ea0", %IPv6 string +% {0,0,0,0,0,12031,62128,7840}, %IPv6 tuple +% ["my_ip6_host"] %Aliases. +% }}. + +%{test_dummy_ipv6_host, {"dummy6", +% "dummy6.mydomain.com", +% "127::1", +% {295,0,0,0,0,0,0,1}, +% ["dummy6-ip6"] +% }}. diff --git a/lib/test_server/src/ts.unix.config b/lib/test_server/src/ts.unix.config index b4325f065f..5a2580f464 100644 --- a/lib/test_server/src/ts.unix.config +++ b/lib/test_server/src/ts.unix.config @@ -1,4 +1,4 @@ %% -*- erlang -*- %% Always run a (VNC) X server on host -{xserver, "frumgar.du.uab.ericsson.se:66"}. +%% {xserver, "xserver.example.com:66"}. diff --git a/lib/test_server/src/ts.vxworks.config b/lib/test_server/src/ts.vxworks.config deleted file mode 100644 index b0b66e07ad..0000000000 --- a/lib/test_server/src/ts.vxworks.config +++ /dev/null @@ -1,19 +0,0 @@ -%% -*- erlang -*- - -%%% There is no equivalent command to ypmatch on Win32... :-( -{hardcoded_hosts, - [{"134.138.177.74","strider"}, - {"134.138.177.72", "elrond"}, - {"134.138.177.67", "sam"}, - {"134.138.176.215", "nenya"}, - {"134.138.176.192", "merry"}, - {"134.138.177.35", "lw4"}, - {"134.138.177.35", "lw5"}, - {"134.138.176.16", "super"}, - {"134.138.177.16", "gandalf"}, - {"134.138.177.92", "turin"}, - {"134.138.177.86", "mallor"}]}. - -{hardcoded_ipv6_hosts, - [{"fe80::a00:20ff:feb2:b4a9","otptest06"}, - {"fe80::a00:20ff:feb2:a621","otptest08"}]}. diff --git a/lib/test_server/src/ts.win32.config b/lib/test_server/src/ts.win32.config index 2802c4a75a..cae587bea8 100644 --- a/lib/test_server/src/ts.win32.config +++ b/lib/test_server/src/ts.win32.config @@ -1,15 +1,8 @@ %% -*- erlang -*- %%% There is no equivalent command to ypmatch on Win32... :-( -{hardcoded_hosts, - [{"134.138.177.24","isildur"}, - {"134.138.177.72", "elrond"}, - {"134.138.176.215", "nenya"}, - {"134.138.176.192", "merry"}, - {"134.138.176.16", "super"}, - {"134.138.177.16", "gandalf"}, - {"134.138.177.92", "turin"}]}. +%{hardcoded_hosts, +% [{"127.0.0.1","localhost"}]}. -{hardcoded_ipv6_hosts, - [{"fe80::a00:20ff:feb2:b4a9","otptest06"}, - {"fe80::a00:20ff:feb2:a621","otptest08"}]}. +%{hardcoded_ipv6_hosts, +% [{"::1","localhost"}]}. -- cgit v1.2.3 From 308d6638450f5ffc7f432302367e84bcd92ea683 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 9 Feb 2011 19:10:44 +0100 Subject: Rename Suite Callback to Common Test Hook --- erts/emulator/test/a_SUITE.erl | 2 +- erts/emulator/test/after_SUITE.erl | 2 +- erts/emulator/test/alloc_SUITE.erl | 2 +- erts/emulator/test/beam_SUITE.erl | 2 +- erts/emulator/test/beam_literals_SUITE.erl | 2 +- erts/emulator/test/bif_SUITE.erl | 2 +- erts/emulator/test/big_SUITE.erl | 2 +- erts/emulator/test/binary_SUITE.erl | 2 +- erts/emulator/test/bs_bincomp_SUITE.erl | 2 +- erts/emulator/test/bs_bit_binaries_SUITE.erl | 2 +- erts/emulator/test/bs_construct_SUITE.erl | 2 +- erts/emulator/test/bs_match_bin_SUITE.erl | 2 +- erts/emulator/test/bs_match_int_SUITE.erl | 2 +- erts/emulator/test/bs_match_misc_SUITE.erl | 2 +- erts/emulator/test/bs_match_tail_SUITE.erl | 2 +- erts/emulator/test/bs_utf_SUITE.erl | 2 +- erts/emulator/test/busy_port_SUITE.erl | 2 +- erts/emulator/test/call_trace_SUITE.erl | 2 +- erts/emulator/test/code_SUITE.erl | 2 +- erts/emulator/test/crypto_SUITE.erl | 2 +- erts/emulator/test/ddll_SUITE.erl | 2 +- erts/emulator/test/decode_packet_SUITE.erl | 2 +- erts/emulator/test/distribution_SUITE.erl | 2 +- erts/emulator/test/driver_SUITE.erl | 2 +- erts/emulator/test/efile_SUITE.erl | 2 +- erts/emulator/test/erl_drv_thread_SUITE.erl | 2 +- erts/emulator/test/erl_link_SUITE.erl | 2 +- erts/emulator/test/erts_debug_SUITE.erl | 2 +- erts/emulator/test/estone_SUITE.erl | 2 +- erts/emulator/test/evil_SUITE.erl | 2 +- erts/emulator/test/exception_SUITE.erl | 2 +- erts/emulator/test/float_SUITE.erl | 2 +- erts/emulator/test/fun_SUITE.erl | 2 +- erts/emulator/test/fun_r12_SUITE.erl | 2 +- erts/emulator/test/gc_SUITE.erl | 2 +- erts/emulator/test/guard_SUITE.erl | 2 +- erts/emulator/test/hash_SUITE.erl | 2 +- erts/emulator/test/hibernate_SUITE.erl | 2 +- erts/emulator/test/list_bif_SUITE.erl | 2 +- erts/emulator/test/match_spec_SUITE.erl | 2 +- erts/emulator/test/module_info_SUITE.erl | 2 +- erts/emulator/test/monitor_SUITE.erl | 2 +- erts/emulator/test/mtx_SUITE.erl | 2 +- erts/emulator/test/nested_SUITE.erl | 2 +- erts/emulator/test/nif_SUITE.erl | 2 +- erts/emulator/test/node_container_SUITE.erl | 2 +- erts/emulator/test/nofrag_SUITE.erl | 2 +- erts/emulator/test/num_bif_SUITE.erl | 2 +- erts/emulator/test/old_scheduler_SUITE.erl | 2 +- erts/emulator/test/op_SUITE.erl | 2 +- erts/emulator/test/port_SUITE.erl | 2 +- erts/emulator/test/port_bif_SUITE.erl | 2 +- erts/emulator/test/process_SUITE.erl | 2 +- erts/emulator/test/pseudoknot_SUITE.erl | 2 +- erts/emulator/test/receive_SUITE.erl | 2 +- erts/emulator/test/ref_SUITE.erl | 2 +- erts/emulator/test/register_SUITE.erl | 2 +- erts/emulator/test/save_calls_SUITE.erl | 2 +- erts/emulator/test/scheduler_SUITE.erl | 2 +- erts/emulator/test/send_term_SUITE.erl | 2 +- erts/emulator/test/sensitive_SUITE.erl | 2 +- erts/emulator/test/signal_SUITE.erl | 2 +- erts/emulator/test/statistics_SUITE.erl | 2 +- erts/emulator/test/system_info_SUITE.erl | 2 +- erts/emulator/test/system_profile_SUITE.erl | 2 +- erts/emulator/test/time_SUITE.erl | 2 +- erts/emulator/test/timer_bif_SUITE.erl | 2 +- erts/emulator/test/trace_SUITE.erl | 2 +- erts/emulator/test/trace_bif_SUITE.erl | 2 +- erts/emulator/test/trace_call_count_SUITE.erl | 2 +- erts/emulator/test/trace_call_time_SUITE.erl | 2 +- erts/emulator/test/trace_local_SUITE.erl | 2 +- erts/emulator/test/trace_meta_SUITE.erl | 2 +- erts/emulator/test/trace_nif_SUITE.erl | 2 +- erts/emulator/test/trace_port_SUITE.erl | 2 +- erts/emulator/test/tuple_SUITE.erl | 2 +- erts/emulator/test/z_SUITE.erl | 2 +- erts/epmd/test/epmd_SUITE.erl | 2 +- erts/test/autoimport_SUITE.erl | 2 +- erts/test/erl_print_SUITE.erl | 2 +- erts/test/erlc_SUITE.erl | 2 +- erts/test/erlexec_SUITE.erl | 2 +- erts/test/ethread_SUITE.erl | 2 +- erts/test/install_SUITE.erl | 2 +- erts/test/nt_SUITE.erl | 2 +- erts/test/otp_SUITE.erl | 2 +- erts/test/run_erl_SUITE.erl | 2 +- erts/test/z_SUITE.erl | 2 +- lib/asn1/test/asn1_SUITE.erl | 2 +- lib/asn1/test/asn1_bin_SUITE.erl | 2 +- lib/asn1/test/asn1_bin_v2_SUITE.erl | 2 +- lib/common_test/test/ct_config_SUITE.erl | 2 +- lib/common_test/test/ct_error_SUITE.erl | 2 +- lib/common_test/test/ct_event_handler_SUITE.erl | 2 +- lib/common_test/test/ct_groups_test_1_SUITE.erl | 2 +- lib/common_test/test/ct_groups_test_2_SUITE.erl | 2 +- lib/common_test/test/ct_master_SUITE.erl | 2 +- lib/common_test/test/ct_misc_1_SUITE.erl | 2 +- lib/common_test/test/ct_repeat_1_SUITE.erl | 2 +- lib/common_test/test/ct_sequence_1_SUITE.erl | 2 +- lib/common_test/test/ct_skip_SUITE.erl | 2 +- lib/common_test/test/ct_smoke_test_SUITE.erl | 2 +- lib/common_test/test/ct_test_server_if_1_SUITE.erl | 2 +- lib/common_test/test/ct_testspec_1_SUITE.erl | 2 +- lib/compiler/test/andor_SUITE.erl | 2 +- lib/compiler/test/apply_SUITE.erl | 2 +- lib/compiler/test/beam_validator_SUITE.erl | 2 +- lib/compiler/test/bs_bincomp_SUITE.erl | 2 +- lib/compiler/test/bs_bit_binaries_SUITE.erl | 2 +- lib/compiler/test/bs_construct_SUITE.erl | 2 +- lib/compiler/test/bs_match_SUITE.erl | 2 +- lib/compiler/test/bs_utf_SUITE.erl | 2 +- lib/compiler/test/compilation_SUITE.erl | 2 +- lib/compiler/test/compile_SUITE.erl | 2 +- lib/compiler/test/core_SUITE.erl | 2 +- lib/compiler/test/core_fold_SUITE.erl | 2 +- lib/compiler/test/error_SUITE.erl | 2 +- lib/compiler/test/float_SUITE.erl | 2 +- lib/compiler/test/fun_SUITE.erl | 2 +- lib/compiler/test/guard_SUITE.erl | 2 +- lib/compiler/test/inline_SUITE.erl | 2 +- lib/compiler/test/lc_SUITE.erl | 2 +- lib/compiler/test/match_SUITE.erl | 2 +- lib/compiler/test/misc_SUITE.erl | 2 +- lib/compiler/test/num_bif_SUITE.erl | 2 +- lib/compiler/test/parteval_SUITE.erl | 2 +- lib/compiler/test/pmod_SUITE.erl | 2 +- lib/compiler/test/receive_SUITE.erl | 2 +- lib/compiler/test/record_SUITE.erl | 2 +- lib/compiler/test/trycatch_SUITE.erl | 2 +- lib/compiler/test/warnings_SUITE.erl | 2 +- lib/cosEvent/test/event_channel_SUITE.erl | 2 +- lib/cosEvent/test/generated_SUITE.erl | 2 +- lib/cosEventDomain/test/event_domain_SUITE.erl | 2 +- lib/cosEventDomain/test/generated_SUITE.erl | 2 +- lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 2 +- lib/cosNotification/test/eventDB_SUITE.erl | 2 +- lib/cosNotification/test/generated_SUITE.erl | 2 +- lib/cosNotification/test/grammar_SUITE.erl | 2 +- lib/cosNotification/test/notification_SUITE.erl | 2 +- lib/cosProperty/test/generated_SUITE.erl | 2 +- lib/cosProperty/test/property_SUITE.erl | 2 +- lib/cosTime/test/generated_SUITE.erl | 2 +- lib/cosTime/test/time_SUITE.erl | 2 +- lib/cosTransactions/test/generated_SUITE.erl | 2 +- lib/cosTransactions/test/transactions_SUITE.erl | 2 +- lib/crypto/test/blowfish_SUITE.erl | 2 +- lib/crypto/test/crypto_SUITE.erl | 2 +- lib/debugger/test/andor_SUITE.erl | 2 +- lib/debugger/test/bs_bincomp_SUITE.erl | 2 +- lib/debugger/test/bs_construct_SUITE.erl | 2 +- lib/debugger/test/bs_match_bin_SUITE.erl | 2 +- lib/debugger/test/bs_match_int_SUITE.erl | 2 +- lib/debugger/test/bs_match_misc_SUITE.erl | 2 +- lib/debugger/test/bs_match_tail_SUITE.erl | 2 +- lib/debugger/test/bs_utf_SUITE.erl | 2 +- lib/debugger/test/bug_SUITE.erl | 2 +- lib/debugger/test/dbg_ui_SUITE.erl | 2 +- lib/debugger/test/debugger_SUITE.erl | 2 +- lib/debugger/test/erl_eval_SUITE.erl | 2 +- lib/debugger/test/exception_SUITE.erl | 2 +- lib/debugger/test/fun_SUITE.erl | 2 +- lib/debugger/test/guard_SUITE.erl | 2 +- lib/debugger/test/int_SUITE.erl | 2 +- lib/debugger/test/int_break_SUITE.erl | 2 +- lib/debugger/test/int_eval_SUITE.erl | 2 +- lib/debugger/test/lc_SUITE.erl | 2 +- lib/debugger/test/record_SUITE.erl | 2 +- lib/debugger/test/trycatch_SUITE.erl | 2 +- lib/docbuilder/test/docb_SUITE.erl | 2 +- lib/edoc/test/edoc_SUITE.erl | 2 +- lib/erl_interface/test/ei_accept_SUITE.erl | 2 +- lib/erl_interface/test/ei_connect_SUITE.erl | 2 +- lib/erl_interface/test/ei_decode_SUITE.erl | 2 +- lib/erl_interface/test/ei_decode_encode_SUITE.erl | 2 +- lib/erl_interface/test/ei_encode_SUITE.erl | 2 +- lib/erl_interface/test/ei_format_SUITE.erl | 2 +- lib/erl_interface/test/ei_print_SUITE.erl | 2 +- lib/erl_interface/test/ei_tmo_SUITE.erl | 2 +- lib/erl_interface/test/erl_connect_SUITE.erl | 2 +- lib/erl_interface/test/erl_eterm_SUITE.erl | 2 +- lib/erl_interface/test/erl_ext_SUITE.erl | 2 +- lib/erl_interface/test/erl_format_SUITE.erl | 2 +- lib/erl_interface/test/erl_global_SUITE.erl | 2 +- lib/erl_interface/test/erl_match_SUITE.erl | 2 +- lib/erl_interface/test/port_call_SUITE.erl | 2 +- lib/et/test/et_wx_SUITE.erl | 2 +- lib/eunit/test/eunit_SUITE.erl | 2 +- lib/ic/test/c_client_erl_server_SUITE.erl | 2 +- lib/ic/test/c_client_erl_server_proto_SUITE.erl | 2 +- lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl | 2 +- lib/ic/test/erl_client_c_server_SUITE.erl | 2 +- lib/ic/test/erl_client_c_server_proto_SUITE.erl | 2 +- lib/ic/test/ic_SUITE.erl | 2 +- lib/ic/test/ic_be_SUITE.erl | 2 +- lib/ic/test/ic_pp_SUITE.erl | 2 +- lib/ic/test/ic_pragma_SUITE.erl | 2 +- lib/ic/test/ic_register_SUITE.erl | 2 +- lib/ic/test/java_client_erl_server_SUITE.erl | 2 +- lib/inets/test/ftp_SUITE.erl | 2 +- lib/inets/test/ftp_format_SUITE.erl | 2 +- lib/inets/test/http_format_SUITE.erl | 2 +- lib/inets/test/httpc_SUITE.erl | 2 +- lib/inets/test/httpc_cookie_SUITE.erl | 2 +- lib/inets/test/httpd_SUITE.erl | 2 +- lib/inets/test/httpd_basic_SUITE.erl | 2 +- lib/inets/test/inets_SUITE.erl | 2 +- lib/inets/test/inets_sup_SUITE.erl | 2 +- lib/inets/test/tftp_SUITE.erl | 2 +- lib/inviso/test/inviso_tool_SUITE.erl | 2 +- lib/jinterface/test/jinterface_SUITE.erl | 2 +- lib/jinterface/test/nc_SUITE.erl | 2 +- lib/kernel/test/application_SUITE.erl | 2 +- lib/kernel/test/bif_SUITE.erl | 2 +- lib/kernel/test/code_SUITE.erl | 2 +- lib/kernel/test/disk_log_SUITE.erl | 2 +- lib/kernel/test/erl_boot_server_SUITE.erl | 2 +- lib/kernel/test/erl_distribution_SUITE.erl | 2 +- lib/kernel/test/erl_distribution_wb_SUITE.erl | 2 +- lib/kernel/test/erl_prim_loader_SUITE.erl | 2 +- lib/kernel/test/error_logger_SUITE.erl | 2 +- lib/kernel/test/error_logger_warn_SUITE.erl | 2 +- lib/kernel/test/file_SUITE.erl | 2 +- lib/kernel/test/file_name_SUITE.erl | 2 +- lib/kernel/test/gen_sctp_SUITE.erl | 2 +- lib/kernel/test/gen_tcp_api_SUITE.erl | 2 +- lib/kernel/test/gen_tcp_echo_SUITE.erl | 2 +- lib/kernel/test/gen_tcp_misc_SUITE.erl | 2 +- lib/kernel/test/gen_udp_SUITE.erl | 2 +- lib/kernel/test/global_SUITE.erl | 2 +- lib/kernel/test/global_group_SUITE.erl | 2 +- lib/kernel/test/heart_SUITE.erl | 2 +- lib/kernel/test/inet_SUITE.erl | 2 +- lib/kernel/test/inet_res_SUITE.erl | 2 +- lib/kernel/test/inet_sockopt_SUITE.erl | 2 +- lib/kernel/test/init_SUITE.erl | 2 +- lib/kernel/test/interactive_shell_SUITE.erl | 2 +- lib/kernel/test/kernel_SUITE.erl | 2 +- lib/kernel/test/kernel_config_SUITE.erl | 2 +- lib/kernel/test/os_SUITE.erl | 2 +- lib/kernel/test/pdict_SUITE.erl | 2 +- lib/kernel/test/pg2_SUITE.erl | 2 +- lib/kernel/test/prim_file_SUITE.erl | 2 +- lib/kernel/test/ram_file_SUITE.erl | 2 +- lib/kernel/test/rpc_SUITE.erl | 2 +- lib/kernel/test/seq_trace_SUITE.erl | 2 +- lib/kernel/test/wrap_log_reader_SUITE.erl | 2 +- lib/kernel/test/zlib_SUITE.erl | 2 +- lib/megaco/test/megaco_SUITE.erl | 2 +- lib/mnesia/test/mnesia_SUITE.erl | 2 +- lib/observer/test/crashdump_viewer_SUITE.erl | 2 +- lib/observer/test/etop_SUITE.erl | 2 +- lib/observer/test/observer_SUITE.erl | 2 +- lib/observer/test/ttb_SUITE.erl | 2 +- lib/odbc/test/odbc_connect_SUITE.erl | 2 +- lib/odbc/test/odbc_data_type_SUITE.erl | 2 +- lib/odbc/test/odbc_query_SUITE.erl | 2 +- lib/odbc/test/odbc_start_SUITE.erl | 2 +- lib/orber/test/cdrcoding_10_SUITE.erl | 2 +- lib/orber/test/cdrcoding_11_SUITE.erl | 2 +- lib/orber/test/cdrcoding_12_SUITE.erl | 2 +- lib/orber/test/cdrlib_SUITE.erl | 2 +- lib/orber/test/corba_SUITE.erl | 2 +- lib/orber/test/csiv2_SUITE.erl | 2 +- lib/orber/test/data_types_SUITE.erl | 2 +- lib/orber/test/generated_SUITE.erl | 2 +- lib/orber/test/interceptors_SUITE.erl | 2 +- lib/orber/test/iop_ior_10_SUITE.erl | 2 +- lib/orber/test/iop_ior_11_SUITE.erl | 2 +- lib/orber/test/iop_ior_12_SUITE.erl | 2 +- lib/orber/test/lname_SUITE.erl | 2 +- lib/orber/test/multi_ORB_SUITE.erl | 2 +- lib/orber/test/naming_context_SUITE.erl | 2 +- lib/orber/test/orber_SUITE.erl | 2 +- lib/orber/test/orber_acl_SUITE.erl | 2 +- lib/orber/test/orber_firewall_ipv4_in_SUITE.erl | 2 +- lib/orber/test/orber_firewall_ipv4_out_SUITE.erl | 2 +- lib/orber/test/orber_firewall_ipv6_in_SUITE.erl | 2 +- lib/orber/test/orber_firewall_ipv6_out_SUITE.erl | 2 +- lib/orber/test/orber_nat_SUITE.erl | 2 +- lib/orber/test/orber_web_SUITE.erl | 2 +- lib/orber/test/tc_SUITE.erl | 2 +- lib/os_mon/test/cpu_sup_SUITE.erl | 2 +- lib/os_mon/test/disksup_SUITE.erl | 2 +- lib/os_mon/test/memsup_SUITE.erl | 2 +- lib/os_mon/test/os_mon_SUITE.erl | 2 +- lib/os_mon/test/os_mon_mib_SUITE.erl | 2 +- lib/os_mon/test/os_sup_SUITE.erl | 2 +- lib/parsetools/test/leex_SUITE.erl | 2 +- lib/parsetools/test/yecc_SUITE.erl | 2 +- lib/percept/test/egd_SUITE.erl | 2 +- lib/percept/test/percept_SUITE.erl | 2 +- lib/public_key/test/pkits_SUITE.erl | 2 +- lib/public_key/test/public_key_SUITE.erl | 2 +- lib/reltool/test/reltool_app_SUITE.erl | 2 +- lib/reltool/test/reltool_server_SUITE.erl | 2 +- lib/reltool/test/reltool_wx_SUITE.erl | 2 +- lib/runtime_tools/test/dbg_SUITE.erl | 2 +- lib/runtime_tools/test/erts_alloc_config_SUITE.erl | 2 +- lib/runtime_tools/test/inviso_SUITE.erl | 2 +- lib/runtime_tools/test/runtime_tools_SUITE.erl | 2 +- lib/snmp/test/snmp_SUITE.erl | 2 +- lib/ssl/test/old_ssl_active_SUITE.erl | 2 +- lib/ssl/test/old_ssl_active_once_SUITE.erl | 2 +- lib/ssl/test/old_ssl_dist_SUITE.erl | 2 +- lib/ssl/test/old_ssl_misc_SUITE.erl | 2 +- lib/ssl/test/old_ssl_passive_SUITE.erl | 2 +- lib/ssl/test/old_ssl_peer_cert_SUITE.erl | 2 +- lib/ssl/test/old_ssl_protocol_SUITE.erl | 2 +- lib/ssl/test/old_ssl_verify_SUITE.erl | 2 +- lib/ssl/test/old_transport_accept_SUITE.erl | 2 +- lib/ssl/test/ssl_basic_SUITE.erl | 2 +- lib/ssl/test/ssl_packet_SUITE.erl | 2 +- lib/ssl/test/ssl_payload_SUITE.erl | 2 +- lib/ssl/test/ssl_session_cache_SUITE.erl | 2 +- lib/ssl/test/ssl_to_openssl_SUITE.erl | 2 +- lib/stdlib/test/array_SUITE.erl | 2 +- lib/stdlib/test/base64_SUITE.erl | 2 +- lib/stdlib/test/beam_lib_SUITE.erl | 2 +- lib/stdlib/test/binary_module_SUITE.erl | 2 +- lib/stdlib/test/c_SUITE.erl | 2 +- lib/stdlib/test/calendar_SUITE.erl | 2 +- lib/stdlib/test/dets_SUITE.erl | 2 +- lib/stdlib/test/dict_SUITE.erl | 2 +- lib/stdlib/test/digraph_SUITE.erl | 2 +- lib/stdlib/test/digraph_utils_SUITE.erl | 2 +- lib/stdlib/test/edlin_expand_SUITE.erl | 2 +- lib/stdlib/test/epp_SUITE.erl | 2 +- lib/stdlib/test/erl_eval_SUITE.erl | 2 +- lib/stdlib/test/erl_expand_records_SUITE.erl | 2 +- lib/stdlib/test/erl_internal_SUITE.erl | 2 +- lib/stdlib/test/erl_lint_SUITE.erl | 2 +- lib/stdlib/test/erl_pp_SUITE.erl | 2 +- lib/stdlib/test/erl_scan_SUITE.erl | 2 +- lib/stdlib/test/escript_SUITE.erl | 2 +- lib/stdlib/test/ets_SUITE.erl | 2 +- lib/stdlib/test/ets_tough_SUITE.erl | 2 +- lib/stdlib/test/file_sorter_SUITE.erl | 2 +- lib/stdlib/test/filelib_SUITE.erl | 2 +- lib/stdlib/test/filename_SUITE.erl | 2 +- lib/stdlib/test/fixtable_SUITE.erl | 2 +- lib/stdlib/test/format_SUITE.erl | 2 +- lib/stdlib/test/gen_event_SUITE.erl | 2 +- lib/stdlib/test/gen_fsm_SUITE.erl | 2 +- lib/stdlib/test/gen_server_SUITE.erl | 2 +- lib/stdlib/test/id_transform_SUITE.erl | 2 +- lib/stdlib/test/io_SUITE.erl | 2 +- lib/stdlib/test/io_proto_SUITE.erl | 2 +- lib/stdlib/test/lists_SUITE.erl | 2 +- lib/stdlib/test/log_mf_h_SUITE.erl | 2 +- lib/stdlib/test/ms_transform_SUITE.erl | 2 +- lib/stdlib/test/proc_lib_SUITE.erl | 2 +- lib/stdlib/test/qlc_SUITE.erl | 2 +- lib/stdlib/test/queue_SUITE.erl | 2 +- lib/stdlib/test/random_SUITE.erl | 2 +- lib/stdlib/test/re_SUITE.erl | 2 +- lib/stdlib/test/select_SUITE.erl | 2 +- lib/stdlib/test/sets_SUITE.erl | 2 +- lib/stdlib/test/shell_SUITE.erl | 2 +- lib/stdlib/test/slave_SUITE.erl | 2 +- lib/stdlib/test/sofs_SUITE.erl | 2 +- lib/stdlib/test/stdlib_SUITE.erl | 2 +- lib/stdlib/test/string_SUITE.erl | 2 +- lib/stdlib/test/supervisor_SUITE.erl | 2 +- lib/stdlib/test/supervisor_bridge_SUITE.erl | 2 +- lib/stdlib/test/sys_SUITE.erl | 2 +- lib/stdlib/test/tar_SUITE.erl | 2 +- lib/stdlib/test/timer_SUITE.erl | 2 +- lib/stdlib/test/timer_simple_SUITE.erl | 2 +- lib/stdlib/test/unicode_SUITE.erl | 2 +- lib/stdlib/test/win32reg_SUITE.erl | 2 +- lib/stdlib/test/y2k_SUITE.erl | 2 +- lib/stdlib/test/zip_SUITE.erl | 2 +- lib/syntax_tools/test/syntax_tools_SUITE.erl | 2 +- lib/tools/test/cover_SUITE.erl | 2 +- lib/tools/test/cprof_SUITE.erl | 2 +- lib/tools/test/emem_SUITE.erl | 2 +- lib/tools/test/eprof_SUITE.erl | 2 +- lib/tools/test/fprof_SUITE.erl | 2 +- lib/tools/test/instrument_SUITE.erl | 2 +- lib/tools/test/lcnt_SUITE.erl | 2 +- lib/tools/test/make_SUITE.erl | 2 +- lib/tools/test/tools_SUITE.erl | 2 +- lib/tools/test/xref_SUITE.erl | 2 +- lib/wx/test/wx_app_SUITE.erl | 2 +- lib/wx/test/wx_basic_SUITE.erl | 2 +- lib/wx/test/wx_class_SUITE.erl | 2 +- lib/wx/test/wx_event_SUITE.erl | 2 +- lib/wx/test/wx_opengl_SUITE.erl | 2 +- lib/wx/test/wx_xtra_SUITE.erl | 2 +- 390 files changed, 390 insertions(+), 390 deletions(-) diff --git a/erts/emulator/test/a_SUITE.erl b/erts/emulator/test/a_SUITE.erl index ff1e959c83..784869251a 100644 --- a/erts/emulator/test/a_SUITE.erl +++ b/erts/emulator/test/a_SUITE.erl @@ -31,7 +31,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, long_timers/1, pollset_size/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [long_timers, pollset_size]. diff --git a/erts/emulator/test/after_SUITE.erl b/erts/emulator/test/after_SUITE.erl index cab8e55054..78ac099792 100644 --- a/erts/emulator/test/after_SUITE.erl +++ b/erts/emulator/test/after_SUITE.erl @@ -35,7 +35,7 @@ -export([timeout_g/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_after, receive_after, receive_after_big, diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl index 3bceb03033..687a4f0d5a 100644 --- a/erts/emulator/test/alloc_SUITE.erl +++ b/erts/emulator/test/alloc_SUITE.erl @@ -36,7 +36,7 @@ -define(DEFAULT_TIMETRAP_SECS, 240). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, coalesce, threads, realloc_copy, bucket_index, diff --git a/erts/emulator/test/beam_SUITE.erl b/erts/emulator/test/beam_SUITE.erl index e275fa8ad9..3643750883 100644 --- a/erts/emulator/test/beam_SUITE.erl +++ b/erts/emulator/test/beam_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [packed_registers, apply_last, apply_last_bif, diff --git a/erts/emulator/test/beam_literals_SUITE.erl b/erts/emulator/test/beam_literals_SUITE.erl index 680c0eda48..3ab7fc615b 100644 --- a/erts/emulator/test/beam_literals_SUITE.erl +++ b/erts/emulator/test/beam_literals_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [putting, matching_smalls, matching_smalls_jt, diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index cdbceae239..016befdced 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -29,7 +29,7 @@ binary_to_atom/1,binary_to_existing_atom/1, atom_to_binary/1,min_max/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [types, t_list_to_existing_atom, os_env, otp_7526, diff --git a/erts/emulator/test/big_SUITE.erl b/erts/emulator/test/big_SUITE.erl index b0df2ff18b..60b19af68e 100644 --- a/erts/emulator/test/big_SUITE.erl +++ b/erts/emulator/test/big_SUITE.erl @@ -35,7 +35,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_div, eq_28, eq_32, eq_big, eq_math, big_literals, diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 1abdc91f9c..9b8905712e 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -63,7 +63,7 @@ %% Internal exports. -export([sleeper/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}, +suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,2}}]. all() -> diff --git a/erts/emulator/test/bs_bincomp_SUITE.erl b/erts/emulator/test/bs_bincomp_SUITE.erl index e221f519cf..c0d64c263e 100644 --- a/erts/emulator/test/bs_bincomp_SUITE.erl +++ b/erts/emulator/test/bs_bincomp_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("common_test/include/ct.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [byte_aligned, bit_aligned, extended_byte_aligned, diff --git a/erts/emulator/test/bs_bit_binaries_SUITE.erl b/erts/emulator/test/bs_bit_binaries_SUITE.erl index eaf2f99027..76d2661592 100644 --- a/erts/emulator/test/bs_bit_binaries_SUITE.erl +++ b/erts/emulator/test/bs_bit_binaries_SUITE.erl @@ -31,7 +31,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [misc, horrid_match, test_bitstr, test_bit_size, diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index e23d0c6e26..dd77278307 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test1, test2, test3, test4, test5, testf, not_used, diff --git a/erts/emulator/test/bs_match_bin_SUITE.erl b/erts/emulator/test/bs_match_bin_SUITE.erl index 2530fbd43c..5a028835e6 100644 --- a/erts/emulator/test/bs_match_bin_SUITE.erl +++ b/erts/emulator/test/bs_match_bin_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [byte_split_binary, bit_split_binary, match_huge_bin]. diff --git a/erts/emulator/test/bs_match_int_SUITE.erl b/erts/emulator/test/bs_match_int_SUITE.erl index f454e5d3e9..093ef906c8 100644 --- a/erts/emulator/test/bs_match_int_SUITE.erl +++ b/erts/emulator/test/bs_match_int_SUITE.erl @@ -27,7 +27,7 @@ -import(lists, [seq/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [integer, signed_integer, dynamic, more_dynamic, mml, diff --git a/erts/emulator/test/bs_match_misc_SUITE.erl b/erts/emulator/test/bs_match_misc_SUITE.erl index 31379eccd6..ad21e01f7e 100644 --- a/erts/emulator/test/bs_match_misc_SUITE.erl +++ b/erts/emulator/test/bs_match_misc_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [bound_var, bound_tail, t_float, little_float, sean, diff --git a/erts/emulator/test/bs_match_tail_SUITE.erl b/erts/emulator/test/bs_match_tail_SUITE.erl index 34e711b014..b8f7789f60 100644 --- a/erts/emulator/test/bs_match_tail_SUITE.erl +++ b/erts/emulator/test/bs_match_tail_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [aligned, unaligned, zero_tail]. diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl index 6e660b12b0..626a8b4cb6 100644 --- a/erts/emulator/test/bs_utf_SUITE.erl +++ b/erts/emulator/test/bs_utf_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [utf8_roundtrip, utf16_roundtrip, utf32_roundtrip, diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index f14dec4908..e754d161a3 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -31,7 +31,7 @@ %% Internal exports. -export([init/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [io_to_busy, message_order, send_3, system_monitor, diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl index 2b35fbe80d..11e8085cff 100644 --- a/erts/emulator/test/call_trace_SUITE.erl +++ b/erts/emulator/test/call_trace_SUITE.erl @@ -41,7 +41,7 @@ -define(P, 20). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> Common = [errors, on_load], diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 07a8b04cb4..703a00a598 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [new_binary_types, t_check_process_code, diff --git a/erts/emulator/test/crypto_SUITE.erl b/erts/emulator/test/crypto_SUITE.erl index d967694d61..a8cc175303 100644 --- a/erts/emulator/test/crypto_SUITE.erl +++ b/erts/emulator/test/crypto_SUITE.erl @@ -26,7 +26,7 @@ t_md5/1,t_md5_update/1,error/1,unaligned_context/1,random_lists/1, misc_errors/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_md5, t_md5_update, error, unaligned_context, diff --git a/erts/emulator/test/ddll_SUITE.erl b/erts/emulator/test/ddll_SUITE.erl index 2166b4ab76..ef607bf407 100644 --- a/erts/emulator/test/ddll_SUITE.erl +++ b/erts/emulator/test/ddll_SUITE.erl @@ -53,7 +53,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ddll_test, errors, reference_count, kill_port, diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index a26e2340d0..97ab470a3e 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -28,7 +28,7 @@ init_per_testcase/2,end_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, packet_size, neg, http, line, ssl, otp_8536]. diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index f1e7468860..d62eb00919 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -54,7 +54,7 @@ dist_evil_parallel_receiver/0, sendersender/4, sendersender2/4]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ping, {group, bulk_send}, {group, local_send}, diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 9da7ad671d..d1893e08dd 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -126,7 +126,7 @@ end_per_testcase(Case, Config) -> ?line 0 = erts_debug:get_internal_state(check_io_debug), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [fun_to_port, outputv_echo, queue_echo, {group, timer}, diff --git a/erts/emulator/test/efile_SUITE.erl b/erts/emulator/test/efile_SUITE.erl index d6bd4e3581..0cac0636e0 100644 --- a/erts/emulator/test/efile_SUITE.erl +++ b/erts/emulator/test/efile_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [iter_max_files]. diff --git a/erts/emulator/test/erl_drv_thread_SUITE.erl b/erts/emulator/test/erl_drv_thread_SUITE.erl index eef7fb75b8..bc9e610af3 100644 --- a/erts/emulator/test/erl_drv_thread_SUITE.erl +++ b/erts/emulator/test/erl_drv_thread_SUITE.erl @@ -28,7 +28,7 @@ -define(DEFAULT_TIMETRAP_SECS, 240). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, rwlock, tsd]. diff --git a/erts/emulator/test/erl_link_SUITE.erl b/erts/emulator/test/erl_link_SUITE.erl index e0b122b007..84d17c9596 100644 --- a/erts/emulator/test/erl_link_SUITE.erl +++ b/erts/emulator/test/erl_link_SUITE.erl @@ -78,7 +78,7 @@ -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [links, dist_links, monitor_nodes, process_monitors, diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl index f34904d537..9a6a6f4c05 100644 --- a/erts/emulator/test/erts_debug_SUITE.erl +++ b/erts/emulator/test/erts_debug_SUITE.erl @@ -26,7 +26,7 @@ flat_size/1,flat_size_big/1,df/1, instructions/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [flat_size, flat_size_big, df, instructions]. diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl index 41b785b0c6..a4cb76dde1 100644 --- a/erts/emulator/test/estone_SUITE.erl +++ b/erts/emulator/test/estone_SUITE.erl @@ -74,7 +74,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [estone]. diff --git a/erts/emulator/test/evil_SUITE.erl b/erts/emulator/test/evil_SUITE.erl index 9dc22e04a2..5c59184fe2 100644 --- a/erts/emulator/test/evil_SUITE.erl +++ b/erts/emulator/test/evil_SUITE.erl @@ -34,7 +34,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [heap_frag, encode_decode_ext, decode_integer_ext, diff --git a/erts/emulator/test/exception_SUITE.erl b/erts/emulator/test/exception_SUITE.erl index b398914df5..7041ad32de 100644 --- a/erts/emulator/test/exception_SUITE.erl +++ b/erts/emulator/test/exception_SUITE.erl @@ -30,7 +30,7 @@ -include_lib("test_server/include/test_server.hrl"). -import(lists, [foreach/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [badmatch, pending_errors, nil_arith, stacktrace, diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl index 5cf4370e83..c79a1d9900 100644 --- a/erts/emulator/test/float_SUITE.erl +++ b/erts/emulator/test/float_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [fpe, fp_drv, fp_drv_thread, otp_7178, denormalized, diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index 734177a3db..4b59bfd6a5 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -36,7 +36,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [bad_apply, bad_fun_call, badarity, ext_badarity, diff --git a/erts/emulator/test/fun_r12_SUITE.erl b/erts/emulator/test/fun_r12_SUITE.erl index a1126ba5f4..9421b60f49 100644 --- a/erts/emulator/test/fun_r12_SUITE.erl +++ b/erts/emulator/test/fun_r12_SUITE.erl @@ -27,7 +27,7 @@ -define(default_timeout, ?t:minutes(1)). -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [dist_old_release]. diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl index 95a23da39a..9ce8d18346 100644 --- a/erts/emulator/test/gc_SUITE.erl +++ b/erts/emulator/test/gc_SUITE.erl @@ -29,7 +29,7 @@ -export([grow_heap/1, grow_stack/1, grow_stack_heap/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [grow_heap, grow_stack, grow_stack_heap]. diff --git a/erts/emulator/test/guard_SUITE.erl b/erts/emulator/test/guard_SUITE.erl index 0536112e3a..a3be387a5b 100644 --- a/erts/emulator/test/guard_SUITE.erl +++ b/erts/emulator/test/guard_SUITE.erl @@ -29,7 +29,7 @@ -export([init/3]). -import(lists, [member/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [bad_arith, bad_tuple, test_heap_guards, guard_bifs, diff --git a/erts/emulator/test/hash_SUITE.erl b/erts/emulator/test/hash_SUITE.erl index 46231757ad..257bee0b78 100644 --- a/erts/emulator/test/hash_SUITE.erl +++ b/erts/emulator/test/hash_SUITE.erl @@ -82,7 +82,7 @@ end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test_basic, test_cmp, test_range, test_spread, diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index 17d1a23d59..b8dc87db7f 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -30,7 +30,7 @@ %% Used by test cases. -export([basic_hibernator/1,messages_in_queue_restart/2, no_heap_loop/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, min_heap_size, bad_args, messages_in_queue, diff --git a/erts/emulator/test/list_bif_SUITE.erl b/erts/emulator/test/list_bif_SUITE.erl index 8153fcf016..ef0929e769 100644 --- a/erts/emulator/test/list_bif_SUITE.erl +++ b/erts/emulator/test/list_bif_SUITE.erl @@ -27,7 +27,7 @@ t_list_to_float/1,t_list_to_integer/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [hd_test, tl_test, t_length, t_list_to_pid, diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index 0953908c3d..6bddbb14f5 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -48,7 +48,7 @@ end_per_testcase(_Func, Config) -> ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(match_spec_SUITE) of diff --git a/erts/emulator/test/module_info_SUITE.erl b/erts/emulator/test/module_info_SUITE.erl index 02a95b5fc5..a2a052671f 100644 --- a/erts/emulator/test/module_info_SUITE.erl +++ b/erts/emulator/test/module_info_SUITE.erl @@ -31,7 +31,7 @@ %% Helper. -export([native_proj/1,native_filter/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> modules(). diff --git a/erts/emulator/test/monitor_SUITE.erl b/erts/emulator/test/monitor_SUITE.erl index d19284890e..9cf4ed702a 100644 --- a/erts/emulator/test/monitor_SUITE.erl +++ b/erts/emulator/test/monitor_SUITE.erl @@ -32,7 +32,7 @@ -export([y2/1, g/1, g0/0, g1/0, large_exit_sub/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [case_1, case_1a, case_2, case_2a, mon_e_1, demon_e_1, diff --git a/erts/emulator/test/mtx_SUITE.erl b/erts/emulator/test/mtx_SUITE.erl index 806c0adfd5..d379b8a7fa 100644 --- a/erts/emulator/test/mtx_SUITE.erl +++ b/erts/emulator/test/mtx_SUITE.erl @@ -72,7 +72,7 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [long_rwlock, hammer_rwlock_check, hammer_rwlock, diff --git a/erts/emulator/test/nested_SUITE.erl b/erts/emulator/test/nested_SUITE.erl index 249a02ae52..f889712f46 100644 --- a/erts/emulator/test/nested_SUITE.erl +++ b/erts/emulator/test/nested_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [case_in_case, case_in_after, catch_in_catch, diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index fb78aa9150..54cbf6b974 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -52,7 +52,7 @@ -define(nif_stub,nif_stub_error(?LINE)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, reload, upgrade, heap_frag, types, many_args, diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index c78d249e6b..416fdad941 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -57,7 +57,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(10)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [term_to_binary_to_term_eq, round_trip_eq, cmp, ref_eq, diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl index add733dd89..9287158981 100644 --- a/erts/emulator/test/nofrag_SUITE.erl +++ b/erts/emulator/test/nofrag_SUITE.erl @@ -32,7 +32,7 @@ %% Exported functions for an error_handler module. -export([undefined_function/3,undefined_lambda/3,breakpoint/3]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [error_handler, error_handler_apply, diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index 9a9d4d93f1..bf101b038d 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -38,7 +38,7 @@ t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_abs, t_float, t_float_to_list, t_integer_to_list, diff --git a/erts/emulator/test/old_scheduler_SUITE.erl b/erts/emulator/test/old_scheduler_SUITE.erl index 51a4943dd9..6f9c0a9dab 100644 --- a/erts/emulator/test/old_scheduler_SUITE.erl +++ b/erts/emulator/test/old_scheduler_SUITE.erl @@ -28,7 +28,7 @@ -define(default_timeout, ?t:minutes(11)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case catch erlang:system_info(modified_timing_level) of diff --git a/erts/emulator/test/op_SUITE.erl b/erts/emulator/test/op_SUITE.erl index f49986023b..7bea35e980 100644 --- a/erts/emulator/test/op_SUITE.erl +++ b/erts/emulator/test/op_SUITE.erl @@ -29,7 +29,7 @@ -export([]). -import(lists, [foldl/3,flatmap/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [bsl_bsr, logical, t_not, relop_simple, relop, diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index fdfab6e27c..6da9a7e0ad 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -102,7 +102,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [otp_6224, {group, stream}, basic_ping, slow_writes, diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl index 9d6e813cd4..946978c580 100644 --- a/erts/emulator/test/port_bif_SUITE.erl +++ b/erts/emulator/test/port_bif_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [command, {group, port_info}, connect, control, diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index 8a71a6d7e4..f7553e5815 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -57,7 +57,7 @@ -export([hangaround/2, processes_bif_test/0, do_processes/1, processes_term_proc_list_test/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [spawn_with_binaries, t_exit_1, {group, t_exit_2}, diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index 06ff5f8e04..f0668dd287 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -22,7 +22,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,test/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test]. diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl index 0eda2a50d8..2ac696b4c7 100644 --- a/erts/emulator/test/receive_SUITE.erl +++ b/erts/emulator/test/receive_SUITE.erl @@ -29,7 +29,7 @@ -export([init_per_testcase/2,end_per_testcase/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [call_with_huge_message_queue, receive_in_between]. diff --git a/erts/emulator/test/ref_SUITE.erl b/erts/emulator/test/ref_SUITE.erl index b455632c4e..327d55fead 100644 --- a/erts/emulator/test/ref_SUITE.erl +++ b/erts/emulator/test/ref_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [wrap_1]. diff --git a/erts/emulator/test/register_SUITE.erl b/erts/emulator/test/register_SUITE.erl index 58e23de5eb..d88df8d59d 100644 --- a/erts/emulator/test/register_SUITE.erl +++ b/erts/emulator/test/register_SUITE.erl @@ -33,7 +33,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [otp_8099]. diff --git a/erts/emulator/test/save_calls_SUITE.erl b/erts/emulator/test/save_calls_SUITE.erl index 594421b687..4929031794 100644 --- a/erts/emulator/test/save_calls_SUITE.erl +++ b/erts/emulator/test/save_calls_SUITE.erl @@ -28,7 +28,7 @@ -export([do_bopp/1, do_bipp/0, do_bepp/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [save_calls_1, dont_break_reductions]. diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index dd7d95c5eb..1478bbeb52 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -59,7 +59,7 @@ -define(MIN_SCHEDULER_TEST_TIMEOUT, ?t:minutes(1)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [equal, few_low, many_low, equal_with_part_time_high, diff --git a/erts/emulator/test/send_term_SUITE.erl b/erts/emulator/test/send_term_SUITE.erl index 7c1aa159f6..84352f78ad 100644 --- a/erts/emulator/test/send_term_SUITE.erl +++ b/erts/emulator/test/send_term_SUITE.erl @@ -35,7 +35,7 @@ end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic]. diff --git a/erts/emulator/test/sensitive_SUITE.erl b/erts/emulator/test/sensitive_SUITE.erl index 69dd2c9072..57bc6ce08e 100644 --- a/erts/emulator/test/sensitive_SUITE.erl +++ b/erts/emulator/test/sensitive_SUITE.erl @@ -40,7 +40,7 @@ end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [stickiness, send_trace, recv_trace, proc_trace, diff --git a/erts/emulator/test/signal_SUITE.erl b/erts/emulator/test/signal_SUITE.erl index 5db4f2eba5..682a9d03fc 100644 --- a/erts/emulator/test/signal_SUITE.erl +++ b/erts/emulator/test/signal_SUITE.erl @@ -69,7 +69,7 @@ end_per_suite(_Config) -> catch erts_debug:set_internal_state(not_running_optimization, true), available_internal_state(false). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [xm_sig_order, pending_exit_unlink_process, diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl index 582acb5495..b543491471 100644 --- a/erts/emulator/test/statistics_SUITE.erl +++ b/erts/emulator/test/statistics_SUITE.erl @@ -47,7 +47,7 @@ end_per_testcase(_, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, wall_clock}, {group, runtime}, reductions, diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index 865a8fbe45..0293341eac 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -41,7 +41,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [process_count, system_version, misc_smoke_tests, diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl index b74613f6b4..e4cfa56d88 100644 --- a/erts/emulator/test/system_profile_SUITE.erl +++ b/erts/emulator/test/system_profile_SUITE.erl @@ -47,7 +47,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [system_profile_on_and_off, runnable_procs, diff --git a/erts/emulator/test/time_SUITE.erl b/erts/emulator/test/time_SUITE.erl index 6c2b85815c..43dccc6ecb 100644 --- a/erts/emulator/test/time_SUITE.erl +++ b/erts/emulator/test/time_SUITE.erl @@ -55,7 +55,7 @@ -define(dst_timezone, 2). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [univ_to_local, local_to_univ, local_to_univ_utc, diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index 233455cae5..6c421253af 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -50,7 +50,7 @@ init_per_suite(Config) -> end_per_suite(_Config) -> catch erts_debug:set_internal_state(available_internal_state, false). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_timer_1, send_after_1, send_after_2, diff --git a/erts/emulator/test/trace_SUITE.erl b/erts/emulator/test/trace_SUITE.erl index 16f4d91a2d..d200fdaf4c 100644 --- a/erts/emulator/test/trace_SUITE.erl +++ b/erts/emulator/test/trace_SUITE.erl @@ -41,7 +41,7 @@ %%% Internal exports -export([process/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cpu_timestamp, receive_trace, self_send, timeout_trace, diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl index 3e14ceff43..263db065b3 100644 --- a/erts/emulator/test/trace_bif_SUITE.erl +++ b/erts/emulator/test/trace_bif_SUITE.erl @@ -30,7 +30,7 @@ -export([bif_process/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_bif_SUITE) of diff --git a/erts/emulator/test/trace_call_count_SUITE.erl b/erts/emulator/test/trace_call_count_SUITE.erl index c45d11f770..55d9b2b288 100644 --- a/erts/emulator/test/trace_call_count_SUITE.erl +++ b/erts/emulator/test/trace_call_count_SUITE.erl @@ -80,7 +80,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_call_count_SUITE) of diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 2dbc8345a7..8bf66b7177 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -82,7 +82,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_call_time_SUITE) of diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index ffd1a80bc8..0235f624ce 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -90,7 +90,7 @@ end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_local_SUITE) of diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index 444f07e17f..666bd60511 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -80,7 +80,7 @@ end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_meta_SUITE) of diff --git a/erts/emulator/test/trace_nif_SUITE.erl b/erts/emulator/test/trace_nif_SUITE.erl index 3b6496e0cc..a52ee15e0e 100644 --- a/erts/emulator/test/trace_nif_SUITE.erl +++ b/erts/emulator/test/trace_nif_SUITE.erl @@ -33,7 +33,7 @@ -export([nif_process/0, nif/0, nif/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(trace_nif_SUITE) of diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl index 2429f729fd..d94fc0aa20 100644 --- a/erts/emulator/test/trace_port_SUITE.erl +++ b/erts/emulator/test/trace_port_SUITE.erl @@ -46,7 +46,7 @@ test_cases() -> fake_schedule_after_getting_unlinked, gc, default_tracer]. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_cases(). diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index a5c38bc239..c1f171d9b5 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -35,7 +35,7 @@ %% make_tuple/2 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [build_and_match, t_size, t_tuple_size, t_list_to_tuple, diff --git a/erts/emulator/test/z_SUITE.erl b/erts/emulator/test/z_SUITE.erl index ff5075956b..9637ecd87e 100644 --- a/erts/emulator/test/z_SUITE.erl +++ b/erts/emulator/test/z_SUITE.erl @@ -42,7 +42,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(5)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [schedulers_alive, node_container_refc_check, diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index a5d7b24345..ec566f817b 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -103,7 +103,7 @@ %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [register_name, register_names_1, register_names_2, diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl index a6270e373a..9724ea3ad5 100644 --- a/erts/test/autoimport_SUITE.erl +++ b/erts/test/autoimport_SUITE.erl @@ -26,7 +26,7 @@ autoimports/1]). -define(TEST_TIMEOUT, ?t:seconds(180)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [autoimports]. diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl index e6154aec2b..fe9e811d4d 100644 --- a/erts/test/erl_print_SUITE.erl +++ b/erts/test/erl_print_SUITE.erl @@ -41,7 +41,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_cases(). diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index e8531bac8b..a3a33b568c 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [compile_erl, compile_yecc, compile_script, compile_mib, diff --git a/erts/test/erlexec_SUITE.erl b/erts/test/erlexec_SUITE.erl index bc95d7feb5..e932e5a211 100644 --- a/erts/test/erlexec_SUITE.erl +++ b/erts/test/erlexec_SUITE.erl @@ -53,7 +53,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [args_file, evil_args_file, env, args_file_env, diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl index 52edfd254b..9bc3eebb74 100644 --- a/erts/test/ethread_SUITE.erl +++ b/erts/test/ethread_SUITE.erl @@ -56,7 +56,7 @@ tests() -> cond_wait, broadcast, detached_thread, max_threads, tsd, spinlock, rwspinlock, rwmutex, atomic]. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> tests(). diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl index c9f0fb5343..2279ddae00 100644 --- a/erts/test/install_SUITE.erl +++ b/erts/test/install_SUITE.erl @@ -76,7 +76,7 @@ dont_need_symlink_cases() -> bin_unreasonable_path, 'bin white space', bin_no_srcfile]. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> dont_need_symlink_cases() ++ need_symlink_cases(). diff --git a/erts/test/nt_SUITE.erl b/erts/test/nt_SUITE.erl index f06a5c2190..8b2d8a7147 100644 --- a/erts/test/nt_SUITE.erl +++ b/erts/test/nt_SUITE.erl @@ -33,7 +33,7 @@ -define(TEST_SERVICES, [1,2,3,4,5,6,7,8,9,10,11]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case os:type() of diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index 0dc6074d12..43655c4844 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -29,7 +29,7 @@ -import(lists, [filter/2,foldl/3,foreach/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [undefined_functions, deprecated_not_in_obsolete, diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index a76f8d877e..5288e3e827 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -36,7 +36,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, heavy, heavier, defunct]. diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl index c88b7e84d0..acd07b44c5 100644 --- a/erts/test/z_SUITE.erl +++ b/erts/test/z_SUITE.erl @@ -53,7 +53,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [core_files]. diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index d45cc6df15..e12dede3f7 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -62,7 +62,7 @@ %-record('Def3',{ %bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, compile}, parse, default_per, default_ber, diff --git a/lib/asn1/test/asn1_bin_SUITE.erl b/lib/asn1/test/asn1_bin_SUITE.erl index 0c3fc43dde..d8c5dd5b27 100644 --- a/lib/asn1/test/asn1_bin_SUITE.erl +++ b/lib/asn1/test/asn1_bin_SUITE.erl @@ -63,7 +63,7 @@ -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, compile}, parse, default_per, default_ber, diff --git a/lib/asn1/test/asn1_bin_v2_SUITE.erl b/lib/asn1/test/asn1_bin_v2_SUITE.erl index 6e541a788c..43d6ba0c6e 100644 --- a/lib/asn1/test/asn1_bin_v2_SUITE.erl +++ b/lib/asn1/test/asn1_bin_v2_SUITE.erl @@ -62,7 +62,7 @@ bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, compile}, parse, default_per, default_ber, diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl index 438d3f52e8..2ddc7d6422 100644 --- a/lib/common_test/test/ct_config_SUITE.erl +++ b/lib/common_test/test/ct_config_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(install_config = TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [require, install_config, userconfig_static, diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index 75d1c7d079..17faf5ee3f 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cfg_error, lib_error, no_compile, timetrap_end_conf, diff --git a/lib/common_test/test/ct_event_handler_SUITE.erl b/lib/common_test/test/ct_event_handler_SUITE.erl index 39216d9b9e..b27770881d 100644 --- a/lib/common_test/test/ct_event_handler_SUITE.erl +++ b/lib/common_test/test/ct_event_handler_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_stop, results]. diff --git a/lib/common_test/test/ct_groups_test_1_SUITE.erl b/lib/common_test/test/ct_groups_test_1_SUITE.erl index 8ba44e9925..3712bc0e33 100644 --- a/lib/common_test/test/ct_groups_test_1_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_1_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [groups_suite_1, groups_suite_2, groups_suites_1, diff --git a/lib/common_test/test/ct_groups_test_2_SUITE.erl b/lib/common_test/test/ct_groups_test_2_SUITE.erl index f4503e97a8..32e8d0c6d7 100644 --- a/lib/common_test/test/ct_groups_test_2_SUITE.erl +++ b/lib/common_test/test/ct_groups_test_2_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [missing_conf, repeat_1]. diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl index 74e0e73f9f..e208397296 100644 --- a/lib/common_test/test/ct_master_SUITE.erl +++ b/lib/common_test/test/ct_master_SUITE.erl @@ -81,7 +81,7 @@ end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ct_master_test]. diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl index c2ce713fe0..f5904ca180 100644 --- a/lib/common_test/test/ct_misc_1_SUITE.erl +++ b/lib/common_test/test/ct_misc_1_SUITE.erl @@ -57,7 +57,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [beam_me_up, {group,parse_table}]. diff --git a/lib/common_test/test/ct_repeat_1_SUITE.erl b/lib/common_test/test/ct_repeat_1_SUITE.erl index 52ef5cba4b..40ef3e42fb 100644 --- a/lib/common_test/test/ct_repeat_1_SUITE.erl +++ b/lib/common_test/test/ct_repeat_1_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [repeat_cs, repeat_cs_and_grs, repeat_seq, diff --git a/lib/common_test/test/ct_sequence_1_SUITE.erl b/lib/common_test/test/ct_sequence_1_SUITE.erl index 80275c28f7..0876a6f8b8 100644 --- a/lib/common_test/test/ct_sequence_1_SUITE.erl +++ b/lib/common_test/test/ct_sequence_1_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [subgroup_return_fail, subgroup_init_fail, diff --git a/lib/common_test/test/ct_skip_SUITE.erl b/lib/common_test/test/ct_skip_SUITE.erl index 1284932717..2b64062e4d 100644 --- a/lib/common_test/test/ct_skip_SUITE.erl +++ b/lib/common_test/test/ct_skip_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [auto_skip, user_skip]. diff --git a/lib/common_test/test/ct_smoke_test_SUITE.erl b/lib/common_test/test/ct_smoke_test_SUITE.erl index 0e02fb4fc6..096171f951 100644 --- a/lib/common_test/test/ct_smoke_test_SUITE.erl +++ b/lib/common_test/test/ct_smoke_test_SUITE.erl @@ -112,7 +112,7 @@ end_per_testcase(TestCase, Config) -> %% Description: Returns a description of the test suite (doc) and a %% list of all test cases in the suite (suite). %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [dir1, dir2, dir1_2, suite11, suite21, suite11_21, diff --git a/lib/common_test/test/ct_test_server_if_1_SUITE.erl b/lib/common_test/test/ct_test_server_if_1_SUITE.erl index 70943285bd..44c30d7a38 100644 --- a/lib/common_test/test/ct_test_server_if_1_SUITE.erl +++ b/lib/common_test/test/ct_test_server_if_1_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ts_if_1]. diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl index 949269a9e4..c2a7bd8fd7 100644 --- a/lib/common_test/test/ct_testspec_1_SUITE.erl +++ b/lib/common_test/test/ct_testspec_1_SUITE.erl @@ -56,7 +56,7 @@ init_per_testcase(TestCase, Config) -> end_per_testcase(TestCase, Config) -> ct_test_support:end_per_testcase(TestCase, Config). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [all_suites, skip_all_suites, suite, skip_suite, diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index d592a20bb0..2438fad6ca 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(andor_SUITE), diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index 8a8c971837..f309042911 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(apply_SUITE), diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 2699e90bb4..7fca737a20 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(beam_validator_SUITE), diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl index c5a054aba6..28801bd7d0 100644 --- a/lib/compiler/test/bs_bincomp_SUITE.erl +++ b/lib/compiler/test/bs_bincomp_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(bs_bincomp_SUITE), diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 1b5a4a9666..052289e00c 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -30,7 +30,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(bs_bit_binaries_SUITE), diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index 0d6582d16f..fe72fbb143 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(bs_construct_SUITE), diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 6cc5a35b5e..d674f273f0 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -40,7 +40,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(bs_match_SUITE), diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index db38fa0fa3..af57688347 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(bs_utf_SUITE), diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 746c74f6a9..6cd133ee39 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -24,7 +24,7 @@ -compile(export_all). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(compilation_SUITE), diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index 96456211a2..a9ba4b0b86 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -33,7 +33,7 @@ -export([init/3]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. %% To cover the stripping of 'type' and 'spec' in beam_asm. -type all_return_type() :: [atom()]. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 8d472ec44b..c5969b5580 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(core_SUITE), diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 8491c4eaf0..c13e4d2162 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(core_fold_SUITE), diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index dc051fbd98..2bb3fea438 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -24,7 +24,7 @@ init_per_group/2,end_per_group/2, head_mismatch_line/1,warnings_as_errors/1, bif_clashes/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(error_SUITE), diff --git a/lib/compiler/test/float_SUITE.erl b/lib/compiler/test/float_SUITE.erl index b963634aec..cad144ea63 100644 --- a/lib/compiler/test/float_SUITE.erl +++ b/lib/compiler/test/float_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(float_SUITE), diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index 810d98b5aa..dbf2416f3c 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -24,7 +24,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(fun_SUITE), diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 60b53efa47..7201edf4ac 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -34,7 +34,7 @@ basic_andalso_orelse/1,traverse_dcd/1, check_qlc_hrl/1,andalso_semi/1,t_tuple_size/1,binary_part/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(guard_SUITE), diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index ec86daea9b..6684b82751 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -28,7 +28,7 @@ %% Needed by test case `lists'. -compile(inline_list_funcs). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(inline_SUITE), diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index 2f95ca9d76..6dd950eade 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(lc_SUITE), diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 3cd519a6ef..b9b9fdd158 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -26,7 +26,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(match_SUITE), diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index d80eabd1e7..bf8d6c7b7c 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -52,7 +52,7 @@ end_per_testcase(Case, Config) when is_atom(Case), is_list(Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. -spec all() -> misc_SUITE_test_cases(). all() -> diff --git a/lib/compiler/test/num_bif_SUITE.erl b/lib/compiler/test/num_bif_SUITE.erl index 8534b63602..29610aec6e 100644 --- a/lib/compiler/test/num_bif_SUITE.erl +++ b/lib/compiler/test/num_bif_SUITE.erl @@ -37,7 +37,7 @@ t_list_to_float_safe/1, t_list_to_float_risky/1, t_round/1, t_trunc/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(num_bif_SUITE), diff --git a/lib/compiler/test/parteval_SUITE.erl b/lib/compiler/test/parteval_SUITE.erl index 8d7542516c..b8faaf5f87 100644 --- a/lib/compiler/test/parteval_SUITE.erl +++ b/lib/compiler/test/parteval_SUITE.erl @@ -23,7 +23,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, pe2/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [pe2]. diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index 3479bf9270..f9fcae6ba8 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(pmod_SUITE), diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 12aa81a30c..bf6f289656 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -36,7 +36,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(receive_SUITE), diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index 07add97246..6f85adbb77 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(record_SUITE), diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index 61cb87799e..db438e28f8 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(trycatch_SUITE), diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index 8f827de428..75e2b17de4 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(warnings_SUITE), diff --git a/lib/cosEvent/test/event_channel_SUITE.erl b/lib/cosEvent/test/event_channel_SUITE.erl index 742a85af78..6c7194e8c7 100644 --- a/lib/cosEvent/test/event_channel_SUITE.erl +++ b/lib/cosEvent/test/event_channel_SUITE.erl @@ -62,7 +62,7 @@ %% Internal exports %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosEvent/test/generated_SUITE.erl b/lib/cosEvent/test/generated_SUITE.erl index c21c4b1e45..b3c8f91267 100644 --- a/lib/cosEvent/test/generated_SUITE.erl +++ b/lib/cosEvent/test/generated_SUITE.erl @@ -84,7 +84,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['CosEventChannelAdmin_AlreadyConnected', diff --git a/lib/cosEventDomain/test/event_domain_SUITE.erl b/lib/cosEventDomain/test/event_domain_SUITE.erl index b3bb109b3c..2793f94639 100644 --- a/lib/cosEventDomain/test/event_domain_SUITE.erl +++ b/lib/cosEventDomain/test/event_domain_SUITE.erl @@ -65,7 +65,7 @@ %% Internal exports %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosEventDomain/test/generated_SUITE.erl b/lib/cosEventDomain/test/generated_SUITE.erl index c810e84605..575568a7b9 100644 --- a/lib/cosEventDomain/test/generated_SUITE.erl +++ b/lib/cosEventDomain/test/generated_SUITE.erl @@ -83,7 +83,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['CosEventDomainAdmin', diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl index 63eeb517bf..1e27139ed1 100644 --- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl +++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl @@ -93,7 +93,7 @@ %% Returns: %%----------------------------------------------------------------- suite() -> - [{suite_callbacks,[ts_install_scb]}]. + [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl index ff0888366f..ee521d4111 100644 --- a/lib/cosNotification/test/eventDB_SUITE.erl +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -271,7 +271,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl index 5002d2dd8e..20abfde018 100644 --- a/lib/cosNotification/test/generated_SUITE.erl +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -84,7 +84,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['CosNotification', diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl index 69aac76506..6dbd353dbe 100644 --- a/lib/cosNotification/test/grammar_SUITE.erl +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -77,7 +77,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl index bce3a5d6d4..99a3f62bc2 100644 --- a/lib/cosNotification/test/notification_SUITE.erl +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -138,7 +138,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosProperty/test/generated_SUITE.erl b/lib/cosProperty/test/generated_SUITE.erl index 8abb12b43f..63c0c0dd6a 100644 --- a/lib/cosProperty/test/generated_SUITE.erl +++ b/lib/cosProperty/test/generated_SUITE.erl @@ -84,7 +84,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['CosPropertyService_ConflictingProperty', diff --git a/lib/cosProperty/test/property_SUITE.erl b/lib/cosProperty/test/property_SUITE.erl index 3a40f217ea..df6b56113e 100644 --- a/lib/cosProperty/test/property_SUITE.erl +++ b/lib/cosProperty/test/property_SUITE.erl @@ -99,7 +99,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosTime/test/generated_SUITE.erl b/lib/cosTime/test/generated_SUITE.erl index 0083d45a22..465d02288f 100644 --- a/lib/cosTime/test/generated_SUITE.erl +++ b/lib/cosTime/test/generated_SUITE.erl @@ -84,7 +84,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['TimeBase_IntervalT', 'TimeBase_UtcT', diff --git a/lib/cosTime/test/time_SUITE.erl b/lib/cosTime/test/time_SUITE.erl index 2b8fdcebdb..646097a086 100644 --- a/lib/cosTime/test/time_SUITE.erl +++ b/lib/cosTime/test/time_SUITE.erl @@ -77,7 +77,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/cosTransactions/test/generated_SUITE.erl b/lib/cosTransactions/test/generated_SUITE.erl index 20988b53f1..65a94266ab 100644 --- a/lib/cosTransactions/test/generated_SUITE.erl +++ b/lib/cosTransactions/test/generated_SUITE.erl @@ -85,7 +85,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['CosTransactions_Control', diff --git a/lib/cosTransactions/test/transactions_SUITE.erl b/lib/cosTransactions/test/transactions_SUITE.erl index 3727d94e67..27272eeb40 100644 --- a/lib/cosTransactions/test/transactions_SUITE.erl +++ b/lib/cosTransactions/test/transactions_SUITE.erl @@ -45,7 +45,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/crypto/test/blowfish_SUITE.erl b/lib/crypto/test/blowfish_SUITE.erl index 36fbc59f00..735433cd47 100644 --- a/lib/crypto/test/blowfish_SUITE.erl +++ b/lib/crypto/test/blowfish_SUITE.erl @@ -104,7 +104,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ecb, cbc, cfb64, ofb64]. diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index e145d61654..b29b067967 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -61,7 +61,7 @@ -export([hexstr2bin/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [link_test, md5, md5_update, md4, md4_update, md5_mac, diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl index 0c0eb78339..68b2f521d6 100644 --- a/lib/debugger/test/andor_SUITE.erl +++ b/lib/debugger/test/andor_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl index e361ebefbb..f341700c3b 100644 --- a/lib/debugger/test/bs_bincomp_SUITE.erl +++ b/lib/debugger/test/bs_bincomp_SUITE.erl @@ -41,7 +41,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [byte_aligned, bit_aligned, extended_byte_aligned, diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl index 3ea0b08600..c51e7fbf4c 100644 --- a/lib/debugger/test/bs_construct_SUITE.erl +++ b/lib/debugger/test/bs_construct_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl index bbe3728816..fe2a8d6698 100644 --- a/lib/debugger/test/bs_match_bin_SUITE.erl +++ b/lib/debugger/test/bs_match_bin_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl index 7a5b5c8f74..c667e7cbce 100644 --- a/lib/debugger/test/bs_match_int_SUITE.erl +++ b/lib/debugger/test/bs_match_int_SUITE.erl @@ -29,7 +29,7 @@ -import(lists, [seq/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cases()]. diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl index eec0973668..e7ea355c9d 100644 --- a/lib/debugger/test/bs_match_misc_SUITE.erl +++ b/lib/debugger/test/bs_match_misc_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl index 69362b7d14..282eebcd25 100644 --- a/lib/debugger/test/bs_match_tail_SUITE.erl +++ b/lib/debugger/test/bs_match_tail_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl index 3f85dd855a..b61638fa25 100644 --- a/lib/debugger/test/bs_utf_SUITE.erl +++ b/lib/debugger/test/bs_utf_SUITE.erl @@ -30,7 +30,7 @@ -include_lib("test_server/include/test_server.hrl"). -compile([no_jopt,time]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl index e98eeae92e..d881b9ab08 100644 --- a/lib/debugger/test/bug_SUITE.erl +++ b/lib/debugger/test/bug_SUITE.erl @@ -27,7 +27,7 @@ -export([otp2163/1, otp4845/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, ticket_tests}]. diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl index 532ded06f6..e59c23442a 100644 --- a/lib/debugger/test/dbg_ui_SUITE.erl +++ b/lib/debugger/test/dbg_ui_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [dbg_ui, {group, manual_tests}]. diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl index 9ae255d2ea..747d9e343d 100644 --- a/lib/debugger/test/debugger_SUITE.erl +++ b/lib/debugger/test/debugger_SUITE.erl @@ -30,7 +30,7 @@ app_test/1,erts_debug/1,encrypted_debug_info/1, no_abstract_code/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test, erts_debug, no_abstract_code, diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl index b8d66d698d..67ca3d4867 100644 --- a/lib/debugger/test/erl_eval_SUITE.erl +++ b/lib/debugger/test/erl_eval_SUITE.erl @@ -71,7 +71,7 @@ end_per_testcase(_Case, Config) -> ok. -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [guard_1, guard_2, match_pattern, string_plusplus, diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl index cb7c55ee2a..e6d627b40e 100644 --- a/lib/debugger/test/exception_SUITE.erl +++ b/lib/debugger/test/exception_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl index 673de5bead..f56c6fe4bf 100644 --- a/lib/debugger/test/fun_SUITE.erl +++ b/lib/debugger/test/fun_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl index 36bd5c7137..dd8a2fe4d5 100644 --- a/lib/debugger/test/guard_SUITE.erl +++ b/lib/debugger/test/guard_SUITE.erl @@ -42,7 +42,7 @@ -export([init/4]). -import(lists, [member/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl index 3cfc90f01f..fb3a828fa1 100644 --- a/lib/debugger/test/int_SUITE.erl +++ b/lib/debugger/test/int_SUITE.erl @@ -60,7 +60,7 @@ end_per_testcase(_Case, Config) -> ?line test_server:timetrap_cancel(Dog), ?line ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [interpret, guards, {group, list_suite}, interpretable]. diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl index f8cd542e98..d2ffd2938d 100644 --- a/lib/debugger/test/int_break_SUITE.erl +++ b/lib/debugger/test/int_break_SUITE.erl @@ -31,7 +31,7 @@ -export([auto_attach/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, cleanup]. diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl index ab72715190..6051bfc5ed 100644 --- a/lib/debugger/test/int_eval_SUITE.erl +++ b/lib/debugger/test/int_eval_SUITE.erl @@ -37,7 +37,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}, +suite() -> [{ct_hooks,[ts_install_cth]}, {timetrap,{minutes,1}}]. all() -> diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl index 2a31143b4d..f8ab9311e9 100644 --- a/lib/debugger/test/lc_SUITE.erl +++ b/lib/debugger/test/lc_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl index e17ad74e5b..83351231d7 100644 --- a/lib/debugger/test/record_SUITE.erl +++ b/lib/debugger/test/record_SUITE.erl @@ -29,7 +29,7 @@ init_per_suite/1,end_per_suite/1, errors/1,record_test/1,eval_once/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl index 3d5dd9a615..aa9d898c02 100644 --- a/lib/debugger/test/trycatch_SUITE.erl +++ b/lib/debugger/test/trycatch_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/docbuilder/test/docb_SUITE.erl b/lib/docbuilder/test/docb_SUITE.erl index ddce50c0fb..d286824539 100644 --- a/lib/docbuilder/test/docb_SUITE.erl +++ b/lib/docbuilder/test/docb_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("kernel/include/file.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [html]. diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl index 54b999d068..0d57591e3e 100644 --- a/lib/edoc/test/edoc_SUITE.erl +++ b/lib/edoc/test/edoc_SUITE.erl @@ -26,7 +26,7 @@ %% Test cases -export([build_std/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [build_std]. diff --git a/lib/erl_interface/test/ei_accept_SUITE.erl b/lib/erl_interface/test/ei_accept_SUITE.erl index c75916cbe5..d3d37fce6c 100644 --- a/lib/erl_interface/test/ei_accept_SUITE.erl +++ b/lib/erl_interface/test/ei_accept_SUITE.erl @@ -30,7 +30,7 @@ -import(runner, [get_term/1,send_term/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ei_accept, ei_threaded_accept]. diff --git a/lib/erl_interface/test/ei_connect_SUITE.erl b/lib/erl_interface/test/ei_connect_SUITE.erl index 314ac1c140..47247dd891 100644 --- a/lib/erl_interface/test/ei_connect_SUITE.erl +++ b/lib/erl_interface/test/ei_connect_SUITE.erl @@ -41,7 +41,7 @@ -import(runner, [get_term/1,send_term/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ei_send, ei_reg_send, ei_rpc, ei_format_pid, ei_send_funs, diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl index d032303ef8..8a653078a7 100644 --- a/lib/erl_interface/test/ei_decode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_SUITE.erl @@ -36,7 +36,7 @@ test_ei_decode_misc/1 ]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test_ei_decode_long, test_ei_decode_ulong, diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl index 3b37b2ba5d..0a1eda41e1 100644 --- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl @@ -30,7 +30,7 @@ test_ei_decode_encode/1 ]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test_ei_decode_encode]. diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl index 5551913c30..1674274bc9 100644 --- a/lib/erl_interface/test/ei_encode_SUITE.erl +++ b/lib/erl_interface/test/ei_encode_SUITE.erl @@ -36,7 +36,7 @@ test_ei_encode_fails/1 ]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test_ei_encode_long, test_ei_encode_ulong, diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl index 106282cef7..a6eafc79cf 100644 --- a/lib/erl_interface/test/ei_format_SUITE.erl +++ b/lib/erl_interface/test/ei_format_SUITE.erl @@ -38,7 +38,7 @@ %% This test suite test the erl_format() function. %% It uses the port program "ei_format_test". -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [format_wo_ver, atoms, tuples, lists]. diff --git a/lib/erl_interface/test/ei_print_SUITE.erl b/lib/erl_interface/test/ei_print_SUITE.erl index 7f5b011c23..7e656650a8 100644 --- a/lib/erl_interface/test/ei_print_SUITE.erl +++ b/lib/erl_interface/test/ei_print_SUITE.erl @@ -32,7 +32,7 @@ %% This test suite test the ei_print() function. %% It uses the port program "ei_format_test". -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [atoms, tuples, lists, strings]. diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl index cf8d273f90..52cf2b160d 100644 --- a/lib/erl_interface/test/ei_tmo_SUITE.erl +++ b/lib/erl_interface/test/ei_tmo_SUITE.erl @@ -32,7 +32,7 @@ framework_check/1, ei_accept_tmo/1, ei_connect_tmo/1, ei_send_tmo/1, ei_recv_tmo/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [framework_check, ei_accept_tmo, ei_connect_tmo, diff --git a/lib/erl_interface/test/erl_connect_SUITE.erl b/lib/erl_interface/test/erl_connect_SUITE.erl index 2d60ce5204..0483a393d4 100644 --- a/lib/erl_interface/test/erl_connect_SUITE.erl +++ b/lib/erl_interface/test/erl_connect_SUITE.erl @@ -30,7 +30,7 @@ -import(runner, [get_term/1,send_term/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [erl_send, erl_reg_send, erl_send_cookie_file]. diff --git a/lib/erl_interface/test/erl_eterm_SUITE.erl b/lib/erl_interface/test/erl_eterm_SUITE.erl index 860d080acf..21de1efa2e 100644 --- a/lib/erl_interface/test/erl_eterm_SUITE.erl +++ b/lib/erl_interface/test/erl_eterm_SUITE.erl @@ -75,7 +75,7 @@ %% This test suite controls the running of the C language functions %% in eterm_test.c and print_term.c. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [build_terms, round_trip_conversion, decode_terms, diff --git a/lib/erl_interface/test/erl_ext_SUITE.erl b/lib/erl_interface/test/erl_ext_SUITE.erl index ddf9970df8..38b01e73cf 100644 --- a/lib/erl_interface/test/erl_ext_SUITE.erl +++ b/lib/erl_interface/test/erl_ext_SUITE.erl @@ -35,7 +35,7 @@ -import(runner, [get_term/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [compare_tuple, compare_list, compare_string, diff --git a/lib/erl_interface/test/erl_format_SUITE.erl b/lib/erl_interface/test/erl_format_SUITE.erl index 00f4a2ada0..9905669ef9 100644 --- a/lib/erl_interface/test/erl_format_SUITE.erl +++ b/lib/erl_interface/test/erl_format_SUITE.erl @@ -31,7 +31,7 @@ %% This test suite test the erl_format() function. %% It uses the port program "format_test". -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [atoms, tuples, lists]. diff --git a/lib/erl_interface/test/erl_global_SUITE.erl b/lib/erl_interface/test/erl_global_SUITE.erl index 3d080f482d..604d72dd24 100644 --- a/lib/erl_interface/test/erl_global_SUITE.erl +++ b/lib/erl_interface/test/erl_global_SUITE.erl @@ -34,7 +34,7 @@ all() -> [erl_global_registration, erl_global_whereis, erl_global_names]. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. init_per_suite(Config) -> Config. diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl index 1f0a274c14..da5788722c 100644 --- a/lib/erl_interface/test/erl_match_SUITE.erl +++ b/lib/erl_interface/test/erl_match_SUITE.erl @@ -33,7 +33,7 @@ %% This test suite tests the erl_match() function. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [atoms, lists, tuples, references, pids, ports, bind, diff --git a/lib/erl_interface/test/port_call_SUITE.erl b/lib/erl_interface/test/port_call_SUITE.erl index 1bd47b33d3..33755c3431 100644 --- a/lib/erl_interface/test/port_call_SUITE.erl +++ b/lib/erl_interface/test/port_call_SUITE.erl @@ -36,7 +36,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic]. diff --git a/lib/et/test/et_wx_SUITE.erl b/lib/et/test/et_wx_SUITE.erl index b1e805e2c8..6109ed4e04 100644 --- a/lib/et/test/et_wx_SUITE.erl +++ b/lib/et/test/et_wx_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(Func,Config) -> et_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_all_windows]. diff --git a/lib/eunit/test/eunit_SUITE.erl b/lib/eunit/test/eunit_SUITE.erl index 02c32aebd5..0f57905d17 100644 --- a/lib/eunit/test/eunit_SUITE.erl +++ b/lib/eunit/test/eunit_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("common_test/include/ct.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [eunit_test]. diff --git a/lib/ic/test/c_client_erl_server_SUITE.erl b/lib/ic/test/c_client_erl_server_SUITE.erl index 60ea6c50e8..038172c311 100644 --- a/lib/ic/test/c_client_erl_server_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_SUITE.erl @@ -65,7 +65,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [void_test, long_test, long_long_test, diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_SUITE.erl index 5f298fcd51..172e4de6d1 100644 --- a/lib/ic/test/c_client_erl_server_proto_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [void_test, long_test, long_long_test, diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl index 2532bc9b46..53bf99c917 100644 --- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl +++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [void_test, long_test, long_long_test, diff --git a/lib/ic/test/erl_client_c_server_SUITE.erl b/lib/ic/test/erl_client_c_server_SUITE.erl index 8ed995656e..a42dbb9604 100644 --- a/lib/ic/test/erl_client_c_server_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_SUITE.erl @@ -63,7 +63,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [void_test, long_test, longlong_test, ushort_test, diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE.erl b/lib/ic/test/erl_client_c_server_proto_SUITE.erl index 6bee7adc3b..c8ad4042e4 100644 --- a/lib/ic/test/erl_client_c_server_proto_SUITE.erl +++ b/lib/ic/test/erl_client_c_server_proto_SUITE.erl @@ -63,7 +63,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [void_test, long_test, longlong_test, ushort_test, diff --git a/lib/ic/test/ic_SUITE.erl b/lib/ic/test/ic_SUITE.erl index 84ddc89454..6a9d1325e1 100644 --- a/lib/ic/test/ic_SUITE.erl +++ b/lib/ic/test/ic_SUITE.erl @@ -87,7 +87,7 @@ %% Top of cases -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test, {group, const}, {group, union}, diff --git a/lib/ic/test/ic_be_SUITE.erl b/lib/ic/test/ic_be_SUITE.erl index 1f9c830776..3693d22cd2 100644 --- a/lib/ic/test/ic_be_SUITE.erl +++ b/lib/ic/test/ic_be_SUITE.erl @@ -34,7 +34,7 @@ %% Top of cases -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [plain]. diff --git a/lib/ic/test/ic_pp_SUITE.erl b/lib/ic/test/ic_pp_SUITE.erl index b36b14fd5d..27d404239f 100644 --- a/lib/ic/test/ic_pp_SUITE.erl +++ b/lib/ic/test/ic_pp_SUITE.erl @@ -54,7 +54,7 @@ -export([cases/0, init_per_suite/1, end_per_suite/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/ic/test/ic_pragma_SUITE.erl b/lib/ic/test/ic_pragma_SUITE.erl index e825287945..65fda2e3b9 100644 --- a/lib/ic/test/ic_pragma_SUITE.erl +++ b/lib/ic/test/ic_pragma_SUITE.erl @@ -54,7 +54,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/ic/test/ic_register_SUITE.erl b/lib/ic/test/ic_register_SUITE.erl index 8cc6394077..6a9dea5a3d 100644 --- a/lib/ic/test/ic_register_SUITE.erl +++ b/lib/ic/test/ic_register_SUITE.erl @@ -58,7 +58,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index bde78f709f..bd87ce24d9 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -38,7 +38,7 @@ %% Top of cases -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl index 32501af362..7059bb12cf 100644 --- a/lib/inets/test/ftp_SUITE.erl +++ b/lib/inets/test/ftp_SUITE.erl @@ -57,7 +57,7 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, solaris8_test}, {group, solaris9_test}, diff --git a/lib/inets/test/ftp_format_SUITE.erl b/lib/inets/test/ftp_format_SUITE.erl index 488560b266..3a8cb9a3d0 100644 --- a/lib/inets/test/ftp_format_SUITE.erl +++ b/lib/inets/test/ftp_format_SUITE.erl @@ -35,7 +35,7 @@ ftp_other_status_codes/1, ftp_multiple_lines/1, ftp_multipel_ctrl_messages/1, format_error/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, ftp_response}, format_error]. diff --git a/lib/inets/test/http_format_SUITE.erl b/lib/inets/test/http_format_SUITE.erl index 61df8c396a..f05dfd78bc 100644 --- a/lib/inets/test/http_format_SUITE.erl +++ b/lib/inets/test/http_format_SUITE.erl @@ -37,7 +37,7 @@ esi_parse_headers/1, cgi_parse_headers/1, is_absolut_uri/1, convert_netscapecookie_date/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, chunk}, http_response, http_request, diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index e7bde8b541..aff20ff7cf 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -59,7 +59,7 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [proxy_options, proxy_head, proxy_get, proxy_trace, diff --git a/lib/inets/test/httpc_cookie_SUITE.erl b/lib/inets/test/httpc_cookie_SUITE.erl index c4d8a107d1..a9eddac6eb 100644 --- a/lib/inets/test/httpc_cookie_SUITE.erl +++ b/lib/inets/test/httpc_cookie_SUITE.erl @@ -116,7 +116,7 @@ end_per_testcase(Case, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [session_cookies_only, netscape_cookies, cookie_cancel, diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl index 02ee2d802e..95ee15d08f 100644 --- a/lib/inets/test/httpd_SUITE.erl +++ b/lib/inets/test/httpd_SUITE.erl @@ -238,7 +238,7 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, ip}, {group, ssl}, {group, http_1_1_ip}, diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index b52af364d4..dcea200a1a 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -26,7 +26,7 @@ -define(URL_START, "http://localhost:"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [uri_too_long_414, header_too_long_413, escaped_url_in_error_body]. diff --git a/lib/inets/test/inets_SUITE.erl b/lib/inets/test/inets_SUITE.erl index b67db0a7c5..8e3ba226b9 100644 --- a/lib/inets/test/inets_SUITE.erl +++ b/lib/inets/test/inets_SUITE.erl @@ -28,7 +28,7 @@ -define(NUM_DEFAULT_SERVICES, 1). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, app_test}, {group, appup_test}, diff --git a/lib/inets/test/inets_sup_SUITE.erl b/lib/inets/test/inets_sup_SUITE.erl index 181eb29f7b..fb29ab279f 100644 --- a/lib/inets/test/inets_sup_SUITE.erl +++ b/lib/inets/test/inets_sup_SUITE.erl @@ -26,7 +26,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [default_tree, ftpc_worker, tftpd_worker, httpd_subtree, diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index 606b829ca4..79e9682ca4 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -71,7 +71,7 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Top test case %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [simple, extra, reuse_connection, resend_client, diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl index e0704c3d2b..d59e3b5fa8 100644 --- a/lib/inviso/test/inviso_tool_SUITE.erl +++ b/lib/inviso/test/inviso_tool_SUITE.erl @@ -33,7 +33,7 @@ -define(l,?line). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [dist_basic_1, dist_rtc, dist_reconnect, dist_adopt, diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index b42101908e..e608bcb093 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -82,7 +82,7 @@ %%%----------------------------------------------------------------- %%% INIT/END %%%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> lists:append([fundamental(), ping(), send_receive(), diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index f9a588f32c..03f6f2036c 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -50,7 +50,7 @@ %% Top of cases -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [pid_roundtrip, port_roundtrip, ref_roundtrip, diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index c139c0eefe..2912735368 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -43,7 +43,7 @@ % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [failover, failover_comp, permissions, load, diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index 980d162f55..173051b693 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -49,7 +49,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, spawn_tests}, {group, spawn_link_tests}, diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 64c2878f9e..7b1e4fc522 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -43,7 +43,7 @@ handle_event/2, handle_call/2, handle_info/2, terminate/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [set_path, get_path, add_path, add_paths, del_path, diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index b5faf984ff..389a911d0b 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -143,7 +143,7 @@ change_size_after, default_size]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, halt_int}, {group, wrap_int}, diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index ad71e0c1bd..8399e8072f 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -33,7 +33,7 @@ %% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson. %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start, start_link, stop, add, delete, responses]. diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 4933137650..efce5bd476 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -58,7 +58,7 @@ %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [tick, tick_change, illegal_nodenames, hidden_node, diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index f61a8fe2cc..f712cdea46 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -78,7 +78,7 @@ -define(u32(X3,X2,X1,X0), (((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [whitebox, switch_options, missing_compulsory_dflags]. diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index e429986ca9..b990e76064 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -36,7 +36,7 @@ %% Test suite for erl_prim_loader. (Most code is run during system start/stop.) %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [get_path, set_path, get_file, inet_existing, diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index 57d7f07ebc..dca073cea0 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -39,7 +39,7 @@ terminate/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [error_report, info_report, error, info, emulator, tty, diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 3e76355dfd..5b8f0eb049 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -45,7 +45,7 @@ -define(default_timeout, ?t:minutes(1)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, warnings_info, warnings_warnings, rb_basic, diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 0e84cae7ca..d218589028 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -98,7 +98,7 @@ -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [altname, read_write_file, {group, dirs}, diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index 99996bd7bd..33c8e5bbe4 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -85,7 +85,7 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [normal, icky, very_icky, normalize]. diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 20b0d46d56..d3aa62d7ec 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -32,7 +32,7 @@ api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1, xfer_min/1,xfer_active/1,def_sndrcvinfo/1,implicit_inet6/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, api_open_close, api_listen, api_connect_init, diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 6fcc2bed40..c8fe602ac2 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -34,7 +34,7 @@ t_shutdown_write/1, t_shutdown_both/1, t_shutdown_error/1, t_fdopen/1, t_implicit_inet6/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, t_accept}, {group, t_connect}, {group, t_recv}, diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index bebd4fa880..830e2d9c39 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -33,7 +33,7 @@ -define(TPKT_VRSN, 3). -define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1 -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [active_echo, passive_echo, active_once_echo, diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index bd554ba486..c3ce6497bb 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -53,7 +53,7 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [controlling_process, no_accept, diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 50f8d55630..ee9288bc75 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -37,7 +37,7 @@ buffer_size/1, binary_passive_recv/1, bad_address/1, read_packets/1, open_fd/1, connect/1, implicit_inet6/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [send_to_closed, buffer_size, binary_passive_recv, diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 3cd47927c9..c88e0f60bb 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -60,7 +60,7 @@ -define(GLOBAL_LOCK, global). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case init:get_argument(ring_line) of diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index 859d0618e7..c113bbc0cb 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -35,7 +35,7 @@ -define(UNTIL(Seq), loop_until_true(fun() -> Seq end)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index 24e05b011a..e82eabe530 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -55,7 +55,7 @@ end_per_testcase(_Func, Config) -> %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start, restart, reboot, set_cmd, clear_cmd, kill_pid]. diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index d4dd98dd1e..622107fa84 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -43,7 +43,7 @@ kill_gethost/0, parallell_gethost/0]). -export([init_per_testcase/2, end_per_testcase/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_gethostbyaddr, t_gethostbyname, t_getaddr, diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index 1e5a62216f..0c3c7c950c 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -41,7 +41,7 @@ -define(RUN_NAMED, "run-named"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, resolve, edns0, txt_record, files_monitor, diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index 2c192aa383..1ef182ca18 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -58,7 +58,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [simple, loop_all, simple_raw, simple_raw_getbin, diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index 90f1334f1c..18bb5c7087 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -39,7 +39,7 @@ %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [get_arguments, get_argument, boot_var, diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index f6fac3983d..66a01b1849 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -46,7 +46,7 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [get_columns_and_rows, exit_initial, job_control_local, diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 02bb3ced08..02b6edf0bd 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -37,7 +37,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test]. diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index 554b782797..deef248956 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -24,7 +24,7 @@ -export([init_per_suite/1, end_per_suite/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [sync]. diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index 8541170893..ecb9a111f6 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -25,7 +25,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [space_in_cwd, quoting, space_in_name, bad_command, diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index f8091a5d17..d41ad41350 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [simple, complicated, heavy, info]. diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index 048a73b8cb..5dc32440a0 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, tickets}]. diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index ad259ec2ec..3013af70f6 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -67,7 +67,7 @@ _ -> apply(?PRIM_FILE, F, [H | A]) end). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [read_write_file, {group, dirs}, {group, files}, diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index 6cda16f1f2..5f9ccaa34f 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -35,7 +35,7 @@ %%-------------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [open_modes, open_old_modes, pread_pwrite, position, diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 6ea2bd194a..895441251a 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [call, block_call, multicall, multicall_timeout, diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index 7cb67b261a..9637e18959 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -36,7 +36,7 @@ -define(default_timeout, ?t:minutes(1)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [token_set_get, tracer_set_get, print, send, diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index adf13c2d8f..b4a9b578eb 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -46,7 +46,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [no_file, {group, one}, {group, two}, {group, four}, diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index 6ec38ddc86..170f685390 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -69,7 +69,7 @@ error(Format, Args, File, Line) -> %% end, %% log("<>ERROR<>~n" ++ Format, Args, File, Line). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, api}, {group, examples}, {group, func}, smp, diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index a0b3f1aa01..4faa6736e6 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -46,7 +46,7 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -suite() -> [{suite_callbacks,[{ts_install_scb,[{nodenames,1}]}]}]. +suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,1}]}]}]. all() -> [{group, app_test}, {group, appup_test}, diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 83175b04c3..fe7d366eb3 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -30,7 +30,7 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[{ts_install_scb,[{nodenames,1}]}]}]. +suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,1}]}]}]. %% Verify that Mnesia really is a distributed real-time DBMS. diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index 6f89fabd13..1a7e6f61fe 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -47,7 +47,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [translate, load_file, non_existing, not_a_crashdump, diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index cecea302ea..ab2a6f5d18 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -36,7 +36,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [text, text_tracing_off]. diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index 05ac562b81..46d4612706 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -40,7 +40,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_file]. diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 9b5ec88ad6..14bd1e9c33 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [file, file_no_pi, file_fetch, wrap, wrap_merge, diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl index b080984f4a..fd7693de3a 100644 --- a/lib/odbc/test/odbc_connect_SUITE.erl +++ b/lib/odbc/test/odbc_connect_SUITE.erl @@ -41,7 +41,7 @@ %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case odbc_test_lib:odbc_check() of diff --git a/lib/odbc/test/odbc_data_type_SUITE.erl b/lib/odbc/test/odbc_data_type_SUITE.erl index 75484b177e..83bb821e2b 100644 --- a/lib/odbc/test/odbc_data_type_SUITE.erl +++ b/lib/odbc/test/odbc_data_type_SUITE.erl @@ -39,7 +39,7 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case odbc_test_lib:odbc_check() of diff --git a/lib/odbc/test/odbc_query_SUITE.erl b/lib/odbc/test/odbc_query_SUITE.erl index a4abb3edbb..5c8126ace6 100644 --- a/lib/odbc/test/odbc_query_SUITE.erl +++ b/lib/odbc/test/odbc_query_SUITE.erl @@ -38,7 +38,7 @@ %% Description: Returns documentation/test cases in this test suite %% or a skip tuple if the platform is not supported. %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case odbc_test_lib:odbc_check() of diff --git a/lib/odbc/test/odbc_start_SUITE.erl b/lib/odbc/test/odbc_start_SUITE.erl index 1171408547..902e77d210 100644 --- a/lib/odbc/test/odbc_start_SUITE.erl +++ b/lib/odbc/test/odbc_start_SUITE.erl @@ -98,7 +98,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case odbc_test_lib:odbc_check() of diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl index 05820bfca9..666f474e90 100644 --- a/lib/orber/test/cdrcoding_10_SUITE.erl +++ b/lib/orber/test/cdrcoding_10_SUITE.erl @@ -48,7 +48,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl index dc981c70df..273c94a79e 100644 --- a/lib/orber/test/cdrcoding_11_SUITE.erl +++ b/lib/orber/test/cdrcoding_11_SUITE.erl @@ -48,7 +48,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl index af760c6999..3a2d995b99 100644 --- a/lib/orber/test/cdrcoding_12_SUITE.erl +++ b/lib/orber/test/cdrcoding_12_SUITE.erl @@ -49,7 +49,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/cdrlib_SUITE.erl b/lib/orber/test/cdrlib_SUITE.erl index 763b433589..faf06904f0 100644 --- a/lib/orber/test/cdrlib_SUITE.erl +++ b/lib/orber/test/cdrlib_SUITE.erl @@ -45,7 +45,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [short, ushort, long, ulong, longlong, ulonglong, diff --git a/lib/orber/test/corba_SUITE.erl b/lib/orber/test/corba_SUITE.erl index aadb533fe4..1b28228375 100644 --- a/lib/orber/test/corba_SUITE.erl +++ b/lib/orber/test/corba_SUITE.erl @@ -64,7 +64,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index b95302e47f..e7c79b9e84 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -317,7 +317,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/data_types_SUITE.erl b/lib/orber/test/data_types_SUITE.erl index 534fa8ee98..45a8af9415 100644 --- a/lib/orber/test/data_types_SUITE.erl +++ b/lib/orber/test/data_types_SUITE.erl @@ -61,7 +61,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [fixed_type, any_type]. diff --git a/lib/orber/test/generated_SUITE.erl b/lib/orber/test/generated_SUITE.erl index 28387ad2f8..29f0a54aed 100644 --- a/lib/orber/test/generated_SUITE.erl +++ b/lib/orber/test/generated_SUITE.erl @@ -85,7 +85,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port, diff --git a/lib/orber/test/interceptors_SUITE.erl b/lib/orber/test/interceptors_SUITE.erl index 3d45c4b047..487cfd0aec 100644 --- a/lib/orber/test/interceptors_SUITE.erl +++ b/lib/orber/test/interceptors_SUITE.erl @@ -79,7 +79,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [local_pseudo, local_default, local_local, local_global]. diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl index d232b6d032..50d657ea4e 100644 --- a/lib/orber/test/iop_ior_10_SUITE.erl +++ b/lib/orber/test/iop_ior_10_SUITE.erl @@ -47,7 +47,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl index f1f7cbc867..38112cc335 100644 --- a/lib/orber/test/iop_ior_11_SUITE.erl +++ b/lib/orber/test/iop_ior_11_SUITE.erl @@ -47,7 +47,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl index d7e3cf05f6..3baea074c2 100644 --- a/lib/orber/test/iop_ior_12_SUITE.erl +++ b/lib/orber/test/iop_ior_12_SUITE.erl @@ -48,7 +48,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [encoding, create_and_get_ops]. diff --git a/lib/orber/test/lname_SUITE.erl b/lib/orber/test/lname_SUITE.erl index 4c973502e3..5e283d7bba 100644 --- a/lib/orber/test/lname_SUITE.erl +++ b/lib/orber/test/lname_SUITE.erl @@ -48,7 +48,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [lname_component, lname]. diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl index 9946f55bc2..6ac514eb77 100644 --- a/lib/orber/test/multi_ORB_SUITE.erl +++ b/lib/orber/test/multi_ORB_SUITE.erl @@ -87,7 +87,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/naming_context_SUITE.erl b/lib/orber/test/naming_context_SUITE.erl index d9a78861ed..5250beacbe 100644 --- a/lib/orber/test/naming_context_SUITE.erl +++ b/lib/orber/test/naming_context_SUITE.erl @@ -76,7 +76,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl index f481914ccd..a55705e550 100644 --- a/lib/orber/test/orber_SUITE.erl +++ b/lib/orber/test/orber_SUITE.erl @@ -36,7 +36,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test, undefined_functions, install_load_order, diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl index 9af85af1ff..9e69457d6e 100644 --- a/lib/orber/test/orber_acl_SUITE.erl +++ b/lib/orber/test/orber_acl_SUITE.erl @@ -59,7 +59,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ipv4_verify, ipv4_range, ipv4_interfaces, ipv4_bm, diff --git a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl index 3a18eb534a..e2c73c2fd0 100644 --- a/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_in_SUITE.erl @@ -61,7 +61,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl index 986cb4549b..ac6c7327a1 100644 --- a/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv4_out_SUITE.erl @@ -61,7 +61,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl index aefd0bcd39..2888565c54 100644 --- a/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_in_SUITE.erl @@ -61,7 +61,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl index bcf347dbc7..f0a865adcb 100644 --- a/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl +++ b/lib/orber/test/orber_firewall_ipv6_out_SUITE.erl @@ -61,7 +61,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_nat_SUITE.erl b/lib/orber/test/orber_nat_SUITE.erl index 7a1cfa5db3..264a8ec523 100644 --- a/lib/orber/test/orber_nat_SUITE.erl +++ b/lib/orber/test/orber_nat_SUITE.erl @@ -69,7 +69,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> cases(). diff --git a/lib/orber/test/orber_web_SUITE.erl b/lib/orber/test/orber_web_SUITE.erl index 2c11cf2c21..ed5c0cbfa0 100644 --- a/lib/orber/test/orber_web_SUITE.erl +++ b/lib/orber/test/orber_web_SUITE.erl @@ -78,7 +78,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [menu, configure, info, nameservice, ifr_select, diff --git a/lib/orber/test/tc_SUITE.erl b/lib/orber/test/tc_SUITE.erl index 0ae4d989b0..9e6ee4eb90 100644 --- a/lib/orber/test/tc_SUITE.erl +++ b/lib/orber/test/tc_SUITE.erl @@ -141,7 +141,7 @@ %% Args: %% Returns: %%----------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [null, void, short, ushort, long, ulong, longlong, diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl index 73dc901e8a..174317527c 100644 --- a/lib/os_mon/test/cpu_sup_SUITE.erl +++ b/lib/os_mon/test/cpu_sup_SUITE.erl @@ -56,7 +56,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:os_type() of diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index f7fa5bb237..6e015ef74a 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -50,7 +50,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> Bugs = [otp_5910], diff --git a/lib/os_mon/test/memsup_SUITE.erl b/lib/os_mon/test/memsup_SUITE.erl index d3aaa64233..afc14d1c83 100644 --- a/lib/os_mon/test/memsup_SUITE.erl +++ b/lib/os_mon/test/memsup_SUITE.erl @@ -49,7 +49,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), Config. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> All = case test_server:os_type() of diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl index a2f5317daf..dd0ab0fbba 100644 --- a/lib/os_mon/test/os_mon_SUITE.erl +++ b/lib/os_mon/test/os_mon_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:os_type() of diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl index 5d3ac4b7bd..01feb3a57c 100644 --- a/lib/os_mon/test/os_mon_mib_SUITE.erl +++ b/lib/os_mon/test/os_mon_mib_SUITE.erl @@ -78,7 +78,7 @@ end_per_testcase(_Case, Config) when is_list(Config) -> test_server:timetrap_cancel(Dog), Config. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [load_unload, get_mem_sys_mark, get_mem_proc_mark, diff --git a/lib/os_mon/test/os_sup_SUITE.erl b/lib/os_mon/test/os_sup_SUITE.erl index c606001dbd..873db06317 100644 --- a/lib/os_mon/test/os_sup_SUITE.erl +++ b/lib/os_mon/test/os_sup_SUITE.erl @@ -63,7 +63,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:os_type() of diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl index d57a2acf76..066d221ae7 100644 --- a/lib/parsetools/test/leex_SUITE.erl +++ b/lib/parsetools/test/leex_SUITE.erl @@ -56,7 +56,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, checks}, {group, examples}]. diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl index 961fc0b05f..8e27ddb13d 100644 --- a/lib/parsetools/test/yecc_SUITE.erl +++ b/lib/parsetools/test/yecc_SUITE.erl @@ -62,7 +62,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test, {group, checks}, {group, examples}, diff --git a/lib/percept/test/egd_SUITE.erl b/lib/percept/test/egd_SUITE.erl index 948d12a7dd..39d87efcf8 100644 --- a/lib/percept/test/egd_SUITE.erl +++ b/lib/percept/test/egd_SUITE.erl @@ -54,7 +54,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [image_create_and_destroy, image_shape, diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl index 9909f1ff53..411fcd78f3 100644 --- a/lib/percept/test/percept_SUITE.erl +++ b/lib/percept/test/percept_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [webserver, profile, analyze, analyze_dist]. diff --git a/lib/public_key/test/pkits_SUITE.erl b/lib/public_key/test/pkits_SUITE.erl index c0a09d076a..fd976cb2f3 100644 --- a/lib/public_key/test/pkits_SUITE.erl +++ b/lib/public_key/test/pkits_SUITE.erl @@ -43,7 +43,7 @@ -define(NIST6, "2.16.840.1.101.3.2.1.48.6"). %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [signature_verification, validity_periods, diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index e56f117e83..d130196c15 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -99,7 +99,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app, pk_decode_encode, encrypt_decrypt, sign_verify, diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index 45709f8e7b..537a06315a 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -60,7 +60,7 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [fields, modules, export_all, app_depend, undef_funcs]. diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index 46374972bc..b9b53b5a59 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -47,7 +47,7 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_server, set_config, create_release, diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index f34df78fc0..56b0a3ed4a 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start_all_windows]. diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl index 8f31252aa5..8e01e75aba 100644 --- a/lib/runtime_tools/test/dbg_SUITE.erl +++ b/lib/runtime_tools/test/dbg_SUITE.erl @@ -41,7 +41,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [big, tiny, simple, message, distributed, ip_port, diff --git a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl index 0af2fb5c5b..d4957c060e 100644 --- a/lib/runtime_tools/test/erts_alloc_config_SUITE.erl +++ b/lib/runtime_tools/test/erts_alloc_config_SUITE.erl @@ -36,7 +36,7 @@ -define(DEFAULT_TIMEOUT, ?t:minutes(2)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic]. diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl index 348813c739..817ebfbbba 100644 --- a/lib/runtime_tools/test/inviso_SUITE.erl +++ b/lib/runtime_tools/test/inviso_SUITE.erl @@ -34,7 +34,7 @@ -define(l,?line). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic_dist_trace_1, basic_dist_trace_2, diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl index 61b1d79e54..4d46d75b62 100644 --- a/lib/runtime_tools/test/runtime_tools_SUITE.erl +++ b/lib/runtime_tools/test/runtime_tools_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_file]. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 7919519913..3f6473893b 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -54,7 +54,7 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, app}, {group, compiler}, {group, misc}, diff --git a/lib/ssl/test/old_ssl_active_SUITE.erl b/lib/ssl/test/old_ssl_active_SUITE.erl index 3b8326895d..a878c5af68 100644 --- a/lib/ssl/test/old_ssl_active_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_SUITE.erl @@ -52,7 +52,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cinit_return_chkclose, sinit_return_chkclose, diff --git a/lib/ssl/test/old_ssl_active_once_SUITE.erl b/lib/ssl/test/old_ssl_active_once_SUITE.erl index 9f2eef4d49..b68ff6c66a 100644 --- a/lib/ssl/test/old_ssl_active_once_SUITE.erl +++ b/lib/ssl/test/old_ssl_active_once_SUITE.erl @@ -52,7 +52,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [server_accept_timeout, cinit_return_chkclose, diff --git a/lib/ssl/test/old_ssl_dist_SUITE.erl b/lib/ssl/test/old_ssl_dist_SUITE.erl index 19a339e81d..6a072c9d98 100644 --- a/lib/ssl/test/old_ssl_dist_SUITE.erl +++ b/lib/ssl/test/old_ssl_dist_SUITE.erl @@ -46,7 +46,7 @@ -record(node_handle, {connection_handler, socket, name, nodename}). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic]. diff --git a/lib/ssl/test/old_ssl_misc_SUITE.erl b/lib/ssl/test/old_ssl_misc_SUITE.erl index 04760008c5..e1a21096bc 100644 --- a/lib/ssl/test/old_ssl_misc_SUITE.erl +++ b/lib/ssl/test/old_ssl_misc_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [seed, app]. diff --git a/lib/ssl/test/old_ssl_passive_SUITE.erl b/lib/ssl/test/old_ssl_passive_SUITE.erl index d7ed42148c..8bdadd4ea6 100644 --- a/lib/ssl/test/old_ssl_passive_SUITE.erl +++ b/lib/ssl/test/old_ssl_passive_SUITE.erl @@ -52,7 +52,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [server_accept_timeout, cinit_return_chkclose, diff --git a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl index 56404af1c3..54f06aec2f 100644 --- a/lib/ssl/test/old_ssl_peer_cert_SUITE.erl +++ b/lib/ssl/test/old_ssl_peer_cert_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cinit_plain, cinit_both_verify, cinit_cnocert]. diff --git a/lib/ssl/test/old_ssl_protocol_SUITE.erl b/lib/ssl/test/old_ssl_protocol_SUITE.erl index a957680e20..779491ee69 100644 --- a/lib/ssl/test/old_ssl_protocol_SUITE.erl +++ b/lib/ssl/test/old_ssl_protocol_SUITE.erl @@ -40,7 +40,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [sslv2, sslv3, tlsv1, sslv2_sslv3, sslv2_tlsv1, diff --git a/lib/ssl/test/old_ssl_verify_SUITE.erl b/lib/ssl/test/old_ssl_verify_SUITE.erl index 2bde2865f5..d388484141 100644 --- a/lib/ssl/test/old_ssl_verify_SUITE.erl +++ b/lib/ssl/test/old_ssl_verify_SUITE.erl @@ -42,7 +42,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cinit_both_verify, cinit_cnocert]. diff --git a/lib/ssl/test/old_transport_accept_SUITE.erl b/lib/ssl/test/old_transport_accept_SUITE.erl index bcb994e8ed..21ee0690b1 100644 --- a/lib/ssl/test/old_transport_accept_SUITE.erl +++ b/lib/ssl/test/old_transport_accept_SUITE.erl @@ -48,7 +48,7 @@ end_per_testcase(_Case, Config) -> WatchDog = ?config(watchdog, Config), test_server:timetrap_cancel(WatchDog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [config, echo_once, echo_twice, close_before_ssl_accept]. diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index b566fea91d..87d5fc8d71 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -200,7 +200,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app, alerts, connection_info, protocol_versions, diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl index 64b80233f7..1ecf55d6e8 100644 --- a/lib/ssl/test/ssl_packet_SUITE.erl +++ b/lib/ssl/test/ssl_packet_SUITE.erl @@ -118,7 +118,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [packet_raw_passive_many_small, diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl index 8f0553b445..f57d7fa0e8 100644 --- a/lib/ssl/test/ssl_payload_SUITE.erl +++ b/lib/ssl/test/ssl_payload_SUITE.erl @@ -99,7 +99,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [server_echos_passive_small, diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl index f08838db18..b47efe0941 100644 --- a/lib/ssl/test/ssl_session_cache_SUITE.erl +++ b/lib/ssl/test/ssl_session_cache_SUITE.erl @@ -145,7 +145,7 @@ end_per_testcase(_TestCase, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [session_cache_process_list, diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index e05dab8d87..4ab8fe3273 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -143,7 +143,7 @@ end_per_testcase(_, Config) -> %% Name of a test case. %% Description: Returns a list of all test cases in this test suite %%-------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [erlang_client_openssl_server, diff --git a/lib/stdlib/test/array_SUITE.erl b/lib/stdlib/test/array_SUITE.erl index 8846e1dd39..a8b252f081 100644 --- a/lib/stdlib/test/array_SUITE.erl +++ b/lib/stdlib/test/array_SUITE.erl @@ -65,7 +65,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [new_test, fix_test, relax_test, resize_test, diff --git a/lib/stdlib/test/base64_SUITE.erl b/lib/stdlib/test/base64_SUITE.erl index bf817b6ff9..c64a961ffa 100644 --- a/lib/stdlib/test/base64_SUITE.erl +++ b/lib/stdlib/test/base64_SUITE.erl @@ -45,7 +45,7 @@ end_per_testcase(_, Config) -> %%------------------------------------------------------------------------- %% Test cases starts here. %%------------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [base64_encode, base64_decode, base64_otp_5635, diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl index fbde73d4aa..994abebc1a 100644 --- a/lib/stdlib/test/beam_lib_SUITE.erl +++ b/lib/stdlib/test/beam_lib_SUITE.erl @@ -39,7 +39,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [error, normal, cmp, cmp_literals, strip, otp_6711, diff --git a/lib/stdlib/test/binary_module_SUITE.erl b/lib/stdlib/test/binary_module_SUITE.erl index 8874dfd50a..f6bf874741 100644 --- a/lib/stdlib/test/binary_module_SUITE.erl +++ b/lib/stdlib/test/binary_module_SUITE.erl @@ -64,7 +64,7 @@ end_per_testcase(_Case, Config) -> ok. -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [interesting, random_ref_fla_comp, random_ref_sr_comp, diff --git a/lib/stdlib/test/c_SUITE.erl b/lib/stdlib/test/c_SUITE.erl index badfe56b5b..e4c794ca84 100644 --- a/lib/stdlib/test/c_SUITE.erl +++ b/lib/stdlib/test/c_SUITE.erl @@ -26,7 +26,7 @@ -import(c, [c/2, nc/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory]. diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 438a9b4776..81b0299118 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -33,7 +33,7 @@ -define(START_YEAR, 1947). -define(END_YEAR, 2012). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [gregorian_days, gregorian_seconds, day_of_the_week, diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl index 1d4cecb18b..a37822ea9d 100644 --- a/lib/stdlib/test/dets_SUITE.erl +++ b/lib/stdlib/test/dets_SUITE.erl @@ -90,7 +90,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case os:type() of diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl index 6884acd2af..396a8d4763 100644 --- a/lib/stdlib/test/dict_SUITE.erl +++ b/lib/stdlib/test/dict_SUITE.erl @@ -31,7 +31,7 @@ -import(lists, [foldl/3,reverse/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [create, store]. diff --git a/lib/stdlib/test/digraph_SUITE.erl b/lib/stdlib/test/digraph_SUITE.erl index 07be45596e..4e7c468097 100644 --- a/lib/stdlib/test/digraph_SUITE.erl +++ b/lib/stdlib/test/digraph_SUITE.erl @@ -36,7 +36,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [opts, degree, path, cycle, {group, misc}, diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl index f3a9d485c2..28daf0f0fb 100644 --- a/lib/stdlib/test/digraph_utils_SUITE.erl +++ b/lib/stdlib/test/digraph_utils_SUITE.erl @@ -34,7 +34,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [simple, loop, isolated, topsort, subgraph, diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl index 1332a261ec..514d22c4d2 100644 --- a/lib/stdlib/test/edlin_expand_SUITE.erl +++ b/lib/stdlib/test/edlin_expand_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [normal, quoted_fun, quoted_module, quoted_both]. diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl index 2b5b1cedc8..195eeb5e89 100644 --- a/lib/stdlib/test/epp_SUITE.erl +++ b/lib/stdlib/test/epp_SUITE.erl @@ -60,7 +60,7 @@ end_per_testcase(_, Config) -> ok. -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [rec_1, {group, upcase_mac}, predef_mac, diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl index 1eb6a22e3c..6277b2c52e 100644 --- a/lib/stdlib/test/erl_eval_SUITE.erl +++ b/lib/stdlib/test/erl_eval_SUITE.erl @@ -72,7 +72,7 @@ end_per_testcase(_Case, Config) -> ok. -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [guard_1, guard_2, match_pattern, string_plusplus, diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl index bbd4d916cb..44c986640f 100644 --- a/lib/stdlib/test/erl_expand_records_SUITE.erl +++ b/lib/stdlib/test/erl_expand_records_SUITE.erl @@ -52,7 +52,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [abstract_module, attributes, expr, guard, init, diff --git a/lib/stdlib/test/erl_internal_SUITE.erl b/lib/stdlib/test/erl_internal_SUITE.erl index dd57f19547..678e22c252 100644 --- a/lib/stdlib/test/erl_internal_SUITE.erl +++ b/lib/stdlib/test/erl_internal_SUITE.erl @@ -27,7 +27,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [behav]. diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 96abb8c786..f980d52e4e 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -72,7 +72,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, unused_vars_warn}, export_vars_warn, diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl index 0ad979da68..e0f233fb2a 100644 --- a/lib/stdlib/test/erl_pp_SUITE.erl +++ b/lib/stdlib/test/erl_pp_SUITE.erl @@ -65,7 +65,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, expr}, {group, attributes}, hook, neg_indent, diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl index bbd704fbea..75e908e97c 100644 --- a/lib/stdlib/test/erl_scan_SUITE.erl +++ b/lib/stdlib/test/erl_scan_SUITE.erl @@ -56,7 +56,7 @@ end_per_testcase(_Case, Config) -> % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, error}, iso88591, otp_7810]. diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl index 2c2edf1a4e..447d6fb629 100644 --- a/lib/stdlib/test/escript_SUITE.erl +++ b/lib/stdlib/test/escript_SUITE.erl @@ -39,7 +39,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, errors, strange_name, emulator_flags, diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index b1a847f331..dba70d9f3f 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -117,7 +117,7 @@ end_per_testcase(_Func, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, new}, {group, insert}, {group, lookup}, diff --git a/lib/stdlib/test/ets_tough_SUITE.erl b/lib/stdlib/test/ets_tough_SUITE.erl index 00bac13680..0386a0272a 100644 --- a/lib/stdlib/test/ets_tough_SUITE.erl +++ b/lib/stdlib/test/ets_tough_SUITE.erl @@ -24,7 +24,7 @@ -compile([export_all]). -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [ex1]. diff --git a/lib/stdlib/test/file_sorter_SUITE.erl b/lib/stdlib/test/file_sorter_SUITE.erl index 9c960c0aa4..9ca2460a05 100644 --- a/lib/stdlib/test/file_sorter_SUITE.erl +++ b/lib/stdlib/test/file_sorter_SUITE.erl @@ -56,7 +56,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, badarg, term_sort, term_keysort, diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl index da957fd238..628e741870 100644 --- a/lib/stdlib/test/filelib_SUITE.erl +++ b/lib/stdlib/test/filelib_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [wildcard_one, wildcard_two, wildcard_errors, diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl index ad38c013c5..a72af3448b 100644 --- a/lib/stdlib/test/filename_SUITE.erl +++ b/lib/stdlib/test/filename_SUITE.erl @@ -30,7 +30,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [absname, absname_2, basename_1, basename_2, dirname, diff --git a/lib/stdlib/test/fixtable_SUITE.erl b/lib/stdlib/test/fixtable_SUITE.erl index e0e3d2f66b..c2160d8ba7 100644 --- a/lib/stdlib/test/fixtable_SUITE.erl +++ b/lib/stdlib/test/fixtable_SUITE.erl @@ -32,7 +32,7 @@ %%% Internal exports -export([command_loop/0,start_commander/0]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [multiple_fixes, multiple_processes, diff --git a/lib/stdlib/test/format_SUITE.erl b/lib/stdlib/test/format_SUITE.erl index 712147ff66..c1a896abe8 100644 --- a/lib/stdlib/test/format_SUITE.erl +++ b/lib/stdlib/test/format_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [hang_1]. diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl index cb2ffa8cf4..8fa2f4e3a3 100644 --- a/lib/stdlib/test/gen_event_SUITE.erl +++ b/lib/stdlib/test/gen_event_SUITE.erl @@ -27,7 +27,7 @@ notify/1, sync_notify/1, call/1, info/1, hibernate/1, call_format_status/1, error_format_status/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start, {group, test_all}, hibernate, diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl index 58545117fb..9d9e1f8dd8 100644 --- a/lib/stdlib/test/gen_fsm_SUITE.erl +++ b/lib/stdlib/test/gen_fsm_SUITE.erl @@ -54,7 +54,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, start}, {group, abnormal}, shutdown, diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl index 8615d5476e..5a248d7c10 100644 --- a/lib/stdlib/test/gen_server_SUITE.erl +++ b/lib/stdlib/test/gen_server_SUITE.erl @@ -46,7 +46,7 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, format_status/2]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [start, crash, call, cast, cast_fast, info, abcast, diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl index 6ecacb4dd6..da52f43728 100644 --- a/lib/stdlib/test/id_transform_SUITE.erl +++ b/lib/stdlib/test/id_transform_SUITE.erl @@ -32,7 +32,7 @@ -hej(hopp). -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [id_transform]. diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 98322c0b9c..497fd3c562 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -55,7 +55,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [error_1, float_g, otp_5403, otp_5813, otp_6230, diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl index 5456001f5c..3474f41ee6 100644 --- a/lib/stdlib/test/io_proto_SUITE.erl +++ b/lib/stdlib/test/io_proto_SUITE.erl @@ -84,7 +84,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [setopts_getopts, unicode_options, unicode_options_gen, diff --git a/lib/stdlib/test/lists_SUITE.erl b/lib/stdlib/test/lists_SUITE.erl index 1658446220..1fc9de09c3 100644 --- a/lib/stdlib/test/lists_SUITE.erl +++ b/lib/stdlib/test/lists_SUITE.erl @@ -77,7 +77,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, append}, reverse, member, keymember, diff --git a/lib/stdlib/test/log_mf_h_SUITE.erl b/lib/stdlib/test/log_mf_h_SUITE.erl index b17a54fe6c..688be31e64 100644 --- a/lib/stdlib/test/log_mf_h_SUITE.erl +++ b/lib/stdlib/test/log_mf_h_SUITE.erl @@ -24,7 +24,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, test/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [test]. diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl index 6212cc8641..f747d09f3c 100644 --- a/lib/stdlib/test/ms_transform_SUITE.erl +++ b/lib/stdlib/test/ms_transform_SUITE.erl @@ -49,7 +49,7 @@ end_per_testcase(_Func, Config) -> Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [from_shell, basic_ets, basic_dbg, records, diff --git a/lib/stdlib/test/proc_lib_SUITE.erl b/lib/stdlib/test/proc_lib_SUITE.erl index 8edc8a8098..25a385950e 100644 --- a/lib/stdlib/test/proc_lib_SUITE.erl +++ b/lib/stdlib/test/proc_lib_SUITE.erl @@ -45,7 +45,7 @@ -include_lib("test_server/include/test_server.hrl"). -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [crash, {group, sync_start}, spawn_opt, hibernate, diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl index f42ffe338c..05d8c5f8e3 100644 --- a/lib/stdlib/test/qlc_SUITE.erl +++ b/lib/stdlib/test/qlc_SUITE.erl @@ -116,7 +116,7 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, parse_transform}, {group, evaluation}, diff --git a/lib/stdlib/test/queue_SUITE.erl b/lib/stdlib/test/queue_SUITE.erl index d4deb7f000..4095b62643 100644 --- a/lib/stdlib/test/queue_SUITE.erl +++ b/lib/stdlib/test/queue_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [do, to_list, io_test, op_test, error, oops]. diff --git a/lib/stdlib/test/random_SUITE.erl b/lib/stdlib/test/random_SUITE.erl index 40df9e9de3..6164301e38 100644 --- a/lib/stdlib/test/random_SUITE.erl +++ b/lib/stdlib/test/random_SUITE.erl @@ -37,7 +37,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [interval_1, seed0, seed]. diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index 5124e8aed9..b82835854e 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -29,7 +29,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [pcre, compile_options, run_options, combined_options, diff --git a/lib/stdlib/test/select_SUITE.erl b/lib/stdlib/test/select_SUITE.erl index c46975c3b8..af67b798b0 100644 --- a/lib/stdlib/test/select_SUITE.erl +++ b/lib/stdlib/test/select_SUITE.erl @@ -72,7 +72,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [return_values, select_test]. diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl index eef1817bf1..bce23c7b12 100644 --- a/lib/stdlib/test/sets_SUITE.erl +++ b/lib/stdlib/test/sets_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [create, add_element, del_element, subtract, diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl index d44779e950..4f8c9dffd3 100644 --- a/lib/stdlib/test/shell_SUITE.erl +++ b/lib/stdlib/test/shell_SUITE.erl @@ -72,7 +72,7 @@ end_per_testcase(_Case, Config) -> ok. -endif. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [forget, records, known_bugs, otp_5226, otp_5327, diff --git a/lib/stdlib/test/slave_SUITE.erl b/lib/stdlib/test/slave_SUITE.erl index e5acef0513..12325dcca9 100644 --- a/lib/stdlib/test/slave_SUITE.erl +++ b/lib/stdlib/test/slave_SUITE.erl @@ -28,7 +28,7 @@ -export([fun_init/1, test_errors/1]). -export([timeout_test/1, auth_test/1, rsh_test/1, start_a_slave/3]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [t_start_link, start_link_nodedown, t_start, errors]. diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl index 5136e9f2e0..e1eaf7f8ec 100644 --- a/lib/stdlib/test/sofs_SUITE.erl +++ b/lib/stdlib/test/sofs_SUITE.erl @@ -86,7 +86,7 @@ -compile({inline,[{eval,2}]}). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, sofs}, {group, sofs_family}]. diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index cf59f34f52..f46493a2d8 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -39,7 +39,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test]. diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl index 1a7466759a..7e52441a67 100644 --- a/lib/stdlib/test/string_SUITE.erl +++ b/lib/stdlib/test/string_SUITE.erl @@ -41,7 +41,7 @@ %% %% all/1 %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [len, equal, concat, chr_rchr, str_rstr, span_cspan, diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 714db26fa3..82643e105f 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -56,7 +56,7 @@ %------------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, sup_start}, {group, sup_stop}, child_adm, diff --git a/lib/stdlib/test/supervisor_bridge_SUITE.erl b/lib/stdlib/test/supervisor_bridge_SUITE.erl index 79259cd4d5..407968747c 100644 --- a/lib/stdlib/test/supervisor_bridge_SUITE.erl +++ b/lib/stdlib/test/supervisor_bridge_SUITE.erl @@ -28,7 +28,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [starting, mini_terminate, mini_die, badstart]. diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl index 065494c6d7..dcb2380910 100644 --- a/lib/stdlib/test/sys_SUITE.erl +++ b/lib/stdlib/test/sys_SUITE.erl @@ -31,7 +31,7 @@ %% system messages at all. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [log, log_to_file, stats, trace, suspend, install]. diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index 8e4aff5403..84c3915749 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -28,7 +28,7 @@ -include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [borderline, atomic, long_names, create_long_names, diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl index b07d3edb66..cc05e3d832 100644 --- a/lib/stdlib/test/timer_SUITE.erl +++ b/lib/stdlib/test/timer_SUITE.erl @@ -51,7 +51,7 @@ %% amount of load. The test suite should also include tests that test the %% interface of the timer module. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [do_big_test]. diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl index bd978bfc25..afe6699920 100644 --- a/lib/stdlib/test/timer_simple_SUITE.erl +++ b/lib/stdlib/test/timer_simple_SUITE.erl @@ -55,7 +55,7 @@ -define(MAXREF, (1 bsl 18)). -define(REFMARG, 30). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [apply_after, send_after1, send_after2, send_after3, diff --git a/lib/stdlib/test/unicode_SUITE.erl b/lib/stdlib/test/unicode_SUITE.erl index 6050a619f6..3cca1ab894 100644 --- a/lib/stdlib/test/unicode_SUITE.erl +++ b/lib/stdlib/test/unicode_SUITE.erl @@ -39,7 +39,7 @@ end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [utf8_illegal_sequences_bif, diff --git a/lib/stdlib/test/win32reg_SUITE.erl b/lib/stdlib/test/win32reg_SUITE.erl index 8ba9142e57..f54cd2dcca 100644 --- a/lib/stdlib/test/win32reg_SUITE.erl +++ b/lib/stdlib/test/win32reg_SUITE.erl @@ -23,7 +23,7 @@ -include_lib("test_server/include/test_server.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [long, evil_write]. diff --git a/lib/stdlib/test/y2k_SUITE.erl b/lib/stdlib/test/y2k_SUITE.erl index ad364d8f34..0ea51355e2 100644 --- a/lib/stdlib/test/y2k_SUITE.erl +++ b/lib/stdlib/test/y2k_SUITE.erl @@ -31,7 +31,7 @@ date_2001_02_29/1, date_2004_02_29/1 ]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [date_1999_01_01, date_1999_02_28, date_1999_09_09, diff --git a/lib/stdlib/test/zip_SUITE.erl b/lib/stdlib/test/zip_SUITE.erl index 96c27cb13c..895019ab96 100644 --- a/lib/stdlib/test/zip_SUITE.erl +++ b/lib/stdlib/test/zip_SUITE.erl @@ -32,7 +32,7 @@ -include_lib("kernel/include/file.hrl"). -include_lib("stdlib/include/zip.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [borderline, atomic, bad_zip, unzip_from_binary, diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl index a4cfd89dd5..fd381f0b25 100644 --- a/lib/syntax_tools/test/syntax_tools_SUITE.erl +++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl @@ -26,7 +26,7 @@ %% Test cases -export([smoke_test/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [smoke_test]. diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index ce88e973ce..d9daff7a1f 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -38,7 +38,7 @@ %% y %%---------------------------------------------------------------------- -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case whereis(cover_server) of diff --git a/lib/tools/test/cprof_SUITE.erl b/lib/tools/test/cprof_SUITE.erl index 158a4c696a..b6f786d33f 100644 --- a/lib/tools/test/cprof_SUITE.erl +++ b/lib/tools/test/cprof_SUITE.erl @@ -81,7 +81,7 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(cprof_SUITE) of diff --git a/lib/tools/test/emem_SUITE.erl b/lib/tools/test/emem_SUITE.erl index b0812922ac..8b38e7d3a8 100644 --- a/lib/tools/test/emem_SUITE.erl +++ b/lib/tools/test/emem_SUITE.erl @@ -66,7 +66,7 @@ %% %% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case is_debug_compiled() of diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index 4f1ec94e3d..16246d5e0b 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -23,7 +23,7 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2,tiny/1,eed/1,basic/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [basic, tiny, eed]. diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl index 82a7e81d44..78de77526c 100644 --- a/lib/tools/test/fprof_SUITE.erl +++ b/lib/tools/test/fprof_SUITE.erl @@ -55,7 +55,7 @@ -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> case test_server:is_native(fprof_SUITE) of diff --git a/lib/tools/test/instrument_SUITE.erl b/lib/tools/test/instrument_SUITE.erl index 30a7b2b6df..6800a94f94 100644 --- a/lib/tools/test/instrument_SUITE.erl +++ b/lib/tools/test/instrument_SUITE.erl @@ -35,7 +35,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> ['+Mim true', '+Mis true']. diff --git a/lib/tools/test/lcnt_SUITE.erl b/lib/tools/test/lcnt_SUITE.erl index 2df78ee63b..21383fa544 100644 --- a/lib/tools/test/lcnt_SUITE.erl +++ b/lib/tools/test/lcnt_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [load_v1, conflicts, locations, swap_keys]. diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl index fa88a65443..524ed04af4 100644 --- a/lib/tools/test/make_SUITE.erl +++ b/lib/tools/test/make_SUITE.erl @@ -36,7 +36,7 @@ %% that the file :"test5.erl" shall be compiled with the 'S' option, %% i.e. produce "test5.S" instead of "test5." -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [make_all, make_files, {group, otp_6057}]. diff --git a/lib/tools/test/tools_SUITE.erl b/lib/tools/test/tools_SUITE.erl index 2ef69ce9e7..69dfab8fe7 100644 --- a/lib/tools/test/tools_SUITE.erl +++ b/lib/tools/test/tools_SUITE.erl @@ -32,7 +32,7 @@ %% Test cases must be exported. -export([app_test/1]). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [app_test]. diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl index e3e8ac3924..1fad070b67 100644 --- a/lib/tools/test/xref_SUITE.erl +++ b/lib/tools/test/xref_SUITE.erl @@ -69,7 +69,7 @@ -include_lib("tools/src/xref.hrl"). -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [{group, xref}, {group, files}, {group, analyses}, diff --git a/lib/wx/test/wx_app_SUITE.erl b/lib/wx/test/wx_app_SUITE.erl index 1bf5ca2224..9c1e5868f4 100644 --- a/lib/wx/test/wx_app_SUITE.erl +++ b/lib/wx/test/wx_app_SUITE.erl @@ -47,7 +47,7 @@ end_per_testcase(Func,Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [fields, modules, exportall, app_depend, undef_funcs]. diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl index 5b4c65827c..bdf54a1b35 100644 --- a/lib/wx/test/wx_basic_SUITE.erl +++ b/lib/wx/test/wx_basic_SUITE.erl @@ -44,7 +44,7 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [create_window, several_apps, wx_api, wx_misc, diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl index e3e4bdc646..9c9dcd3576 100644 --- a/lib/wx/test/wx_class_SUITE.erl +++ b/lib/wx/test/wx_class_SUITE.erl @@ -45,7 +45,7 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [calendarCtrl, treeCtrl, notebook, staticBoxSizer, diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index 21f928587b..3258f55e50 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -43,7 +43,7 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [connect, disconnect, connect_msg_20, connect_cb_20, diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index 03fe291577..93efa4c68f 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -51,7 +51,7 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [canvas, glu_tesselation]. diff --git a/lib/wx/test/wx_xtra_SUITE.erl b/lib/wx/test/wx_xtra_SUITE.erl index ecb43e4162..0d876c4e52 100644 --- a/lib/wx/test/wx_xtra_SUITE.erl +++ b/lib/wx/test/wx_xtra_SUITE.erl @@ -44,7 +44,7 @@ end_per_testcase(Func,Config) -> wx_test_lib:end_per_testcase(Func,Config). %% SUITE specification -suite() -> [{suite_callbacks,[ts_install_scb]}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [destroy_app, multiple_add_in_sizer, app_dies, -- cgit v1.2.3 From d1a2f287ee9059cb8f16e40c2808d98d09a74dd9 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 14 Feb 2011 16:55:27 +0100 Subject: Update gethostname test cases for v6 to use the v6 hosts instead of v4 --- lib/kernel/test/inet_SUITE.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 622107fa84..523e5c63ce 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -386,7 +386,7 @@ try_host({Ip0, Host}) -> %% Get all hosts from the system using 'ypcat hosts' or the local %% equvivalent. -get_hosts(Config) -> +get_hosts(_Config) -> case os:type() of {unix, _} -> List = lists:map(fun(X) -> @@ -399,12 +399,12 @@ get_hosts(Config) -> ct:get_config(hardcoded_hosts) end. -get_ipv6_hosts(Config) -> +get_ipv6_hosts(_Config) -> case os:type() of {unix, _} -> List = lists:map(fun(X) -> atom_to_list(X)++" " - end, ct:get_config(test_hosts)), + end, ct:get_config(ipv6_hosts)), Cmd = "ypmatch "++List++" ipnodes.byname", HostFile = os:cmd(Cmd), get_hosts(HostFile, [], [], []); -- cgit v1.2.3 From a342ded6e4ca90db3300a64a06d866b1e07484c7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 15 Feb 2011 11:50:33 +0100 Subject: Update ftp suite to take config from ct:get_config --- lib/inets/test/ftp_suite_lib.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/inets/test/ftp_suite_lib.erl b/lib/inets/test/ftp_suite_lib.erl index c539b7c17c..5ae0298b29 100644 --- a/lib/inets/test/ftp_suite_lib.erl +++ b/lib/inets/test/ftp_suite_lib.erl @@ -21,8 +21,8 @@ -module(ftp_suite_lib). --include("test_server.hrl"). --include("test_server_line.hrl"). +-include_lib("test_server/include/test_server.hrl"). +-include_lib("test_server/include/test_server_line.hrl"). -include("inets_test_lib.hrl"). %% Test server specific exports @@ -74,7 +74,7 @@ tickets(suite) -> ftpd_init(FtpdTag, Config) -> %% Get the host name(s) of FTP server Hosts = - case ?config(ftpd_hosts, Config) of + case ct:get_config(ftpd_hosts) of undefined -> ftpd_hosts(data_dir(Config)); H -> @@ -129,7 +129,7 @@ get_ftpd_host([Host|Hosts]) -> dirty_select_ftpd_host(Config) -> Hosts = - case ?config(ftpd_hosts, Config) of + case ct:get_config(ftpd_hosts) of undefined -> ftpd_hosts(data_dir(Config)); H -> -- cgit v1.2.3 From a6092e8eeccbd7a24943d53592e8085a20efb1ce Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 16 Feb 2011 11:10:15 +0100 Subject: Update ipv6 testcase to be skipped if no ipv6 hosts are defined --- lib/inets/test/httpc_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index aff20ff7cf..7aa11ebc27 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -1737,6 +1737,8 @@ parse_url(Config) when is_list(Config) -> %%------------------------------------------------------------------------- +ipv6() -> + [{require,ipv6_hosts}]. ipv6(doc) -> ["Test ipv6."]; ipv6(suite) -> -- cgit v1.2.3 From b16c705cb08743333dba26f036ff44cf7d4b7da8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 17 Feb 2011 18:49:32 +0100 Subject: Fixed release notes. --- lib/snmp/doc/src/notes.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index cb41ca8e3a..3fe39c4d03 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -4,7 +4,7 @@
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -50,10 +50,10 @@ snmp_view_based_acm_mib:reconfigure/1 on a running node, the table vacmAccessTable was not properly cleaned. - This means that if some entries in the vacm.conf file was removed + This meant that if some entries in the vacm.conf file was removed (compared to the current config), - while others where modified and/or added, the removed entrie(s), - would still exist in the vacmAccessTable.

+ while others where modified and/or added, the removed entrie(s) + would still exist in the vacmAccessTable table.

Own Id: OTP-8981

Aux Id: Seq 11750

-- cgit v1.2.3 From dd3e666c5114f81c9518e9f5ba14959ced079ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Mon, 14 Dec 2009 23:04:00 +0100 Subject: Add dependencies Makefile generation to erlc(1) and compile(3) This is useful when a project is built with Makefiles and erlc(1) instead of EMakefiles. Tracking dependencies by hand is error-prone and it becomes painful when using external application headers like EUnit's one. A dependencies Makefile will look like this: module.beam: module.erl \ /usr/local/lib/erlang/lib/eunit-2.1.4/include/eunit.hrl \ header.hrl When included in the main Makefile, 'module' will be recompiled only when needed. GCC offers the same feature and new erlc(1) options are compatible with it. More informations at: http://wiki.github.com/dumbbell/otp/dependencies-makefile --- erts/doc/src/erlc.xml | 44 +++++ erts/etc/common/erlc.c | 99 +++++++++++ lib/compiler/doc/src/compile.xml | 64 +++++++ lib/compiler/src/compile.erl | 194 ++++++++++++++++++++- lib/compiler/test/compile_SUITE.erl | 74 +++++++- .../test/compile_SUITE_data/simple-basic1.mk | 1 + .../test/compile_SUITE_data/simple-basic2.mk | 1 + .../test/compile_SUITE_data/simple-missing.mk | 1 + .../test/compile_SUITE_data/simple-target1.mk | 1 + .../test/compile_SUITE_data/simple-target2.mk | 1 + lib/compiler/test/compile_SUITE_data/simple.erl | 4 + 11 files changed, 481 insertions(+), 3 deletions(-) create mode 100644 lib/compiler/test/compile_SUITE_data/simple-basic1.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-basic2.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-missing.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-target1.mk create mode 100644 lib/compiler/test/compile_SUITE_data/simple-target2.mk diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index 1e8960c22c..7e689c418e 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -141,6 +141,50 @@ for compiling native code, which needs to be compiled with the same run-time system that it should be run on.

+ -M + +

Produces a Makefile rule to track headers dependencies. The + rule is sent to stdout. No object file is produced. +

+
+ -MF Makefile + +

Like the option above, except that the + Makefile is written to Makefile. No object + file is produced. +

+
+ -MD + +

Same as .Pbeam]]>. +

+
+ -MT Target + +

In conjunction with or + , change the name of the rule emitted + to Target. +

+
+ -MQ Target + +

Like the option above, except that + characters special to make(1) are quoted. +

+
+ -MP + +

In conjunction with or + , add a phony target for each dependency. +

+
+ -MG + +

In conjunction with or + , consider missing headers as generated + files and add them to the dependencies. +

+
--

Signals that no more options will follow. diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c index cd137435d1..b76a2caf91 100644 --- a/erts/etc/common/erlc.c +++ b/erts/etc/common/erlc.c @@ -28,6 +28,7 @@ #include /* FIXE ME config_win32.h? */ #define HAVE_STRERROR 1 +#define snprintf _snprintf #endif #include @@ -260,6 +261,95 @@ main(int argc, char** argv) case 'I': PUSH2("@i", process_opt(&argc, &argv, 0)); break; + case 'M': + { + char *buf, *key, *val; + size_t buf_len; + + if (argv[1][2] == '\0') { /* -M */ + /* Push the following options: + * o 'makedep' + * o {makedep_output, standard_io} + */ + buf = strsave("makedep"); + PUSH2("@option", buf); + + key = "makedep_output"; + val = "standard_io"; + buf_len = 1 + strlen(key) + 1 + strlen(val) + 1 + 1; + buf = emalloc(buf_len); + snprintf(buf, buf_len, "{%s,%s}", key, val); + PUSH2("@option", buf); + } else if (argv[1][3] == '\0') { + switch(argv[1][2]) { + case 'D': /* -MD */ + /* Push the following options: + * o 'makedep' + */ + buf = strsave("makedep"); + PUSH2("@option", buf); + break; + case 'F': /* -MF */ + /* Push the following options: + * o 'makedep' + * o {makedep_output, } + */ + buf = strsave("makedep"); + PUSH2("@option", buf); + + key = "makedep_output"; + val = process_opt(&argc, &argv, 1); + buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1; + buf = emalloc(buf_len); + snprintf(buf, buf_len, "{%s,\"%s\"}", key, val); + PUSH2("@option", buf); + break; + case 'T': /* -MT */ + /* Push the following options: + * o {makedep_target, } + */ + key = "makedep_target"; + val = process_opt(&argc, &argv, 1); + buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1; + buf = emalloc(buf_len); + snprintf(buf, buf_len, "{%s,\"%s\"}", key, val); + PUSH2("@option", buf); + break; + case 'Q': /* -MQ */ + /* Push the following options: + * o {makedep_target, } + * o makedep_quote_target + */ + key = "makedep_target"; + val = process_opt(&argc, &argv, 1); + buf_len = 1 + strlen(key) + 2 + strlen(val) + 2 + 1; + buf = emalloc(buf_len); + snprintf(buf, buf_len, "{%s,\"%s\"}", key, val); + PUSH2("@option", buf); + + buf = strsave("makedep_quote_target"); + PUSH2("@option", buf); + break; + case 'G': /* -MG */ + /* Push the following options: + * o makedep_add_missing + */ + buf = strsave("makedep_add_missing"); + PUSH2("@option", buf); + break; + case 'P': /* -MP */ + /* Push the following options: + * o makedep_phony + */ + buf = strsave("makedep_add_missing"); + PUSH2("@option", buf); + break; + default: + goto error; + } + } + } + break; case 'o': PUSH2("@outdir", process_opt(&argc, &argv, 0)); break; @@ -561,6 +651,15 @@ usage(void) {"-hybrid", "compile using hybrid-heap emulator"}, {"-help", "shows this help text"}, {"-I path", "where to search for include files"}, + {"-M", "generate a rule for make(1) describing the dependencies"}, + {"-MF file", "write the dependencies to 'file'"}, + {"-MT target", "change the target of the rule emitted by dependency " + "generation"}, + {"-MQ target", "same as -MT but quote characters special to make(1)"}, + {"-MG", "consider missing headers as generated files and add them to " + "the dependencies"}, + {"-MP", "add a phony target for each dependency"}, + {"-MD", "same as -M -MT file (with default 'file')"}, {"-o name", "name output directory or file"}, {"-pa path", "add path to the front of Erlang's code path"}, {"-pz path", "add path to the end of Erlang's code path"}, diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index c3d65b4cb5..77f3e9b0be 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -164,6 +164,70 @@ for details.

+ makedep + +

Produce a Makefile rule to track headers dependencies. + No object file is produced. +

+

By default, this rule is written to + .Pbeam]]>. However, if the option + binary is set, nothing is written and the rule is + returned in Binary. +

+

For instance, if one has the following module: +

+ +-module(module). + +-include_lib("eunit/include/eunit.hrl"). +-include("header.hrl"). + +

Here is the Makefile rule generated by this option: +

+ +module.beam: module.erl \ + /usr/local/lib/erlang/lib/eunit/include/eunit.hrl \ + header.hrl + +
+ + {makedep_output, Output} + +

Write generated rule(s) to Output instead of the + default .Pbeam]]>. Output + can be a filename or an io_device(). To write to + stdout, use standard_io. However if binary + is set, nothing is written to Output and the + result is returned to the caller with + {ok, ModuleName, Binary}. +

+
+ + {makedep_target, Target} + +

Change the name of the rule emitted to Target. +

+
+ + makedep_quote_target + +

Characters in Target special to make(1) are quoted. +

+
+ + makedep_add_missing + +

Consider missing headers as generated files and add them to the + dependencies. +

+
+ + makedep_phony + +

Add a phony target for each dependency. +

+
+ 'P'

Produces a listing of the parsed code after preprocessing diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 26da3ecad2..38603a76a1 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -205,6 +205,9 @@ format_error(write_error) -> format_error({rename,From,To,Error}) -> io_lib:format("failed to rename ~s to ~s: ~s", [From,To,file:format_error(Error)]); +format_error({delete,File,Error}) -> + io_lib:format("failed to delete file ~s: ~s", + [File,file:format_error(Error)]); format_error({delete_temp,File,Error}) -> io_lib:format("failed to delete temporary file ~s: ~s", [File,file:format_error(Error)]); @@ -435,6 +438,8 @@ passes(file, Opts) -> %% file will be Ext. (Ext should not contain %% a period.) No more passes will be run. %% +%% done End compilation at this point. +%% %% {done,Ext} End compilation at this point. Produce a listing %% as with {listing,Ext}, unless 'binary' is %% specified, in which case the current @@ -468,6 +473,8 @@ select_passes([{src_listing,Ext}|_], _Opts) -> [{listing,fun (St) -> src_listing(Ext, St) end}]; select_passes([{listing,Ext}|_], _Opts) -> [{listing,fun (St) -> listing(Ext, St) end}]; +select_passes([done|_], _Opts) -> + []; select_passes([{done,Ext}|_], Opts) -> select_passes([{unless,binary,{listing,Ext}}], Opts); select_passes([{iff,Flag,Pass}|Ps], Opts) -> @@ -550,6 +557,13 @@ select_list_passes_1([], _, Acc) -> standard_passes() -> [?pass(transform_module), + + {iff,makedep,[ + ?pass(makedep), + {unless,binary,?pass(makedep_output)} + ]}, + {iff,makedep,done}, + {iff,'dpp',{listing,"pp"}}, ?pass(lint_module), {iff,'P',{src_listing,"P"}}, @@ -901,6 +915,184 @@ core_lint_module(St) -> errors=St#compile.errors ++ Es}} end. +makedep(#compile{code=Code,options=Opts}=St) -> + Ifile = St#compile.ifile, + Ofile = St#compile.ofile, + + %% Get the target of the Makefile rule. + Target0 = + case proplists:get_value(makedep_target, Opts) of + undefined -> + %% The target is derived from the output filename: possibly + %% remove the current working directory to obtain a relative + %% path. + shorten_filename(Ofile); + T -> + %% The caller specified one. + T + end, + + %% Quote the target is the called asked for this. + Target1 = case proplists:get_value(makedep_quote_target, Opts) of + true -> + %% For now, only "$" is replaced by "$$". + Fun = fun + ($$) -> "$$"; + (C) -> C + end, + map(Fun, Target0); + _ -> + Target0 + end, + Target = Target1 ++ ":", + + %% List the dependencies (includes) for this target. + {MainRule,PhonyRules} = makedep_add_headers( + Ifile, % The input file name. + Code, % The parsed source. + [], % The list of dependencies already added. + length(Target), % The current line length. + Target, % The target. + "", % Phony targets. + Opts), + + %% Prepare the content of the Makefile. For instance: + %% hello.erl: hello.hrl common.hrl + %% + %% Or if phony targets are enabled: + %% hello.erl: hello.hrl common.hrl + %% + %% hello.hrl: + %% + %% common.hrl: + Makefile = case proplists:get_value(makedep_phony, Opts) of + true -> MainRule ++ PhonyRules; + _ -> MainRule + end, + {ok,St#compile{code=iolist_to_binary([Makefile,"\n"])}}. + +makedep_add_headers(Ifile, [{attribute,_,file,{File,_}}|Rest], + Included, LineLen, MainTarget, Phony, Opts) -> + %% The header "File" exists, add it to the dependencies. + {Included1,LineLen1,MainTarget1,Phony1} = + makedep_add_header(Ifile, Included, LineLen, MainTarget, Phony, File), + makedep_add_headers(Ifile, Rest, Included1, LineLen1, + MainTarget1, Phony1, Opts); +makedep_add_headers(Ifile, [{error,{_,epp,{include,file,File}}}|Rest], + Included, LineLen, MainTarget, Phony, Opts) -> + %% The header "File" doesn't exist, do we add it to the dependencies? + case proplists:get_value(makedep_add_missing, Opts) of + true -> + {Included1,LineLen1,MainTarget1,Phony1} = + makedep_add_header(Ifile, Included, LineLen, MainTarget, + Phony, File), + makedep_add_headers(Ifile, Rest, Included1, LineLen1, + MainTarget1, Phony1, Opts); + _ -> + makedep_add_headers(Ifile, Rest, Included, LineLen, + MainTarget, Phony, Opts) + end; +makedep_add_headers(Ifile, [_|Rest], Included, LineLen, + MainTarget, Phony, Opts) -> + makedep_add_headers(Ifile, Rest, Included, + LineLen, MainTarget, Phony, Opts); +makedep_add_headers(_Ifile, [], _Included, _LineLen, + MainTarget, Phony, _Opts) -> + {MainTarget,Phony}. + +makedep_add_header(Ifile, Included, LineLen, MainTarget, Phony, File) -> + case member(File, Included) of + true -> + %% This file was already listed in the dependencies, skip it. + {Included,LineLen,MainTarget,Phony}; + false -> + Included1 = [File|Included], + + %% Remove "./" in front of the dependency filename. + File1 = case File of + "./" ++ File0 -> File0; + _ -> File + end, + + %% Prepare the phony target name. + Phony1 = case File of + Ifile -> Phony; + _ -> Phony ++ "\n\n" ++ File1 ++ ":" + end, + + %% Add the file to the dependencies. Lines longer than 76 columns + %% are splitted. + if + LineLen + 1 + length(File1) > 76 -> + LineLen1 = 2 + length(File1), + MainTarget1 = MainTarget ++ " \\\n " ++ File1, + {Included1,LineLen1,MainTarget1,Phony1}; + true -> + LineLen1 = LineLen + 1 + length(File1), + MainTarget1 = MainTarget ++ " " ++ File1, + {Included1,LineLen1,MainTarget1,Phony1} + end + end. + +makedep_output(#compile{code=Code,options=Opts,ofile=Ofile}=St) -> + %% Write this Makefile (Code) to the selected output. + %% If no output is specified, the default is to write to a file named after + %% the output file. + Output0 = case proplists:get_value(makedep_output, Opts) of + undefined -> + %% Prepare the default filename. + outfile(filename:basename(Ofile, ".beam"), "Pbeam", Opts); + O -> + O + end, + + %% If the caller specified an io_device(), there's nothing to do. If he + %% specified a filename, we must create it. Furthermore, this created file + %% must be closed before returning. + Ret = case Output0 of + _ when is_list(Output0) -> + case file:delete(Output0) of + Ret2 when Ret2 =:= ok; Ret2 =:= {error,enoent} -> + case file:open(Output0, [write]) of + {ok,IODev} -> + {ok,IODev,true}; + {error,Reason2} -> + {error,open,Reason2} + end; + {error,Reason1} -> + {error,delete,Reason1} + end; + _ -> + {ok,Output0,false} + end, + + case Ret of + {ok,Output1,CloseOutput} -> + try + %% Write the Makefile. + io:fwrite(Output1, "~s", [Code]), + %% Close the file if relevant. + if + CloseOutput -> file:close(Output1); + true -> ok + end, + {ok,St} + catch + exit:_ -> + %% Couldn't write to output Makefile. + Err = {St#compile.ifile,[{none,?MODULE,write_error}]}, + {error,St#compile{errors=St#compile.errors++[Err]}} + end; + {error,open,Reason} -> + %% Couldn't open output Makefile. + Err = {St#compile.ifile,[{none,?MODULE,{open,Reason}}]}, + {error,St#compile{errors=St#compile.errors++[Err]}}; + {error,delete,Reason} -> + %% Couldn't open output Makefile. + Err = {St#compile.ifile,[{none,?MODULE,{delete,Output0,Reason}}]}, + {error,St#compile{errors=St#compile.errors++[Err]}} + end. + %% expand_module(State) -> State' %% Do the common preprocessing of the input forms. diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl index e1cc5dafb5..cf0f352979 100644 --- a/lib/compiler/test/compile_SUITE.erl +++ b/lib/compiler/test/compile_SUITE.erl @@ -25,7 +25,7 @@ -export([all/1, app_test/1, file_1/1, module_mismatch/1, big_file/1, outdir/1, - binary/1, cond_and_ifdef/1, listings/1, listings_big/1, + binary/1, makedep/1, cond_and_ifdef/1, listings/1, listings_big/1, other_output/1, package_forms/1, encrypted_abstr/1, bad_record_use/1, bad_record_use1/1, bad_record_use2/1, strict_record/1, missing_testheap/1, cover/1, env/1, core/1, asm/1]). @@ -40,7 +40,7 @@ all(suite) -> test_lib:recompile(?MODULE), [app_test, - file_1, module_mismatch, big_file, outdir, binary, + file_1, module_mismatch, big_file, outdir, binary, makedep, cond_and_ifdef, listings, listings_big, other_output, package_forms, encrypted_abstr, @@ -132,6 +132,76 @@ binary(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. +%% Tests that the dependencies-Makefile-related options work. + +makedep(Config) when is_list(Config) -> + ?line Dog = test_server:timetrap(test_server:seconds(60)), + ?line {Simple,Target} = files(Config, "makedep"), + ?line DataDir = ?config(data_dir, Config), + ?line SimpleRootname = filename:rootname(Simple), + ?line IncludeDir = filename:join(filename:dirname(Simple), "include"), + ?line IncludeOptions = [ + {d,need_foo}, + {d,foo_value,42}, + {d,include_generated}, + {i,IncludeDir} + ], + %% Basic rule. + ?line BasicMf1Name = SimpleRootname ++ "-basic1.mk", + ?line {ok,BasicMf1} = file:read_file(BasicMf1Name), + ?line {ok,_,Mf1} = compile:file(Simple, [binary,makedep]), + ?line BasicMf1 = makedep_canonicalize_result(Mf1, DataDir), + %% Basic rule with one existing header. + ?line BasicMf2Name = SimpleRootname ++ "-basic2.mk", + ?line {ok,BasicMf2} = file:read_file(BasicMf2Name), + ?line {ok,_,Mf2} = compile:file(Simple, [binary,makedep|IncludeOptions]), + ?line BasicMf2 = makedep_canonicalize_result(Mf2, DataDir), + %% Rule with one existing header and one missing header. + ?line MissingMfName = SimpleRootname ++ "-missing.mk", + ?line {ok,MissingMf} = file:read_file(MissingMfName), + ?line {ok,_,Mf3} = compile:file(Simple, + [binary,makedep,makedep_add_missing|IncludeOptions]), + ?line MissingMf = makedep_canonicalize_result(Mf3, DataDir), + %% Rule with modified target. + ?line TargetMf1Name = SimpleRootname ++ "-target1.mk", + ?line {ok,TargetMf1} = file:read_file(TargetMf1Name), + ?line {ok,_,Mf4} = compile:file(Simple, + [binary,makedep,{makedep_target,"$target"}|IncludeOptions]), + ?line TargetMf1 = makedep_modify_target( + makedep_canonicalize_result(Mf4, DataDir), "$$target"), + %% Rule with quoted modified target. + ?line TargetMf2Name = SimpleRootname ++ "-target2.mk", + ?line {ok,TargetMf2} = file:read_file(TargetMf2Name), + ?line {ok,_,Mf5} = compile:file(Simple, + [binary,makedep,{makedep_target,"$target"},makedep_quote_target| + IncludeOptions]), + ?line TargetMf2 = makedep_modify_target( + makedep_canonicalize_result(Mf5, DataDir), "$$target"), + %% Basic rule written to some file. + ?line {ok,_} = compile:file(Simple, + [makedep,{makedep_output,Target}|IncludeOptions]), + ?line {ok,Mf6} = file:read_file(Target), + ?line BasicMf2 = makedep_canonicalize_result(Mf6, DataDir), + + ?line ok = file:delete(Target), + ?line ok = file:del_dir(filename:dirname(Target)), + ?line test_server:timetrap_cancel(Dog), + ok. + +makedep_canonicalize_result(Mf, DataDir) -> + Mf0 = binary_to_list(Mf), + %% Replace the Datadir by "$(srcdir)". + Mf1 = re:replace(Mf0, DataDir, "$(srcdir)/", + [global,multiline,{return,list}]), + %% Long lines are splitted, put back everything on one line. + Mf2 = re:replace(Mf1, "\\\\\n ", "", [global,multiline,{return,list}]), + list_to_binary(Mf2). + +makedep_modify_target(Mf, Target) -> + Mf0 = binary_to_list(Mf), + Mf1 = re:replace(Mf0, Target, "$target", [{return,list}]), + list_to_binary(Mf1). + %% Tests that conditional compilation, defining values, including files work. cond_and_ifdef(Config) when is_list(Config) -> diff --git a/lib/compiler/test/compile_SUITE_data/simple-basic1.mk b/lib/compiler/test/compile_SUITE_data/simple-basic1.mk new file mode 100644 index 0000000000..4073fa82d0 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-basic1.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl diff --git a/lib/compiler/test/compile_SUITE_data/simple-basic2.mk b/lib/compiler/test/compile_SUITE_data/simple-basic2.mk new file mode 100644 index 0000000000..761d1d9582 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-basic2.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-missing.mk b/lib/compiler/test/compile_SUITE_data/simple-missing.mk new file mode 100644 index 0000000000..b13d44ec36 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-missing.mk @@ -0,0 +1 @@ +simple.beam: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl generated.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-target1.mk b/lib/compiler/test/compile_SUITE_data/simple-target1.mk new file mode 100644 index 0000000000..dd9fa0d6e5 --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-target1.mk @@ -0,0 +1 @@ +$target: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple-target2.mk b/lib/compiler/test/compile_SUITE_data/simple-target2.mk new file mode 100644 index 0000000000..a5fc6f461d --- /dev/null +++ b/lib/compiler/test/compile_SUITE_data/simple-target2.mk @@ -0,0 +1 @@ +$$target: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl diff --git a/lib/compiler/test/compile_SUITE_data/simple.erl b/lib/compiler/test/compile_SUITE_data/simple.erl index 2021056388..8e98852417 100644 --- a/lib/compiler/test/compile_SUITE_data/simple.erl +++ b/lib/compiler/test/compile_SUITE_data/simple.erl @@ -37,3 +37,7 @@ foo() -> {?included_value, ?foo_value}. -endif. + +-ifdef(include_generated). +-include("generated.hrl"). +-endif. -- cgit v1.2.3 From 35b85a49dc4ea6febc4cdb4a7024bb7a9aab72be Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 4 Feb 2011 12:07:54 +0100 Subject: Refuse to load NIF library on wrong VM variant (halfword/fullword) --- erts/emulator/beam/erl_nif.c | 8 +++++++- erts/emulator/beam/erl_nif.h | 13 +++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index 2f9295e624..135c6b0ccc 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -1478,7 +1478,13 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2) ret = load_nif_error(BIF_P, bad_lib, "Library version (%d.%d) not compatible (with %d.%d).", entry->major, entry->minor, ERL_NIF_MAJOR_VERSION, ERL_NIF_MINOR_VERSION); - } + } + else if (entry->minor >= 1 + && sys_strcmp(entry->vm_variant, ERL_NIF_VM_VARIANT) != 0) { + ret = load_nif_error(BIF_P, bad_lib, "Library (%s) not compiled for " + "this vm variant (%s).", + entry->vm_variant, ERL_NIF_VM_VARIANT); + } else if (!erts_is_atom_str((char*)entry->name, mod_atom)) { ret = load_nif_error(BIF_P, bad_lib, "Library module name '%s' does not" " match calling module '%T'", entry->name, mod_atom); diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h index ee3a7cd5f4..2719e0bfc3 100644 --- a/erts/emulator/beam/erl_nif.h +++ b/erts/emulator/beam/erl_nif.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2009-2010. All Rights Reserved. + * Copyright Ericsson AB 2009-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -30,9 +30,10 @@ ** 0.1: R13B03 ** 1.0: R13B04 ** 2.0: R14A +** 2.1: R14B02 "vm_variant" */ #define ERL_NIF_MAJOR_VERSION 2 -#define ERL_NIF_MINOR_VERSION 0 +#define ERL_NIF_MINOR_VERSION 1 #include @@ -80,8 +81,10 @@ typedef long long ErlNifSInt64; #endif #ifdef HALFWORD_HEAP_EMULATOR +# define ERL_NIF_VM_VARIANT "beam.halfword" typedef unsigned int ERL_NIF_TERM; #else +# define ERL_NIF_VM_VARIANT "beam.vanilla" typedef unsigned long ERL_NIF_TERM; #endif @@ -105,7 +108,8 @@ typedef struct enif_entry_t int (*load) (ErlNifEnv*, void** priv_data, ERL_NIF_TERM load_info); int (*reload) (ErlNifEnv*, void** priv_data, ERL_NIF_TERM load_info); int (*upgrade)(ErlNifEnv*, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info); - void (*unload) (ErlNifEnv*, void* priv_data); + void (*unload) (ErlNifEnv*, void* priv_data); + const char* vm_variant; }ErlNifEntry; @@ -207,7 +211,8 @@ ERL_NIF_INIT_DECL(NAME) \ #NAME, \ sizeof(FUNCS) / sizeof(*FUNCS), \ FUNCS, \ - LOAD, RELOAD, UPGRADE, UNLOAD \ + LOAD, RELOAD, UPGRADE, UNLOAD, \ + ERL_NIF_VM_VARIANT \ }; \ ERL_NIF_INIT_BODY; \ return &entry; \ -- cgit v1.2.3 From d8babf8bb810ef62c17037d511435642f60eeed3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 4 Feb 2011 12:27:29 +0100 Subject: =?UTF-8?q?remove=20NIF=20compile=20warning:=20no=20previous=20pro?= =?UTF-8?q?totype=20for=20=E2=80=98nif=5Finit=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erts/emulator/beam/erl_nif.h | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h index 2719e0bfc3..8050b3640a 100644 --- a/erts/emulator/beam/erl_nif.h +++ b/erts/emulator/beam/erl_nif.h @@ -202,6 +202,7 @@ extern TWinDynNifCallbacks WinDynNifCallbacks; #define ERL_NIF_INIT(NAME, FUNCS, LOAD, RELOAD, UPGRADE, UNLOAD) \ ERL_NIF_INIT_PROLOGUE \ ERL_NIF_INIT_GLOB \ +ERL_NIF_INIT_DECL(NAME); \ ERL_NIF_INIT_DECL(NAME) \ { \ static ErlNifEntry entry = \ -- cgit v1.2.3 From ad1f48d0429b480f5344e3b354a89124ed4fe852 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 4 Feb 2011 18:11:32 +0100 Subject: Fix vm crash in kernel test case seq_trace_SUITE:call --- erts/emulator/beam/erl_db_util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 69b6261549..d3e31da413 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -2209,20 +2209,21 @@ restart: Eterm sender = SEQ_TRACE_TOKEN_SENDER(c_p); Uint sender_sz = is_immed(sender) ? 0 : size_object(sender); ehp = HAllocX(build_proc, 6 + sender_sz, HEAP_XTRA); + if (sender_sz) { + sender = copy_struct(sender, sender_sz, &ehp, &MSO(build_proc)); + } *esp++ = make_tuple(ehp); ehp[0] = make_arityval(5); ehp[1] = SEQ_TRACE_TOKEN_FLAGS(c_p); ehp[2] = SEQ_TRACE_TOKEN_LABEL(c_p); ehp[3] = SEQ_TRACE_TOKEN_SERIAL(c_p); + ehp[4] = sender; ehp[5] = SEQ_TRACE_TOKEN_LASTCNT(c_p); ASSERT(SEQ_TRACE_TOKEN_ARITY(c_p) == 5); ASSERT(is_immed(ehp[1])); ASSERT(is_immed(ehp[2])); ASSERT(is_immed(ehp[3])); ASSERT(is_immed(ehp[5])); - ehp += 6; - ehp[4] = (sender_sz==0) ? sender - : copy_struct(sender, sender_sz, &ehp, &MSO(build_proc)); } break; case matchEnableTrace: -- cgit v1.2.3 From 01e18729aa7c5104ace3b4366c93ba9f5f7405bb Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 18 Feb 2011 16:23:55 +0100 Subject: HALFWORD ETS Fix copyright year in some source files --- erts/emulator/beam/big.c | 2 +- erts/emulator/beam/big.h | 2 +- erts/emulator/beam/copy.c | 2 +- erts/emulator/beam/erl_alloc.types | 2 +- erts/emulator/beam/erl_bif_lists.c | 2 +- erts/emulator/beam/erl_binary.h | 2 +- erts/emulator/beam/erl_lock_check.c | 2 +- erts/emulator/beam/erl_monitors.c | 2 +- erts/emulator/beam/erl_node_container_utils.h | 2 +- erts/emulator/beam/erl_term.c | 2 +- erts/emulator/beam/sys.h | 2 +- erts/emulator/sys/unix/sys_float.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c index 57964b31e4..f47f5a9c0c 100644 --- a/erts/emulator/beam/big.c +++ b/erts/emulator/beam/big.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/big.h b/erts/emulator/beam/big.h index 294e1d50fb..f28a390aea 100644 --- a/erts/emulator/beam/big.h +++ b/erts/emulator/beam/big.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c index d582b479cc..243e8973cf 100644 --- a/erts/emulator/beam/copy.c +++ b/erts/emulator/beam/copy.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types index 128adcaa8c..ca71798917 100644 --- a/erts/emulator/beam/erl_alloc.types +++ b/erts/emulator/beam/erl_alloc.types @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2003-2010. All Rights Reserved. +# Copyright Ericsson AB 2003-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_bif_lists.c b/erts/emulator/beam/erl_bif_lists.c index d4dc3867ad..47c48e74d6 100644 --- a/erts/emulator/beam/erl_bif_lists.c +++ b/erts/emulator/beam/erl_bif_lists.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2010. All Rights Reserved. + * Copyright Ericsson AB 1999-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h index 3093fb8856..506c4813fa 100644 --- a/erts/emulator/beam/erl_binary.h +++ b/erts/emulator/beam/erl_binary.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * Copyright Ericsson AB 2000-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_lock_check.c b/erts/emulator/beam/erl_lock_check.c index 7cd379d2c8..9e18997890 100644 --- a/erts/emulator/beam/erl_lock_check.c +++ b/erts/emulator/beam/erl_lock_check.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2010. All Rights Reserved. + * Copyright Ericsson AB 2005-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_monitors.c b/erts/emulator/beam/erl_monitors.c index 9dff157411..9751b5d77c 100644 --- a/erts/emulator/beam/erl_monitors.c +++ b/erts/emulator/beam/erl_monitors.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_node_container_utils.h b/erts/emulator/beam/erl_node_container_utils.h index e06a54477c..2c67e781e0 100644 --- a/erts/emulator/beam/erl_node_container_utils.h +++ b/erts/emulator/beam/erl_node_container_utils.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c index e4ed685169..f77e8b798f 100644 --- a/erts/emulator/beam/erl_term.c +++ b/erts/emulator/beam/erl_term.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * Copyright Ericsson AB 2000-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index d480229999..b1cd683b3b 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c index 8abf698d4f..8ec7b31ce0 100644 --- a/erts/emulator/sys/unix/sys_float.c +++ b/erts/emulator/sys/unix/sys_float.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From b8541c9267c8e46a8ab5e3e577f5117ecf693cc3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 21 Feb 2011 14:22:26 +0100 Subject: Remove old test_server code --- lib/test_server/src/ts_install_cth.erl | 7 - lib/test_server/src/ts_run.erl | 392 +-------------------------------- 2 files changed, 1 insertion(+), 398 deletions(-) diff --git a/lib/test_server/src/ts_install_cth.erl b/lib/test_server/src/ts_install_cth.erl index 3e28ebd529..f8b4e5a4f8 100644 --- a/lib/test_server/src/ts_install_cth.erl +++ b/lib/test_server/src/ts_install_cth.erl @@ -68,7 +68,6 @@ id(_Opts) -> -spec init(Id :: term(), Opts :: proplist()) -> State :: #state{}. init(_Id, Opts) -> -% ct:log("CurrWD: ~p",[file:get_cwd()]), Nodenames = proplists:get_value(nodenames, Opts, 0), Nodes = proplists:get_value(nodes, Opts, 0), TSConfDir = proplists:get_value(ts_conf_dir, Opts), @@ -93,13 +92,8 @@ pre_init_per_suite(Suite,Config,#state{ ts_conf_dir = undefined} = State) -> TSConfDir = filename:join([ParentDir, "..","test_server"]), pre_init_per_suite(Suite, Config, State#state{ ts_conf_dir = TSConfDir }); pre_init_per_suite(_Suite,Config,State) -> -% ct:log("pre_init_per_suite(~p,~p,~p)",[_Suite,Config,State]), DataDir = proplists:get_value(data_dir, Config), try -% install(State#state.ts_conf_dir, -% State#state.target_system, -% State#state.install_opts), - {ok,Variables} = file:consult(filename:join(State#state.ts_conf_dir,"variables")), @@ -221,7 +215,6 @@ on_tc_skip(_TC, _Reason, State) -> -spec terminate(State :: #state{}) -> term(). terminate(_State) -> -% ct:log("Terminate called"), ok. %%% ============================================================================ diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl index 60e01600e1..d572b1454c 100644 --- a/lib/test_server/src/ts_run.erl +++ b/lib/test_server/src/ts_run.erl @@ -28,7 +28,7 @@ -include("ts.hrl"). --import(lists, [map/2,member/2,filter/2,reverse/1]). +-import(lists, [member/2,filter/2]). -record(state, {file, % File given. @@ -75,19 +75,6 @@ run(File, Args0, Options, Vars0) -> Error -> Error end. -make_loop(Hooks, Vars0, Spec0, St0) -> - case St0#state.makefiles of - [Makefile|Rest] -> - case execute(Hooks, Vars0, Spec0, St0#state{makefile=Makefile}) of - {error, Reason} -> - {error, Reason}; - {ok, Vars, Spec, St} -> - make_loop(Hooks, Vars, Spec, St#state{makefiles=Rest}) - end; - [] -> - {ok, Vars0, Spec0, St0} - end. - execute([Hook|Rest], Vars0, Spec0, St0) -> case Hook(Vars0, Spec0, St0) of ok -> @@ -137,101 +124,6 @@ init_state(Vars, [], St0) -> false -> {error,{no_test_directory,TestDir}} end. - -%% Read the spec file for the test suite. - -read_spec_file(Vars, _, St) -> - TestDir = St#state.test_dir, - File = St#state.file, - {SpecFile,Res} = get_spec_filename(Vars, TestDir, File), - case Res of - {ok,Spec} -> - {ok,Vars,Spec,St}; - {error,Atom} when is_atom(Atom) -> - {error,{no_spec,SpecFile}}; - {error,Reason} -> - {error,{bad_spec,lists:flatten(file:format_error(Reason))}} - end. - -get_spec_filename(Vars, TestDir, File) -> - DynSpec = filename:join(TestDir, File ++ ".dynspec"), - case filelib:is_file(DynSpec) of - true -> - Bs0 = erl_eval:new_bindings(), - Bs1 = erl_eval:add_binding('Target', ts_lib:var(target, Vars), Bs0), - Bs2 = erl_eval:add_binding('Os', ts_lib:var(os, Vars), Bs1), - TCCStr = ts_lib:var(test_c_compiler, Vars), - TCC = try - {ok, Toks, _} = erl_scan:string(TCCStr ++ "."), - {ok, Tcc} = erl_parse:parse_term(Toks), - Tcc - catch - _:_ -> undefined - end, - Bs = erl_eval:add_binding('TestCCompiler', TCC, Bs2), - {DynSpec,file:script(DynSpec, Bs)}; - false -> - SpecFile = get_spec_filename_1(Vars, TestDir, File), - {SpecFile,file:consult(SpecFile)} - end. - -get_spec_filename_1(Vars, TestDir, File) -> - case ts_lib:var(os, Vars) of - "VxWorks" -> - check_spec_filename(TestDir, File, ".spec.vxworks"); - "Windows"++_ -> - check_spec_filename(TestDir, File, ".spec.win"); - _Other -> - filename:join(TestDir, File ++ ".spec") - end. - -check_spec_filename(TestDir, File, Ext) -> - Spec = filename:join(TestDir, File ++ Ext), - case filelib:is_file(Spec) of - true -> Spec; - false -> filename:join(TestDir, File ++ ".spec") - end. - -%% Remove the top case from the spec file. We will add our own -%% top case later. - -remove_original_topcase(Vars, Spec, St) -> - {ok,Vars,filter(fun ({topcase,_}) -> false; - (_Other) -> true end, Spec),St}. - -%% Initialize our new top case. We'll keep in it the state to be -%% able to add more to it. - -init_topcase(Vars, Spec, St) -> - TestDir = St#state.test_dir, - TopCase = - case St#state.mod of - Mod when is_atom(Mod) -> - ModStr = atom_to_list(Mod), - case filelib:is_file(filename:join(TestDir,ModStr++".erl")) of - true -> [{Mod,all}]; - false -> - Wc = filename:join(TestDir, ModStr ++ "*_SUITE.erl"), - [{list_to_atom(filename:basename(M, ".erl")),all} || - M <- filelib:wildcard(Wc)] - end; - _Other -> - %% Here we used to return {dir,TestDir}. Now we instead - %% list all suites in TestDir, so we can add make testcases - %% around it later (see add_make_testcase) without getting - %% duplicates of the suite. (test_server_ctrl does no longer - %% check for duplicates of testcases) - Wc = filename:join(TestDir, "*_SUITE.erl"), - [{list_to_atom(filename:basename(M, ".erl")),all} || - M <- filelib:wildcard(Wc)] - end, - {ok,Vars,Spec,St#state{topcase=TopCase}}. - -%% Or if option keep_topcase was given, eh... keep the topcase -copy_topcase(Vars, Spec, St) -> - {value,{topcase,Tc}} = lists:keysearch(topcase,1,Spec), - {ok, Vars, lists:keydelete(topcase,1,Spec),St#state{topcase=Tc}}. - %% Run any "Makefile.first" files first. %% XXX We should fake a failing test case if the make fails. @@ -260,157 +152,6 @@ run_pre_makefile(Vars, Spec, St) -> {error,_Reason}=Error -> Error end. -%% Search for `Makefile.src' in each *_SUITE_data directory. - -find_makefiles(Vars, Spec, St) -> - Wc = filename:join(St#state.data_wc, "Makefile.src"), - Makefiles = reverse(del_skipped_suite_data_dir(filelib:wildcard(Wc), Spec)), - {ok,Vars,Spec,St#state{makefiles=Makefiles}}. - -%% Create "Makefile" from "Makefile.src". - -make_make(Vars, Spec, State) -> - Src = State#state.makefile, - Dest = filename:rootname(Src), - ts_lib:progress(Vars, 1, "Making ~s...\n", [Dest]), - case ts_lib:subst_file(Src, Dest, Vars) of - ok -> - {ok, Vars, Spec, State#state{makefile=Dest}}; - {error, Reason} -> - {error, {Src, Reason}} - end. - -%% Add a testcase which will do the making of the stuff in the data directory. - -add_make_testcase(Vars, Spec, St) -> - Makefile = St#state.makefile, - Dir = filename:dirname(Makefile), - Shortname = filename:basename(Makefile), - Suite = filename:basename(Dir, "_data"), - Config = [{data_dir,Dir},{makefile,Shortname}], - MakeModule = Suite ++ "_make", - MakeModuleSrc = filename:join(filename:dirname(Dir), - MakeModule ++ ".erl"), - MakeMod = list_to_atom(MakeModule), - case filelib:is_file(MakeModuleSrc) of - true -> ok; - false -> generate_make_module(ts_lib:var(make_command, Vars), - MakeModuleSrc, - MakeModule) - end, - case Suite of - "all_SUITE" -> - {ok,Vars,Spec,St#state{all={MakeMod,Config}}}; - _ -> - %% Avoid duplicates of testcases. There is no longer - %% a check for this in test_server_ctrl. - TestCase = {list_to_atom(Suite),all}, - TopCase0 = case St#state.topcase of - List when is_list(List) -> - List -- [TestCase]; - Top -> - [Top] -- [TestCase] - end, - TopCase = [{make,{MakeMod,make,[Config]}, - TestCase, - {MakeMod,unmake,[Config]}}|TopCase0], - {ok,Vars,Spec,St#state{topcase=TopCase}} - end. - -generate_make_module(MakeCmd, Name, ModuleString) -> - {ok,Host} = inet:gethostname(), - file:write_file(Name, - ["-module(",ModuleString,").\n", - "\n", - "-export([make/1,unmake/1]).\n", - "\n", - "make(Config) when is_list(Config) ->\n", - " Mins = " ++ integer_to_list(?DEFAULT_MAKE_TIMETRAP_MINUTES) ++ ",\n" - " test_server:format(\"=== Setting timetrap to ~p minutes ===~n\", [Mins]),\n" - " TimeTrap = test_server:timetrap(test_server:minutes(Mins)),\n" - " Res = ts_make:make([{make_command, \""++MakeCmd++"\"},{cross_node,\'ts@" ++ Host ++ "\'}|Config]),\n", - " test_server:timetrap_cancel(TimeTrap),\n" - " Res.\n" - "\n", - "unmake(Config) when is_list(Config) ->\n", - " Mins = " ++ integer_to_list(?DEFAULT_UNMAKE_TIMETRAP_MINUTES) ++ ",\n" - " test_server:format(\"=== Setting timetrap to ~p minutes ===~n\", [Mins]),\n" - " TimeTrap = test_server:timetrap(test_server:minutes(Mins)),\n" - " Res = ts_make:unmake([{make_command, \""++MakeCmd++"\"}|Config]),\n" - " test_server:timetrap_cancel(TimeTrap),\n" - " Res.\n" - "\n"]). - - -make_test_suite(Vars, _Spec, State) -> - TestDir = State#state.test_dir, - - Erl_flags=[{i, "../test_server"}|ts_lib:var(erl_flags,Vars)], - - case code:is_loaded(test_server_line) of - false -> code:load_file(test_server_line); - _ -> ok - end, - - {ok, Cwd} = file:get_cwd(), - ok = file:set_cwd(TestDir), - Result = (catch make_all(Erl_flags)), - ok = file:set_cwd(Cwd), - case Result of - up_to_date -> - ok; - {'EXIT', Reason} -> - %% If I return an error here, the test will be stopped - %% and it will not show up in the top index page. Instead - %% I return ok - the test will run for all existing suites. - %% It might be that there are old suites that are run, but - %% at least one suite is missing, and that is reported on the - %% top index page. - io:format("~s: {error,{make_crashed,~p}\n", - [State#state.file,Reason]), - ok; - error -> - %% See comment above - io:format("~s: {error,make_of_test_suite_failed}\n", - [State#state.file]), - ok - end. - -%% Add topcase to spec. - -add_topcase_to_spec(Vars, Spec, St) -> - Tc = case St#state.all of - {MakeMod,Config} -> - [{make,{MakeMod,make,[Config]}, - St#state.topcase, - {MakeMod,unmake,[Config]}}]; - undefined -> St#state.topcase - end, - {ok,Vars,Spec++[{topcase,Tc}],St}. - -%% Writes the (possibly transformed) spec file. - -write_spec_file(Vars, Spec, _State) -> - F = fun(Term) -> io_lib:format("~p.~n", [Term]) end, - SpecFile = map(F, Spec), - Hosts = - case lists:keysearch(hosts, 1, Vars) of - false -> - []; - {value, {hosts, HostList}} -> - io_lib:format("{hosts,~p}.~n",[HostList]) - end, - DiskLess = - case lists:keysearch(diskless, 1, Vars) of - false -> - []; - {value, {diskless, How}} -> - io_lib:format("{diskless, ~p}.~n",[How]) - end, - Conf = consult_config(), - MoreConfig = io_lib:format("~p.\n", [{config,Conf}]), - file:write_file("current.spec", [DiskLess,Hosts,MoreConfig,SpecFile]). - get_config_files() -> TSConfig = "ts.config", [TSConfig | case os:type() of @@ -420,21 +161,6 @@ get_config_files() -> _ -> [] end]. -consult_config() -> - {ok,Conf} = file:consult("ts.config"), - case os:type() of - {unix,_} -> consult_config("ts.unix.config", Conf); - {win32,_} -> consult_config("ts.win32.config", Conf); - vxworks -> consult_config("ts.vxworks.config", Conf); - _ -> Conf - end. - -consult_config(File, Conf0) -> - case file:consult(File) of - {ok,Conf} -> Conf++Conf0; - {error,enoent} -> Conf0 - end. - %% Makes the command to start up the Erlang node to run the tests. backslashify([$\\, $" | T]) -> @@ -647,77 +373,11 @@ make_common_test_args(Args0, Options, _Vars) -> io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++ ConfigFiles++Options]). -make_test_server_args(Args0,Options,Vars) -> - Parameters = - case ts_lib:var(os, Vars) of - "VxWorks" -> - F = write_parameterfile(vxworks,Vars), - " PARAMETERS " ++ F; - _ -> - "" - end, - Trace = - case lists:keysearch(trace,1,Options) of - {value,{trace,TI}} when is_tuple(TI); is_tuple(hd(TI)) -> - ok = file:write_file(?tracefile,io_lib:format("~p.~n",[TI])), - " TRACE " ++ ?tracefile; - {value,{trace,TIFile}} when is_atom(TIFile) -> - " TRACE " ++ atom_to_list(TIFile); - {value,{trace,TIFile}} -> - " TRACE " ++ TIFile; - false -> - "" - end, - Cover = - case lists:keysearch(cover,1,Options) of - {value,{cover,App,File,Analyse}} -> - " COVER " ++ to_list(App) ++ " " ++ to_list(File) ++ " " ++ - to_list(Analyse); - false -> - "" - end, - TCCallback = - case ts_lib:var(ts_testcase_callback, Vars) of - "" -> - ""; - {Mod,Func} -> - io:format("Function ~w:~w/4 will be called before and " - "after each test case.\n", [Mod,Func]), - " TESTCASE_CALLBACK " ++ to_list(Mod) ++ " " ++ to_list(Func); - ModFunc when is_list(ModFunc) -> - [Mod,Func]=string:tokens(ModFunc," "), - io:format("Function ~s:~s/4 will be called before and " - "after each test case.\n", [Mod,Func]), - " TESTCASE_CALLBACK " ++ ModFunc; - _ -> - "" - end, - Args0 ++ Parameters ++ Trace ++ Cover ++ TCCallback. - to_list(X) when is_atom(X) -> atom_to_list(X); to_list(X) when is_list(X) -> X. -write_parameterfile(Type,Vars) -> - Cross_host = ts_lib:var(target_host, Vars), - SlaveTargets = case lists:keysearch(slavetargets,1,Vars) of - {value, ST} -> - [ST]; - _ -> - [] - end, - Master = case lists:keysearch(master,1,Vars) of - {value,M} -> [M]; - false -> [] - end, - ToWrite = [{type,Type}, - {target, list_to_atom(Cross_host)}] ++ SlaveTargets ++ Master, - - Crossfile = atom_to_list(Type) ++ "parameters" ++ os:getpid(), - ok = file:write_file(Crossfile,io_lib:format("~p.~n", [ToWrite])), - Crossfile. - %% %% Paths and spaces handling for w2k and XP %% @@ -763,53 +423,3 @@ split_one(Path) -> split_path(Path) -> string:tokens(Path,";"). - -%% -%% Run make:all/1 if the test suite seems to be designed -%% to be built/re-built by ts. -%% -make_all(Flags) -> - case filelib:is_regular("Emakefile") of - false -> - make_all_no_emakefile(Flags); - true -> - make:all(Flags) - end. - -make_all_no_emakefile(Flags) -> - case filelib:wildcard("*.beam") of - [] -> - %% Since there are no *.beam files, we will assume - %% that this test suite was designed to be built and - %% re-built by ts. Create an Emakefile so that - %% make:all/1 will be run the next time too - %% (in case a test suite is being interactively - %% developed). - create_emakefile(Flags, "*.erl"); - [_|_] -> - %% There is no Emakefile and there already are - %% some *.beam files here. Assume that this test - %% suite was not designed to be re-built by ts. - %% Only create a Emakefile that will compile - %% generated *_SUITE_make files (if any). - create_emakefile(Flags, "*_SUITE_make.erl") - end. - -create_emakefile(Flags, Wc) -> - case filelib:wildcard(Wc) of - [] -> - %% There are no files to be built (i.e. not even any - %% generated *_SUITE_make.erl files). We must handle - %% this case specially, because make:all/1 will crash - %% on Emakefile with an empty list of modules. - io:put_chars("No Emakefile found - not running make:all/1\n"), - up_to_date; - [_|_]=Ms0 -> - io:format("Creating an Emakefile for compiling files matching ~s\n", - [Wc]), - Ms = [list_to_atom(filename:rootname(M, ".erl")) || M <- Ms0], - Make0 = {Ms,Flags}, - Make = io_lib:format("~p. \n", [Make0]), - ok = file:write_file("Emakefile", Make), - make:all(Flags) - end. -- cgit v1.2.3 From c478e3fda9b244fe49da78e6a64021b40a792688 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 14 Jan 2011 08:52:59 +0100 Subject: Ignore permission error when implicitly setting SO_PRIORITY --- erts/emulator/drivers/common/inet_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 818bc6334e..49da0ef118 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1997-2010. All Rights Reserved. + * Copyright Ericsson AB 1997-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -5095,6 +5095,9 @@ static int setopt_prio_tos_trick SO_PRIORITY, (char *) &tmp_ival_prio, tmp_arg_sz_prio); + if (res != 0 && sock_errno() == EPERM) { + res = 0; + } } } } -- cgit v1.2.3 From 3c10f18499b9b3f713ac48ca5973869778cf4df9 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 27 Jan 2011 12:11:23 +0100 Subject: Add patch from Per Hedeland Per H @ Tail-f: The original code here had problems that possibly only occur if you abuse it for non-INET sockets, but anyway: a) If the getsockopt for SO_PRIORITY or IP_TOS failed, the actual requested setsockopt was never even attempted. b) If {get,set}sockopt for one of IP_TOS and SO_PRIORITY failed, but ditto for the other worked and that was actually the requested option, failure was still reported to erlang. --- erts/emulator/drivers/common/inet_drv.c | 42 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index 49da0ef118..b491242aea 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -5050,9 +5050,17 @@ static STATUS wrap_sockopt(STATUS (*function)() /* Yep, no parameter } #endif +/* Per H @ Tail-f: The original code here had problems that possibly + only occur if you abuse it for non-INET sockets, but anyway: + a) If the getsockopt for SO_PRIORITY or IP_TOS failed, the actual + requested setsockopt was never even attempted. + b) If {get,set}sockopt for one of IP_TOS and SO_PRIORITY failed, + but ditto for the other worked and that was actually the requested + option, failure was still reported to erlang. */ + #if defined(IP_TOS) && defined(SOL_IP) && defined(SO_PRIORITY) static int setopt_prio_tos_trick - (int fd, int proto, int type, char* arg_ptr, int arg_sz) + (int fd, int proto, int type, char* arg_ptr, int arg_sz, int propagate) { /* The relations between SO_PRIORITY, TOS and other options is not what you (or at least I) would expect...: @@ -5065,6 +5073,8 @@ static int setopt_prio_tos_trick int tmp_ival_prio; int tmp_ival_tos; int res; + int res_prio; + int res_tos; #ifdef HAVE_SOCKLEN_T socklen_t #else @@ -5073,31 +5083,35 @@ static int setopt_prio_tos_trick tmp_arg_sz_prio = sizeof(tmp_ival_prio), tmp_arg_sz_tos = sizeof(tmp_ival_tos); - res = sock_getopt(fd, SOL_SOCKET, SO_PRIORITY, + res_prio = sock_getopt(fd, SOL_SOCKET, SO_PRIORITY, (char *) &tmp_ival_prio, &tmp_arg_sz_prio); - if (res == 0) { - res = sock_getopt(fd, SOL_IP, IP_TOS, + res_tos = sock_getopt(fd, SOL_IP, IP_TOS, (char *) &tmp_ival_tos, &tmp_arg_sz_tos); - if (res == 0) { res = sock_setopt(fd, proto, type, arg_ptr, arg_sz); if (res == 0) { if (type != SO_PRIORITY) { - if (type != IP_TOS) { - res = sock_setopt(fd, + if (type != IP_TOS && res_tos == 0) { + res_tos = sock_setopt(fd, SOL_IP, IP_TOS, (char *) &tmp_ival_tos, tmp_arg_sz_tos); + if (propagate) + res = res_tos; } - if (res == 0) { - res = sock_setopt(fd, + if (res == 0 && res_prio == 0) { + res_prio = sock_setopt(fd, SOL_SOCKET, SO_PRIORITY, (char *) &tmp_ival_prio, tmp_arg_sz_prio); - if (res != 0 && sock_errno() == EPERM) { - res = 0; - } + if (propagate) { + /* Some kernels set a SO_PRIORITY by default that you are not permitted to reset, + silently ignore this error condition */ + if (res_prio != 0 && sock_errno() == EPERM) { + res = 0; + } else { + res = res_prio; } } } @@ -5443,7 +5457,7 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len) return -1; } #if defined(IP_TOS) && defined(SOL_IP) && defined(SO_PRIORITY) - res = setopt_prio_tos_trick (desc->s, proto, type, arg_ptr, arg_sz); + res = setopt_prio_tos_trick (desc->s, proto, type, arg_ptr, arg_sz, propagate); #else res = sock_setopt (desc->s, proto, type, arg_ptr, arg_sz); #endif @@ -5973,7 +5987,7 @@ static int sctp_set_opts(inet_descriptor* desc, char* ptr, int len) return -1; } #if defined(IP_TOS) && defined(SOL_IP) && defined(SO_PRIORITY) - res = setopt_prio_tos_trick (desc->s, proto, type, arg_ptr, arg_sz); + res = setopt_prio_tos_trick (desc->s, proto, type, arg_ptr, arg_sz, 1); #else res = sock_setopt (desc->s, proto, type, arg_ptr, arg_sz); #endif -- cgit v1.2.3 From 1580937874b35350c0ff5c2a72b2540d7ec28378 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 15 Feb 2011 14:48:08 +0100 Subject: Allow unexpected driver input event in driver_SUITE:smp_select epoll on Linux has been seen to sometimes trigger unexpected events. Most of the time these events are filtered by erl_check_io, but may slip up to the driver in cases when fd's are reused. Also made clear in driver docs that spurious events may happen. --- erts/doc/src/driver_entry.xml | 6 +++++- erts/emulator/test/driver_SUITE.erl | 4 ++-- erts/emulator/test/driver_SUITE_data/chkio_drv.c | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index dd949d4048..7d1585f483 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -4,7 +4,7 @@

- 20012010 + 20012011 Ericsson AB. All Rights Reserved. @@ -219,6 +219,10 @@ typedef struct erl_drv_entry { completes, write to the pipe (use SetEvent on Windows), this will make the emulator call ready_input or ready_output.

+

Spurious events may happen. That is, calls to ready_input + or ready_output even though no real events are signaled. In + reality it should be rare (and OS dependant), but a robust driver + must nevertheless be able to handle such cases.

char *driver_name diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 39b2ed395f..e029e4ec87 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1682,7 +1682,7 @@ smp_select0(Config) -> ProcFun = fun()-> io:format("Worker ~p starting\n",[self()]), ?line Port = open_port({spawn, DrvName}, []), smp_select_loop(Port, 100000), - sleep(500), % wait for driver to handle pending events + sleep(1000), % wait for driver to handle pending events ?line true = erlang:port_close(Port), Master ! {ok,self()}, io:format("Worker ~p finished\n",[self()]) diff --git a/erts/emulator/test/driver_SUITE_data/chkio_drv.c b/erts/emulator/test/driver_SUITE_data/chkio_drv.c index b571cb30e6..bbdb09cfcb 100644 --- a/erts/emulator/test/driver_SUITE_data/chkio_drv.c +++ b/erts/emulator/test/driver_SUITE_data/chkio_drv.c @@ -102,6 +102,7 @@ typedef struct chkio_smp_select { int write_fd; int next_read; int next_write; + int first_write; enum {Closed, Opened, Selected, Waiting} state; int wasSelected; unsigned rand_state; @@ -577,9 +578,16 @@ chkio_drv_ready_input(ErlDrvData drv_data, ErlDrvEvent event) inPipe = (pip->next_write - pip->next_read); if (inPipe == 0) { bytes = read(pip->read_fd, &word, sizeof(word)); - printf("Unexpected empty pipe, expected %u -> %u, bytes=%d, word=%d\n", - pip->next_read, pip->next_write-1, bytes, word); - abort(); + printf("Unexpected empty pipe, expected %u -> %u, bytes=%d, word=%d, written=%d\n", + pip->next_read, pip->next_write-1, bytes, word, + (pip->next_write - pip->first_write)); + /*abort(); + Allow unexpected events as it's been seen to be triggered by epoll + on Linux. Most of the time the unwanted events are filtered by + the erl_check_io layer. But when fd's are reused the events may + slip up to the driver. + */ + break; } n = rand_r(&pip->rand_state) % (inPipe*4); @@ -1252,6 +1260,7 @@ chkio_drv_control(ErlDrvData drv_data, pip->state = Opened; pip->wasSelected = 0; pip->next_write = pip->next_read = rand_r(&pip->rand_state) % 1024; + pip->first_write = pip->next_write; if (op & 1) break; op >>= 1; }/*fall through*/ -- cgit v1.2.3 From 95280cc9c09187465d423fd3481b3aa4310c4bab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 22 Feb 2011 10:32:00 +0100 Subject: Prep for release: snmp-4.19 --- lib/snmp/doc/src/notes.xml | 8 ++++---- lib/snmp/vsn.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 3fe39c4d03..39aff4e28a 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -33,8 +33,8 @@
- SNMP Development Toolkit 4.18.1 -

Version 4.18.1 supports code replacement in runtime from/to + SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to version 4.18, 4.17.1 and 4.17.

@@ -64,7 +64,7 @@ Incompatibilities

-

-
+
SNMP 4.18 diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 67cc05687d..617f0fce62 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.18.1 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 197d6abd8b6efb30c6237133ed08bf379f29cb84 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 22 Feb 2011 10:37:18 +0100 Subject: Prep for release: snmp-4.19 --- lib/snmp/doc/src/notes.xml | 10 +++++----- lib/snmp/vsn.mk | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index f3bb9d25ea..c42d62f013 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -33,8 +33,8 @@
- SNMP Development Toolkit 4.18.1 -

Version 4.18.1 supports code replacement in runtime from/to + SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to version 4.18, 4.17.1 and 4.17.

@@ -47,7 +47,7 @@

[agent] For the table vacmAccessTable, - when performing the is_set_ok and set opteration(s), + when performing the is_set_ok and set operation(s), all values of the vacmAccessSecurityModel column was incorrectly translated to any.

+
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 67cc05687d..617f0fce62 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -17,6 +17,6 @@ # # %CopyrightEnd% -SNMP_VSN = 4.18.1 +SNMP_VSN = 4.19 PRE_VSN = APP_VSN = "snmp-$(SNMP_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 937e33952a41fed5357d19338a81f4f026930f52 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 11 Feb 2011 17:31:34 +0100 Subject: Do not save initial arguments for dynamic temporary processes --- lib/stdlib/src/supervisor.erl | 88 +++++++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 20 deletions(-) diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl index 7102fb9f6e..bfa7c96eca 100644 --- a/lib/stdlib/src/supervisor.erl +++ b/lib/stdlib/src/supervisor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -69,7 +69,7 @@ -record(state, {name, strategy :: strategy(), children = [] :: [child()], - dynamics = ?DICT:new() :: ?DICT(), + dynamics :: ?DICT() | list(), intensity :: non_neg_integer(), period :: pos_integer(), restarts = [], @@ -283,16 +283,15 @@ do_start_child_i(M, F, A) -> -spec handle_call(call(), term(), state()) -> {'reply', term(), state()}. handle_call({start_child, EArgs}, _From, State) when ?is_simple(State) -> - #child{mfargs = {M, F, A}} = hd(State#state.children), + Child = hd(State#state.children), + #child{mfargs = {M, F, A}} = Child, Args = A ++ EArgs, case do_start_child_i(M, F, Args) of {ok, Pid} -> - NState = State#state{dynamics = - ?DICT:store(Pid, Args, State#state.dynamics)}, + NState = save_dynamic_child(Child#child.restart_type, Pid, Args, State), {reply, {ok, Pid}, NState}; {ok, Pid, Extra} -> - NState = State#state{dynamics = - ?DICT:store(Pid, Args, State#state.dynamics)}, + NState = save_dynamic_child(Child#child.restart_type, Pid, Args, State), {reply, {ok, Pid, Extra}, NState}; What -> {reply, What, State} @@ -351,10 +350,20 @@ handle_call({terminate_child, Name}, _From, State) -> {reply, {error, not_found}, State} end; -handle_call(which_children, _From, State) when ?is_simple(State) -> - [#child{child_type = CT, modules = Mods}] = State#state.children, +handle_call(which_children, _From, #state{children = [#child{restart_type = temporary, + child_type = CT, + modules = Mods}]} = + State) when ?is_simple(State) -> + Reply = lists:map(fun(Pid) -> {undefined, Pid, CT, Mods} end, dynamics_db(temporary, + State#state.dynamics)), + {reply, Reply, State}; + +handle_call(which_children, _From, #state{children = [#child{restart_type = RType, + child_type = CT, + modules = Mods}]} = + State) when ?is_simple(State) -> Reply = lists:map(fun({Pid, _}) -> {undefined, Pid, CT, Mods} end, - ?DICT:to_list(State#state.dynamics)), + ?DICT:to_list(dynamics_db(RType, State#state.dynamics))), {reply, Reply, State}; handle_call(which_children, _From, State) -> @@ -366,13 +375,31 @@ handle_call(which_children, _From, State) -> State#state.children), {reply, Resp, State}; -handle_call(count_children, _From, State) when ?is_simple(State) -> - [#child{child_type = CT}] = State#state.children, + +handle_call(count_children, _From, #state{children = [#child{restart_type = temporary, + child_type = CT}]} = State) + when ?is_simple(State) -> + {Active, Count} = + lists:foldl(fun(Pid, {Alive, Tot}) -> + if is_pid(Pid) -> {Alive+1, Tot +1}; + true -> {Alive, Tot + 1} end + end, {0, 0}, dynamics_db(temporary, State#state.dynamics)), + Reply = case CT of + supervisor -> [{specs, 1}, {active, Active}, + {supervisors, Count}, {workers, 0}]; + worker -> [{specs, 1}, {active, Active}, + {supervisors, 0}, {workers, Count}] + end, + {reply, Reply, State}; + +handle_call(count_children, _From, #state{children = [#child{restart_type = RType, + child_type = CT}]} = State) + when ?is_simple(State) -> {Active, Count} = ?DICT:fold(fun(Pid, _Val, {Alive, Tot}) -> if is_pid(Pid) -> {Alive+1, Tot +1}; true -> {Alive, Tot + 1} end - end, {0, 0}, State#state.dynamics), + end, {0, 0}, dynamics_db(RType, State#state.dynamics)), Reply = case CT of supervisor -> [{specs, 1}, {active, Active}, {supervisors, Count}, {workers, 0}]; @@ -558,11 +585,10 @@ handle_start_child(Child, State) -> %%% Returns: {ok, state()} | {shutdown, state()} %%% --------------------------------------------------- -restart_child(Pid, Reason, State) when ?is_simple(State) -> - case ?DICT:find(Pid, State#state.dynamics) of +restart_child(Pid, Reason, #state{children = [Child]} = State) when ?is_simple(State) -> + RestartType = Child#child.restart_type, + case dynamic_child_args(Pid, dynamics_db(RestartType, State#state.dynamics)) of {ok, Args} -> - [Child] = State#state.children, - RestartType = Child#child.restart_type, {M, F, _} = Child#child.mfargs, NChild = Child#child{pid = Pid, mfargs = {M, F, Args}}, do_restart(RestartType, Reason, NChild, State); @@ -608,7 +634,8 @@ restart(Child, State) -> restart(simple_one_for_one, Child, State) -> #child{mfargs = {M, F, A}} = Child, - Dynamics = ?DICT:erase(Child#child.pid, State#state.dynamics), + Dynamics = ?DICT:erase(Child#child.pid, dynamics_db(Child#child.restart_type, + State#state.dynamics)), case do_start_child_i(M, F, A) of {ok, Pid} -> NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)}, @@ -755,8 +782,29 @@ monitor_child(Pid) -> %%----------------------------------------------------------------- %% Child/State manipulating functions. %%----------------------------------------------------------------- -state_del_child(#child{pid = Pid}, State) when ?is_simple(State) -> - NDynamics = ?DICT:erase(Pid, State#state.dynamics), + +save_dynamic_child(temporary, Pid, _, #state{dynamics = Dynamics} = State) -> + State#state{dynamics = [Pid | dynamics_db(temporary, Dynamics)]}; +save_dynamic_child(RestartType, Pid, Args, #state{dynamics = Dynamics} = State) -> + State#state{dynamics = ?DICT:store(Pid, Args, dynamics_db(RestartType, Dynamics))}. + +dynamics_db(temporary, undefined) -> + []; +dynamics_db(_, undefined) -> + ?DICT:new(); +dynamics_db(_,Dynamics) -> + Dynamics. + +dynamic_child_args(_, Dynamics) when is_list(Dynamics)-> + {ok, undefined}; +dynamic_child_args(Pid, Dynamics) -> + ?DICT:find(Pid, Dynamics). + +state_del_child(#child{pid = Pid, restart_type = temporary}, State) when ?is_simple(State) -> + NDynamics = lists:delete(Pid, dynamics_db(temporary, State#state.dynamics)), + State#state{dynamics = NDynamics}; +state_del_child(#child{pid = Pid, restart_type = RType}, State) when ?is_simple(State) -> + NDynamics = ?DICT:erase(Pid, dynamics_db(RType, State#state.dynamics)), State#state{dynamics = NDynamics}; state_del_child(Child, State) -> NChildren = del_child(Child#child.name, State#state.children), -- cgit v1.2.3 From a51fea68bbcf341bf7857a6bd3f0c17ffd0402bb Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 15 Feb 2011 16:51:38 +0100 Subject: Do not save parameter list for any temporary processes Previous commit changed the supervisor to not save parameter lists for temporary processes supervised by simple-one-for-one supervisors. But it is unnecessary to save them for any temporary processes as they should not be restarted. Proably the biggest gain is in the simple-one-for-one case. Also changed the test case count_children_memory so it does not test that which_children will produce garbage that must be reclaimed later. This is a strange thing to test and it is no longer true for all invocations of which_children. --- lib/stdlib/src/supervisor.erl | 25 ++++++++++++++++--------- lib/stdlib/test/supervisor_SUITE.erl | 20 ++++---------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl index bfa7c96eca..469063689d 100644 --- a/lib/stdlib/src/supervisor.erl +++ b/lib/stdlib/src/supervisor.erl @@ -562,15 +562,11 @@ handle_start_child(Child, State) -> false -> case do_start_child(State#state.name, Child) of {ok, Pid} -> - Children = State#state.children, {{ok, Pid}, - State#state{children = - [Child#child{pid = Pid}|Children]}}; + save_child(Child#child{pid = Pid}, State)}; {ok, Pid, Extra} -> - Children = State#state.children, {{ok, Pid, Extra}, - State#state{children = - [Child#child{pid = Pid}|Children]}}; + save_child(Child#child{pid = Pid}, State)}; {error, What} -> {{error, {What, Child}}, State} end; @@ -593,13 +589,13 @@ restart_child(Pid, Reason, #state{children = [Child]} = State) when ?is_simple(S NChild = Child#child{pid = Pid, mfargs = {M, F, Args}}, do_restart(RestartType, Reason, NChild, State); error -> - {ok, State} + {ok, State} end; + restart_child(Pid, Reason, State) -> Children = State#state.children, case lists:keyfind(Pid, #child.pid, Children) of - #child{} = Child -> - RestartType = Child#child.restart_type, + #child{restart_type = RestartType} = Child -> do_restart(RestartType, Reason, Child, State); false -> {ok, State} @@ -783,6 +779,17 @@ monitor_child(Pid) -> %% Child/State manipulating functions. %%----------------------------------------------------------------- +%% Note we do not want to save the parameter list for temporary processes as +%% they will not be restarted, and hence we do not need this information. +%% Especially for dynamic children to simple_one_for_one supervisors +%% it could become very costly as it is not uncommon to spawn +%% very many such processes. +save_child(#child{restart_type = temporary, + mfargs = {M, F, _}} = Child, #state{children = Children} = State) -> + State#state{children = [Child#child{mfargs = {M, F, undefined}} |Children]}; +save_child(Child, #state{children = Children} = State) -> + State#state{children = [Child |Children]}. + save_dynamic_child(temporary, Pid, _, #state{dynamics = Dynamics} = State) -> State#state{dynamics = [Pid | dynamics_db(temporary, Dynamics)]}; save_dynamic_child(RestartType, Pid, Args, #state{dynamics = Dynamics} = State) -> diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 039ea298c4..4708658a6d 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1279,7 +1279,7 @@ count_children_allocator_test(MemoryState) -> lists:all(fun(State) -> State == {e, true} end, AllocStates). count_children_memory(doc) -> - ["Test that which_children eats memory, but count_children does not."]; + ["Test that count_children does not eat memory."]; count_children_memory(suite) -> MemoryState = erlang:system_info(allocator), case count_children_allocator_test(MemoryState) of @@ -1323,8 +1323,8 @@ count_children_memory(Config) when is_list(Config) -> ?line ChildCount3 = ChildCount2, %% count_children consumes memory using an accumulator function, - %% but the space can be reclaimed incrementally, whereas - %% which_children generates a return list. + %% but the space can be reclaimed incrementally, + %% which_children may generate garbage that will reclaimed later. case (Size5 =< Size4) of true -> ok; false -> @@ -1336,19 +1336,7 @@ count_children_memory(Config) when is_list(Config) -> ?line test_server:fail({count_children, used_more_memory}) end, - case Size4 > Size3 of - true -> ok; - false -> - ?line test_server:fail({which_children, used_no_memory}) - end, - case Size6 > Size5 of - true -> ok; - false -> - ?line test_server:fail({which_children, used_no_memory}) - end, - [exit(Pid, kill) || {undefined, Pid, worker, _Modules} <- Children3], test_server:sleep(100), ?line [1,0,0,0] = get_child_counts(sup_test), - ok. -- cgit v1.2.3 From a317dc1cce5705a5ccace98fdef59704e7240b6d Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 22 Feb 2011 11:24:53 +0100 Subject: Added test case do_not_save_start_parameters_for_temporary_children and fixed dialyzer spec. --- lib/stdlib/src/supervisor.erl | 2 +- lib/stdlib/test/supervisor_SUITE.erl | 86 +++++++++++++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl index 469063689d..3c5800effa 100644 --- a/lib/stdlib/src/supervisor.erl +++ b/lib/stdlib/src/supervisor.erl @@ -40,7 +40,7 @@ %%-------------------------------------------------------------------------- -type child_id() :: pid() | 'undefined'. --type mfargs() :: {module(), atom(), [term()]}. +-type mfargs() :: {module(), atom(), [term()] | undefined}. -type modules() :: [module()] | 'dynamic'. -type restart() :: 'permanent' | 'transient' | 'temporary'. -type shutdown() :: 'brutal_kill' | timeout(). diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 4708658a6d..4ee323ee62 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -50,7 +50,8 @@ simple_one_for_one_extra/1]). %% Misc tests --export([child_unlink/1, tree/1, count_children_memory/1]). +-export([child_unlink/1, tree/1, count_children_memory/1, + do_not_save_start_parameters_for_temporary_children/1]). %------------------------------------------------------------------------- @@ -61,7 +62,7 @@ all(suite) -> restart_one_for_one, restart_one_for_all, restart_simple_one_for_one, restart_rest_for_one, normal_termination, abnormal_termination, child_unlink, tree, - count_children_memory]}. + count_children_memory, do_not_save_start_parameters_for_temporary_children]}. start(InitResult) -> @@ -1340,3 +1341,84 @@ count_children_memory(Config) when is_list(Config) -> test_server:sleep(100), ?line [1,0,0,0] = get_child_counts(sup_test), ok. +%------------------------------------------------------------------------- +do_not_save_start_parameters_for_temporary_children(doc) -> + ["Temporary children shall not be restarted so they should not" + "save start parameters, as it potentially can" + "take up a huge amount of memory for no purpose."]; +do_not_save_start_parameters_for_temporary_children(suite) -> + []; +do_not_save_start_parameters_for_temporary_children(Config) when is_list(Config) -> + process_flag(trap_exit, true), + dont_save_start_parameters_for_temporary_children(one_for_all), + dont_save_start_parameters_for_temporary_children(one_for_one), + dont_save_start_parameters_for_temporary_children(rest_for_one), + dont_save_start_parameters_for_temporary_children(simple_one_for_one). + +dont_save_start_parameters_for_temporary_children(simple_one_for_one = Type) -> + Permanent = {child, {supervisor_1, start_child, []}, + permanent, 1000, worker, []}, + Transient = {child, {supervisor_1, start_child, []}, + transient, 1000, worker, []}, + Temporary = {child, {supervisor_1, start_child, []}, + temporary, 1000, worker, []}, + {ok, Sup1} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, [Permanent]}}), + {ok, Sup2} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, [Transient]}}), + {ok, Sup3} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, [Temporary]}}), + + LargeList = lists:duplicate(10, "Potentially large"), + + start_children(Sup1, [LargeList], 100), + start_children(Sup2, [LargeList], 100), + start_children(Sup3, [LargeList], 100), + + [{memory,Mem1}] = process_info(Sup1, [memory]), + [{memory,Mem2}] = process_info(Sup2, [memory]), + [{memory,Mem3}] = process_info(Sup3, [memory]), + + true = (Mem3 < Mem1) and (Mem3 < Mem2), + + exit(Sup1, shutdown), + exit(Sup2, shutdown), + exit(Sup3, shutdown); + +dont_save_start_parameters_for_temporary_children(Type) -> + {ok, Sup1} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, []}}), + {ok, Sup2} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, []}}), + {ok, Sup3} = supervisor:start_link(?MODULE, {ok, {{Type, 2, 3600}, []}}), + + LargeList = lists:duplicate(10, "Potentially large"), + + Permanent = {child1, {supervisor_1, start_child, [LargeList]}, + permanent, 1000, worker, []}, + Transient = {child2, {supervisor_1, start_child, [LargeList]}, + transient, 1000, worker, []}, + Temporary = {child3, {supervisor_1, start_child, [LargeList]}, + temporary, 1000, worker, []}, + + start_children(Sup1, Permanent, 100), + start_children(Sup2, Transient, 100), + start_children(Sup3, Temporary, 100), + + [{memory,Mem1}] = process_info(Sup1, [memory]), + [{memory,Mem2}] = process_info(Sup2, [memory]), + [{memory,Mem3}] = process_info(Sup3, [memory]), + + true = (Mem3 < Mem1) and (Mem3 < Mem2), + + exit(Sup1, shutdown), + exit(Sup2, shutdown), + exit(Sup3, shutdown). + +start_children(_,_, 0) -> + ok; +start_children(Sup, Args, N) -> + Spec = child_spec(Args, N), + {ok, _, _} = supervisor:start_child(Sup, Spec), + start_children(Sup, Args, N-1). + +child_spec([_|_] = SimpleOneForOneArgs, _) -> + SimpleOneForOneArgs; +child_spec({Name, MFA, RestartType, Shutdown, Type, Modules}, N) -> + NewName = list_to_atom((atom_to_list(Name) ++ integer_to_list(N))), + {NewName, MFA, RestartType, Shutdown, Type, Modules}. -- cgit v1.2.3 From fa2d70cc03578d80d67e099ffd47f73c39c2cdad Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 22 Feb 2011 16:01:35 +0100 Subject: Modernized some dialyzer specs --- lib/ssl/src/inet_ssl_dist.erl | 4 ++-- lib/ssl/src/ssl_connection.erl | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ssl/src/inet_ssl_dist.erl b/lib/ssl/src/inet_ssl_dist.erl index b10aa76246..249097c162 100644 --- a/lib/ssl/src/inet_ssl_dist.erl +++ b/lib/ssl/src/inet_ssl_dist.erl @@ -137,7 +137,7 @@ accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) -> %% Suppress dialyzer warning, we do not really care about old ssl code %% as we intend to remove it. --spec(do_accept/6 :: (_,_,_,_,_,_) -> no_return()). +-spec(do_accept(_,_,_,_,_,_) -> no_return()). do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) -> process_flag(priority, max), receive @@ -209,7 +209,7 @@ setup(Node, Type, MyNode, LongOrShortNames,SetupTime) -> %% Suppress dialyzer warning, we do not really care about old ssl code %% as we intend to remove it. --spec(do_setup/6 :: (_,_,_,_,_,_) -> no_return()). +-spec(do_setup(_,_,_,_,_,_) -> no_return()). do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> process_flag(priority, max), ?trace("~p~n",[{inet_ssl_dist,self(),setup,Node}]), diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 489895cf29..85245f4342 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -1086,13 +1086,13 @@ init_private_key({rsa, PrivateKey}, _, _,_) -> init_private_key({dsa, PrivateKey},_,_,_) -> public_key:der_decode('DSAPrivateKey', PrivateKey). --spec(handle_file_error/6 :: (_,_,_,_,_,_) -> no_return()). +-spec(handle_file_error(_,_,_,_,_,_) -> no_return()). handle_file_error(Line, Error, {badmatch, Reason}, File, Throw, Stack) -> file_error(Line, Error, Reason, File, Throw, Stack); handle_file_error(Line, Error, Reason, File, Throw, Stack) -> file_error(Line, Error, Reason, File, Throw, Stack). --spec(file_error/6 :: (_,_,_,_,_,_) -> no_return()). +-spec(file_error(_,_,_,_,_,_) -> no_return()). file_error(Line, Error, Reason, File, Throw, Stack) -> Report = io_lib:format("SSL: ~p: ~p:~p ~s~n ~p~n", [Line, Error, Reason, File, Stack]), @@ -1412,8 +1412,6 @@ key_exchange(#state{role = client, State#state{connection_states = ConnectionStates1, tls_handshake_hashes = Hashes1}. --spec(rsa_key_exchange/2 :: (_,_) -> no_return()). - rsa_key_exchange(PremasterSecret, PublicKeyInfo = {Algorithm, _, _}) when Algorithm == ?rsaEncryption; Algorithm == ?md2WithRSAEncryption; -- cgit v1.2.3 From eed4341a21b8e2c8e00d0321bde1213d7a4359df Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Sun, 23 Jan 2011 18:16:36 -0500 Subject: erl_interface: fix buffer overflows --- lib/erl_interface/src/legacy/erl_connect.c | 7 +++---- lib/erl_interface/src/legacy/erl_format.c | 2 +- lib/erl_interface/src/legacy/erl_marshal.c | 4 ++-- lib/erl_interface/src/legacy/erl_timeout.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/erl_interface/src/legacy/erl_connect.c b/lib/erl_interface/src/legacy/erl_connect.c index 3c8c946506..e77bd5db37 100644 --- a/lib/erl_interface/src/legacy/erl_connect.c +++ b/lib/erl_interface/src/legacy/erl_connect.c @@ -180,9 +180,7 @@ int erl_xconnect(Erl_IpAddr addr, char *alivename) * * Close a connection. FIXME call ei_close_connection() later. * - * Returns valid file descriptor on success and < 0 on failure. - * Set erl_errno to EHOSTUNREACH, ENOMEM, EIO or errno from socket(2) - * or connect(2). + * Returns 0 on success and -1 on failure. * ***************************************************************************/ @@ -250,7 +248,8 @@ int erl_send(int fd, ETERM *to ,ETERM *msg) return -1; } - strcpy(topid.node, (char *)ERL_PID_NODE(to)); + strncpy(topid.node, (char *)ERL_PID_NODE(to), sizeof(topid.node)); + topid.node[sizeof(topid.node)-1] = '\0'; topid.num = ERL_PID_NUMBER(to); topid.serial = ERL_PID_SERIAL(to); topid.creation = ERL_PID_CREATION(to); diff --git a/lib/erl_interface/src/legacy/erl_format.c b/lib/erl_interface/src/legacy/erl_format.c index 9848e9296a..b17269213f 100644 --- a/lib/erl_interface/src/legacy/erl_format.c +++ b/lib/erl_interface/src/legacy/erl_format.c @@ -116,7 +116,7 @@ static lvar *lvar_alloc(void) lvar *tmp; if ((tmp = ef.idle) == NULL) { - tmp = (lvar *) malloc(sizeof(lvar)); /* FIXME check result */ + tmp = (lvar *) erl_malloc(sizeof(lvar)); } else { tmp = ef.idle; diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c index 70949a7adf..5cfb5e2124 100644 --- a/lib/erl_interface/src/legacy/erl_marshal.c +++ b/lib/erl_interface/src/legacy/erl_marshal.c @@ -662,7 +662,7 @@ len = i #define STATIC_NODE_BUF_SZ 30 #define SET_NODE(node,node_buf,cp,len) \ -if (len >= STATIC_NODE_BUF_SZ) node = malloc(len+1); \ +if (len >= STATIC_NODE_BUF_SZ) node = erl_malloc(len+1); \ else node = node_buf; \ memcpy(node, cp, len); \ node[len] = '\0' @@ -1534,7 +1534,7 @@ static int cmp_string_list(unsigned char **e1, unsigned char **e2) { if ( e1_len < 256 ) { bp = buf; } else { - bp = malloc(5+(2*e1_len)+1); + bp = erl_malloc(5+(2*e1_len)+1); } bp[0] = ERL_LIST_EXT; diff --git a/lib/erl_interface/src/legacy/erl_timeout.c b/lib/erl_interface/src/legacy/erl_timeout.c index af1a4a1f3a..6ef5d258ed 100644 --- a/lib/erl_interface/src/legacy/erl_timeout.c +++ b/lib/erl_interface/src/legacy/erl_timeout.c @@ -74,7 +74,7 @@ jmp_buf *timeout_setup(int ms) t.it_value.tv_usec = (ms % 1000) * 1000; /* get a jump buffer and save it */ - j = malloc(sizeof(*j)); /* FIXME check result */ + j = erl_malloc(sizeof(*j)); j->siginfo = s; push(j); -- cgit v1.2.3 From 0b9795fa8145dcb06639cbb67a376e440b4fbc92 Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Sun, 23 Jan 2011 18:16:10 -0500 Subject: ei: buffer overflow when decoding atoms --- lib/erl_interface/src/decode/decode_atom.c | 2 ++ lib/erl_interface/src/decode/decode_pid.c | 2 ++ lib/erl_interface/src/decode/decode_port.c | 2 ++ lib/erl_interface/src/decode/decode_ref.c | 3 +++ lib/erl_interface/src/misc/ei_decode_term.c | 5 +++++ 5 files changed, 14 insertions(+) diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c index b247bd4e17..ef28838b79 100644 --- a/lib/erl_interface/src/decode/decode_atom.c +++ b/lib/erl_interface/src/decode/decode_atom.c @@ -31,6 +31,8 @@ int ei_decode_atom(const char *buf, int *index, char *p) len = get16be(s); + if (len > MAXATOMLEN) return -1; + if (p) { memmove(p,s,len); p[len] = (char)0; diff --git a/lib/erl_interface/src/decode/decode_pid.c b/lib/erl_interface/src/decode/decode_pid.c index 5f2aec3b44..48a0c68240 100644 --- a/lib/erl_interface/src/decode/decode_pid.c +++ b/lib/erl_interface/src/decode/decode_pid.c @@ -33,6 +33,8 @@ int ei_decode_pid(const char *buf, int *index, erlang_pid *p) if (get8(s) != ERL_ATOM_EXT) return -1; len = get16be(s); + + if (len > MAXATOMLEN) return -1; if (p) { memmove(p->node, s, len); diff --git a/lib/erl_interface/src/decode/decode_port.c b/lib/erl_interface/src/decode/decode_port.c index 7fb7d8d414..296ebae024 100644 --- a/lib/erl_interface/src/decode/decode_port.c +++ b/lib/erl_interface/src/decode/decode_port.c @@ -34,6 +34,8 @@ int ei_decode_port(const char *buf, int *index, erlang_port *p) len = get16be(s); + if (len > MAXATOMLEN) return -1; + if (p) { memmove(p->node, s, len); p->node[len] = (char)0; diff --git a/lib/erl_interface/src/decode/decode_ref.c b/lib/erl_interface/src/decode/decode_ref.c index 6fc2cd6533..691b51fe2d 100644 --- a/lib/erl_interface/src/decode/decode_ref.c +++ b/lib/erl_interface/src/decode/decode_ref.c @@ -35,6 +35,8 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p) len = get16be(s); + if (len > MAXATOMLEN) return -1; + if (p) { memmove(p->node, s, len); p->node[len] = (char)0; @@ -62,6 +64,7 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p) /* then the nodename */ if (get8(s) != ERL_ATOM_EXT) return -1; len = get16be(s); + if (len > MAXATOMLEN) return -1; if (p) { memmove(p->node, s, len); diff --git a/lib/erl_interface/src/misc/ei_decode_term.c b/lib/erl_interface/src/misc/ei_decode_term.c index 75c5dc9460..9b238c1e90 100644 --- a/lib/erl_interface/src/misc/ei_decode_term.c +++ b/lib/erl_interface/src/misc/ei_decode_term.c @@ -49,6 +49,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) return ei_decode_double(buf, index, &term->value.d_val); case ERL_ATOM_EXT: len = get16be(s); + if (len > MAXATOMLEN) return -1; memcpy(term->value.atom_name, s, len); term->value.atom_name[len] = '\0'; s += len; @@ -57,6 +58,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) /* first the nodename */ if (get8(s) != ERL_ATOM_EXT) return -1; len = get16be(s); + if (len > MAXATOMLEN) return -1; memcpy(term->value.ref.node, s, len); term->value.ref.node[len] = '\0'; s += len; @@ -71,6 +73,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) /* then the nodename */ if (get8(s) != ERL_ATOM_EXT) return -1; len = get16be(s); + if (len > MAXATOMLEN) return -1; memcpy(term->value.ref.node, s, len); term->value.ref.node[len] = '\0'; s += len; @@ -87,6 +90,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) case ERL_PORT_EXT: if (get8(s) != ERL_ATOM_EXT) return -1; len = get16be(s); + if (len > MAXATOMLEN) return -1; memcpy(term->value.port.node, s, len); term->value.port.node[len] = '\0'; term->value.port.id = get32be(s) & 0x0fffffff; /* 28 bits */; @@ -96,6 +100,7 @@ int ei_decode_ei_term(const char* buf, int* index, ei_term* term) if (get8(s) != ERL_ATOM_EXT) return -1; /* name first */ len = get16be(s); + if (len > MAXATOMLEN) return -1; memcpy(term->value.pid.node, s, len); term->value.pid.node[len] = '\0'; s += len; -- cgit v1.2.3 From d9ebfb8576027d384ee6b8bb3460c14560abab12 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 22 Feb 2011 16:52:28 +0100 Subject: Corrected dialyzer specs --- lib/ssl/src/ssl.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index 65b081937f..b85188b878 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -72,8 +72,8 @@ %%-------------------------------------------------------------------- --spec start() -> ok. --spec start(permanent | transient | temporary) -> ok. +-spec start() -> ok | {error, reason()}. +-spec start(permanent | transient | temporary) -> ok | {error, reason()}. %% %% Description: Utility function that starts the ssl, %% crypto and public_key applications. Default type -- cgit v1.2.3 From afdb6f011baedffb7290dd7b689a88af015e8b37 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Tue, 22 Feb 2011 17:45:43 +0100 Subject: Dialyzer does not like old fun syntax --- lib/ssl/src/inet_ssl_dist.erl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/ssl/src/inet_ssl_dist.erl b/lib/ssl/src/inet_ssl_dist.erl index 249097c162..6c0fbc0618 100644 --- a/lib/ssl/src/inet_ssl_dist.erl +++ b/lib/ssl/src/inet_ssl_dist.erl @@ -1,8 +1,8 @@ -%% -%% 2000-2008 -%% Ericsson AB, All Rights Reserved -%% -%% +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the @@ -14,8 +14,9 @@ %% the License for the specific language governing rights and limitations %% under the License. %% -%% The Initial Developer of the Original Code is Ericsson AB. -%% +%% %CopyrightEnd% +%% + %% -module(inet_ssl_dist). @@ -170,8 +171,8 @@ do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) -> ssl_prim:getll(S) end, f_address = fun get_remote_id/2, - mf_tick = {?MODULE, tick}, - mf_getstat = {?MODULE,getstat} + mf_tick = fun ?MODULE:tick/1, + mf_getstat = fun ?MODULE:getstat/1 }, dist_util:handshake_other_started(HSData); {false,IP} -> @@ -264,8 +265,8 @@ do_setup(Kernel, Node, Type, MyNode, LongOrShortNames,SetupTime) -> protocol = ssl, family = inet} end, - mf_tick = {?MODULE, tick}, - mf_getstat = {?MODULE,getstat}, + mf_tick = fun ?MODULE:tick/1, + mf_getstat = fun ?MODULE:getstat/1, request_type = Type }, dist_util:handshake_we_started(HSData); -- cgit v1.2.3 From 6dfa9a9a775fe0c73d08dc7f2f5fa67edd9ece25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 10:19:16 +0100 Subject: inet6_tcp_dist: Eliminate dialyzer warning for "tuple fun" Replace the "tuple fun" with an external fun. --- lib/kernel/src/inet6_tcp_dist.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/kernel/src/inet6_tcp_dist.erl b/lib/kernel/src/inet6_tcp_dist.erl index fab00bbb9f..b9c4fa607c 100644 --- a/lib/kernel/src/inet6_tcp_dist.erl +++ b/lib/kernel/src/inet6_tcp_dist.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -162,8 +162,8 @@ do_accept(Kernel, AcceptPid, Socket, MyNode, Allowed, SetupTime) -> inet:getll(S) end, f_address = fun get_remote_id/2, - mf_tick = {?MODULE, tick}, - mf_getstat = {?MODULE,getstat} + mf_tick = fun ?MODULE:tick/1, + mf_getstat = fun ?MODULE:getstat/1 }, dist_util:handshake_other_started(HSData); {false,IP} -> -- cgit v1.2.3 From b939f70dd90152d48d2f2f10e650cc2115742489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 08:35:21 +0100 Subject: beam_emu: Remove unnecessary decrement of I in "case_end r" It is not necessary to decrement I, because an exception is about to be generated. Furthermore, I pointing *before* the instruction that caused the exception may cause problems in the future. --- erts/emulator/beam/beam_emu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 16741aa2d7..733f91705e 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -3424,7 +3424,6 @@ void process_main(void) OpCase(case_end_r): case_end_val = r(0); - I--; do_case_end: c_p->fvalue = case_end_val; -- cgit v1.2.3 From 84da094f755c32b507d91ff2269218c43b7e9624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 20 Feb 2011 09:55:54 +0100 Subject: beam_emu: Eliminate redundant #ifdef The halfword emulator used to require special handling, but no longer does. --- erts/emulator/beam/beam_emu.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index 733f91705e..12a8022861 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -5864,9 +5864,6 @@ build_stacktrace(Process* c_p, Eterm exc) { Eterm args; int depth; BeamInstr* current; -#if HALFWORD_HEAP - BeamInstr current_buff[3]; -#endif Eterm Where = NIL; Eterm *next_p = &Where; @@ -5896,14 +5893,7 @@ build_stacktrace(Process* c_p, Eterm exc) { * (e.g. spawn_link(erlang, abs, [1])). */ if (current == NULL) { -#if HALFWORD_HEAP - current = current_buff; - current[0] = (BeamInstr) c_p->initial[0]; - current[1] = (BeamInstr) c_p->initial[1]; - current[2] = (BeamInstr) c_p->initial[2]; -#else current = c_p->initial; -#endif args = am_true; /* Just in case */ } else { args = get_args_from_exc(exc); -- cgit v1.2.3 From e1833ee82c7a07e000dbbea3af6c8fefc02582d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 22 Feb 2011 10:07:04 +0100 Subject: BEAM loader: Add an assertion to check for overflowed code space While at it, clean up indentation of CHKBLK() macros. --- erts/emulator/beam/beam_load.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 4e0d19dafa..788cb4209c 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3770,24 +3770,31 @@ freeze_code(LoaderState* stp) CHKBLK(ERTS_ALC_T_CODE,code); if (compile_size) { byte* compile_info = str_table + strtab_size + attr_size; - CHKBLK(ERTS_ALC_T_CODE,code); + CHKBLK(ERTS_ALC_T_CODE,code); sys_memcpy(compile_info, stp->chunks[COMPILE_CHUNK].start, stp->chunks[COMPILE_CHUNK].size); - CHKBLK(ERTS_ALC_T_CODE,code); + + CHKBLK(ERTS_ALC_T_CODE,code); code[MI_COMPILE_PTR] = (BeamInstr) compile_info; - CHKBLK(ERTS_ALC_T_CODE,code); + CHKBLK(ERTS_ALC_T_CODE,code); code[MI_COMPILE_SIZE] = (BeamInstr) stp->chunks[COMPILE_CHUNK].size; - CHKBLK(ERTS_ALC_T_CODE,code); + CHKBLK(ERTS_ALC_T_CODE,code); decoded_size = erts_decode_ext_size(compile_info, compile_size, 0); - CHKBLK(ERTS_ALC_T_CODE,code); + CHKBLK(ERTS_ALC_T_CODE,code); if (decoded_size < 0) { LoadError0(stp, "bad external term representation of compilation information"); } - CHKBLK(ERTS_ALC_T_CODE,code); + CHKBLK(ERTS_ALC_T_CODE,code); code[MI_COMPILE_SIZE_ON_HEAP] = decoded_size; } CHKBLK(ERTS_ALC_T_CODE,code); + /* + * Make sure that we have not overflowed the allocated code space. + */ + ASSERT(str_table + strtab_size + attr_size + compile_size == + ((byte *) code) + size); + /* * Go through all i_new_bs_put_strings instructions, restore the pointer to * the instruction and convert string offsets to pointers (to the -- cgit v1.2.3 From fe1a4d17ee6558f466c49bfaea25c3a0b4ca9936 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 11:58:16 +0100 Subject: Initial fix of release notes (bad notes for version 4.18). --- lib/snmp/doc/src/notes.xml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..015e2628f4 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,10 +1,10 @@ - +
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -37,18 +37,14 @@
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Cosmetic prep for R14B (plain) release.

-
+
-
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

@@ -63,7 +59,8 @@

When the function FilterMod:accept_recv/2 - returned false the SNMP agent stopped collecting messages from UDP.

+ returned false the SNMP agent stopped collecting + messages from UDP.

Own Id: OTP-8761

-- cgit v1.2.3 From 88994f8e203dc6bf31968cad0bc70b6789a15a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 13:03:17 +0100 Subject: emulator tests: Eliminate some compiler warnings --- erts/emulator/test/binary_SUITE.erl | 9 +--- erts/emulator/test/match_spec_SUITE.erl | 30 ++++++------- erts/emulator/test/pseudoknot_SUITE.erl | 14 +++--- erts/emulator/test/scheduler_SUITE.erl | 67 ++-------------------------- erts/emulator/test/trace_call_time_SUITE.erl | 6 +-- erts/emulator/test/trace_local_SUITE.erl | 5 +-- erts/emulator/test/trace_meta_SUITE.erl | 7 +-- erts/emulator/test/tuple_SUITE.erl | 4 +- 8 files changed, 33 insertions(+), 109 deletions(-) diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index 9b8905712e..7e409f053e 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1321,11 +1321,4 @@ unaligned_sub_bin(Bin0, Offs) -> <<_:Offs,Bin:Sz/binary,_:Roffs>> = id(Bin1), Bin. -hostname() -> - from($@, atom_to_list(node())). - -from(H, [H | T]) -> T; -from(H, [_ | T]) -> from(H, T); -from(_, []) -> []. - id(I) -> I. diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index 6bddbb14f5..2b21fa58f4 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,7 +30,7 @@ -export([runner/2]). -export([f1/1, f2/2, f3/2, fn/1, fn/2, fn/3]). --export([do_boxed_and_small/0, suite/0]). +-export([do_boxed_and_small/0]). % This test suite assumes that tracing in general works. What we test is % the match spec functionality. @@ -365,15 +365,15 @@ silent_no_ms(Config) when is_list(Config) -> fun () -> ?MODULE:f1(a), ?MODULE:f2(b, c), - erlang:integer_to_list(id(1)), + _ = erlang:integer_to_list(id(1)), ?MODULE:f3(d, e), ?MODULE:f1(start), ?MODULE:f2(f, g), - erlang:integer_to_list(id(2)), + _ = erlang:integer_to_list(id(2)), ?MODULE:f3(h, i), ?MODULE:f1(stop), ?MODULE:f2(j, k), - erlang:integer_to_list(id(3)), + _ = erlang:integer_to_list(id(3)), ?MODULE:f3(l, m) end, fun (Tracee) -> @@ -413,15 +413,15 @@ silent_no_ms(Config) when is_list(Config) -> fun () -> ?MODULE:f1(a), ?MODULE:f2(b, c), - erlang:integer_to_list(id(1)), + _ = erlang:integer_to_list(id(1)), ?MODULE:f3(d, e), ?MODULE:f1(start), ?MODULE:f2(f, g), - erlang:integer_to_list(id(2)), + _ = erlang:integer_to_list(id(2)), ?MODULE:f3(h, i), ?MODULE:f1(stop), ?MODULE:f2(j, k), - erlang:integer_to_list(id(3)), + _ = erlang:integer_to_list(id(3)), ?MODULE:f3(l, m) end, fun (Tracee) -> @@ -475,18 +475,18 @@ ms_trace2(Config) when is_list(Config) -> fun () -> ?MODULE:f1(a), ?MODULE:f2(b, c), - erlang:integer_to_list(id(1)), + _ = erlang:integer_to_list(id(1)), ?MODULE:f3(d, e), fn([all], [call,return_to,{tracer,Tracer}]), ?MODULE:f1(f), f2(g, h), f1(i), - erlang:integer_to_list(id(2)), + _ = erlang:integer_to_list(id(2)), ?MODULE:f3(j, k), fn([call,return_to], []), ?MODULE:f1(l), ?MODULE:f2(m, n), - erlang:integer_to_list(id(3)), + _ = erlang:integer_to_list(id(3)), ?MODULE:f3(o, p) end, fun (Tracee) -> @@ -571,26 +571,26 @@ ms_trace3(Config) when is_list(Config) -> register(TraceeName, self()), ?MODULE:f1(a), ?MODULE:f2(b, c), - erlang:integer_to_list(id(1)), + _ = erlang:integer_to_list(id(1)), ?MODULE:f3(d, e), Controller ! {self(),Tag,start}, receive {Controller,Tag,started} -> ok end, ?MODULE:f1(f), f2(g, h), f1(i), - erlang:integer_to_list(id(2)), + _ = erlang:integer_to_list(id(2)), ?MODULE:f3(j, k), Controller ! {self(),Tag,stop_1}, receive {Controller,Tag,stopped_1} -> ok end, ?MODULE:f1(l), ?MODULE:f2(m, n), - erlang:integer_to_list(id(3)), + _ = erlang:integer_to_list(id(3)), ?MODULE:f3(o, p), Controller ! {self(),Tag,stop_2}, receive {Controller,Tag,stopped_2} -> ok end, ?MODULE:f1(q), ?MODULE:f2(r, s), - erlang:integer_to_list(id(4)), + _ = erlang:integer_to_list(id(4)), ?MODULE:f3(t, u) end, diff --git a/erts/emulator/test/pseudoknot_SUITE.erl b/erts/emulator/test/pseudoknot_SUITE.erl index f0668dd287..5a7cdcecd5 100644 --- a/erts/emulator/test/pseudoknot_SUITE.erl +++ b/erts/emulator/test/pseudoknot_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -3294,13 +3294,13 @@ most_distant_atom(Sols) -> maximum(map(sol_most_distant_atom, Sols)). maximum([H|T]) -> - max(T,H). + max1(T,H). -max([H|T],M) when is_float(H), is_float(M), H > M -> - max(T,H); -max([_|T],M) -> - max(T,M); -max([],M) -> M. +max1([H|T],M) when is_float(H), is_float(M), H > M -> + max1(T,H); +max1([_|T],M) -> + max1(T,M); +max1([],M) -> M. map(_Func,[]) -> []; map(Func,[H|T]) -> diff --git a/erts/emulator/test/scheduler_SUITE.erl b/erts/emulator/test/scheduler_SUITE.erl index 1478bbeb52..f16d0ea429 100644 --- a/erts/emulator/test/scheduler_SUITE.erl +++ b/erts/emulator/test/scheduler_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -862,9 +862,9 @@ get_affinity_mask(Port, Status, Affinity) when Status == unknown; {Port,{exit_status,S}} -> get_affinity_mask(Port, S, Affinity) end; -get_affinity_mask(Port, Status, bad) -> +get_affinity_mask(_Port, _Status, bad) -> unknown; -get_affinity_mask(Port, Status, Affinity) -> +get_affinity_mask(_Port, _Status, Affinity) -> Affinity. get_affinity_mask() -> @@ -1389,67 +1389,6 @@ reader_groups_map(CPUT, Groups) -> %% Utils %% -tilera_cpu_topology() -> - [{processor,[{node,[{core,{logical,0}}, - {core,{logical,1}}, - {core,{logical,2}}, - {core,{logical,8}}, - {core,{logical,9}}, - {core,{logical,10}}, - {core,{logical,11}}, - {core,{logical,16}}, - {core,{logical,17}}, - {core,{logical,18}}, - {core,{logical,19}}, - {core,{logical,24}}, - {core,{logical,25}}, - {core,{logical,27}}, - {core,{logical,29}}]}, - {node,[{core,{logical,3}}, - {core,{logical,4}}, - {core,{logical,5}}, - {core,{logical,6}}, - {core,{logical,7}}, - {core,{logical,12}}, - {core,{logical,13}}, - {core,{logical,14}}, - {core,{logical,15}}, - {core,{logical,20}}, - {core,{logical,21}}, - {core,{logical,22}}, - {core,{logical,23}}, - {core,{logical,28}}, - {core,{logical,30}}]}, - {node,[{core,{logical,31}}, - {core,{logical,36}}, - {core,{logical,37}}, - {core,{logical,38}}, - {core,{logical,44}}, - {core,{logical,45}}, - {core,{logical,46}}, - {core,{logical,47}}, - {core,{logical,51}}, - {core,{logical,52}}, - {core,{logical,53}}, - {core,{logical,54}}, - {core,{logical,55}}, - {core,{logical,60}}, - {core,{logical,61}}]}, - {node,[{core,{logical,26}}, - {core,{logical,32}}, - {core,{logical,33}}, - {core,{logical,34}}, - {core,{logical,35}}, - {core,{logical,39}}, - {core,{logical,40}}, - {core,{logical,41}}, - {core,{logical,42}}, - {core,{logical,43}}, - {core,{logical,48}}, - {core,{logical,49}}, - {core,{logical,50}}, - {core,{logical,58}}]}]}]. - l(Id) -> {logical, Id}. diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl index 8bf66b7177..5dfa87bbee 100644 --- a/erts/emulator/test/trace_call_time_SUITE.erl +++ b/erts/emulator/test/trace_call_time_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -427,7 +427,7 @@ nif(Config) when is_list(Config) -> ?line 1 = erlang:trace_pattern({?MODULE, nif_dec, '_'}, true, [call_time]), ?line 1 = erlang:trace_pattern({?MODULE, with_nif, '_'}, true, [call_time]), ?line Pid = setup(), - ?line {L, T1} = execute(Pid, fun() -> with_nif(M) end), + ?line {_, T1} = execute(Pid, fun() -> with_nif(M) end), % the nif is called M - 1 times, the last time the function with 'with_nif' % returns ok and does not call the nif. @@ -506,7 +506,7 @@ with_nif(N) -> with_nif(?MODULE:nif_dec(N)). -nif_dec(N) -> 0. +nif_dec(_) -> 0. dec(N) -> loaded(10000), diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl index 0235f624ce..091e960610 100644 --- a/erts/emulator/test/trace_local_SUITE.erl +++ b/erts/emulator/test/trace_local_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -814,9 +814,6 @@ loop(D1,D2,D3,0) -> loop(D1,D2,D3,N) -> max(N,loop(D1,D2,D3,N-1)). -max(A, B) when A > B -> A; -max(_, B) -> B. - exported_wrap(Val) -> exported(Val). diff --git a/erts/emulator/test/trace_meta_SUITE.erl b/erts/emulator/test/trace_meta_SUITE.erl index 666bd60511..45987cc319 100644 --- a/erts/emulator/test/trace_meta_SUITE.erl +++ b/erts/emulator/test/trace_meta_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -613,11 +613,6 @@ loop(D1,D2,D3,0) -> loop(D1,D2,D3,N) -> max(N,loop(D1,D2,D3,N-1)). -max(A,B) when A > B -> - A; -max(_A,B) -> - B. - id(X) -> X. diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl index c1f171d9b5..bfc3910742 100644 --- a/erts/emulator/test/tuple_SUITE.erl +++ b/erts/emulator/test/tuple_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -99,7 +99,7 @@ t_tuple_size(Config) when is_list(Config) -> ludicrous_tuple_size(T) when tuple_size(T) =:= 16#7777777777777777777777777777777777 -> ok; -ludicrous_tuple_size(T) -> error. +ludicrous_tuple_size(_) -> error. %% Tests element/2. -- cgit v1.2.3 From c347415765f4e30e38e49f5bd369f48523ef935e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 13:18:28 +0100 Subject: compiler: Eliminate some warnings --- lib/compiler/test/bs_construct_SUITE.erl | 4 ++-- lib/compiler/test/compilation_SUITE.erl | 10 +++++----- lib/compiler/test/guard_SUITE.erl | 6 +++--- lib/compiler/test/inline_SUITE.erl | 4 ++-- lib/compiler/test/lc_SUITE.erl | 4 ++-- lib/compiler/test/test_lib.erl | 18 +++++++++--------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index fe72fbb143..c430b12b70 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -231,7 +231,7 @@ one_test({C_bin, E_bin, Str, Result}) -> ok; %% For situations where the final bits may not matter, like %% for floats: - N when integer(N) -> + N when is_integer(N) -> io:format("Info: compiled and interpreted differ in the" " last bytes:~n ~p, ~p.~n", [bitstring_to_list(C_bin), bitstring_to_list(E_bin)]), diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 6cd133ee39..ba225b66d0 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -163,7 +163,7 @@ split({int, N}, <>) -> beam_compiler_7(doc) -> "Code snippet submitted from Ulf Wiger which fails in R3 Beam."; beam_compiler_7(suite) -> []; -beam_compiler_7(Config) when list(Config) -> +beam_compiler_7(Config) when is_list(Config) -> ?line done = empty(2, false). empty(N, Toggle) when N > 0 -> @@ -327,7 +327,7 @@ from(_, []) -> []. vsn_1(doc) -> "Test generation of 'vsn' attribute"; vsn_1(suite) -> []; -vsn_1(Conf) when list(Conf) -> +vsn_1(Conf) when is_list(Conf) -> ?line M = vsn_1, ?line compile_load(M, ?config(data_dir, Conf), Conf), @@ -351,7 +351,7 @@ vsn_1(Conf) when list(Conf) -> vsn_2(doc) -> "Test overriding of generation of 'vsn' attribute"; vsn_2(suite) -> []; -vsn_2(Conf) when list(Conf) -> +vsn_2(Conf) when is_list(Conf) -> ?line M = vsn_2, ?line compile_load(M, ?config(data_dir, Conf), Conf), @@ -367,7 +367,7 @@ vsn_2(Conf) when list(Conf) -> vsn_3(doc) -> "Test that different code yields different generated 'vsn'"; vsn_3(suite) -> []; -vsn_3(Conf) when list(Conf) -> +vsn_3(Conf) when is_list(Conf) -> ?line M = vsn_3, ?line compile_load(M, ?config(data_dir, Conf), Conf), diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 7201edf4ac..482564a32b 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -111,8 +111,8 @@ const_cond(Config) when is_list(Config) -> const_cond(T, Sz) -> case T of _X when false -> never; - _X when tuple(T), eq == eq, tuple_size(T) == Sz -> ok; - _X when tuple(T), eq == leq, tuple_size(T) =< Sz -> ok; + _X when is_tuple(T), eq == eq, tuple_size(T) == Sz -> ok; + _X when is_tuple(T), eq == leq, tuple_size(T) =< Sz -> ok; _X -> error end. diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 6684b82751..7b9600c2f6 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -68,7 +68,7 @@ attribute(Config) when is_list(Config) -> ok. -define(comp(Name), - Name(Config) when list(Config) -> + Name(Config) when is_list(Config) -> try_inline(Name, Config)). ?comp(bsdecode). diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index 6dd950eade..bcdcf2fd9f 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -180,7 +180,7 @@ empty_generator(Config) when is_list(Config) -> id(I) -> I. fc(Args, {'EXIT',{function_clause,[{?MODULE,_,Args}|_]}}) -> ok; -fc(Args, {'EXIT',{function_clause,[{?MODULE,Name,Arity}|_]}}) +fc(Args, {'EXIT',{function_clause,[{?MODULE,_,Arity}|_]}}) when length(Args) =:= Arity -> true = test_server:is_native(?MODULE); fc(Args, {'EXIT',{{case_clause,ActualArgs},_}}) diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl index d8799952a9..53d8c04169 100644 --- a/lib/compiler/test/test_lib.erl +++ b/lib/compiler/test/test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -41,7 +41,7 @@ smoke_disasm(Mod) when is_atom(Mod) -> smoke_disasm(code:which(Mod)); smoke_disasm(File) when is_list(File) -> Res = beam_disasm:file(File), - {beam_file,Mod} = {element(1, Res),element(2, Res)}. + {beam_file,_Mod} = {element(1, Res),element(2, Res)}. %% Retrieve the "interesting" compiler options (options for optimization %% and compatibility) for the given module. @@ -62,16 +62,16 @@ opt_opts(Mod) -> (_) -> false end, Opts). -%% Some test suites gets cloned (e.g. to "record_SUITE" to "record_no_opt_SUITE"), -%% but the data directory is not cloned. This function retrieves the path to -%% the original data directory. +%% Some test suites gets cloned (e.g. to "record_SUITE" to +%% "record_no_opt_SUITE"), but the data directory is not cloned. +%% This function retrieves the path to the original data directory. get_data_dir(Config) -> Data0 = ?config(data_dir, Config), - {ok,Data1,_} = regexp:sub(Data0, "_no_opt_SUITE", "_SUITE"), - {ok,Data2,_} = regexp:sub(Data1, "_post_opt_SUITE", "_SUITE"), - {ok,Data,_} = regexp:sub(Data2, "_inline_SUITE", "_SUITE"), - Data. + Opts = [{return,list}], + Data1 = re:replace(Data0, "_no_opt_SUITE", "_SUITE", Opts), + Data = re:replace(Data1, "_post_opt_SUITE", "_SUITE", Opts), + re:replace(Data, "_inline_SUITE", "_SUITE", Opts). %% p_run(fun(Data) -> ok|error, List) -> ok %% Will fail the test case if there were any errors. -- cgit v1.2.3 From 9726d9798b0c41ba2126e55e64c5913873116218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 13:33:34 +0100 Subject: stdlib tests: Eliminate some compiler warnings --- lib/stdlib/test/ets_SUITE.erl | 4 ++-- lib/stdlib/test/stdlib_SUITE.erl | 4 ++-- lib/stdlib/test/supervisor_SUITE.erl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 60fa429a3e..9d348b5f1a 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -348,8 +348,8 @@ t_match_spec_run_test(List, MS, Result) -> ms_tracer_collect(Tracee, Ref, Acc) -> receive - {trace, Tracee, call, Args, [Msg]} -> - %io:format("trace Args=~p Msg=~p\n", [Args, Msg]), + {trace, Tracee, call, _Args, [Msg]} -> + %io:format("trace Args=~p Msg=~p\n", [_Args, Msg]), ms_tracer_collect(Tracee, Ref, [Msg | Acc]); {'DOWN', Ref, process, Tracee, _} -> diff --git a/lib/stdlib/test/stdlib_SUITE.erl b/lib/stdlib/test/stdlib_SUITE.erl index f46493a2d8..0cca030b3d 100644 --- a/lib/stdlib/test/stdlib_SUITE.erl +++ b/lib/stdlib/test/stdlib_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -75,7 +75,7 @@ app_test(suite) -> []; app_test(doc) -> ["Application consistency test."]; -app_test(Config) when list(Config) -> +app_test(Config) when is_list(Config) -> ?t:app_test(stdlib), ok. diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 988e98aca4..8aed93ce12 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -1285,7 +1285,7 @@ count_children_memory(Config) when is_list(Config) -> Children = supervisor:which_children(sup_test), _Size2 = erlang:memory(processes_used), ChildCount = get_child_counts(sup_test), - Size3 = erlang:memory(processes_used), + _Size3 = erlang:memory(processes_used), [supervisor:start_child(sup_test, []) || _Ignore2 <- lists:seq(1,1000)], -- cgit v1.2.3 From 8592a7629a4afd1ea5b19f7473b3b06605169e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 14:04:15 +0100 Subject: kernel: Eliminate compiler warning --- lib/kernel/test/erl_distribution_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index efce5bd476..9cccdab76b 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 1997-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -865,7 +865,7 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) -> % the node mercilessly. % We then want to ensure that the nodedown message arrives % last ... without garbage after it. - Pid = spawn(fun() -> node_loop_send(Me, NodeMsg, 1) end), + _ = spawn(fun() -> node_loop_send(Me, NodeMsg, 1) end), receive {Me, kill_it} -> ok end, halt() end), -- cgit v1.2.3 From 22ad9ca8677a372c9a7b615157f7fb7892211a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Feb 2011 14:15:20 +0100 Subject: v3_kernel_pp: Eliminate dialyzer warning Use conditional compilation instead of a run-time test. Will also improve the coverage of the code. --- lib/compiler/src/v3_kernel_pp.erl | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl index 9bd13f7032..e363a5387a 100644 --- a/lib/compiler/src/v3_kernel_pp.erl +++ b/lib/compiler/src/v3_kernel_pp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,10 +20,12 @@ -module(v3_kernel_pp). --include("v3_kernel.hrl"). - -export([format/1]). +%%-define(INCLUDE_ANNOTATIONS, 1). + +-include("v3_kernel.hrl"). + %% These are "internal" structures in sys_kernel which are here for %% debugging purposes. -record(iset, {anno=[],vars,arg,body}). @@ -62,22 +64,21 @@ format(Node, Ctxt) -> end) end. -format_anno(Anno, Ctxt0, ObjFun) -> - case annotations_enabled() of - true -> - Ctxt1 = ctxt_bump_indent(Ctxt0, 1), - ["( ", - ObjFun(Ctxt0), - nl_indent(Ctxt1), - "-| ",io_lib:write(Anno), - " )"]; - false -> - ObjFun(Ctxt0) - end. -%% By default, don't show annotations since they clutter up the output. -annotations_enabled() -> - false. +-ifndef(INCLUDE_ANNOTATIONS). +%% Don't include annotations (for readability). +format_anno(_Anno, Ctxt, ObjFun) -> + ObjFun(Ctxt). +-else. +%% Include annotations (for debugging of annotations). +format_anno(Anno, Ctxt0, ObjFun) -> + Ctxt1 = ctxt_bump_indent(Ctxt0, 1), + ["( ", + ObjFun(Ctxt0), + nl_indent(Ctxt1), + "-| ",io_lib:write(Anno), + " )"]. +-endif. %% format_1(Kexpr, Context) -> string(). -- cgit v1.2.3 From ae806f1663d47569876b3abc0998ee3387c7abd2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 16:12:36 +0100 Subject: Updated release notes and the documentation. Also added entry in the appup file. --- lib/snmp/doc/src/notes.xml | 52 +++++++++++++++++- lib/snmp/doc/src/snmp_config.xml | 42 ++++----------- lib/snmp/doc/src/snmpa.xml | 37 ++++++++++++- lib/snmp/src/app/snmp.appup.src | 114 +++++++++++++++------------------------ 4 files changed, 139 insertions(+), 106 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 015e2628f4..3d76fdeaf6 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -32,6 +32,56 @@ notes.xml +
+ SNMP Development Toolkit 4.19 +

Version 4.19 supports code replacement in runtime from/to + version 4.18.

+ +
+ Improvements and new features + + + +

[agent] Added a "complete" set of (snmp) table and variable + print functions, for each mib handled by the SNMP (agent) + application. This will be usefull when debugging a running agent.

+

See + print_mib_info/0, + print_mib_tables/0 + and + print_mib_variables/0 + for more info.

+

Own Id: OTP-8977

+
+ +
+ +
+ +
+ Reported Fixed Bugs and Malfunctions +

-

+ +
+ +
+ Incompatibilities +

-

+
+
+ +
SNMP 4.18
Fixed Bugs and Malfunctions @@ -42,7 +92,7 @@
-
+
SNMP Development Toolkit 4.17.1 diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 769b908adc..4e41cb5037 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -1,4 +1,4 @@ - + @@ -1004,36 +1004,16 @@ ok

Another usefull way to debug the agent is to pretty-print the content of - some of the (MIB-) tables handled directly by the agent. This can be done - for the following tables:

- - - -

-
- - - -

-
- - - -

-
- - - -

-
- - - -

-
- -
- + all the tables and/or variables handled directly by the agent. + This can be done by simply calling:

+

+

See + print_mib_info/0, + print_mib_tables/0 + or + print_mib_variables/0 + for more info.

+
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index f546724a78..1d680e80f5 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -1,10 +1,10 @@ - +
- 20042010 + 20042011 Ericsson AB. All Rights Reserved. @@ -1252,6 +1252,39 @@ snmp_agent:register_subagent(SA1,[1,2,3], SA2).

This is a utility function, that can be useful when e.g. debugging instrumentation functions.

+ + + + + + print_mib_info() -> void() + Print mib info + +

Prints the content of all the (snmp) tables and variables + for all mibs handled by the snmp agent.

+ + +
+
+ + + print_mib_tables() -> void() + Print mib tables + +

Prints the content of all the (snmp) tables + for all mibs handled by the snmp agent.

+ + +
+
+ + + print_mib_variables() -> void() + Print mib variables + +

Prints the content of all the (snmp) variables + for all mibs handled by the snmp agent.

+
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..24f3b2e755 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,43 +22,28 @@ %% ----- U p g r a d e ------------------------------------------------------- [ - {"4.17.1", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} + {load_module, snmpa, soft_purge, soft_purge, + [snmp_community_mib, + snmp_framework_mib, + snmp_standard_mib, + snmp_target_mib, + snmp_user_based_sm_mib, + snmp_view_based_acm_mib]}, + {load_module, snmp_community_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_framework_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_standard_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_target_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmps_mib_lib, soft_purge, soft_purge, []} ] } ], @@ -66,43 +51,28 @@ %% ------D o w n g r a d e --------------------------------------------------- [ - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} + {load_module, snmpa, soft_purge, soft_purge, + [snmp_community_mib, + snmp_framework_mib, + snmp_standard_mib, + snmp_target_mib, + snmp_user_based_sm_mib, + snmp_view_based_acm_mib]}, + {load_module, snmp_community_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_framework_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_standard_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_target_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, + [snmpa_mib_lib]}, + {load_module, snmps_mib_lib, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From 866edfa8a5510189ee7e0b1584edb5582ba7a589 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 17:46:50 +0100 Subject: Final update to release notes and the appup file. --- lib/snmp/doc/src/notes.xml | 12 +++++-- lib/snmp/src/app/snmp.appup.src | 78 ----------------------------------------- 2 files changed, 10 insertions(+), 80 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index e9c7bef68f..41825df276 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1, 4.17.

+ version 4.18.

Improvements and new features @@ -67,8 +67,15 @@

-

+ +
+ Incompatibilities +

-

+
+
+
SNMP 4.18
Fixed Bugs and Malfunctions @@ -81,6 +88,7 @@
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 9bb4846c6e..4f76095c04 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -25,45 +25,6 @@ {"4.18", [ ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -73,45 +34,6 @@ {"4.18", [ ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From 205d55b2ee2afe70a9cbac6da15c8b985c76f2ab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 17:55:21 +0100 Subject: Final update of appup filer (forgot about the read_mib macro used by the snmp_misc module). --- lib/snmp/src/app/snmp.appup.src | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 4f76095c04..ea39a7c30a 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -24,6 +24,7 @@ [ {"4.18", [ + {load_module, snmp_misc, soft_purge, soft_purge, []} ] } ], @@ -33,6 +34,7 @@ [ {"4.18", [ + {load_module, snmp_misc, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From bb3fef253dc2e1253d7c422c1d9846d13135f847 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 21:00:48 +0100 Subject: Updated release notes and appup file. --- lib/snmp/doc/src/notes.xml | 4 +-- lib/snmp/src/app/snmp.appup.src | 80 +---------------------------------------- 2 files changed, 3 insertions(+), 81 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index c42d62f013..7010b3c641 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -4,7 +4,7 @@

- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1 and 4.17.

+ version 4.18.

Improvements and new features diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 03a0044908..13a84d4ab1 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,45 +26,6 @@ [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -75,45 +36,6 @@ [ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From ca6e87e84dae13b6ebe15ca67bf98a0245f25857 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 23:07:52 +0100 Subject: Fixed release notes and appup file. --- lib/snmp/doc/src/notes.xml | 2 +- lib/snmp/src/app/snmp.appup.src | 78 ----------------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 39aff4e28a..4896a62bb4 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -35,7 +35,7 @@
SNMP Development Toolkit 4.19

Version 4.19 supports code replacement in runtime from/to - version 4.18, 4.17.1 and 4.17.

+ version 4.18.

Improvements and new features diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index fafbf79bb7..0c1d6655ef 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -27,45 +27,6 @@ {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ], @@ -77,45 +38,6 @@ {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} ] - }, - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} - ] } ] }. -- cgit v1.2.3 From cf8a23cd0017d2206926a4445736029a05a7a0dd Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 23 Feb 2011 23:18:27 +0100 Subject: Fixed release notes (almost, since this change will not actually be part of the release notes) and appup file. --- lib/snmp/doc/src/notes.xml | 23 ++++++++----- lib/snmp/src/app/snmp.appup.src | 74 ++--------------------------------------- 2 files changed, 16 insertions(+), 81 deletions(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 493e7aa092..03881f1823 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1,10 +1,10 @@ - +
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -33,22 +33,27 @@
SNMP 4.18 +
+ Improvements and new features +

-

+
Fixed Bugs and Malfunctions -

- When the function FilterMod:accept_recv/2 returned false - the SNMP agent stopped collecting messages from UDP.

-

- Own Id: OTP-8761

+

Cosmetic prep for R14B (plain) release.

-
+
+ Incompatibilities +

-

+
+
+ -
+
SNMP Development Toolkit 4.17.1

Version 4.17.1 supports code replacement in runtime from/to version 4.17, 4.16.2, 4.16.1, 4.16, 4.15, 4.14 and 4.13.5.

diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..4f76095c04 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,43 +22,8 @@ %% ----- U p g r a d e ------------------------------------------------------- [ - {"4.17.1", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} ] } ], @@ -66,43 +31,8 @@ %% ------D o w n g r a d e --------------------------------------------------- [ - {"4.17.1", - [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []} - ] - }, - {"4.17", + {"4.18", [ - {load_module, snmp_community_mib, soft_purge, soft_purge, []}, - {load_module, snmp_framework_mib, soft_purge, soft_purge, []}, - {load_module, snmp_generic, soft_purge, soft_purge, []}, - {load_module, snmp_notification_mib, soft_purge, soft_purge, []}, - {load_module, snmp_standard_mib, soft_purge, soft_purge, []}, - {load_module, snmp_target_mib, soft_purge, soft_purge, []}, - {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}, - {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []}, - {load_module, snmpa_conf, soft_purge, soft_purge, []}, - {update, snmpa_target_cache, soft, soft_purge, soft_purge, []}, - {load_module, snmpa_usm, soft_purge, soft_purge, []}, - {load_module, snmpm, soft_purge, soft_purge, []}, - {load_module, snmpm_conf, soft_purge, soft_purge, []}, - {update, snmpm_config, soft, soft_purge, soft_purge, []}, - {load_module, snmpm_usm, soft_purge, soft_purge, []}, - {load_module, snmpa_net_if, soft_purge, soft_purge, []} ] } ] -- cgit v1.2.3 From 3e8194197566efb051b3b09114fe5f91f4d611f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 24 Feb 2011 10:05:27 +0100 Subject: Write the value "Time left" for BIF timers as an unsigned integer --- erts/emulator/beam/erl_bif_timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/erl_bif_timer.c b/erts/emulator/beam/erl_bif_timer.c index 3508e8e0dc..db771bd216 100644 --- a/erts/emulator/beam/erl_bif_timer.c +++ b/erts/emulator/beam/erl_bif_timer.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2010. All Rights Reserved. + * Copyright Ericsson AB 2005-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -613,7 +613,8 @@ erts_print_bif_timer_info(int to, void *to_arg) : btm->receiver.proc.ess->id); erts_print(to, to_arg, "=timer:%T\n", receiver); erts_print(to, to_arg, "Message: %T\n", btm->message); - erts_print(to, to_arg, "Time left: %d ms\n", erts_time_left(&btm->tm)); + erts_print(to, to_arg, "Time left: %u ms\n", + erts_time_left(&btm->tm)); } } -- cgit v1.2.3 From 527bf97b84f9a3d17e5d6b19120ab2dca63111c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 24 Feb 2011 10:07:29 +0100 Subject: Don't dump the contents of ordered_set ets tables --- erts/emulator/beam/erl_db_tree.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c index 484a096249..6cdbec3213 100644 --- a/erts/emulator/beam/erl_db_tree.c +++ b/erts/emulator/beam/erl_db_tree.c @@ -335,7 +335,6 @@ static int doit_select_delete(DbTableTree *tb, TreeDbTerm *this, void *ptr, int forward); -static void do_dump_tree(int to, void *to_arg, TreeDbTerm *t); static int partly_bound_can_match_lesser(Eterm partly_bound_1, Eterm partly_bound_2); @@ -1747,7 +1746,6 @@ static void db_print_tree(int to, void *to_arg, "------------------------------------------------\n"); #else erts_print(to, to_arg, "Ordered set (AVL tree), Elements: %d\n", NITEMS(tb)); - do_dump_tree(to, to_arg, tb->root); #endif } @@ -2063,15 +2061,6 @@ static int analyze_pattern(DbTableTree *tb, Eterm pattern, return DB_ERROR_NONE; } -static void do_dump_tree(int to, void *to_arg, TreeDbTerm *t) -{ - if (t != NULL) { - do_dump_tree(to, to_arg, t->left); - erts_print(to, to_arg, "%T\n", make_tuple(t->dbterm.tpl)); - do_dump_tree(to, to_arg, t->right); - } -} - static int do_free_tree_cont(DbTableTree *tb, int num_left) { TreeDbTerm *root; -- cgit v1.2.3 From 9cc0332d42f58b69fbd10123e56c9e246ec4023b Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 11 Jan 2011 00:09:05 +0100 Subject: Simplify erts_poll_wait() wakeup logic --- erts/emulator/beam/erl_threads.h | 5 +- erts/emulator/beam/sys.h | 10 +- erts/emulator/sys/common/erl_poll.c | 284 +++++++++++------------- erts/emulator/sys/unix/sys.c | 24 +- erts/emulator/sys/win32/erl_poll.c | 382 ++++++++++++++++---------------- erts/emulator/sys/win32/sys_interrupt.c | 8 +- 6 files changed, 344 insertions(+), 369 deletions(-) diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h index 84a20b51f2..bd1d35aa05 100644 --- a/erts/emulator/beam/erl_threads.h +++ b/erts/emulator/beam/erl_threads.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -175,6 +175,9 @@ typedef struct { int gcc_is_buggy; } erts_rwlock_t; #endif /* #ifdef USE_THREADS */ #define ERTS_AINT_T_MAX (~(((erts_aint_t) 1) << (sizeof(erts_aint_t)*8-1))) +#define ERTS_AINT_T_MIN ((((erts_aint_t) 1) << (sizeof(erts_aint_t)*8-1))) +#define ERTS_AINT32_T_MAX (~(((erts_aint32_t) 1) << (sizeof(erts_aint32_t)*8-1))) +#define ERTS_AINT32_T_MIN ((((erts_aint32_t) 1) << (sizeof(erts_aint32_t)*8-1))) ERTS_GLB_INLINE void erts_thr_init(erts_thr_init_data_t *id); ERTS_GLB_INLINE void erts_thr_late_init(erts_thr_late_init_data_t *id); diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index dff2dc37a2..3a566f91fb 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -335,8 +335,8 @@ typedef unsigned char byte; #ifdef ERTS_WANT_BREAK_HANDLING # ifdef ERTS_SMP -extern erts_smp_atomic_t erts_break_requested; -# define ERTS_BREAK_REQUESTED ((int) erts_smp_atomic_read(&erts_break_requested)) +extern erts_smp_atomic32_t erts_break_requested; +# define ERTS_BREAK_REQUESTED ((int) erts_smp_atomic32_read(&erts_break_requested)) # else extern volatile int erts_break_requested; # define ERTS_BREAK_REQUESTED erts_break_requested @@ -349,8 +349,8 @@ void erts_do_break_handling(void); # define ERTS_GOT_SIGUSR1 0 # else # ifdef ERTS_SMP -extern erts_smp_atomic_t erts_got_sigusr1; -# define ERTS_GOT_SIGUSR1 ((int) erts_smp_atomic_read(&erts_got_sigusr1)) +extern erts_smp_atomic32_t erts_got_sigusr1; +# define ERTS_GOT_SIGUSR1 ((int) erts_smp_atomic32_read(&erts_got_sigusr1)) # else extern volatile int erts_got_sigusr1; # define ERTS_GOT_SIGUSR1 erts_got_sigusr1 diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index 4d0ca97889..77ac2de5f6 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2010. All Rights Reserved. + * Copyright Ericsson AB 2006-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -124,25 +124,11 @@ erts_smp_mtx_unlock(&(PS)->mtx) #define ERTS_POLLSET_SET_POLLED_CHK(PS) \ - ((int) erts_smp_atomic_xchg(&(PS)->polled, (erts_aint_t) 1)) + ((int) erts_atomic32_xchg(&(PS)->polled, (erts_aint32_t) 1)) #define ERTS_POLLSET_UNSET_POLLED(PS) \ - erts_smp_atomic_set(&(PS)->polled, (erts_aint_t) 0) + erts_atomic32_set(&(PS)->polled, (erts_aint32_t) 0) #define ERTS_POLLSET_IS_POLLED(PS) \ - ((int) erts_smp_atomic_read(&(PS)->polled)) - -#define ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) set_poller_woken_chk((PS)) -#define ERTS_POLLSET_SET_POLLER_WOKEN(PS) \ -do { \ - ERTS_THR_MEMORY_BARRIER; \ - erts_smp_atomic_set(&(PS)->woken, (erts_aint_t) 1); \ -} while (0) -#define ERTS_POLLSET_UNSET_POLLER_WOKEN(PS) \ -do { \ - erts_smp_atomic_set(&(PS)->woken, (erts_aint_t) 0); \ - ERTS_THR_MEMORY_BARRIER; \ -} while (0) -#define ERTS_POLLSET_IS_POLLER_WOKEN(PS) \ - ((int) erts_smp_atomic_read(&(PS)->woken)) + ((int) erts_atomic32_read(&(PS)->polled)) #else @@ -152,69 +138,21 @@ do { \ #define ERTS_POLLSET_UNSET_POLLED(PS) #define ERTS_POLLSET_IS_POLLED(PS) 0 -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT - -/* - * Ideally, the ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) operation would - * be atomic. This operation isn't, but we will do okay anyway. The - * "woken check" is only an optimization. The only requirement we have: - * If (PS)->woken is set to a value != 0 when interrupting, we have to - * write on the the wakeup pipe at least once. Multiple writes are okay. - */ -#define ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) ((PS)->woken++) -#define ERTS_POLLSET_SET_POLLER_WOKEN(PS) ((PS)->woken = 1, (void) 0) -#define ERTS_POLLSET_UNSET_POLLER_WOKEN(PS) ((PS)->woken = 0, (void) 0) -#define ERTS_POLLSET_IS_POLLER_WOKEN(PS) ((PS)->woken) - -#else - -#define ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) 1 -#define ERTS_POLLSET_SET_POLLER_WOKEN(PS) -#define ERTS_POLLSET_UNSET_POLLER_WOKEN(PS) -#define ERTS_POLLSET_IS_POLLER_WOKEN(PS) 1 - -#endif - #endif #if ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE #define ERTS_POLLSET_SET_HAVE_UPDATE_REQUESTS(PS) \ - erts_smp_atomic_set(&(PS)->have_update_requests, (erts_aint_t) 1) + erts_smp_atomic32_set(&(PS)->have_update_requests, (erts_aint32_t) 1) #define ERTS_POLLSET_UNSET_HAVE_UPDATE_REQUESTS(PS) \ - erts_smp_atomic_set(&(PS)->have_update_requests, (erts_aint_t) 0) + erts_smp_atomic32_set(&(PS)->have_update_requests, (erts_aint32_t) 0) #define ERTS_POLLSET_HAVE_UPDATE_REQUESTS(PS) \ - ((int) erts_smp_atomic_read(&(PS)->have_update_requests)) + ((int) erts_smp_atomic32_read(&(PS)->have_update_requests)) #else #define ERTS_POLLSET_SET_HAVE_UPDATE_REQUESTS(PS) #define ERTS_POLLSET_UNSET_HAVE_UPDATE_REQUESTS(PS) #define ERTS_POLLSET_HAVE_UPDATE_REQUESTS(PS) 0 #endif -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT && !defined(ERTS_SMP) - -#define ERTS_POLLSET_UNSET_INTERRUPTED_CHK(PS) unset_interrupted_chk((PS)) -#define ERTS_POLLSET_UNSET_INTERRUPTED(PS) ((PS)->interrupt = 0, (void) 0) -#define ERTS_POLLSET_SET_INTERRUPTED(PS) ((PS)->interrupt = 1, (void) 0) -#define ERTS_POLLSET_IS_INTERRUPTED(PS) ((PS)->interrupt) - -#else - -#define ERTS_POLLSET_UNSET_INTERRUPTED_CHK(PS) unset_interrupted_chk((PS)) -#define ERTS_POLLSET_UNSET_INTERRUPTED(PS) \ -do { \ - erts_smp_atomic_set(&(PS)->interrupt, (erts_aint_t) 0); \ - ERTS_THR_MEMORY_BARRIER; \ -} while (0) -#define ERTS_POLLSET_SET_INTERRUPTED(PS) \ -do { \ - ERTS_THR_MEMORY_BARRIER; \ - erts_smp_atomic_set(&(PS)->interrupt, (erts_aint_t) 1); \ -} while (0) -#define ERTS_POLLSET_IS_INTERRUPTED(PS) \ - ((int) erts_smp_atomic_read(&(PS)->interrupt)) - -#endif - #if ERTS_POLL_USE_FALLBACK # if ERTS_POLL_USE_POLL # define ERTS_POLL_NEED_FALLBACK(PS) ((PS)->no_poll_fds > 1) @@ -318,14 +256,12 @@ struct ErtsPollSet_ { #if ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE ErtsPollSetUpdateRequestsBlock update_requests; ErtsPollSetUpdateRequestsBlock *curr_upd_req_block; - erts_smp_atomic_t have_update_requests; + erts_smp_atomic32_t have_update_requests; #endif #ifdef ERTS_SMP - erts_smp_atomic_t polled; - erts_smp_atomic_t woken; + erts_atomic32_t polled; erts_smp_mtx_t mtx; #elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT - volatile int woken; #endif #if ERTS_POLL_USE_WAKEUP_PIPE int wake_fds[2]; @@ -333,12 +269,12 @@ struct ErtsPollSet_ { #if ERTS_POLL_USE_FALLBACK int fallback_used; #endif -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT && !defined(ERTS_SMP) - volatile int interrupt; -#else - erts_smp_atomic_t interrupt; +#ifdef ERTS_SMP + erts_atomic32_t wakeup_state; +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + volatile int wakeup_state; #endif - erts_smp_atomic_t timeout; + erts_smp_atomic32_t timeout; #ifdef ERTS_POLL_COUNT_AVOIDED_WAKEUPS erts_smp_atomic_t no_avoided_wakeups; erts_smp_atomic_t no_avoided_interrupts; @@ -346,34 +282,6 @@ struct ErtsPollSet_ { #endif }; -static ERTS_INLINE int -unset_interrupted_chk(ErtsPollSet ps) -{ - int res; -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT && !defined(ERTS_SMP) - /* This operation isn't atomic, but we have no need at all for an - atomic operation here... */ - res = ps->interrupt; - ps->interrupt = 0; -#else - res = (int) erts_smp_atomic_xchg(&ps->interrupt, (erts_aint_t) 0); - ERTS_THR_MEMORY_BARRIER; -#endif - return res; - -} - -#ifdef ERTS_SMP - -static ERTS_INLINE int -set_poller_woken_chk(ErtsPollSet ps) -{ - ERTS_THR_MEMORY_BARRIER; - return (int) erts_smp_atomic_xchg(&ps->woken, (erts_aint_t) 1); -} - -#endif - void erts_silence_warn_unused_result(long unused); static void fatal_error(char *format, ...); static void fatal_error_async_signal_safe(char *error_str); @@ -430,6 +338,63 @@ static void check_poll_status(ErtsPollSet ps); static void print_misc_debug_info(void); #endif +#define ERTS_POLL_NOT_WOKEN 0 +#define ERTS_POLL_WOKEN -1 +#define ERTS_POLL_WOKEN_INTR 1 + +static ERTS_INLINE void +reset_wakeup_state(ErtsPollSet ps) +{ +#ifdef ERTS_SMP + erts_atomic32_set(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN); +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + ps->wakeup_state = 0; +#endif +} + +static ERTS_INLINE int +is_woken(ErtsPollSet ps) +{ +#ifdef ERTS_SMP + return erts_atomic32_read_acqb(&ps->wakeup_state) != ERTS_POLL_NOT_WOKEN; +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + return ps->wakeup_state != ERTS_POLL_NOT_WOKEN; +#else + return 0; +#endif +} + +static ERTS_INLINE int +is_interrupted_reset(ErtsPollSet ps) +{ +#ifdef ERTS_SMP + return (erts_atomic32_xchg(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN) + == ERTS_POLL_WOKEN_INTR); +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + int res = ps->wakeup_state == ERTS_POLL_WOKEN_INTR; + ps->wakeup_state = ERTS_POLL_NOT_WOKEN; + return res; +#else + return 0; +#endif +} + +static ERTS_INLINE void +woke_up(ErtsPollSet ps) +{ +#ifdef ERTS_SMP + erts_aint32_t wakeup_state = erts_atomic32_read(&ps->wakeup_state); + if (wakeup_state == ERTS_POLL_NOT_WOKEN) + (void) erts_atomic32_cmpxchg(&ps->wakeup_state, + ERTS_POLL_WOKEN, + ERTS_POLL_NOT_WOKEN); + ASSERT(erts_atomic32_read(&ps->wakeup_state) != ERTS_POLL_NOT_WOKEN); +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + if (ps->wakeup_state == ERTS_POLL_NOT_WOKEN) + ps->wakeup_state = ERTS_POLL_WOKEN; +#endif +} + /* * --- Wakeup pipe ----------------------------------------------------------- */ @@ -437,14 +402,34 @@ static void print_misc_debug_info(void); #if ERTS_POLL_USE_WAKEUP_PIPE static ERTS_INLINE void -wake_poller(ErtsPollSet ps) +wake_poller(ErtsPollSet ps, int interrupted) { + int wake; +#ifdef ERTS_SMP + erts_aint32_t wakeup_state; + if (!interrupted) + wakeup_state = erts_atomic32_cmpxchg_relb(&ps->wakeup_state, + ERTS_POLL_WOKEN, + ERTS_POLL_NOT_WOKEN); + else { + /* + * We might unnecessarily write to the pipe, however, + * that isn't problematic. + */ + wakeup_state = erts_atomic32_read(&ps->wakeup_state); + erts_atomic32_set_relb(&ps->wakeup_state, ERTS_POLL_WOKEN_INTR); + } + wake = wakeup_state == ERTS_POLL_NOT_WOKEN; +#elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT + wake = ps->wakeup_state == ERTS_POLL_NOT_WOKEN; + ps->wakeup_state = interrupted ? ERTS_POLL_WOKEN_INTR : ERTS_POLL_NOT_WOKEN; +#endif /* * NOTE: This function might be called from signal handlers in the * non-smp case; therefore, it has to be async-signal safe in * the non-smp case. */ - if (!ERTS_POLLSET_SET_POLLER_WOKEN_CHK(ps)) { + if (wake) { ssize_t res; if (ps->wake_fds[1] < 0) return; /* Not initialized yet */ @@ -1387,9 +1372,7 @@ handle_update_requests(ErtsPollSet ps) #endif /* ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE */ static ERTS_INLINE ErtsPollEvents -poll_control(ErtsPollSet ps, int fd, ErtsPollEvents events, int on, - int *have_set_have_update_requests, - int *do_wake) +poll_control(ErtsPollSet ps, int fd, ErtsPollEvents events, int on, int *do_wake) { ErtsPollEvents new_events; @@ -1493,7 +1476,6 @@ ERTS_POLL_EXPORT(erts_poll_controlv)(ErtsPollSet ps, int len) { int i; - int hshur = 0; int do_wake; int final_do_wake = 0; @@ -1505,17 +1487,17 @@ ERTS_POLL_EXPORT(erts_poll_controlv)(ErtsPollSet ps, pcev[i].fd, pcev[i].events, pcev[i].on, - &hshur, &do_wake); final_do_wake |= do_wake; } + ERTS_POLLSET_UNLOCK(ps); + #ifdef ERTS_SMP if (final_do_wake) - wake_poller(ps); + wake_poller(ps, 0); #endif /* ERTS_SMP */ - ERTS_POLLSET_UNLOCK(ps); } ErtsPollEvents @@ -1526,20 +1508,20 @@ ERTS_POLL_EXPORT(erts_poll_control)(ErtsPollSet ps, int* do_wake) /* In: Wake up polling thread */ /* Out: Poller is woken */ { - int hshur = 0; ErtsPollEvents res; ERTS_POLLSET_LOCK(ps); - res = poll_control(ps, fd, events, on, &hshur, do_wake); + res = poll_control(ps, fd, events, on, do_wake); + + ERTS_POLLSET_UNLOCK(ps); #ifdef ERTS_SMP if (*do_wake) { - wake_poller(ps); + wake_poller(ps, 0); } #endif /* ERTS_SMP */ - ERTS_POLLSET_UNLOCK(ps); return res; } @@ -1918,9 +1900,11 @@ check_fd_events(ErtsPollSet ps, SysTimeval *tv, int max_res, int *ps_locked) return 0; } else { - erts_aint_t timeout = tv->tv_sec*1000 + tv->tv_usec/1000; + long timeout = tv->tv_sec*1000 + tv->tv_usec/1000; + if (timeout > ERTS_AINT32_T_MAX) + timeout = ERTS_AINT32_T_MAX; ASSERT(timeout >= 0); - erts_smp_atomic_set(&ps->timeout, timeout); + erts_smp_atomic32_set_relb(&ps->timeout, (erts_aint32_t) timeout); #if ERTS_POLL_USE_FALLBACK if (!(ps->fallback_used = ERTS_POLL_NEED_FALLBACK(ps))) { @@ -2042,15 +2026,14 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps, (int) tv->tv_sec*1000 + tv->tv_usec/1000); #endif - ERTS_POLLSET_UNSET_POLLER_WOKEN(ps); if (ERTS_POLLSET_SET_POLLED_CHK(ps)) { res = EINVAL; /* Another thread is in erts_poll_wait() on this pollset... */ goto done; } - if (ERTS_POLLSET_IS_INTERRUPTED(ps)) { - /* Interrupt use zero timeout */ + if (is_woken(ps)) { + /* Use zero timeout */ itv.tv_sec = 0; itv.tv_usec = 0; tvp = &itv; @@ -2067,7 +2050,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps, ps_locked = 0; res = check_fd_events(ps, tvp, no_fds, &ps_locked); - ERTS_POLLSET_SET_POLLER_WOKEN(ps); + woke_up(ps); if (res == 0) { res = ETIMEDOUT; @@ -2099,9 +2082,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps, check_poll_result(pr, no_fds); #endif - res = (no_fds == 0 - ? (ERTS_POLLSET_UNSET_INTERRUPTED_CHK(ps) ? EINTR : EAGAIN) - : 0); + res = (no_fds == 0 ? (is_interrupted_reset(ps) ? EINTR : EAGAIN) : 0); *len = no_fds; } @@ -2112,7 +2093,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps, #endif done: - erts_smp_atomic_set(&ps->timeout, ERTS_AINT_T_MAX); + erts_smp_atomic32_set_relb(&ps->timeout, ERTS_AINT32_T_MAX); #ifdef ERTS_POLL_DEBUG_PRINT erts_printf("Leaving %s = erts_poll_wait()\n", res == 0 ? "0" : erl_errno_id(res)); @@ -2128,20 +2109,17 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps, void ERTS_POLL_EXPORT(erts_poll_interrupt)(ErtsPollSet ps, int set) { +#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT || defined(ERTS_SMP) /* * NOTE: This function might be called from signal handlers in the * non-smp case; therefore, it has to be async-signal safe in * the non-smp case. */ - if (set) { - ERTS_POLLSET_SET_INTERRUPTED(ps); -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT || defined(ERTS_SMP) - wake_poller(ps); + if (!set) + reset_wakeup_state(ps); + else + wake_poller(ps, 1); #endif - } - else { - ERTS_POLLSET_UNSET_INTERRUPTED(ps); - } } /* @@ -2154,13 +2132,12 @@ ERTS_POLL_EXPORT(erts_poll_interrupt_timed)(ErtsPollSet ps, int set, long msec) { - if (set) { - if (erts_smp_atomic_read(&ps->timeout) > (erts_aint_t) msec) { - ERTS_POLLSET_SET_INTERRUPTED(ps); #if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT || defined(ERTS_SMP) - wake_poller(ps); -#endif - } + if (!set) + reset_wakeup_state(ps); + else { + if (erts_smp_atomic32_read_acqb(&ps->timeout) > (erts_aint32_t) msec) + wake_poller(ps, 1); #ifdef ERTS_POLL_COUNT_AVOIDED_WAKEUPS else { if (ERTS_POLLSET_IS_POLLED(ps)) @@ -2170,9 +2147,7 @@ ERTS_POLL_EXPORT(erts_poll_interrupt_timed)(ErtsPollSet ps, erts_smp_atomic_inc(&ps->no_interrupt_timed); #endif } - else { - ERTS_POLLSET_UNSET_INTERRUPTED(ps); - } +#endif } int @@ -2283,14 +2258,16 @@ ERTS_POLL_EXPORT(erts_poll_create_pollset)(void) ps->update_requests.next = NULL; ps->update_requests.len = 0; ps->curr_upd_req_block = &ps->update_requests; - erts_smp_atomic_init(&ps->have_update_requests, 0); + erts_smp_atomic32_init(&ps->have_update_requests, 0); #endif #ifdef ERTS_SMP - erts_smp_atomic_init(&ps->polled, 0); - erts_smp_atomic_init(&ps->woken, 0); + erts_atomic32_init(&ps->polled, 0); erts_smp_mtx_init(&ps->mtx, "pollset"); +#endif +#ifdef ERTS_SMP + erts_atomic32_init(&ps->wakeup_state, (erts_aint32_t) 0); #elif ERTS_POLL_ASYNC_INTERRUPT_SUPPORT - ps->woken = 0; + ps->wakeup_state = 0; #endif #if ERTS_POLL_USE_WAKEUP_PIPE create_wakeup_pipe(ps); @@ -2312,12 +2289,7 @@ ERTS_POLL_EXPORT(erts_poll_create_pollset)(void) ps->internal_fd_limit = kp_fd + 1; ps->kp_fd = kp_fd; #endif -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT && !defined(ERTS_SMP) - ps->interrupt = 0; -#else - erts_smp_atomic_init(&ps->interrupt, 0); -#endif - erts_smp_atomic_init(&ps->timeout, ERTS_AINT_T_MAX); + erts_smp_atomic32_init(&ps->timeout, ERTS_AINT32_T_MAX); #ifdef ERTS_POLL_COUNT_AVOIDED_WAKEUPS erts_smp_atomic_init(&ps->no_avoided_wakeups, 0); erts_smp_atomic_init(&ps->no_avoided_interrupts, 0); diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index bfc04faa45..bc940d2084 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -160,14 +160,14 @@ static int debug_log = 0; #endif #ifdef ERTS_SMP -erts_smp_atomic_t erts_got_sigusr1; +erts_smp_atomic32_t erts_got_sigusr1; #define ERTS_SET_GOT_SIGUSR1 \ - erts_smp_atomic_set(&erts_got_sigusr1, 1) + erts_smp_atomic32_set(&erts_got_sigusr1, 1) #define ERTS_UNSET_GOT_SIGUSR1 \ - erts_smp_atomic_set(&erts_got_sigusr1, 0) -static erts_smp_atomic_t have_prepared_crash_dump; + erts_smp_atomic32_set(&erts_got_sigusr1, 0) +static erts_smp_atomic32_t have_prepared_crash_dump; #define ERTS_PREPARED_CRASH_DUMP \ - ((int) erts_smp_atomic_xchg(&have_prepared_crash_dump, 1)) + ((int) erts_smp_atomic32_xchg(&have_prepared_crash_dump, 1)) #else volatile int erts_got_sigusr1; #define ERTS_SET_GOT_SIGUSR1 (erts_got_sigusr1 = 1) @@ -235,11 +235,11 @@ static int max_files = -1; * a few variables used by the break handler */ #ifdef ERTS_SMP -erts_smp_atomic_t erts_break_requested; +erts_smp_atomic32_t erts_break_requested; #define ERTS_SET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 1) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 1) #define ERTS_UNSET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 0) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 0) #else volatile int erts_break_requested = 0; #define ERTS_SET_BREAK_REQUESTED (erts_break_requested = 1) @@ -504,9 +504,9 @@ erts_sys_pre_init(void) #endif } #ifdef ERTS_SMP - erts_smp_atomic_init(&erts_break_requested, 0); - erts_smp_atomic_init(&erts_got_sigusr1, 0); - erts_smp_atomic_init(&have_prepared_crash_dump, 0); + erts_smp_atomic32_init(&erts_break_requested, 0); + erts_smp_atomic32_init(&erts_got_sigusr1, 0); + erts_smp_atomic32_init(&have_prepared_crash_dump, 0); #else erts_break_requested = 0; erts_got_sigusr1 = 0; diff --git a/erts/emulator/sys/win32/erl_poll.c b/erts/emulator/sys/win32/erl_poll.c index d84ae2ede2..1f2877b682 100644 --- a/erts/emulator/sys/win32/erl_poll.c +++ b/erts/emulator/sys/win32/erl_poll.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2007-2010. All Rights Reserved. + * Copyright Ericsson AB 2007-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -274,7 +274,6 @@ struct ErtsPollSet_ { Waiter** waiter; int allocated_waiters; /* Size ow waiter array */ int num_waiters; /* Number of waiter threads. */ - erts_atomic_t sys_io_ready; /* Tells us there is I/O ready (already). */ int restore_events; /* Tells us to restore waiters events next time around */ HANDLE event_io_ready; /* To be used when waiting for io */ @@ -282,12 +281,11 @@ struct ErtsPollSet_ { volatile int standby_wait_counter; /* Number of threads to wait for */ CRITICAL_SECTION standby_crit; /* CS to guard the counter */ HANDLE standby_wait_event; /* Event signalled when counte == 0 */ + erts_atomic32_t wakeup_state; #ifdef ERTS_SMP - erts_smp_atomic_t woken; erts_smp_mtx_t mtx; - erts_smp_atomic_t interrupt; #endif - erts_smp_atomic_t timeout; + erts_smp_atomic32_t timeout; }; #ifdef ERTS_SMP @@ -296,126 +294,24 @@ struct ErtsPollSet_ { erts_smp_mtx_lock(&(PS)->mtx) #define ERTS_POLLSET_UNLOCK(PS) \ erts_smp_mtx_unlock(&(PS)->mtx) -#define ERTS_POLLSET_SET_POLLED_CHK(PS) \ - ((int) erts_smp_atomic_xchg(&(PS)->polled, (erts_aint_t) 1)) -#define ERTS_POLLSET_SET_POLLED(PS) \ - erts_smp_atomic_set(&(PS)->polled, (erts_aint_t) 1) -#define ERTS_POLLSET_UNSET_POLLED(PS) \ - erts_smp_atomic_set(&(PS)->polled, (erts_aint_t) 0) -#define ERTS_POLLSET_IS_POLLED(PS) \ - ((int) erts_smp_atomic_read(&(PS)->polled)) - -#define ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) set_poller_woken_chk((PS)) -#define ERTS_POLLSET_SET_POLLER_WOKEN(PS) \ -do { \ - ERTS_THR_MEMORY_BARRIER; \ - erts_smp_atomic_set(&(PS)->woken, (erts_aint_t) 1); \ -} while (0) -#define ERTS_POLLSET_UNSET_POLLER_WOKEN(PS) \ -do { \ - erts_smp_atomic_set(&(PS)->woken, (erts_aint_t) 0); \ - ERTS_THR_MEMORY_BARRIER; \ -} while (0) -#define ERTS_POLLSET_IS_POLLER_WOKEN(PS) \ - ((int) erts_smp_atomic_read(&(PS)->woken)) - -#define ERTS_POLLSET_UNSET_INTERRUPTED_CHK(PS) unset_interrupted_chk((PS)) -#define ERTS_POLLSET_UNSET_INTERRUPTED(PS) \ -do { \ - erts_smp_atomic_set(&(PS)->interrupt, (erts_aint_t) 0); \ - ERTS_THR_MEMORY_BARRIER; \ -} while (0) -#define ERTS_POLLSET_SET_INTERRUPTED(PS) \ -do { \ - ERTS_THR_MEMORY_BARRIER; \ - erts_smp_atomic_set(&(PS)->interrupt, (erts_aint_t) 1); \ -} while (0) -#define ERTS_POLLSET_IS_INTERRUPTED(PS) \ - ((int) erts_smp_atomic_read(&(PS)->interrupt)) - -static ERTS_INLINE int -unset_interrupted_chk(ErtsPollSet ps) -{ - int res = (int) erts_smp_atomic_xchg(&ps->interrupt, (erts_aint_t) 0); - ERTS_THR_MEMORY_BARRIER; - return res; - -} - -static ERTS_INLINE int -set_poller_woken_chk(ErtsPollSet ps) -{ - ERTS_THR_MEMORY_BARRIER; - return (int) erts_smp_atomic_xchg(&ps->woken, (erts_aint_t) 1); -} #else #define ERTS_POLLSET_LOCK(PS) #define ERTS_POLLSET_UNLOCK(PS) -#define ERTS_POLLSET_SET_POLLED_CHK(PS) 0 -#define ERTS_POLLSET_UNSET_POLLED(PS) -#define ERTS_POLLSET_IS_POLLED(PS) 0 -#define ERTS_POLLSET_SET_POLLER_WOKEN_CHK(PS) 1 -#define ERTS_POLLSET_SET_POLLER_WOKEN(PS) -#define ERTS_POLLSET_UNSET_POLLER_WOKEN(PS) -#define ERTS_POLLSET_IS_POLLER_WOKEN(PS) 1 - #endif -/* - * While atomics are not yet implemented for windows in the common library... - * - * MSDN doc states that SMP machines and old compilers require - * InterLockedExchange to properly read and write interlocked - * variables, otherwise the processors might reschedule - * the access and order of atomics access is destroyed... - * While they only mention it in white-papers, the problem - * in VS2003 is due to the IA64 arch, so we can still count - * on the CPU not rescheduling the access to volatile in X86 arch using - * even the slightly older compiler... - * - * So here's (hopefully) a subset of the generally working atomic - * variable access... - */ - -#if defined(__GNUC__) -# if defined(__i386__) || defined(__x86_64__) -# define VOLATILE_IN_SEQUENCE 1 -# else -# define VOLATILE_IN_SEQUENCE 0 -# endif -#elif defined(_MSC_VER) -# if _MSC_VER < 1300 -# define VOLATILE_IN_SEQUENCE 0 /* Dont trust really old compilers */ -# else -# if defined(_M_IX86) -# define VOLATILE_IN_SEQUENCE 1 -# else /* I.e. IA64 */ -# if _MSC_VER >= 1400 -# define VOLATILE_IN_SEQUENCE 1 -# else -# define VOLATILE_IN_SEQUENCE 0 -# endif -# endif -# endif -#else -# define VOLATILE_IN_SEQUENCE 0 -#endif - - - /* * Communication with sys_interrupt */ #ifdef ERTS_SMP -extern erts_smp_atomic_t erts_break_requested; +extern erts_smp_atomic32_t erts_break_requested; #define ERTS_SET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 1) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 1) #define ERTS_UNSET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 0) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 0) #else extern volatile int erts_break_requested; #define ERTS_SET_BREAK_REQUESTED (erts_break_requested = 1) @@ -424,7 +320,7 @@ extern volatile int erts_break_requested; static erts_mtx_t break_waiter_lock; static HANDLE break_happened_event; -static erts_atomic_t break_waiter_state; +static erts_atomic32_t break_waiter_state; #define BREAK_WAITER_GOT_BREAK 1 #define BREAK_WAITER_GOT_HALT 2 @@ -467,29 +363,168 @@ do { \ wait_standby(PS); \ } while(0) -#if ERTS_POLL_ASYNC_INTERRUPT_SUPPORT && !defined(ERTS_SMP) +#define ERTS_POLL_NOT_WOKEN ((erts_aint32_t) 0) +#define ERTS_POLL_WOKEN_IO_READY ((erts_aint32_t) 1) +#define ERTS_POLL_WOKEN_INTR ((erts_aint32_t) 2) +#define ERTS_POLL_WOKEN_TIMEDOUT ((erts_aint32_t) 3) static ERTS_INLINE int -unset_interrupted_chk(ErtsPollSet ps) +is_io_ready(ErtsPollSet ps) { - /* This operation isn't atomic, but we have no need at all for an - atomic operation here... */ - int res = ps->interrupt; - ps->interrupt = 0; - return res; + return erts_atomic32_read(&ps->wakeup_state) == ERTS_POLL_WOKEN_IO_READY; } +static ERTS_INLINE void +woke_up(ErtsPollSet ps) +{ + if (erts_atomic32_read(&ps->wakeup_state) == ERTS_POLL_NOT_WOKEN) + erts_atomic32_cmpxchg(&ps->wakeup_state, + ERTS_POLL_WOKEN_TIMEDOUT, + ERTS_POLL_NOT_WOKEN); +#ifdef DEBUG + { + erts_aint32_t wakeup_state = erts_atomic32_read(&ps->wakeup_state); + switch (wakeup_state) { + case ERTS_POLL_WOKEN_IO_READY: + case ERTS_POLL_WOKEN_INTR: + case ERTS_POLL_WOKEN_TIMEDOUT: + break; + default: + ASSERT(0); + break; + } + } #endif +} + +static ERTS_INLINE int +wakeup_cause(ErtsPollSet ps) +{ + int res; + erts_aint32_t wakeup_state = erts_atomic32_read(&ps->wakeup_state); + switch (wakeup_state) { + case ERTS_POLL_WOKEN_IO_READY: + res = 0; + break; + case ERTS_POLL_WOKEN_INTR: + res = EINTR; + break; + case ERTS_POLL_WOKEN_TIMEDOUT: + res = ETIMEDOUT; + break; + default: + res = 0; + erl_exit(ERTS_ABORT_EXIT, + "%s:%d: Internal error: Invalid wakeup_state=%d\n", + __FILE__, __LINE__, (int) wakeup_state); + } + return res; +} + +static ERTS_INLINE DWORD +poll_wait_timeout(ErtsPollSet ps, SysTimeval *tvp) +{ + time_t timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; + + if (timeout <= 0) { + woke_up(ps); + return (DWORD) 0; + } + + ResetEvent(ps->event_io_ready); + /* + * Since we don't know the internals of ResetEvent() we issue + * a memory barrier as a safety precaution ensuring that + * the load of wakeup_state wont be reordered with stores made + * by ResetEvent(). + */ + ERTS_THR_MEMORY_BARRIER; + if (erts_atomic32_read(&ps->wakeup_state) != ERTS_POLL_NOT_WOKEN) + return (DWORD) 0; + + if (timeout > ERTS_AINT32_T_MAX) /* Also prevents DWORD overflow */ + timeout = ERTS_AINT32_T_MAX; + + erts_smp_atomic32_set_relb(&ps->timeout, (erts_aint32_t) timeout); + return (DWORD) timeout; +} -#ifdef ERTS_SMP static ERTS_INLINE void -wake_poller(ErtsPollSet ps) +wake_poller(ErtsPollSet ps, int io_ready) { - if (!ERTS_POLLSET_SET_POLLER_WOKEN_CHK(ps)) { + erts_aint32_t wakeup_state = erts_atomic32_read(&ps->wakeup_state); + if (io_ready) { + /* We may set the event multiple times. This is, however, harmless. */ + erts_atomic32_set(&ps->wakeup_state, ERTS_POLL_WOKEN_IO_READY); + } + else { + while (wakeup_state != ERTS_POLL_WOKEN_IO_READY + && wakeup_state != ERTS_POLL_WOKEN_INTR) { + erts_aint32_t act = erts_atomic32_cmpxchg(&ps->wakeup_state, + ERTS_POLL_WOKEN_INTR, + wakeup_state); + if (act == wakeup_state) { + wakeup_state = act; + break; + } + wakeup_state = act; + } + } + if (wakeup_state == ERTS_POLL_NOT_WOKEN) { + /* + * Since we don't know the internals of SetEvent() we issue + * a memory barrier as a safety precaution ensuring that + * the store we just made to wakeup_state wont be reordered + * with loads in SetEvent(). + */ + ERTS_THR_MEMORY_BARRIER; SetEvent(ps->event_io_ready); } } -#endif + +static ERTS_INLINE void +reset_io_ready(ErtsPollSet ps) +{ + erts_atomic32_set(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN); +} + +static ERTS_INLINE void +restore_io_ready(ErtsPollSet ps) +{ + erts_atomic32_set(&ps->wakeup_state, ERTS_POLL_WOKEN_IO_READY); +} + +/* + * notify_io_ready() is used by threads waiting for events, when + * notifying a poller thread about I/O ready. + */ +static ERTS_INLINE void +notify_io_ready(ErtsPollSet ps) +{ + wake_poller(ps, 1); +} + +static ERTS_INLINE void +reset_interrupt(ErtsPollSet ps) +{ + /* We need to keep io-ready if set */ + erts_aint32_t wakeup_state = erts_atomic32_read(&ps->wakeup_state); + while (wakeup_state != ERTS_POLL_WOKEN_IO_READY + && wakeup_state != ERTS_POLL_NOT_WOKEN) { + erts_aint32_t act = erts_atomic32_cmpxchg(&ps->wakeup_state, + ERTS_POLL_NOT_WOKEN, + wakeup_state); + if (wakeup_state == act) + break; + wakeup_state = act; + } +} + +static ERTS_INLINE void +set_interrupt(ErtsPollSet ps) +{ + wake_poller(ps, 0); +} static void setup_standby_wait(ErtsPollSet ps, int num_threads) { @@ -653,14 +688,14 @@ static void *break_waiter(void *param) case WAIT_OBJECT_0: ResetEvent(harr[0]); erts_mtx_lock(&break_waiter_lock); - erts_atomic_set(&break_waiter_state,BREAK_WAITER_GOT_BREAK); + erts_atomic32_set(&break_waiter_state,BREAK_WAITER_GOT_BREAK); SetEvent(break_happened_event); erts_mtx_unlock(&break_waiter_lock); break; case (WAIT_OBJECT_0+1): ResetEvent(harr[1]); erts_mtx_lock(&break_waiter_lock); - erts_atomic_set(&break_waiter_state,BREAK_WAITER_GOT_HALT); + erts_atomic32_set(&break_waiter_state,BREAK_WAITER_GOT_HALT); SetEvent(break_happened_event); erts_mtx_unlock(&break_waiter_lock); break; @@ -767,12 +802,7 @@ event_happened: consistency_check(w); #endif ASSERT(WAIT_OBJECT_0 < i && i < WAIT_OBJECT_0+w->active_events); - if (!erts_atomic_xchg(&ps->sys_io_ready,1)) { - HARDDEBUGF(("SET EventIoReady (%d)",erts_atomic_read(&ps->sys_io_ready))); - SetEvent(ps->event_io_ready); - } else { - HARDDEBUGF(("DONT SET EventIoReady")); - } + notify_io_ready(ps); /* * The main thread wont start working on our arrays untill we're @@ -967,15 +997,10 @@ static int cancel_driver_select(ErtsPollSet ps, HANDLE event) void erts_poll_interrupt(ErtsPollSet ps, int set /* bool */) { HARDTRACEF(("In erts_poll_interrupt(%d)",set)); -#ifdef ERTS_SMP - if (set) { - ERTS_POLLSET_SET_INTERRUPTED(ps); - wake_poller(ps); - } - else { - ERTS_POLLSET_UNSET_INTERRUPTED(ps); - } -#endif + if (!set) + reset_interrupt(ps); + else + set_interrupt(ps); HARDTRACEF(("Out erts_poll_interrupt(%d)",set)); } @@ -984,17 +1009,10 @@ void erts_poll_interrupt_timed(ErtsPollSet ps, long msec) { HARDTRACEF(("In erts_poll_interrupt_timed(%d,%ld)",set,msec)); -#ifdef ERTS_SMP - if (set) { - if (erts_smp_atomic_read(&ps->timeout) > (erts_aint_t) msec) { - ERTS_POLLSET_SET_INTERRUPTED(ps); - wake_poller(ps); - } - } - else { - ERTS_POLLSET_UNSET_INTERRUPTED(ps); - } -#endif + if (!set) + reset_interrupt(ps); + else if (erts_smp_atomic32_read_acqb(&ps->timeout) > (erts_aint32_t) msec) + set_interrupt(ps); HARDTRACEF(("Out erts_poll_interrupt_timed")); } @@ -1068,10 +1086,8 @@ void erts_poll_controlv(ErtsPollSet ps, int erts_poll_wait(ErtsPollSet ps, ErtsPollResFd pr[], int *len, - SysTimeval *utvp) + SysTimeval *tvp) { - SysTimeval *tvp = utvp; - SysTimeval itv; int no_fds; DWORD timeout; EventData* ev; @@ -1084,7 +1100,7 @@ int erts_poll_wait(ErtsPollSet ps, HARDTRACEF(("In erts_poll_wait")); ERTS_POLLSET_LOCK(ps); - if (!erts_atomic_read(&ps->sys_io_ready) && ps->restore_events) { + if (!is_io_ready(ps) && ps->restore_events) { HARDDEBUGF(("Restore events: %d",ps->num_waiters)); ps->restore_events = 0; for (i = 0; i < ps->num_waiters; ++i) { @@ -1102,7 +1118,7 @@ int erts_poll_wait(ErtsPollSet ps, if (w->highwater != w->active_events) { HARDDEBUGF(("Oups!")); /* Oups, got signalled before we took the lock, can't reset */ - if(erts_atomic_read(&ps->sys_io_ready) == 0) { + if(!is_io_ready(ps)) { erl_exit(1,"Internal error: " "Inconsistent io structures in erl_poll.\n"); } @@ -1127,39 +1143,27 @@ int erts_poll_wait(ErtsPollSet ps, no_fds = ERTS_POLL_MAX_RES; #endif + timeout = poll_wait_timeout(ps, tvp); - ResetEvent(ps->event_io_ready); - ERTS_POLLSET_UNSET_POLLER_WOKEN(ps); - -#ifdef ERTS_SMP - if (ERTS_POLLSET_IS_INTERRUPTED(ps)) { - /* Interrupt use zero timeout */ - itv.tv_sec = 0; - itv.tv_usec = 0; - tvp = &itv; - } -#endif - - timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; /*HARDDEBUGF(("timeout = %ld",(long) timeout));*/ - erts_smp_atomic_set(&ps->timeout, timeout); - if (timeout > 0 && ! erts_atomic_read(&ps->sys_io_ready) && ! erts_atomic_read(&break_waiter_state)) { + if (timeout > 0 && !erts_atomic32_read(&break_waiter_state)) { HANDLE harr[2] = {ps->event_io_ready, break_happened_event}; int num_h = 2; - HARDDEBUGF(("Start waiting %d [%d]",num_h, (long) timeout)); + HARDDEBUGF(("Start waiting %d [%d]",num_h, (int) timeout)); ERTS_POLLSET_UNLOCK(ps); WaitForMultipleObjects(num_h, harr, FALSE, timeout); ERTS_POLLSET_LOCK(ps); - HARDDEBUGF(("Stop waiting %d [%d]",num_h, (long) timeout)); + HARDDEBUGF(("Stop waiting %d [%d]",num_h, (int) timeout)); + woke_up(ps); } ERTS_UNSET_BREAK_REQUESTED; - if(erts_atomic_read(&break_waiter_state)) { + if(erts_atomic32_read(&break_waiter_state)) { erts_mtx_lock(&break_waiter_lock); - break_state = erts_atomic_read(&break_waiter_state); - erts_atomic_set(&break_waiter_state,0); + break_state = erts_atomic32_read(&break_waiter_state); + erts_atomic32_set(&break_waiter_state,0); ResetEvent(break_happened_event); erts_mtx_unlock(&break_waiter_lock); switch (break_state) { @@ -1174,15 +1178,13 @@ int erts_poll_wait(ErtsPollSet ps, } } - ERTS_POLLSET_SET_POLLER_WOKEN(ps); - - if (!erts_atomic_read(&ps->sys_io_ready)) { - res = EINTR; - HARDDEBUGF(("EINTR!")); - goto done; + res = wakeup_cause(ps); + if (res != 0) { + HARDDEBUGF(("%s!", res == EINTR ? "EINTR" : "ETIMEDOUT")); + goto done; } - erts_atomic_set(&ps->sys_io_ready,0); + reset_io_ready(ps); n = ps->num_waiters; @@ -1204,9 +1206,9 @@ int erts_poll_wait(ErtsPollSet ps, if (num >= no_fds) { w->highwater=j+1; erts_mtx_unlock(&w->mtx); - /* This might mean we still have data to report, set - back the global flag! */ - erts_atomic_set(&ps->sys_io_ready,1); + /* This might mean we still have data to report, + restore flag indicating I/O ready! */ + restore_io_ready(ps); HARDDEBUGF(("To many FD's to report!")); goto done; } @@ -1228,7 +1230,7 @@ int erts_poll_wait(ErtsPollSet ps, erts_mtx_unlock(&w->mtx); } done: - erts_smp_atomic_set(&ps->timeout, ERTS_AINT_T_MAX); + erts_smp_atomic32_set(&ps->timeout, ERTS_AINT32_T_MAX); *len = num; ERTS_POLLSET_UNLOCK(ps); HARDTRACEF(("Out erts_poll_wait")); @@ -1306,15 +1308,13 @@ ErtsPollSet erts_poll_create_pollset(void) ps->standby_wait_counter = 0; ps->event_io_ready = CreateManualEvent(FALSE); ps->standby_wait_event = CreateManualEvent(FALSE); - erts_atomic_init(&ps->sys_io_ready,0); ps->restore_events = 0; + erts_atomic32_init(&ps->wakeup_state, ERTS_POLL_NOT_WOKEN); #ifdef ERTS_SMP - erts_smp_atomic_init(&ps->woken, 0); erts_smp_mtx_init(&ps->mtx, "pollset"); - erts_smp_atomic_init(&ps->interrupt, 0); #endif - erts_smp_atomic_init(&ps->timeout, ERTS_AINT_T_MAX); + erts_smp_atomic32_init(&ps->timeout, ERTS_AINT32_T_MAX); HARDTRACEF(("Out erts_poll_create_pollset")); return ps; @@ -1366,7 +1366,7 @@ void erts_poll_init(void) erts_mtx_init(&break_waiter_lock,"break_waiter_lock"); break_happened_event = CreateManualEvent(FALSE); - erts_atomic_init(&break_waiter_state, 0); + erts_atomic32_init(&break_waiter_state, 0); erts_thr_create(&thread, &break_waiter, NULL, NULL); ERTS_UNSET_BREAK_REQUESTED; diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c index 262f84babc..943c338794 100644 --- a/erts/emulator/sys/win32/sys_interrupt.c +++ b/erts/emulator/sys/win32/sys_interrupt.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1997-2010. All Rights Reserved. + * Copyright Ericsson AB 1997-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -31,11 +31,11 @@ #endif #ifdef ERTS_SMP -erts_smp_atomic_t erts_break_requested; +erts_smp_atomic32_t erts_break_requested; #define ERTS_SET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 1) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 1) #define ERTS_UNSET_BREAK_REQUESTED \ - erts_smp_atomic_set(&erts_break_requested, (erts_aint_t) 0) + erts_smp_atomic32_set(&erts_break_requested, (erts_aint32_t) 0) #else volatile int erts_break_requested = 0; #define ERTS_SET_BREAK_REQUESTED (erts_break_requested = 1) -- cgit v1.2.3 From 367f0c57805401254f386deedd83901315a1e59a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 15 Feb 2011 19:57:14 +0100 Subject: Update test_server tests to conform with common_test standard --- lib/test_server/test/Makefile | 7 +- lib/test_server/test/test_server.spec | 3 +- lib/test_server/test/test_server_SUITE.erl | 656 +++++---------------- .../test/test_server_SUITE_data/Makefile.src | 2 + .../test/test_server_SUITE_data/dummy_file | 1 - .../test_server_SUITE_data/test_server_SUITE.erl | 554 +++++++++++++++++ .../test_server_SUITE_data/dummy_file | 1 + .../test_server_conf01_SUITE.erl | 187 ++++++ .../test_server_conf02_SUITE.erl | 294 +++++++++ .../test_server_parallel01_SUITE.erl | 518 ++++++++++++++++ .../test_server_shuffle01_SUITE.erl | 471 +++++++++++++++ .../test_server_skip_SUITE.erl | 43 ++ lib/test_server/test/test_server_conf01_SUITE.erl | 187 ------ lib/test_server/test/test_server_conf02_SUITE.erl | 294 --------- lib/test_server/test/test_server_line_SUITE.erl | 19 +- .../test/test_server_parallel01_SUITE.erl | 518 ---------------- .../test/test_server_shuffle01_SUITE.erl | 471 --------------- lib/test_server/test/test_server_skip_SUITE.erl | 43 -- lib/test_server/test/test_server_test_lib.erl | 191 ++++++ lib/test_server/test/test_server_test_lib.hrl | 23 + 20 files changed, 2434 insertions(+), 2049 deletions(-) create mode 100644 lib/test_server/test/test_server_SUITE_data/Makefile.src delete mode 100644 lib/test_server/test/test_server_SUITE_data/dummy_file create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_SUITE_data/dummy_file create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_conf01_SUITE.erl create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_conf02_SUITE.erl create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl create mode 100644 lib/test_server/test/test_server_SUITE_data/test_server_skip_SUITE.erl delete mode 100644 lib/test_server/test/test_server_conf01_SUITE.erl delete mode 100644 lib/test_server/test/test_server_conf02_SUITE.erl delete mode 100644 lib/test_server/test/test_server_parallel01_SUITE.erl delete mode 100644 lib/test_server/test/test_server_shuffle01_SUITE.erl delete mode 100644 lib/test_server/test/test_server_skip_SUITE.erl create mode 100644 lib/test_server/test/test_server_test_lib.erl create mode 100644 lib/test_server/test/test_server_test_lib.hrl diff --git a/lib/test_server/test/Makefile b/lib/test_server/test/Makefile index 9fe5aee3bb..0648c1f96a 100644 --- a/lib/test_server/test/Makefile +++ b/lib/test_server/test/Makefile @@ -27,11 +27,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk MODULES= \ test_server_SUITE \ test_server_line_SUITE \ - test_server_skip_SUITE \ - test_server_conf01_SUITE \ - test_server_conf02_SUITE \ - test_server_parallel01_SUITE \ - test_server_shuffle01_SUITE + test_server_test_lib ERL_FILES= $(MODULES:%=%.erl) @@ -52,6 +48,7 @@ RELSYSDIR = $(RELEASE_PATH)/test_server_test ERL_MAKE_FLAGS += -pa $(ERL_TOP)/lib/test_server/ebin ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/include +ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/test EBIN = . diff --git a/lib/test_server/test/test_server.spec b/lib/test_server/test/test_server.spec index 23b0b71963..a3b4d01d08 100644 --- a/lib/test_server/test/test_server.spec +++ b/lib/test_server/test/test_server.spec @@ -1,2 +1 @@ -{topcase, {dir, "../test_server_test"}}. -{skip,{test_server_SUITE,skip_case7,"This case should be noted as `Skipped'"}}. +{suites, "../test_server_test", all}. diff --git a/lib/test_server/test/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE.erl index 0563e1104f..f4c19eeaf9 100644 --- a/lib/test_server/test/test_server_SUITE.erl +++ b/lib/test_server/test/test_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% Copyright Ericsson AB 2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -16,539 +16,149 @@ %% %% %CopyrightEnd% %% - -%%%------------------------------------------------------------------ -%%% Test Server self test. -%%%------------------------------------------------------------------ +%%%------------------------------------------------------------------- +%%% @author Lukas Larsson +%%% @copyright (C) 2011, Erlang Solutions Ltd. +%%% @doc +%%% +%%% @end +%%% Created : 15 Feb 2011 by Lukas Larsson +%%%------------------------------------------------------------------- -module(test_server_SUITE). --include_lib("test_server/include/test_server.hrl"). --include_lib("test_server/include/test_server_line.hrl"). --include_lib("kernel/include/file.hrl"). --export([all/1]). --export([init_per_suite/1, end_per_suite/1]). --export([init_per_testcase/2, end_per_testcase/2, fin_per_testcase/2]). --export([config/1, comment/1, timetrap/1, timetrap_cancel/1, multiply_timetrap/1, - init_per_s/1, init_per_tc/1, end_per_tc/1, - timeconv/1, msgs/1, capture/1, timecall/1, - do_times/1, do_times_mfa/1, do_times_fun/1, - skip_cases/1, skip_case1/1, skip_case2/1, skip_case3/1, - skip_case4/1, skip_case5/1, skip_case6/1, skip_case7/1, - skip_case8/1, skip_case9/1, undefined_functions/1, - conf_init/1, check_new_conf/1, conf_cleanup/1, - check_old_conf/1, conf_init_fail/1, start_stop_node/1, - cleanup_nodes_init/1, check_survive_nodes/1, cleanup_nodes_fin/1, - commercial/1]). +%% Note: This directive should only be used in test suites. +-compile(export_all). + +-include_lib("common_test/include/ct.hrl"). +-include("test_server_test_lib.hrl"). --export([dummy_function/0,dummy_function/1,doer/1]). +%%-------------------------------------------------------------------- +%% COMMON TEST CALLBACK FUNCTIONS +%%-------------------------------------------------------------------- -all(doc) -> ["Test Server self test"]; -all(suite) -> - [config, comment, timetrap, timetrap_cancel, multiply_timetrap, - init_per_s, init_per_tc, end_per_tc, - timeconv, msgs, capture, timecall, do_times, skip_cases, - undefined_functions, commercial, - {conf, conf_init, [check_new_conf], conf_cleanup}, - check_old_conf, - {conf, conf_init_fail,[conf_member_skip],conf_cleanup_skip}, - start_stop_node, - {conf, cleanup_nodes_init,[check_survive_nodes],cleanup_nodes_fin}, - config - ]. +%% @spec suite() -> Info +suite() -> + [{ct_hooks,[ts_install_cth,test_server_test_lib]}]. +%% @spec init_per_suite(Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} init_per_suite(Config) -> - [{init_per_suite_var,ok}|Config]. + [{path_dirs,[proplists:get_value(data_dir,Config)]} | Config]. +%% @spec end_per_suite(Config) -> _ end_per_suite(_Config) -> - ok. - -init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> - Dog = ?t:timetrap(?t:minutes(2)), - Config1 = [{watchdog, Dog}|Config], - case Func of - init_per_tc -> - [{strange_var, 1}|Config1]; - skip_case8 -> - {skipped, "This case should be noted as `Skipped'"}; - skip_case9 -> - {skip, "This case should be noted as `Skipped'"}; - _ -> - Config1 - end; -init_per_testcase(Func, Config) -> - io:format("Func:~p",[Func]), - io:format("Config:~p",[Config]), - ?t:fail("Arguments to init_per_testcase not correct"). - -end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> - Dog=?config(watchdog, Config), - ?t:timetrap_cancel(Dog), - case Func of - end_per_tc -> io:format("CLEANUP => this test case is ok\n"); - _Other -> ok - end; -end_per_testcase(Func, Config) -> - io:format("Func:~p",[Func]), - io:format("Config:~p",[Config]), - ?t:fail("Arguments to end_per_testcase not correct"). - -fin_per_testcase(Func, Config) -> - io:format("Func:~p",[Func]), - io:format("Config:~p",[Config]), - ?t:fail("fin_per_testcase/2 called, should have called end_per_testcase/2"). + io:format("TEST_SERVER_FRAMEWORK: ~p",[os:getenv("TEST_SERVER_FRAMEWORK")]), + ok. + +%% @spec init_per_group(GroupName, Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +init_per_group(_GroupName, Config) -> + Config. + +%% @spec end_per_group(GroupName, Config0) -> +%% void() | {save_config,Config1} +end_per_group(_GroupName, _Config) -> + ok. + +%% @spec init_per_testcase(TestCase, Config0) -> +%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1} +init_per_testcase(_TestCase, Config) -> + Config. + +%% @spec end_per_testcase(TestCase, Config0) -> +%% void() | {save_config,Config1} | {fail,Reason} +end_per_testcase(_TestCase, _Config) -> + ok. + +%% @spec: groups() -> [Group] +groups() -> + []. + +%% @spec all() -> GroupsAndTestCases | {skip,Reason} +all() -> + [test_server_SUITE, test_server_parallel01_SUITE, + test_server_conf02_SUITE, test_server_conf01_SUITE, + test_server_skip_SUITE, test_server_shuffle01_SUITE]. + + +%%-------------------------------------------------------------------- +%% TEST CASES +%%-------------------------------------------------------------------- +%% @spec TestCase(Config0) -> +%% ok | exit() | {skip,Reason} | {comment,Comment} | +%% {save_config,Config1} | {skip_and_save,Reason,Config1} +test_server_SUITE(Config) -> +% rpc:call(Node,dbg, tracer,[]), +% rpc:call(Node,dbg, p,[all,c]), +% rpc:call(Node,dbg, tpl,[test_server_ctrl,x]), + run_test_server_tests("test_server_SUITE", 39, 1, 31, + 20, 9, 1, 11, 2, 26, Config). + +test_server_parallel01_SUITE(Config) -> + run_test_server_tests("test_server_parallel01_SUITE", 37, 0, 19, + 19, 0, 0, 0, 0, 37, Config). + +test_server_shuffle01_SUITE(Config) -> + run_test_server_tests("test_server_shuffle01_SUITE", 130, 0, 0, + 76, 0, 0, 0, 0, 130, Config). + +test_server_skip_SUITE(Config) -> + run_test_server_tests("test_server_skip_SUITE", 3, 0, 1, + 0, 0, 1, 3, 0, 0, Config). + +test_server_conf01_SUITE(Config) -> + run_test_server_tests("test_server_conf01_SUITE", 24, 0, 12, + 12, 0, 0, 0, 0, 24, Config). + +test_server_conf02_SUITE(Config) -> + run_test_server_tests("test_server_conf02_SUITE", 26, 0, 12, + 12, 0, 0, 0, 0, 26, Config). + + +run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc, + NUsrSkip, NAutoSkip, + NActualSkip, NActualFail, NActualSucc, Config) -> + Node = proplists:get_value(node, Config), + {ok,_Pid} = rpc:call(Node,test_server_ctrl, start, []), + rpc:call(Node, + test_server_ctrl,add_dir_with_skip, + [SuiteName, + [proplists:get_value(data_dir,Config)],SuiteName, + [{test_server_SUITE,skip_case7,"SKIPPED!"}]]), + + until(fun() -> + rpc:call(Node,test_server_ctrl,jobs,[]) =:= [] + end), - -config(suite) -> []; -config(doc) -> ["Test that the Config variable is decent, ", - "and that the std config variables are correct ", - "(check that data/priv dir exists)." - "Also check that ?config macro works."]; -config(Config) when is_list(Config) -> - is_tuplelist(Config), - {value,{data_dir,Dd}}=lists:keysearch(data_dir,1,Config), - {value,{priv_dir,Dp}}=lists:keysearch(priv_dir,1,Config), - true=is_dir(Dd), - {ok, _Bin}=file:read_file(filename:join(Dd, "dummy_file")), - true=is_dir(Dp), - - Dd = ?config(data_dir,Config), - Dp = ?config(priv_dir,Config), - ok; -config(_Config) -> - ?t:fail("Config variable is not a list."). - -is_tuplelist([]) -> - true; -is_tuplelist([{_A,_B}|Rest]) -> - is_tuplelist(Rest); -is_tuplelist(_) -> - false. - -is_dir(Dir) -> - case file:read_file_info(Dir) of - {ok, #file_info{type=directory}} -> - true; - _ -> - false - end. - -comment(suite) -> []; -comment(doc) -> ["Print a comment in the HTML log"]; -comment(Config) when is_list(Config) -> - ?t:comment("This comment should not occur in the HTML log because a later" - " comment shall overwrite it"), - ?t:comment("This comment is printed with the comment/1 function." - " It should occur in the HTML log"). - - - -timetrap(suite) -> []; -timetrap(doc) -> ["Test that timetrap works."]; -timetrap(Config) when is_list(Config) -> - TrapAfter = 3000, - Dog=?t:timetrap(TrapAfter), - process_flag(trap_exit, true), - TimeOut = TrapAfter * test_server:timetrap_scale_factor() + 1000, - receive - {'EXIT', Dog, {timetrap_timeout, _, _}} -> - ok; - {'EXIT', _OtherPid, {timetrap_timeout, _, _}} -> - ?t:fail("EXIT signal from wrong process") - after - TimeOut -> - ?t:fail("Timetrap is not working.") - end, - ?t:timetrap_cancel(Dog), - ok. - - -timetrap_cancel(suite) -> []; -timetrap_cancel(doc) -> ["Test that timetrap_cancel works."]; -timetrap_cancel(Config) when is_list(Config) -> - Dog=?t:timetrap(1000), - receive - after - 500 -> - ok - end, - ?t:timetrap_cancel(Dog), - receive - after 1000 -> - ok - end, - ok. - -multiply_timetrap(suite) -> []; -multiply_timetrap(doc) -> ["Test multiply timetrap"]; -multiply_timetrap(Config) when is_list(Config) -> - %% This simulates the call to test_server_ctrl:multiply_timetraps/1: - put(test_server_multiply_timetraps,{2,true}), - - Dog = ?t:timetrap(500), - timer:sleep(800), - ?t:timetrap_cancel(Dog), - - %% Reset - put(test_server_multiply_timetraps,1), - ok. - - -init_per_s(suite) -> []; -init_per_s(doc) -> ["Test that a Config that is altered in ", - "init_per_suite gets through to the testcases."]; -init_per_s(Config) -> - %% Check that the config var sent from init_per_suite - %% really exists. - {value, {init_per_suite_var, ok}} = - lists:keysearch(init_per_suite_var,1,Config), - - %% Check that the other variables still exist. - {value,{data_dir,_Dd}}=lists:keysearch(data_dir,1,Config), - {value,{priv_dir,_Dp}}=lists:keysearch(priv_dir,1,Config), - ok. - -init_per_tc(suite) -> []; -init_per_tc(doc) -> ["Test that a Config that is altered in ", - "init_per_testcase gets through to the ", - "actual testcase."]; -init_per_tc(Config) -> - %% Check that the config var sent from init_per_testcase - %% really exists. - {value, {strange_var, 1}} = lists:keysearch(strange_var,1,Config), - - %% Check that the other variables still exist. - {value,{data_dir,_Dd}}=lists:keysearch(data_dir,1,Config), - {value,{priv_dir,_Dp}}=lists:keysearch(priv_dir,1,Config), - ok. - -end_per_tc(suite) -> []; -end_per_tc(doc) -> ["Test that end_per_testcase/2 is called even if" - " test case fails"]; -end_per_tc(Config) when is_list(Config) -> - ?t:fail("This case should fail! Check that \"CLEANUP\" is" - " printed in the minor log file."). - - -timeconv(suite) -> []; -timeconv(doc) -> ["Test that the time unit conversion functions ", - "works."]; -timeconv(Config) when is_list(Config) -> - Val=2, - Secs=Val*1000, - Mins=Secs*60, - Hrs=Mins*60, - Secs=?t:seconds(2), - Mins=?t:minutes(2), - Hrs=?t:hours(2), - ok. - - -msgs(suite) -> []; -msgs(doc) -> ["Tests the messages_get function."]; -msgs(Config) when is_list(Config) -> - self() ! {hej, du}, - self() ! {lite, "data"}, - self() ! en_atom, - [{hej, du}, {lite, "data"}, en_atom] = ?t:messages_get(), - ok. - -capture(suite) -> []; -capture(doc) -> ["Test that the capture functions work properly."]; -capture(Config) when is_list(Config) -> - String1="abcedfghjiklmnopqrstuvwxyz", - String2="0123456789", - ?t:capture_start(), - io:format(String1), - [String1]=?t:capture_get(), - io:format(String2), - [String2]=?t:capture_get(), - ?t:capture_stop(), - []=?t:capture_get(), - io:format(String2), - []=?t:capture_get(), - ok. - -timecall(suite) -> []; -timecall(doc) -> ["Tests that timed calls work."]; -timecall(Config) when is_list(Config) -> - {_Time1, liten_apa_e_oxo_farlig} = ?t:timecall(?MODULE, dummy_function, []), - {Time2, jag_ar_en_gorilla} = ?t:timecall(?MODULE, dummy_function, [gorilla]), - DTime=round(Time2), - if - DTime<1 -> - ?t:fail("Timecall reported a too low time."); - DTime==1 -> + rpc:call(Node,test_server_ctrl, stop, []), + {ok,#suite{ n_cases = NCases, + n_cases_failed = NFail, + n_cases_expected = NExpected, + n_cases_succ = NSucc, + n_cases_user_skip = NUsrSkip, + n_cases_auto_skip = NAutoSkip, + cases = Cases }} = Data = + test_server_test_lib:parse_suite( + hd(filelib:wildcard( + filename:join([proplists:get_value(priv_dir, Config), + SuiteName++".logs","run*","suite.log"])))), + {NActualSkip,NActualFail,NActualSucc} = + lists:foldl(fun(#tc{ result = skip },{S,F,Su}) -> + {S+1,F,Su}; + (#tc{ result = ok },{S,F,Su}) -> + {S,F,Su+1}; + (#tc{ result = failed },{S,F,Su}) -> + {S,F+1,Su} + end,{0,0,0},Cases), + Data. + +until(Fun) -> + case Fun() of + true -> ok; - DTime>1 -> - ?t:fail("Timecall reported a too high time.") - end, - ok. - -dummy_function() -> - liten_apa_e_oxo_farlig. -dummy_function(gorilla) -> - receive after 1000 -> ok end, - jag_ar_en_gorilla. - - -do_times(suite) -> [do_times_mfa, do_times_fun]; -do_times(doc) -> ["Test the do_times function."]. - -do_times_mfa(suite) -> []; -do_times_mfa(doc) -> ["Test the do_times function with M,F,A given."]; -do_times_mfa(Config) when is_list(Config) -> - ?t:do_times(100, ?MODULE, doer, [self()]), - 100=length(?t:messages_get()), - ok. - -do_times_fun(suite) -> []; -do_times_fun(doc) -> ["Test the do_times function with fun given."]; -do_times_fun(Config) when is_list(Config) -> - Self = self(), - ?t:do_times(100, fun() -> doer(Self) end), - 100=length(?t:messages_get()), - ok. - -doer(From) -> - From ! a, - ok. - -skip_cases(doc) -> ["Test all possible ways to skip a test case."]; -skip_cases(suite) -> [skip_case1, skip_case2, skip_case3, skip_case4, - skip_case5, skip_case6, skip_case7, skip_case8, - skip_case9]. - -skip_case1(suite) -> []; -skip_case1(doc) -> ["Test that you can return {skipped, Reason}," - " and that Reason is in the comment field in the HTML log"]; -skip_case1(Config) when is_list(Config) -> - %% If this comment shows, the case failed!! - ?t:comment("ERROR: This case should have been noted as `Skipped'"), - %% The Reason in {skipped, Reason} should overwrite a 'comment' - {skipped, "This case should be noted as `Skipped'"}. - -skip_case2(suite) -> []; -skip_case2(doc) -> ["Test that you can return {skipped, Reason}," - " and that Reason is in the comment field in the HTML log"]; -skip_case2(Config) when is_list(Config) -> - %% If this comment shows, the case failed!! - ?t:comment("ERROR: This case should have been noted as `Skipped'"), - %% The Reason in {skipped, Reason} should overwrite a 'comment' - exit({skipped, "This case should be noted as `Skipped'"}). - -skip_case3(suite) -> []; -skip_case3(doc) -> ["Test that you can return {skip, Reason}," - " and that Reason is in the comment field in the HTML log"]; -skip_case3(Config) when is_list(Config) -> - %% If this comment shows, the case failed!! - ?t:comment("ERROR: This case should have been noted as `Skipped'"), - %% The Reason in {skip, Reason} should overwrite a 'comment' - {skip, "This case should be noted as `Skipped'"}. - -skip_case4(suite) -> []; -skip_case4(doc) -> ["Test that you can return {skip, Reason}," - " and that Reason is in the comment field in the HTML log"]; -skip_case4(Config) when is_list(Config) -> - %% If this comment shows, the case failed!! - ?t:comment("ERROR: This case should have been noted as `Skipped'"), - %% The Reason in {skip, Reason} should overwrite a 'comment' - exit({skip, "This case should be noted as `Skipped'"}). - -skip_case5(suite) -> {skipped, "This case should be noted as `Skipped'"}; -skip_case5(doc) -> ["Test that you can return {skipped, Reason}" - " from the specification clause"]. - -skip_case6(suite) -> {skip, "This case should be noted as `Skipped'"}; -skip_case6(doc) -> ["Test that you can return {skip, Reason}" - " from the specification clause"]. - -skip_case7(suite) -> []; -skip_case7(doc) -> ["Test that skip works from a test specification file"]; -skip_case7(Config) when is_list(Config) -> - %% This case shall be skipped by adding - %% {skip, {test_server_SUITE, skip_case7, Reason}}. - %% to the test specification file. - ?t:fail("This case should have been Skipped by the .spec file"). - -skip_case8(suite) -> []; -skip_case8(doc) -> ["Test that {skipped, Reason} works from" - " init_per_testcase/2"]; -skip_case8(Config) when is_list(Config) -> - %% This case shall be skipped by adding a specific clause to - %% returning {skipped, Reason} from init_per_testcase/2 for this case. - ?t:fail("This case should have been Skipped by init_per_testcase/2"). - -skip_case9(suite) -> []; -skip_case9(doc) -> ["Test that {skip, Reason} works from a init_per_testcase/2"]; -skip_case9(Config) when is_list(Config) -> - %% This case shall be skipped by adding a specific clause to - %% returning {skip, Reason} from init_per_testcase/2 for this case. - ?t:fail("This case should have been Skipped by init_per_testcase/2"). - -undefined_functions(suite) -> []; -undefined_functions(doc) -> ["Check for calls to undefined functions in" - " test_server." - "Skip if cover is running"]; -undefined_functions(Config) when is_list(Config) -> - case whereis(cover_server) of - Pid when is_pid(Pid) -> - {skip,"Cover is running"}; - undefined -> - undefined_functions() - end. - -undefined_functions() -> - TestServerDir = filename:dirname(code:which(test_server)), - Res = xref:d(TestServerDir), - - {value,{unused,Unused}} = lists:keysearch(unused, 1, Res), - case Unused of - [] -> ok; - _ -> - lists:foreach(fun (MFA) -> - io:format("~s unused", [format_mfa(MFA)]) - end, Unused) - end, - - {value,{undefined,Undef0}} = lists:keysearch(undefined, 1, Res), - Undef = [U || U <- Undef0, not unresolved(U)], - case Undef of - [] -> ok; - _ -> - lists:foreach(fun ({MFA1,MFA2}) -> - io:format("~s calls undefined ~s", - [format_mfa(MFA1),format_mfa(MFA2)]) - end, Undef), - ?t:fail({length(Undef),undefined_functions_in_otp}) - end, - ok. - -unresolved({_,{_,'$F_EXPR',_}}) -> true; -unresolved(_) -> false. - -format_mfa({M,F,A}) -> - lists:flatten(io_lib:format("~s:~s/~p", [M,F,A])). - -conf_init(doc) -> ["Test successful conf case: Change Config parameter"]; -conf_init(Config) when is_list(Config) -> - [{conf_init_var,1389}|Config]. - -check_new_conf(suite) -> []; -check_new_conf(doc) -> ["Check that Config parameter changed by" - " conf_init is used"]; -check_new_conf(Config) when is_list(Config) -> - 1389 = ?config(conf_init_var,Config), - ok. - -conf_cleanup(doc) -> ["Test successful conf case: Restore Config parameter"]; -conf_cleanup(Config) when is_list(Config) -> - lists:keydelete(conf_init_var,1,Config). - -check_old_conf(suite) -> []; -check_old_conf(doc) -> ["Test that the restored Config is used after a" - " conf cleanup"]; -check_old_conf(Config) when is_list(Config) -> - undefined = ?config(conf_init_var,Config), - ok. - -conf_init_fail(doc) -> ["Test that config members are skipped if" - " conf init function fails."]; -conf_init_fail(Config) when is_list(Config) -> - ?t:fail("This case should fail! Check that conf_member_skip and" - " conf_cleanup_skip are skipped."). - - - -start_stop_node(suite) -> []; -start_stop_node(doc) -> ["Test start and stop of slave and peer nodes"]; -start_stop_node(Config) when is_list(Config) -> - {ok,Node2} = ?t:start_node(node2,peer,[]), - {error, _} = ?t:start_node(node2,peer,[{fail_on_error,false}]), - true = lists:member(Node2,nodes()), - - {ok,Node3} = ?t:start_node(node3,slave,[]), - {error, _} = ?t:start_node(node3,slave,[]), - true = lists:member(Node3,nodes()), - - {ok,Node4} = ?t:start_node(node4,peer,[{wait,false}]), - case lists:member(Node4,nodes()) of - true -> - ?t:comment("WARNING: Node started with {wait,false}" - " is up faster than expected..."); false -> - wait_for_node(Node4,0), - true = lists:member(Node4,nodes()) - end, - - true = ?t:stop_node(Node2), - false = lists:member(Node2,nodes()), - - true = ?t:stop_node(Node3), - false = lists:member(Node3,nodes()), - - true = ?t:stop_node(Node4), - false = lists:member(Node4,nodes()), - timer:sleep(2000), - false = ?t:stop_node(Node4), - - ok. - - -wait_for_node(Node,Acc) -> - case net_adm:ping(Node) of - pang -> timer:sleep(100), - wait_for_node(Node,Acc+100); - pong -> - Acc + until(Fun) end. - -cleanup_nodes_init(doc) -> ["Test that nodes are terminated when test case" - " is finished unless {cleanup,false} is given."]; -cleanup_nodes_init(Config) when is_list(Config) -> - {ok,DieSlave} = ?t:start_node(die_slave, slave, []), - {ok,SurviveSlave} = ?t:start_node(survive_slave, slave, [{cleanup,false}]), - {ok,DiePeer} = ?t:start_node(die_peer, peer, []), - {ok,SurvivePeer} = ?t:start_node(survive_peer, peer, [{cleanup,false}]), - [{die_slave,DieSlave}, - {survive_slave,SurviveSlave}, - {die_peer,DiePeer}, - {survive_peer,SurvivePeer} | Config]. - - - -check_survive_nodes(suite) -> []; -check_survive_nodes(doc) -> ["Test that nodes with {cleanup,false} survived"]; -check_survive_nodes(Config) when is_list(Config) -> - timer:sleep(1000), - false = lists:member(?config(die_slave,Config),nodes()), - true = lists:member(?config(survive_slave,Config),nodes()), - false = lists:member(?config(die_peer,Config),nodes()), - true = lists:member(?config(survive_peer,Config),nodes()), - ok. - - -cleanup_nodes_fin(doc) -> ["Test that nodes started with {cleanup,false}" - " can be stopped"]; -cleanup_nodes_fin(Config) when is_list(Config) -> - Slave = ?config(survive_slave,Config), - Peer = ?config(survive_peer,Config), - - true = ?t:stop_node(Slave), - false = lists:member(Slave,nodes()), - true = ?t:stop_node(Peer), - false = lists:member(Peer,nodes()), - - C1 = lists:keydelete(die_slave,1,Config), - C2 = lists:keydelete(survive_slave,1,C1), - C3 = lists:keydelete(die_peer,1,C2), - lists:keydelete(survive_peer,1,C3). - -commercial(Config) when is_list(Config) -> - case ?t:is_commercial() of - false -> {comment,"Open-source build"}; - true -> {comment,"Commercial build"} - end. - - + diff --git a/lib/test_server/test/test_server_SUITE_data/Makefile.src b/lib/test_server/test/test_server_SUITE_data/Makefile.src new file mode 100644 index 0000000000..d5af919eec --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/Makefile.src @@ -0,0 +1,2 @@ +all: + erlc *.erl \ No newline at end of file diff --git a/lib/test_server/test/test_server_SUITE_data/dummy_file b/lib/test_server/test/test_server_SUITE_data/dummy_file deleted file mode 100644 index 65c88fbd75..0000000000 --- a/lib/test_server/test/test_server_SUITE_data/dummy_file +++ /dev/null @@ -1 +0,0 @@ -Dummy file. \ No newline at end of file diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl new file mode 100644 index 0000000000..0563e1104f --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl @@ -0,0 +1,554 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1997-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------ +%%% Test Server self test. +%%%------------------------------------------------------------------ +-module(test_server_SUITE). +-include_lib("test_server/include/test_server.hrl"). +-include_lib("test_server/include/test_server_line.hrl"). +-include_lib("kernel/include/file.hrl"). +-export([all/1]). + +-export([init_per_suite/1, end_per_suite/1]). +-export([init_per_testcase/2, end_per_testcase/2, fin_per_testcase/2]). +-export([config/1, comment/1, timetrap/1, timetrap_cancel/1, multiply_timetrap/1, + init_per_s/1, init_per_tc/1, end_per_tc/1, + timeconv/1, msgs/1, capture/1, timecall/1, + do_times/1, do_times_mfa/1, do_times_fun/1, + skip_cases/1, skip_case1/1, skip_case2/1, skip_case3/1, + skip_case4/1, skip_case5/1, skip_case6/1, skip_case7/1, + skip_case8/1, skip_case9/1, undefined_functions/1, + conf_init/1, check_new_conf/1, conf_cleanup/1, + check_old_conf/1, conf_init_fail/1, start_stop_node/1, + cleanup_nodes_init/1, check_survive_nodes/1, cleanup_nodes_fin/1, + commercial/1]). + +-export([dummy_function/0,dummy_function/1,doer/1]). + +all(doc) -> ["Test Server self test"]; +all(suite) -> + [config, comment, timetrap, timetrap_cancel, multiply_timetrap, + init_per_s, init_per_tc, end_per_tc, + timeconv, msgs, capture, timecall, do_times, skip_cases, + undefined_functions, commercial, + {conf, conf_init, [check_new_conf], conf_cleanup}, + check_old_conf, + {conf, conf_init_fail,[conf_member_skip],conf_cleanup_skip}, + start_stop_node, + {conf, cleanup_nodes_init,[check_survive_nodes],cleanup_nodes_fin}, + config + ]. + + +init_per_suite(Config) -> + [{init_per_suite_var,ok}|Config]. + +end_per_suite(_Config) -> + ok. + +init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> + Dog = ?t:timetrap(?t:minutes(2)), + Config1 = [{watchdog, Dog}|Config], + case Func of + init_per_tc -> + [{strange_var, 1}|Config1]; + skip_case8 -> + {skipped, "This case should be noted as `Skipped'"}; + skip_case9 -> + {skip, "This case should be noted as `Skipped'"}; + _ -> + Config1 + end; +init_per_testcase(Func, Config) -> + io:format("Func:~p",[Func]), + io:format("Config:~p",[Config]), + ?t:fail("Arguments to init_per_testcase not correct"). + +end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> + Dog=?config(watchdog, Config), + ?t:timetrap_cancel(Dog), + case Func of + end_per_tc -> io:format("CLEANUP => this test case is ok\n"); + _Other -> ok + end; +end_per_testcase(Func, Config) -> + io:format("Func:~p",[Func]), + io:format("Config:~p",[Config]), + ?t:fail("Arguments to end_per_testcase not correct"). + +fin_per_testcase(Func, Config) -> + io:format("Func:~p",[Func]), + io:format("Config:~p",[Config]), + ?t:fail("fin_per_testcase/2 called, should have called end_per_testcase/2"). + + +config(suite) -> []; +config(doc) -> ["Test that the Config variable is decent, ", + "and that the std config variables are correct ", + "(check that data/priv dir exists)." + "Also check that ?config macro works."]; +config(Config) when is_list(Config) -> + is_tuplelist(Config), + {value,{data_dir,Dd}}=lists:keysearch(data_dir,1,Config), + {value,{priv_dir,Dp}}=lists:keysearch(priv_dir,1,Config), + true=is_dir(Dd), + {ok, _Bin}=file:read_file(filename:join(Dd, "dummy_file")), + true=is_dir(Dp), + + Dd = ?config(data_dir,Config), + Dp = ?config(priv_dir,Config), + ok; +config(_Config) -> + ?t:fail("Config variable is not a list."). + +is_tuplelist([]) -> + true; +is_tuplelist([{_A,_B}|Rest]) -> + is_tuplelist(Rest); +is_tuplelist(_) -> + false. + +is_dir(Dir) -> + case file:read_file_info(Dir) of + {ok, #file_info{type=directory}} -> + true; + _ -> + false + end. + +comment(suite) -> []; +comment(doc) -> ["Print a comment in the HTML log"]; +comment(Config) when is_list(Config) -> + ?t:comment("This comment should not occur in the HTML log because a later" + " comment shall overwrite it"), + ?t:comment("This comment is printed with the comment/1 function." + " It should occur in the HTML log"). + + + +timetrap(suite) -> []; +timetrap(doc) -> ["Test that timetrap works."]; +timetrap(Config) when is_list(Config) -> + TrapAfter = 3000, + Dog=?t:timetrap(TrapAfter), + process_flag(trap_exit, true), + TimeOut = TrapAfter * test_server:timetrap_scale_factor() + 1000, + receive + {'EXIT', Dog, {timetrap_timeout, _, _}} -> + ok; + {'EXIT', _OtherPid, {timetrap_timeout, _, _}} -> + ?t:fail("EXIT signal from wrong process") + after + TimeOut -> + ?t:fail("Timetrap is not working.") + end, + ?t:timetrap_cancel(Dog), + ok. + + +timetrap_cancel(suite) -> []; +timetrap_cancel(doc) -> ["Test that timetrap_cancel works."]; +timetrap_cancel(Config) when is_list(Config) -> + Dog=?t:timetrap(1000), + receive + after + 500 -> + ok + end, + ?t:timetrap_cancel(Dog), + receive + after 1000 -> + ok + end, + ok. + +multiply_timetrap(suite) -> []; +multiply_timetrap(doc) -> ["Test multiply timetrap"]; +multiply_timetrap(Config) when is_list(Config) -> + %% This simulates the call to test_server_ctrl:multiply_timetraps/1: + put(test_server_multiply_timetraps,{2,true}), + + Dog = ?t:timetrap(500), + timer:sleep(800), + ?t:timetrap_cancel(Dog), + + %% Reset + put(test_server_multiply_timetraps,1), + ok. + + +init_per_s(suite) -> []; +init_per_s(doc) -> ["Test that a Config that is altered in ", + "init_per_suite gets through to the testcases."]; +init_per_s(Config) -> + %% Check that the config var sent from init_per_suite + %% really exists. + {value, {init_per_suite_var, ok}} = + lists:keysearch(init_per_suite_var,1,Config), + + %% Check that the other variables still exist. + {value,{data_dir,_Dd}}=lists:keysearch(data_dir,1,Config), + {value,{priv_dir,_Dp}}=lists:keysearch(priv_dir,1,Config), + ok. + +init_per_tc(suite) -> []; +init_per_tc(doc) -> ["Test that a Config that is altered in ", + "init_per_testcase gets through to the ", + "actual testcase."]; +init_per_tc(Config) -> + %% Check that the config var sent from init_per_testcase + %% really exists. + {value, {strange_var, 1}} = lists:keysearch(strange_var,1,Config), + + %% Check that the other variables still exist. + {value,{data_dir,_Dd}}=lists:keysearch(data_dir,1,Config), + {value,{priv_dir,_Dp}}=lists:keysearch(priv_dir,1,Config), + ok. + +end_per_tc(suite) -> []; +end_per_tc(doc) -> ["Test that end_per_testcase/2 is called even if" + " test case fails"]; +end_per_tc(Config) when is_list(Config) -> + ?t:fail("This case should fail! Check that \"CLEANUP\" is" + " printed in the minor log file."). + + +timeconv(suite) -> []; +timeconv(doc) -> ["Test that the time unit conversion functions ", + "works."]; +timeconv(Config) when is_list(Config) -> + Val=2, + Secs=Val*1000, + Mins=Secs*60, + Hrs=Mins*60, + Secs=?t:seconds(2), + Mins=?t:minutes(2), + Hrs=?t:hours(2), + ok. + + +msgs(suite) -> []; +msgs(doc) -> ["Tests the messages_get function."]; +msgs(Config) when is_list(Config) -> + self() ! {hej, du}, + self() ! {lite, "data"}, + self() ! en_atom, + [{hej, du}, {lite, "data"}, en_atom] = ?t:messages_get(), + ok. + +capture(suite) -> []; +capture(doc) -> ["Test that the capture functions work properly."]; +capture(Config) when is_list(Config) -> + String1="abcedfghjiklmnopqrstuvwxyz", + String2="0123456789", + ?t:capture_start(), + io:format(String1), + [String1]=?t:capture_get(), + io:format(String2), + [String2]=?t:capture_get(), + ?t:capture_stop(), + []=?t:capture_get(), + io:format(String2), + []=?t:capture_get(), + ok. + +timecall(suite) -> []; +timecall(doc) -> ["Tests that timed calls work."]; +timecall(Config) when is_list(Config) -> + {_Time1, liten_apa_e_oxo_farlig} = ?t:timecall(?MODULE, dummy_function, []), + {Time2, jag_ar_en_gorilla} = ?t:timecall(?MODULE, dummy_function, [gorilla]), + DTime=round(Time2), + if + DTime<1 -> + ?t:fail("Timecall reported a too low time."); + DTime==1 -> + ok; + DTime>1 -> + ?t:fail("Timecall reported a too high time.") + end, + ok. + +dummy_function() -> + liten_apa_e_oxo_farlig. +dummy_function(gorilla) -> + receive after 1000 -> ok end, + jag_ar_en_gorilla. + + +do_times(suite) -> [do_times_mfa, do_times_fun]; +do_times(doc) -> ["Test the do_times function."]. + +do_times_mfa(suite) -> []; +do_times_mfa(doc) -> ["Test the do_times function with M,F,A given."]; +do_times_mfa(Config) when is_list(Config) -> + ?t:do_times(100, ?MODULE, doer, [self()]), + 100=length(?t:messages_get()), + ok. + +do_times_fun(suite) -> []; +do_times_fun(doc) -> ["Test the do_times function with fun given."]; +do_times_fun(Config) when is_list(Config) -> + Self = self(), + ?t:do_times(100, fun() -> doer(Self) end), + 100=length(?t:messages_get()), + ok. + +doer(From) -> + From ! a, + ok. + +skip_cases(doc) -> ["Test all possible ways to skip a test case."]; +skip_cases(suite) -> [skip_case1, skip_case2, skip_case3, skip_case4, + skip_case5, skip_case6, skip_case7, skip_case8, + skip_case9]. + +skip_case1(suite) -> []; +skip_case1(doc) -> ["Test that you can return {skipped, Reason}," + " and that Reason is in the comment field in the HTML log"]; +skip_case1(Config) when is_list(Config) -> + %% If this comment shows, the case failed!! + ?t:comment("ERROR: This case should have been noted as `Skipped'"), + %% The Reason in {skipped, Reason} should overwrite a 'comment' + {skipped, "This case should be noted as `Skipped'"}. + +skip_case2(suite) -> []; +skip_case2(doc) -> ["Test that you can return {skipped, Reason}," + " and that Reason is in the comment field in the HTML log"]; +skip_case2(Config) when is_list(Config) -> + %% If this comment shows, the case failed!! + ?t:comment("ERROR: This case should have been noted as `Skipped'"), + %% The Reason in {skipped, Reason} should overwrite a 'comment' + exit({skipped, "This case should be noted as `Skipped'"}). + +skip_case3(suite) -> []; +skip_case3(doc) -> ["Test that you can return {skip, Reason}," + " and that Reason is in the comment field in the HTML log"]; +skip_case3(Config) when is_list(Config) -> + %% If this comment shows, the case failed!! + ?t:comment("ERROR: This case should have been noted as `Skipped'"), + %% The Reason in {skip, Reason} should overwrite a 'comment' + {skip, "This case should be noted as `Skipped'"}. + +skip_case4(suite) -> []; +skip_case4(doc) -> ["Test that you can return {skip, Reason}," + " and that Reason is in the comment field in the HTML log"]; +skip_case4(Config) when is_list(Config) -> + %% If this comment shows, the case failed!! + ?t:comment("ERROR: This case should have been noted as `Skipped'"), + %% The Reason in {skip, Reason} should overwrite a 'comment' + exit({skip, "This case should be noted as `Skipped'"}). + +skip_case5(suite) -> {skipped, "This case should be noted as `Skipped'"}; +skip_case5(doc) -> ["Test that you can return {skipped, Reason}" + " from the specification clause"]. + +skip_case6(suite) -> {skip, "This case should be noted as `Skipped'"}; +skip_case6(doc) -> ["Test that you can return {skip, Reason}" + " from the specification clause"]. + +skip_case7(suite) -> []; +skip_case7(doc) -> ["Test that skip works from a test specification file"]; +skip_case7(Config) when is_list(Config) -> + %% This case shall be skipped by adding + %% {skip, {test_server_SUITE, skip_case7, Reason}}. + %% to the test specification file. + ?t:fail("This case should have been Skipped by the .spec file"). + +skip_case8(suite) -> []; +skip_case8(doc) -> ["Test that {skipped, Reason} works from" + " init_per_testcase/2"]; +skip_case8(Config) when is_list(Config) -> + %% This case shall be skipped by adding a specific clause to + %% returning {skipped, Reason} from init_per_testcase/2 for this case. + ?t:fail("This case should have been Skipped by init_per_testcase/2"). + +skip_case9(suite) -> []; +skip_case9(doc) -> ["Test that {skip, Reason} works from a init_per_testcase/2"]; +skip_case9(Config) when is_list(Config) -> + %% This case shall be skipped by adding a specific clause to + %% returning {skip, Reason} from init_per_testcase/2 for this case. + ?t:fail("This case should have been Skipped by init_per_testcase/2"). + +undefined_functions(suite) -> []; +undefined_functions(doc) -> ["Check for calls to undefined functions in" + " test_server." + "Skip if cover is running"]; +undefined_functions(Config) when is_list(Config) -> + case whereis(cover_server) of + Pid when is_pid(Pid) -> + {skip,"Cover is running"}; + undefined -> + undefined_functions() + end. + +undefined_functions() -> + TestServerDir = filename:dirname(code:which(test_server)), + Res = xref:d(TestServerDir), + + {value,{unused,Unused}} = lists:keysearch(unused, 1, Res), + case Unused of + [] -> ok; + _ -> + lists:foreach(fun (MFA) -> + io:format("~s unused", [format_mfa(MFA)]) + end, Unused) + end, + + {value,{undefined,Undef0}} = lists:keysearch(undefined, 1, Res), + Undef = [U || U <- Undef0, not unresolved(U)], + case Undef of + [] -> ok; + _ -> + lists:foreach(fun ({MFA1,MFA2}) -> + io:format("~s calls undefined ~s", + [format_mfa(MFA1),format_mfa(MFA2)]) + end, Undef), + ?t:fail({length(Undef),undefined_functions_in_otp}) + end, + ok. + +unresolved({_,{_,'$F_EXPR',_}}) -> true; +unresolved(_) -> false. + +format_mfa({M,F,A}) -> + lists:flatten(io_lib:format("~s:~s/~p", [M,F,A])). + +conf_init(doc) -> ["Test successful conf case: Change Config parameter"]; +conf_init(Config) when is_list(Config) -> + [{conf_init_var,1389}|Config]. + +check_new_conf(suite) -> []; +check_new_conf(doc) -> ["Check that Config parameter changed by" + " conf_init is used"]; +check_new_conf(Config) when is_list(Config) -> + 1389 = ?config(conf_init_var,Config), + ok. + +conf_cleanup(doc) -> ["Test successful conf case: Restore Config parameter"]; +conf_cleanup(Config) when is_list(Config) -> + lists:keydelete(conf_init_var,1,Config). + +check_old_conf(suite) -> []; +check_old_conf(doc) -> ["Test that the restored Config is used after a" + " conf cleanup"]; +check_old_conf(Config) when is_list(Config) -> + undefined = ?config(conf_init_var,Config), + ok. + +conf_init_fail(doc) -> ["Test that config members are skipped if" + " conf init function fails."]; +conf_init_fail(Config) when is_list(Config) -> + ?t:fail("This case should fail! Check that conf_member_skip and" + " conf_cleanup_skip are skipped."). + + + +start_stop_node(suite) -> []; +start_stop_node(doc) -> ["Test start and stop of slave and peer nodes"]; +start_stop_node(Config) when is_list(Config) -> + {ok,Node2} = ?t:start_node(node2,peer,[]), + {error, _} = ?t:start_node(node2,peer,[{fail_on_error,false}]), + true = lists:member(Node2,nodes()), + + {ok,Node3} = ?t:start_node(node3,slave,[]), + {error, _} = ?t:start_node(node3,slave,[]), + true = lists:member(Node3,nodes()), + + {ok,Node4} = ?t:start_node(node4,peer,[{wait,false}]), + case lists:member(Node4,nodes()) of + true -> + ?t:comment("WARNING: Node started with {wait,false}" + " is up faster than expected..."); + false -> + wait_for_node(Node4,0), + true = lists:member(Node4,nodes()) + end, + + true = ?t:stop_node(Node2), + false = lists:member(Node2,nodes()), + + true = ?t:stop_node(Node3), + false = lists:member(Node3,nodes()), + + true = ?t:stop_node(Node4), + false = lists:member(Node4,nodes()), + timer:sleep(2000), + false = ?t:stop_node(Node4), + + ok. + + +wait_for_node(Node,Acc) -> + case net_adm:ping(Node) of + pang -> + timer:sleep(100), + wait_for_node(Node,Acc+100); + pong -> + Acc + end. + +cleanup_nodes_init(doc) -> ["Test that nodes are terminated when test case" + " is finished unless {cleanup,false} is given."]; +cleanup_nodes_init(Config) when is_list(Config) -> + {ok,DieSlave} = ?t:start_node(die_slave, slave, []), + {ok,SurviveSlave} = ?t:start_node(survive_slave, slave, [{cleanup,false}]), + {ok,DiePeer} = ?t:start_node(die_peer, peer, []), + {ok,SurvivePeer} = ?t:start_node(survive_peer, peer, [{cleanup,false}]), + [{die_slave,DieSlave}, + {survive_slave,SurviveSlave}, + {die_peer,DiePeer}, + {survive_peer,SurvivePeer} | Config]. + + + +check_survive_nodes(suite) -> []; +check_survive_nodes(doc) -> ["Test that nodes with {cleanup,false} survived"]; +check_survive_nodes(Config) when is_list(Config) -> + timer:sleep(1000), + false = lists:member(?config(die_slave,Config),nodes()), + true = lists:member(?config(survive_slave,Config),nodes()), + false = lists:member(?config(die_peer,Config),nodes()), + true = lists:member(?config(survive_peer,Config),nodes()), + ok. + + +cleanup_nodes_fin(doc) -> ["Test that nodes started with {cleanup,false}" + " can be stopped"]; +cleanup_nodes_fin(Config) when is_list(Config) -> + Slave = ?config(survive_slave,Config), + Peer = ?config(survive_peer,Config), + + true = ?t:stop_node(Slave), + false = lists:member(Slave,nodes()), + true = ?t:stop_node(Peer), + false = lists:member(Peer,nodes()), + + C1 = lists:keydelete(die_slave,1,Config), + C2 = lists:keydelete(survive_slave,1,C1), + C3 = lists:keydelete(die_peer,1,C2), + lists:keydelete(survive_peer,1,C3). + +commercial(Config) when is_list(Config) -> + case ?t:is_commercial() of + false -> {comment,"Open-source build"}; + true -> {comment,"Commercial build"} + end. + + diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE_data/dummy_file b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE_data/dummy_file new file mode 100644 index 0000000000..65c88fbd75 --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE_data/dummy_file @@ -0,0 +1 @@ +Dummy file. \ No newline at end of file diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_conf01_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_conf01_SUITE.erl new file mode 100644 index 0000000000..a6d7dfe851 --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_conf01_SUITE.erl @@ -0,0 +1,187 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------ +%%% Test Server self test. +%%%------------------------------------------------------------------ +-module(test_server_conf01_SUITE). +-include_lib("test_server/include/test_server.hrl"). + +-compile(export_all). + +all(doc) -> ["Test simple conf case structure, with and without nested cases"]; +all(suite) -> + [ + {conf, conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, + + {conf, [], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, + + {conf, conf3_init, [conf3_tc1, + + {conf, [], conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, + + conf3_tc2], conf3_end}, + + conf5 + ]. + +%%---------- conf cases ---------- + +conf1_init(Config) when is_list(Config) -> + [{cc1,conf1}|Config]. +conf1_end(_Config) -> + ok. + +conf2_init(Config) when is_list(Config) -> + [{cc2,conf2}|Config]. +conf2_end(_Config) -> + ok. + +conf3_init(Config) when is_list(Config) -> + [{cc3,conf3}|Config]. +conf3_end(_Config) -> + ok. + +conf4_init(Config) when is_list(Config) -> + [{cc4,conf4}|Config]. +conf4_end(_Config) -> + ok. + +conf5_init(Config) when is_list(Config) -> + [{cc5,conf5}|Config]. +conf5_end(_Config) -> + ok. + +conf6_init(Config) when is_list(Config) -> + [{cc6,conf6}|Config]. +conf6_end(_Config) -> + ok. + + +conf5(suite) -> % test specification + [{conf, conf5_init, [conf5_tc1, + + {conf, [], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, + + conf5_tc2], conf5_end}]. + + +%%---------- test cases ---------- + +conf1_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + conf1 = ?config(cc1,Config), + ok. +conf1_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf1 = ?config(cc1,Config), + ok. + +conf2_tc1(Config) when is_list(Config) -> + undefined = ?config(cc1,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + conf2 = ?config(cc2,Config), + ok. +conf2_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf2 = ?config(cc2,Config), + ok. + +conf3_tc1(Config) when is_list(Config) -> + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + ok. +conf3_tc2(Config) when is_list(Config) -> + conf3 = ?config(cc3,Config), + undefined = ?config(cc4,Config), + ok. + +conf4_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + ok. +conf4_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + ok. + +conf5_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + ok. +conf5_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + undefined = ?config(cc6,Config), + ok. + +conf6_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + ok. +conf6_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + ok. + diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_conf02_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_conf02_SUITE.erl new file mode 100644 index 0000000000..deba4660c6 --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_conf02_SUITE.erl @@ -0,0 +1,294 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------ +%%% Test Server self test. +%%%------------------------------------------------------------------ +-module(test_server_conf02_SUITE). +-include_lib("test_server/include/test_server.hrl"). + +-compile(export_all). + +all(doc) -> ["Test simple conf case structure, with and without nested cases"]; +all(suite) -> + [ + {conf, conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, + + {conf, [], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, + + {conf, conf3_init, [conf3_tc1, + + {conf, [], conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, + + conf3_tc2], conf3_end}, + + conf5 + ]. + + +%%---------- conf cases ---------- + +init_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + [{suite,init}|Config]. +end_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + ok. + +init_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + [{tc11,TC}|Config]; +init_per_testcase(TC=conf1_tc2, Config) -> + [{tc12,TC}|Config]; +init_per_testcase(TC=conf2_tc1, Config) -> + [{tc21,TC}|Config]; +init_per_testcase(TC=conf2_tc2, Config) -> + [{tc22,TC}|Config]; +init_per_testcase(TC=conf3_tc1, Config) -> + [{tc31,TC}|Config]; +init_per_testcase(TC=conf3_tc2, Config) -> + [{tc32,TC}|Config]; +init_per_testcase(TC=conf4_tc1, Config) -> + [{tc41,TC}|Config]; +init_per_testcase(TC=conf4_tc2, Config) -> + [{tc42,TC}|Config]; +init_per_testcase(TC=conf5_tc1, Config) -> + [{tc51,TC}|Config]; +init_per_testcase(TC=conf5_tc2, Config) -> + [{tc52,TC}|Config]; +init_per_testcase(TC=conf6_tc1, Config) -> + [{tc61,TC}|Config]; +init_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + [{tc62,TC}|Config]. + +end_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + TC = ?config(tc11,Config), + ok; +end_per_testcase(TC=conf1_tc2, Config) -> + TC = ?config(tc12,Config), + ok; +end_per_testcase(TC=conf2_tc1, Config) -> + TC = ?config(tc21,Config), + ok; +end_per_testcase(TC=conf2_tc2, Config) -> + TC = ?config(tc22,Config), + ok; +end_per_testcase(TC=conf3_tc1, Config) -> + TC = ?config(tc31,Config), + ok; +end_per_testcase(TC=conf3_tc2, Config) -> + TC = ?config(tc32,Config), + ok; +end_per_testcase(TC=conf4_tc1, Config) -> + TC = ?config(tc41,Config), + ok; +end_per_testcase(TC=conf4_tc2, Config) -> + TC = ?config(tc42,Config), + ok; +end_per_testcase(TC=conf5_tc1, Config) -> + TC = ?config(tc51,Config), + ok; +end_per_testcase(TC=conf5_tc2, Config) -> + TC = ?config(tc52,Config), + ok; +end_per_testcase(TC=conf6_tc1, Config) -> + TC = ?config(tc61,Config), + ok; +end_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + TC = ?config(tc62,Config), + ok. + +conf1_init(Config) when is_list(Config) -> + init = ?config(suite,Config), + [{cc1,conf1}|Config]. +conf1_end(_Config) -> + ok. + +conf2_init(Config) when is_list(Config) -> + [{cc2,conf2}|Config]. +conf2_end(_Config) -> + ok. + +conf3_init(Config) when is_list(Config) -> + [{cc3,conf3}|Config]. +conf3_end(_Config) -> + ok. + +conf4_init(Config) when is_list(Config) -> + [{cc4,conf4}|Config]. +conf4_end(_Config) -> + ok. + +conf5_init(Config) when is_list(Config) -> + [{cc5,conf5}|Config]. +conf5_end(_Config) -> + ok. + +conf6_init(Config) when is_list(Config) -> + init = ?config(suite,Config), + [{cc6,conf6}|Config]. +conf6_end(_Config) -> + ok. + +conf5(suite) -> % test specification + [{conf, conf5_init, [conf5_tc1, + + {conf, [], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, + + conf5_tc2], conf5_end}]. + +%%---------- test cases ---------- + +conf1_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc1 = ?config(tc11,Config), + ok. +conf1_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc2 = ?config(tc12,Config), + ok. + +conf2_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + undefined = ?config(cc1,Config), + undefined = ?config(tc11,Config), + conf2 = ?config(cc2,Config), + conf2_tc1 = ?config(tc21,Config), + ok. +conf2_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + conf2 = ?config(cc2,Config), + undefined = ?config(tc21,Config), + conf2_tc2 = ?config(tc22,Config), + ok. + +conf3_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + undefined = ?config(cc2,Config), + undefined = ?config(tc22,Config), + conf3 = ?config(cc3,Config), + conf3_tc1 = ?config(tc31,Config), + ok. +conf3_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + conf3 = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(tc31,Config), + undefined = ?config(tc41,Config), + conf3_tc2 = ?config(tc32,Config), + ok. + +conf4_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + undefined = ?config(tc32,Config), + conf4_tc1 = ?config(tc41,Config), + ok. +conf4_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + undefined = ?config(tc41,Config), + conf4_tc2 = ?config(tc42,Config), + ok. + +conf5_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + undefined = ?config(tc42,Config), + conf5_tc1 = ?config(tc51,Config), + ok. +conf5_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + undefined = ?config(cc6,Config), + undefined = ?config(tc51,Config), + undefined = ?config(tc62,Config), + conf5_tc2 = ?config(tc52,Config), + ok. + +conf6_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + undefined = ?config(tc52,Config), + conf6_tc1 = ?config(tc61,Config), + ok. +conf6_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + undefined = ?config(tc61,Config), + conf6_tc2 = ?config(tc62,Config), + ok. diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl new file mode 100644 index 0000000000..0e7f329f89 --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_parallel01_SUITE.erl @@ -0,0 +1,518 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------ +%%% Test Server self test. +%%%------------------------------------------------------------------ +-module(test_server_parallel01_SUITE). +-include_lib("test_server/include/test_server.hrl"). + +-compile(export_all). + +%% ------------------------------------------------------------------- +%% Notes on parallel execution of test cases +%% ------------------------------------------------------------------- +%% +%% A group nested under a parallel group will start executing in +%% parallel with previous (parallel) test cases (no matter what +%% properties the nested group has). Test cases are however never +%% executed in parallel with the start or end conf case of the same +%% group! Because of this, the test_server_ctrl loop waits at +%% the end conf of a group for all parallel cases to finish +%% before the end conf case actually executes. This has the effect +%% that it's only after a nested group has finished that any +%% remaining parallel cases in the previous group get spawned (*). +%% Example (all parallel cases): +%% +%% group1_init |----> +%% group1_case1 | ---------> +%% group1_case2 | ---------------------------------> +%% group2_init | ----> +%% group2_case1 | ------> +%% group2_case2 | ----------> +%% group2_end | ---> +%% group1_case3 (*)| ----> +%% group1_case4 (*)| --> +%% group1_end | ---> +%% + +all(doc) -> ["Test simple conf case structure, with and without nested cases"]; +all(suite) -> + [ + {conf, [parallel], conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, + + {conf, [parallel], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, + + {conf, [parallel], conf3_init, [conf3_tc1, conf3_tc1, + + {conf, [], + conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, + + conf3_tc2], conf3_end}, + + conf5, + + {conf, [parallel], conf7_init, [conf7_tc1, conf7_tc1, + + {conf, [parallel], + conf8_init, [conf8_tc1, conf8_tc2], conf8_end}, + + conf7_tc2], conf7_end} + + ]. + + +%%---------- conf cases ---------- + +init_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + [{suite,init}|Config]. +end_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + ok. + +init_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + [{tc11,TC}|Config]; +init_per_testcase(TC=conf1_tc2, Config) -> + [{tc12,TC}|Config]; +init_per_testcase(TC=conf2_tc1, Config) -> + [{tc21,TC}|Config]; +init_per_testcase(TC=conf2_tc2, Config) -> + [{tc22,TC}|Config]; +init_per_testcase(TC=conf3_tc1, Config) -> + [{tc31,TC}|Config]; +init_per_testcase(TC=conf3_tc2, Config) -> + [{tc32,TC}|Config]; +init_per_testcase(TC=conf4_tc1, Config) -> + [{tc41,TC}|Config]; +init_per_testcase(TC=conf4_tc2, Config) -> + [{tc42,TC}|Config]; +init_per_testcase(TC=conf5_tc1, Config) -> + [{tc51,TC}|Config]; +init_per_testcase(TC=conf5_tc2, Config) -> + [{tc52,TC}|Config]; +init_per_testcase(TC=conf6_tc1, Config) -> + [{tc61,TC}|Config]; +init_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + [{tc62,TC}|Config]; +init_per_testcase(TC=conf7_tc1, Config) -> + [{tc71,TC}|Config]; +init_per_testcase(TC=conf7_tc2, Config) -> + [{tc72,TC}|Config]; +init_per_testcase(TC=conf8_tc1, Config) -> + [{tc81,TC}|Config]; +init_per_testcase(TC=conf8_tc2, Config) -> + init = ?config(suite,Config), + [{tc82,TC}|Config]. + +end_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + TC = ?config(tc11,Config), + ok; +end_per_testcase(TC=conf1_tc2, Config) -> + TC = ?config(tc12,Config), + ok; +end_per_testcase(TC=conf2_tc1, Config) -> + TC = ?config(tc21,Config), + ok; +end_per_testcase(TC=conf2_tc2, Config) -> + TC = ?config(tc22,Config), + ok; +end_per_testcase(TC=conf3_tc1, Config) -> + TC = ?config(tc31,Config), + ok; +end_per_testcase(TC=conf3_tc2, Config) -> + TC = ?config(tc32,Config), + ok; +end_per_testcase(TC=conf4_tc1, Config) -> + TC = ?config(tc41,Config), + ok; +end_per_testcase(TC=conf4_tc2, Config) -> + TC = ?config(tc42,Config), + ok; +end_per_testcase(TC=conf5_tc1, Config) -> + TC = ?config(tc51,Config), + ok; +end_per_testcase(TC=conf5_tc2, Config) -> + TC = ?config(tc52,Config), + ok; +end_per_testcase(TC=conf6_tc1, Config) -> + TC = ?config(tc61,Config), + ok; +end_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + TC = ?config(tc62,Config), + ok; +end_per_testcase(TC=conf7_tc1, Config) -> + TC = ?config(tc71,Config), + ok; +end_per_testcase(TC=conf7_tc2, Config) -> + TC = ?config(tc72,Config), + ok; +end_per_testcase(TC=conf8_tc1, Config) -> + TC = ?config(tc81,Config), + ok; +end_per_testcase(TC=conf8_tc2, Config) -> + init = ?config(suite,Config), + TC = ?config(tc82,Config), + ok. + +conf1_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + init = ?config(suite,Config), + [{t0,now()},{cc1,conf1}|Config]. +conf1_end(Config) -> + %% check 2s & 3s < 4s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); + Ms < 3000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf2_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + [{t0,now()},{cc2,conf2}|Config]. +conf2_end(Config) -> + %% check 3s & 2s < 4s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); + Ms < 3000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf3_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + [{t0,now()},{cc3,conf3}|Config]. +conf3_end(Config) -> + %% check 6s & 6s & (2s & 3s) & 1s = ~6s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 6500000 -> exit({bad_parallel_exec,Ms}); + Ms < 6000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf4_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [] = ?config(tc_group_properties,Config), + [{t0,now()},{cc4,conf4}|Config]. +conf4_end(Config) -> + %% check 2s & 3s >= 5s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 5500000 -> exit({bad_parallel_exec,Ms}); + Ms < 5000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf5_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [] = ?config(tc_group_properties,Config), + [{t0,now()},{cc5,conf5}|Config]. +conf5_end(Config) -> + %% check 1s & 1s & (3s & 2s) & 1s = ~6s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 7000000 -> exit({bad_parallel_exec,Ms}); + Ms < 6000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf6_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + init = ?config(suite,Config), + [{t0,now()},{cc6,conf6}|Config]. +conf6_end(Config) -> + %% check 3s & 2s < 5s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); + Ms < 3000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf5(suite) -> % test specification + [{conf, conf5_init, [conf5_tc1, conf5_tc1, + + {conf, [parallel], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, + + conf5_tc2], conf5_end}]. + +conf7_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + [{t0,now()},{cc7,conf7}|Config]. +conf7_end(Config) -> + %% check 1s & 1s & (2s & 2s) & 1s = ~3s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); + Ms < 3000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + +conf8_init(Config) when is_list(Config) -> + test_server:comment(io_lib:format("~p",[now()])), + [parallel] = ?config(tc_group_properties,Config), + init = ?config(suite,Config), + [{t0,now()},{cc8,conf8}|Config]. +conf8_end(Config) -> + %% check 2s & 2s < 4s + Ms = timer:now_diff(now(),?config(t0,Config)), + test_server:comment(io_lib:format("~p",[now()])), + if Ms > 2500000 -> exit({bad_parallel_exec,Ms}); + Ms < 2000000 -> exit({bad_parallel_exec,Ms}); + true -> ok + end. + + +%%---------- test cases ---------- + +conf1_tc1(Config) when is_list(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc1 = ?config(tc11,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf1_tc2(Config) when is_list(Config) -> + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc2 = ?config(tc12,Config), + timer:sleep(3000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf2_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + undefined = ?config(cc1,Config), + undefined = ?config(tc11,Config), + conf2 = ?config(cc2,Config), + conf2_tc1 = ?config(tc21,Config), + timer:sleep(3000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf2_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + conf2 = ?config(cc2,Config), + undefined = ?config(tc21,Config), + conf2_tc2 = ?config(tc22,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf3_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + undefined = ?config(cc2,Config), + undefined = ?config(tc22,Config), + conf3 = ?config(cc3,Config), + conf3_tc1 = ?config(tc31,Config), + timer:sleep(6000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf3_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + conf3 = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(tc31,Config), + undefined = ?config(tc41,Config), + conf3_tc2 = ?config(tc32,Config), + timer:sleep(1000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf4_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + undefined = ?config(tc32,Config), + conf4_tc1 = ?config(tc41,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf4_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + undefined = ?config(tc41,Config), + conf4_tc2 = ?config(tc42,Config), + timer:sleep(3000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf5_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + undefined = ?config(tc42,Config), + conf5_tc1 = ?config(tc51,Config), + timer:sleep(1000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf5_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + undefined = ?config(cc6,Config), + undefined = ?config(tc51,Config), + undefined = ?config(tc62,Config), + conf5_tc2 = ?config(tc52,Config), + timer:sleep(1000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf6_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + undefined = ?config(tc52,Config), + conf6_tc1 = ?config(tc61,Config), + timer:sleep(3000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf6_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + undefined = ?config(tc61,Config), + conf6_tc2 = ?config(tc62,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf7_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(cc5,Config), + undefined = ?config(cc6,Config), + conf7 = ?config(cc7,Config), + undefined = ?config(tc62,Config), + conf7_tc1 = ?config(tc71,Config), + timer:sleep(1000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf7_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf7 = ?config(cc7,Config), + undefined = ?config(cc8,Config), + undefined = ?config(tc71,Config), + undefined = ?config(tc82,Config), + conf7_tc2 = ?config(tc72,Config), + timer:sleep(1000), + test_server:comment(io_lib:format("~p",[now()])), + ok. + +conf8_tc1(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(cc5,Config), + undefined = ?config(cc6,Config), + conf7 = ?config(cc7,Config), + conf8 = ?config(cc8,Config), + undefined = ?config(tc72,Config), + conf8_tc1 = ?config(tc81,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. +conf8_tc2(Config) when is_list(Config) -> + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf7 = ?config(cc7,Config), + conf8 = ?config(cc8,Config), + undefined = ?config(tc81,Config), + conf8_tc2 = ?config(tc82,Config), + timer:sleep(2000), + test_server:comment(io_lib:format("~p",[now()])), + ok. diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl new file mode 100644 index 0000000000..7ad269501d --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_shuffle01_SUITE.erl @@ -0,0 +1,471 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%%%------------------------------------------------------------------ +%%% Test Server self test. +%%%------------------------------------------------------------------ +-module(test_server_shuffle01_SUITE). +-include_lib("test_server/include/test_server.hrl"). + +-compile(export_all). + +all(doc) -> ["Test simple conf case structure, with and without nested cases"]; +all(suite) -> + [ + {conf, [shuffle], conf1_init, [conf1_tc1, conf1_tc2, conf1_tc3], conf1_end}, + + {conf, [{shuffle,{1,2,3}}], conf2_init, [conf2_tc1, conf2_tc2, conf2_tc3], conf2_end}, + + {conf, [shuffle], conf3_init, [conf3_tc1, conf3_tc2, conf3_tc3, + + {conf, [], conf4_init, + [conf4_tc1, conf4_tc2], conf4_end}], + conf3_end}, + + conf5, + + {conf, [shuffle,{repeat,5},parallel], conf7_init, [conf7_tc1, + + {conf, [{shuffle,{3,2,1}},{repeat,3}], + conf8_init, [conf8_tc1, conf8_tc2, conf8_tc3], + conf8_end}, + + conf7_tc2, conf7_tc3], conf7_end} + + ]. + + +%%---------- conf cases ---------- + +init_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + [{suite,init}|Config]. +end_per_suite(Config) -> + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + ok. + +init_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + [{tc11,TC}|Config]; +init_per_testcase(TC=conf1_tc2, Config) -> + [{tc12,TC}|Config]; +init_per_testcase(TC=conf1_tc3, Config) -> + [{tc13,TC}|Config]; +init_per_testcase(TC=conf2_tc1, Config) -> + [{tc21,TC}|Config]; +init_per_testcase(TC=conf2_tc2, Config) -> + [{tc22,TC}|Config]; +init_per_testcase(TC=conf2_tc3, Config) -> + [{tc23,TC}|Config]; +init_per_testcase(TC=conf3_tc1, Config) -> + [{tc31,TC}|Config]; +init_per_testcase(TC=conf3_tc2, Config) -> + [{tc32,TC}|Config]; +init_per_testcase(TC=conf3_tc3, Config) -> + [{tc33,TC}|Config]; +init_per_testcase(TC=conf4_tc1, Config) -> + [{tc41,TC}|Config]; +init_per_testcase(TC=conf4_tc2, Config) -> + [{tc42,TC}|Config]; +init_per_testcase(TC=conf5_tc1, Config) -> + [{tc51,TC}|Config]; +init_per_testcase(TC=conf5_tc2, Config) -> + [{tc52,TC}|Config]; +init_per_testcase(TC=conf6_tc1, Config) -> + [{tc61,TC}|Config]; +init_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + [{tc62,TC}|Config]; +init_per_testcase(TC=conf6_tc3, Config) -> + [{tc63,TC}|Config]; +init_per_testcase(TC=conf7_tc1, Config) -> + [{tc71,TC}|Config]; +init_per_testcase(TC=conf7_tc2, Config) -> + [{tc72,TC}|Config]; +init_per_testcase(TC=conf7_tc3, Config) -> + [{tc73,TC}|Config]; +init_per_testcase(TC=conf8_tc1, Config) -> + [{tc81,TC}|Config]; +init_per_testcase(TC=conf8_tc2, Config) -> + init = ?config(suite,Config), + [{tc82,TC}|Config]; +init_per_testcase(TC=conf8_tc3, Config) -> + [{tc83,TC}|Config]. + +end_per_testcase(TC=conf1_tc1, Config) -> + init = ?config(suite,Config), + TC = ?config(tc11,Config), + ok; +end_per_testcase(TC=conf1_tc2, Config) -> + TC = ?config(tc12,Config), + ok; +end_per_testcase(TC=conf1_tc3, Config) -> + TC = ?config(tc13,Config), + ok; +end_per_testcase(TC=conf2_tc1, Config) -> + TC = ?config(tc21,Config), + ok; +end_per_testcase(TC=conf2_tc2, Config) -> + TC = ?config(tc22,Config), + ok; +end_per_testcase(TC=conf2_tc3, Config) -> + TC = ?config(tc23,Config), + ok; +end_per_testcase(TC=conf3_tc1, Config) -> + TC = ?config(tc31,Config), + ok; +end_per_testcase(TC=conf3_tc2, Config) -> + TC = ?config(tc32,Config), + ok; +end_per_testcase(TC=conf3_tc3, Config) -> + TC = ?config(tc33,Config), + ok; +end_per_testcase(TC=conf4_tc1, Config) -> + TC = ?config(tc41,Config), + ok; +end_per_testcase(TC=conf4_tc2, Config) -> + TC = ?config(tc42,Config), + ok; +end_per_testcase(TC=conf5_tc1, Config) -> + TC = ?config(tc51,Config), + ok; +end_per_testcase(TC=conf5_tc2, Config) -> + TC = ?config(tc52,Config), + ok; +end_per_testcase(TC=conf6_tc1, Config) -> + TC = ?config(tc61,Config), + ok; +end_per_testcase(TC=conf6_tc2, Config) -> + init = ?config(suite,Config), + TC = ?config(tc62,Config), + ok; +end_per_testcase(TC=conf6_tc3, Config) -> + TC = ?config(tc63,Config), + ok; +end_per_testcase(TC=conf7_tc1, Config) -> + TC = ?config(tc71,Config), + ok; +end_per_testcase(TC=conf7_tc2, Config) -> + TC = ?config(tc72,Config), + ok; +end_per_testcase(TC=conf7_tc3, Config) -> + TC = ?config(tc73,Config), + ok; +end_per_testcase(TC=conf8_tc1, Config) -> + TC = ?config(tc81,Config), + ok; +end_per_testcase(TC=conf8_tc2, Config) -> + init = ?config(suite,Config), + TC = ?config(tc82,Config), + ok; +end_per_testcase(TC=conf8_tc3, Config) -> + TC = ?config(tc83,Config), + ok. + + +conf1_init(Config) when is_list(Config) -> + init = ?config(suite,Config), + [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), + test_server:comment("Shuffle (random seed)"), + [{cc1,conf1}|Config]. +conf1_end(_Config) -> + ok. + +conf2_init(Config) when is_list(Config) -> + [{shuffle,{1,2,3}}] = ?config(tc_group_properties,Config), + test_server:comment("Shuffle (user seed)"), + [{cc2,conf2}|Config]. +conf2_end(_Config) -> + ok. + +conf3_init(Config) when is_list(Config) -> + [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), + test_server:comment("Shuffle (random)"), + [{cc3,conf3}|Config]. +conf3_end(_Config) -> + ok. + +conf4_init(Config) when is_list(Config) -> + [] = ?config(tc_group_properties,Config), + test_server:comment("No shuffle"), + [{cc4,conf4}|Config]. +conf4_end(_Config) -> + ok. + +conf5_init(Config) when is_list(Config) -> + [] = ?config(tc_group_properties,Config), + test_server:comment("No shuffle"), + [{cc5,conf5}|Config]. +conf5_end(_Config) -> + ok. + +conf6_init(Config) when is_list(Config) -> + [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), + test_server:comment("Shuffle (random)"), + init = ?config(suite,Config), + [{cc6,conf6}|Config]. +conf6_end(_Config) -> + ok. + +conf5(suite) -> % test specification + [{conf, conf5_init, [conf5_tc1, + + {conf, [shuffle], conf6_init, + [conf6_tc1, conf6_tc2, conf6_tc3], + conf6_end}, + + conf5_tc2], conf5_end}]. + +conf7_init(Config) when is_list(Config) -> + test_server:comment("Group 7, Shuffle (random seed)"), + case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of + {_,_,_} -> ok + end, + [{cc7,conf7}|Config]. +conf7_end(_Config) -> + ok. + +conf8_init(Config) when is_list(Config) -> + test_server:comment("Group 8, Shuffle (user start seed)"), + case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of + {_,_,_} -> ok + end, + init = ?config(suite,Config), + [{cc8,conf8}|Config]. +conf8_end(_Config) -> + ok. + + +%%---------- test cases ---------- + +conf1_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc1 = ?config(tc11,Config), + ok. +conf1_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + init = ?config(suite,Config), + conf1 = ?config(cc1,Config), + conf1_tc2 = ?config(tc12,Config), + ok. +conf1_tc3(suite) -> []; +conf1_tc3(_Config) -> + test_server:comment("Case 3"), + ok. + +conf2_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + undefined = ?config(cc1,Config), + conf2 = ?config(cc2,Config), + conf2_tc1 = ?config(tc21,Config), + ok. +conf2_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + conf2 = ?config(cc2,Config), + conf2_tc2 = ?config(tc22,Config), + ok. +conf2_tc3(suite) -> []; +conf2_tc3(_Config) -> + test_server:comment("Case 3"), + ok. + +conf3_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + conf3_tc1 = ?config(tc31,Config), + ok. +conf3_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + conf3 = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf3_tc2 = ?config(tc32,Config), + ok. +conf3_tc3(suite) -> []; +conf3_tc3(_Config) -> + test_server:comment("Case 3"), + ok. + +conf4_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + conf4_tc1 = ?config(tc41,Config), + ok. +conf4_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf3 = ?config(cc3,Config), + conf4 = ?config(cc4,Config), + conf4_tc2 = ?config(tc42,Config), + ok. + +conf5_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + conf5_tc1 = ?config(tc51,Config), + ok. +conf5_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + undefined = ?config(cc6,Config), + conf5_tc2 = ?config(tc52,Config), + ok. + +conf6_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + conf6_tc1 = ?config(tc61,Config), + ok. +conf6_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf5 = ?config(cc5,Config), + conf6 = ?config(cc6,Config), + conf6_tc2 = ?config(tc62,Config), + ok. +conf6_tc3(suite) -> []; +conf6_tc3(_Config) -> + test_server:comment("Case 3"), + ok. + +conf7_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(cc5,Config), + undefined = ?config(cc6,Config), + conf7 = ?config(cc7,Config), + conf7_tc1 = ?config(tc71,Config), + ok. +conf7_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf7 = ?config(cc7,Config), + undefined = ?config(cc8,Config), + conf7_tc2 = ?config(tc72,Config), + ok. +conf7_tc3(suite) -> []; +conf7_tc3(_Config) -> + test_server:comment("Case 3"), + ok. + +conf8_tc1(Config) when is_list(Config) -> + test_server:comment("Case 1"), + init = ?config(suite,Config), + case ?config(data_dir,Config) of + undefined -> exit(no_data_dir); + _ -> ok + end, + undefined = ?config(cc1,Config), + undefined = ?config(cc2,Config), + undefined = ?config(cc3,Config), + undefined = ?config(cc4,Config), + undefined = ?config(cc5,Config), + undefined = ?config(cc6,Config), + conf7 = ?config(cc7,Config), + conf8 = ?config(cc8,Config), + conf8_tc1 = ?config(tc81,Config), + ok. +conf8_tc2(Config) when is_list(Config) -> + test_server:comment("Case 2"), + init = ?config(suite,Config), + case ?config(priv_dir,Config) of + undefined -> exit(no_priv_dir); + _ -> ok + end, + conf7 = ?config(cc7,Config), + conf8 = ?config(cc8,Config), + conf8_tc2 = ?config(tc82,Config), + ok. +conf8_tc3(suite) -> []; +conf8_tc3(_Config) -> + test_server:comment("Case 3"), + ok. diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_skip_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_skip_SUITE.erl new file mode 100644 index 0000000000..4037e1cc0e --- /dev/null +++ b/lib/test_server/test/test_server_SUITE_data/test_server_skip_SUITE.erl @@ -0,0 +1,43 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(test_server_skip_SUITE). + +-export([all/1, init_per_suite/1, end_per_suite/1]). +-export([dummy/1]). + +-include_lib("test_server/include/test_server.hrl"). +-include_lib("test_server/include/test_server_line.hrl"). + +all(suite) -> + [dummy]. + +init_per_suite(Config) when is_list(Config) -> + {skip,"Skipping init_per_suite - check that \'dummy\' and" + " \'end_per_suite\' are also skipped"}. + +dummy(suite) -> []; +dummy(doc) -> ["This testcase should never be executed"]; +dummy(Config) when is_list(Config) -> + ?t:fail("This testcase should be executed since" + " init_per_suite/1 is skipped"). + +end_per_suite(doc) -> ["This testcase should never be executed"]; +end_per_suite(Config) when is_list(Config) -> + ?t:fail("end_per_suite/1 should not be executed when" + " init_per_suite/1 is skipped"). diff --git a/lib/test_server/test/test_server_conf01_SUITE.erl b/lib/test_server/test/test_server_conf01_SUITE.erl deleted file mode 100644 index a6d7dfe851..0000000000 --- a/lib/test_server/test/test_server_conf01_SUITE.erl +++ /dev/null @@ -1,187 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%%------------------------------------------------------------------ -%%% Test Server self test. -%%%------------------------------------------------------------------ --module(test_server_conf01_SUITE). --include_lib("test_server/include/test_server.hrl"). - --compile(export_all). - -all(doc) -> ["Test simple conf case structure, with and without nested cases"]; -all(suite) -> - [ - {conf, conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, - - {conf, [], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, - - {conf, conf3_init, [conf3_tc1, - - {conf, [], conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, - - conf3_tc2], conf3_end}, - - conf5 - ]. - -%%---------- conf cases ---------- - -conf1_init(Config) when is_list(Config) -> - [{cc1,conf1}|Config]. -conf1_end(_Config) -> - ok. - -conf2_init(Config) when is_list(Config) -> - [{cc2,conf2}|Config]. -conf2_end(_Config) -> - ok. - -conf3_init(Config) when is_list(Config) -> - [{cc3,conf3}|Config]. -conf3_end(_Config) -> - ok. - -conf4_init(Config) when is_list(Config) -> - [{cc4,conf4}|Config]. -conf4_end(_Config) -> - ok. - -conf5_init(Config) when is_list(Config) -> - [{cc5,conf5}|Config]. -conf5_end(_Config) -> - ok. - -conf6_init(Config) when is_list(Config) -> - [{cc6,conf6}|Config]. -conf6_end(_Config) -> - ok. - - -conf5(suite) -> % test specification - [{conf, conf5_init, [conf5_tc1, - - {conf, [], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, - - conf5_tc2], conf5_end}]. - - -%%---------- test cases ---------- - -conf1_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - conf1 = ?config(cc1,Config), - ok. -conf1_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf1 = ?config(cc1,Config), - ok. - -conf2_tc1(Config) when is_list(Config) -> - undefined = ?config(cc1,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - conf2 = ?config(cc2,Config), - ok. -conf2_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf2 = ?config(cc2,Config), - ok. - -conf3_tc1(Config) when is_list(Config) -> - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - ok. -conf3_tc2(Config) when is_list(Config) -> - conf3 = ?config(cc3,Config), - undefined = ?config(cc4,Config), - ok. - -conf4_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - ok. -conf4_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - ok. - -conf5_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - ok. -conf5_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - undefined = ?config(cc6,Config), - ok. - -conf6_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - ok. -conf6_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - ok. - diff --git a/lib/test_server/test/test_server_conf02_SUITE.erl b/lib/test_server/test/test_server_conf02_SUITE.erl deleted file mode 100644 index deba4660c6..0000000000 --- a/lib/test_server/test/test_server_conf02_SUITE.erl +++ /dev/null @@ -1,294 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%%------------------------------------------------------------------ -%%% Test Server self test. -%%%------------------------------------------------------------------ --module(test_server_conf02_SUITE). --include_lib("test_server/include/test_server.hrl"). - --compile(export_all). - -all(doc) -> ["Test simple conf case structure, with and without nested cases"]; -all(suite) -> - [ - {conf, conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, - - {conf, [], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, - - {conf, conf3_init, [conf3_tc1, - - {conf, [], conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, - - conf3_tc2], conf3_end}, - - conf5 - ]. - - -%%---------- conf cases ---------- - -init_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - [{suite,init}|Config]. -end_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - ok. - -init_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - [{tc11,TC}|Config]; -init_per_testcase(TC=conf1_tc2, Config) -> - [{tc12,TC}|Config]; -init_per_testcase(TC=conf2_tc1, Config) -> - [{tc21,TC}|Config]; -init_per_testcase(TC=conf2_tc2, Config) -> - [{tc22,TC}|Config]; -init_per_testcase(TC=conf3_tc1, Config) -> - [{tc31,TC}|Config]; -init_per_testcase(TC=conf3_tc2, Config) -> - [{tc32,TC}|Config]; -init_per_testcase(TC=conf4_tc1, Config) -> - [{tc41,TC}|Config]; -init_per_testcase(TC=conf4_tc2, Config) -> - [{tc42,TC}|Config]; -init_per_testcase(TC=conf5_tc1, Config) -> - [{tc51,TC}|Config]; -init_per_testcase(TC=conf5_tc2, Config) -> - [{tc52,TC}|Config]; -init_per_testcase(TC=conf6_tc1, Config) -> - [{tc61,TC}|Config]; -init_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - [{tc62,TC}|Config]. - -end_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - TC = ?config(tc11,Config), - ok; -end_per_testcase(TC=conf1_tc2, Config) -> - TC = ?config(tc12,Config), - ok; -end_per_testcase(TC=conf2_tc1, Config) -> - TC = ?config(tc21,Config), - ok; -end_per_testcase(TC=conf2_tc2, Config) -> - TC = ?config(tc22,Config), - ok; -end_per_testcase(TC=conf3_tc1, Config) -> - TC = ?config(tc31,Config), - ok; -end_per_testcase(TC=conf3_tc2, Config) -> - TC = ?config(tc32,Config), - ok; -end_per_testcase(TC=conf4_tc1, Config) -> - TC = ?config(tc41,Config), - ok; -end_per_testcase(TC=conf4_tc2, Config) -> - TC = ?config(tc42,Config), - ok; -end_per_testcase(TC=conf5_tc1, Config) -> - TC = ?config(tc51,Config), - ok; -end_per_testcase(TC=conf5_tc2, Config) -> - TC = ?config(tc52,Config), - ok; -end_per_testcase(TC=conf6_tc1, Config) -> - TC = ?config(tc61,Config), - ok; -end_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - TC = ?config(tc62,Config), - ok. - -conf1_init(Config) when is_list(Config) -> - init = ?config(suite,Config), - [{cc1,conf1}|Config]. -conf1_end(_Config) -> - ok. - -conf2_init(Config) when is_list(Config) -> - [{cc2,conf2}|Config]. -conf2_end(_Config) -> - ok. - -conf3_init(Config) when is_list(Config) -> - [{cc3,conf3}|Config]. -conf3_end(_Config) -> - ok. - -conf4_init(Config) when is_list(Config) -> - [{cc4,conf4}|Config]. -conf4_end(_Config) -> - ok. - -conf5_init(Config) when is_list(Config) -> - [{cc5,conf5}|Config]. -conf5_end(_Config) -> - ok. - -conf6_init(Config) when is_list(Config) -> - init = ?config(suite,Config), - [{cc6,conf6}|Config]. -conf6_end(_Config) -> - ok. - -conf5(suite) -> % test specification - [{conf, conf5_init, [conf5_tc1, - - {conf, [], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, - - conf5_tc2], conf5_end}]. - -%%---------- test cases ---------- - -conf1_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc1 = ?config(tc11,Config), - ok. -conf1_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc2 = ?config(tc12,Config), - ok. - -conf2_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - undefined = ?config(cc1,Config), - undefined = ?config(tc11,Config), - conf2 = ?config(cc2,Config), - conf2_tc1 = ?config(tc21,Config), - ok. -conf2_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - conf2 = ?config(cc2,Config), - undefined = ?config(tc21,Config), - conf2_tc2 = ?config(tc22,Config), - ok. - -conf3_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - undefined = ?config(cc2,Config), - undefined = ?config(tc22,Config), - conf3 = ?config(cc3,Config), - conf3_tc1 = ?config(tc31,Config), - ok. -conf3_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - conf3 = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(tc31,Config), - undefined = ?config(tc41,Config), - conf3_tc2 = ?config(tc32,Config), - ok. - -conf4_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - undefined = ?config(tc32,Config), - conf4_tc1 = ?config(tc41,Config), - ok. -conf4_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - undefined = ?config(tc41,Config), - conf4_tc2 = ?config(tc42,Config), - ok. - -conf5_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - undefined = ?config(tc42,Config), - conf5_tc1 = ?config(tc51,Config), - ok. -conf5_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - undefined = ?config(cc6,Config), - undefined = ?config(tc51,Config), - undefined = ?config(tc62,Config), - conf5_tc2 = ?config(tc52,Config), - ok. - -conf6_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - undefined = ?config(tc52,Config), - conf6_tc1 = ?config(tc61,Config), - ok. -conf6_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - undefined = ?config(tc61,Config), - conf6_tc2 = ?config(tc62,Config), - ok. diff --git a/lib/test_server/test/test_server_line_SUITE.erl b/lib/test_server/test/test_server_line_SUITE.erl index 02897f164f..aa14862e5a 100644 --- a/lib/test_server/test/test_server_line_SUITE.erl +++ b/lib/test_server/test/test_server_line_SUITE.erl @@ -23,20 +23,29 @@ -module(test_server_line_SUITE). -include_lib("test_server/include/test_server.hrl"). --export([all/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,suite/0]). +-export([init_per_suite/1,end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -export([parse_transform/1, lines/1]). -all(doc) -> ["Test of parse transform for collection line numbers"]; -all(suite) -> [parse_transform,lines]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {doc,["Test of parse transform for collection line numbers"]}]. +all() -> [parse_transform,lines]. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. init_per_testcase(_Case, Config) -> ?line test_server_line:clear(), Dog = ?t:timetrap(?t:minutes(2)), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> ?line test_server_line:clear(), Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), diff --git a/lib/test_server/test/test_server_parallel01_SUITE.erl b/lib/test_server/test/test_server_parallel01_SUITE.erl deleted file mode 100644 index 0e7f329f89..0000000000 --- a/lib/test_server/test/test_server_parallel01_SUITE.erl +++ /dev/null @@ -1,518 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%%------------------------------------------------------------------ -%%% Test Server self test. -%%%------------------------------------------------------------------ --module(test_server_parallel01_SUITE). --include_lib("test_server/include/test_server.hrl"). - --compile(export_all). - -%% ------------------------------------------------------------------- -%% Notes on parallel execution of test cases -%% ------------------------------------------------------------------- -%% -%% A group nested under a parallel group will start executing in -%% parallel with previous (parallel) test cases (no matter what -%% properties the nested group has). Test cases are however never -%% executed in parallel with the start or end conf case of the same -%% group! Because of this, the test_server_ctrl loop waits at -%% the end conf of a group for all parallel cases to finish -%% before the end conf case actually executes. This has the effect -%% that it's only after a nested group has finished that any -%% remaining parallel cases in the previous group get spawned (*). -%% Example (all parallel cases): -%% -%% group1_init |----> -%% group1_case1 | ---------> -%% group1_case2 | ---------------------------------> -%% group2_init | ----> -%% group2_case1 | ------> -%% group2_case2 | ----------> -%% group2_end | ---> -%% group1_case3 (*)| ----> -%% group1_case4 (*)| --> -%% group1_end | ---> -%% - -all(doc) -> ["Test simple conf case structure, with and without nested cases"]; -all(suite) -> - [ - {conf, [parallel], conf1_init, [conf1_tc1, conf1_tc2], conf1_end}, - - {conf, [parallel], conf2_init, [conf2_tc1, conf2_tc2], conf2_end}, - - {conf, [parallel], conf3_init, [conf3_tc1, conf3_tc1, - - {conf, [], - conf4_init, [conf4_tc1, conf4_tc2], conf4_end}, - - conf3_tc2], conf3_end}, - - conf5, - - {conf, [parallel], conf7_init, [conf7_tc1, conf7_tc1, - - {conf, [parallel], - conf8_init, [conf8_tc1, conf8_tc2], conf8_end}, - - conf7_tc2], conf7_end} - - ]. - - -%%---------- conf cases ---------- - -init_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - [{suite,init}|Config]. -end_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - ok. - -init_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - [{tc11,TC}|Config]; -init_per_testcase(TC=conf1_tc2, Config) -> - [{tc12,TC}|Config]; -init_per_testcase(TC=conf2_tc1, Config) -> - [{tc21,TC}|Config]; -init_per_testcase(TC=conf2_tc2, Config) -> - [{tc22,TC}|Config]; -init_per_testcase(TC=conf3_tc1, Config) -> - [{tc31,TC}|Config]; -init_per_testcase(TC=conf3_tc2, Config) -> - [{tc32,TC}|Config]; -init_per_testcase(TC=conf4_tc1, Config) -> - [{tc41,TC}|Config]; -init_per_testcase(TC=conf4_tc2, Config) -> - [{tc42,TC}|Config]; -init_per_testcase(TC=conf5_tc1, Config) -> - [{tc51,TC}|Config]; -init_per_testcase(TC=conf5_tc2, Config) -> - [{tc52,TC}|Config]; -init_per_testcase(TC=conf6_tc1, Config) -> - [{tc61,TC}|Config]; -init_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - [{tc62,TC}|Config]; -init_per_testcase(TC=conf7_tc1, Config) -> - [{tc71,TC}|Config]; -init_per_testcase(TC=conf7_tc2, Config) -> - [{tc72,TC}|Config]; -init_per_testcase(TC=conf8_tc1, Config) -> - [{tc81,TC}|Config]; -init_per_testcase(TC=conf8_tc2, Config) -> - init = ?config(suite,Config), - [{tc82,TC}|Config]. - -end_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - TC = ?config(tc11,Config), - ok; -end_per_testcase(TC=conf1_tc2, Config) -> - TC = ?config(tc12,Config), - ok; -end_per_testcase(TC=conf2_tc1, Config) -> - TC = ?config(tc21,Config), - ok; -end_per_testcase(TC=conf2_tc2, Config) -> - TC = ?config(tc22,Config), - ok; -end_per_testcase(TC=conf3_tc1, Config) -> - TC = ?config(tc31,Config), - ok; -end_per_testcase(TC=conf3_tc2, Config) -> - TC = ?config(tc32,Config), - ok; -end_per_testcase(TC=conf4_tc1, Config) -> - TC = ?config(tc41,Config), - ok; -end_per_testcase(TC=conf4_tc2, Config) -> - TC = ?config(tc42,Config), - ok; -end_per_testcase(TC=conf5_tc1, Config) -> - TC = ?config(tc51,Config), - ok; -end_per_testcase(TC=conf5_tc2, Config) -> - TC = ?config(tc52,Config), - ok; -end_per_testcase(TC=conf6_tc1, Config) -> - TC = ?config(tc61,Config), - ok; -end_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - TC = ?config(tc62,Config), - ok; -end_per_testcase(TC=conf7_tc1, Config) -> - TC = ?config(tc71,Config), - ok; -end_per_testcase(TC=conf7_tc2, Config) -> - TC = ?config(tc72,Config), - ok; -end_per_testcase(TC=conf8_tc1, Config) -> - TC = ?config(tc81,Config), - ok; -end_per_testcase(TC=conf8_tc2, Config) -> - init = ?config(suite,Config), - TC = ?config(tc82,Config), - ok. - -conf1_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - init = ?config(suite,Config), - [{t0,now()},{cc1,conf1}|Config]. -conf1_end(Config) -> - %% check 2s & 3s < 4s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); - Ms < 3000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf2_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - [{t0,now()},{cc2,conf2}|Config]. -conf2_end(Config) -> - %% check 3s & 2s < 4s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); - Ms < 3000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf3_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - [{t0,now()},{cc3,conf3}|Config]. -conf3_end(Config) -> - %% check 6s & 6s & (2s & 3s) & 1s = ~6s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 6500000 -> exit({bad_parallel_exec,Ms}); - Ms < 6000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf4_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [] = ?config(tc_group_properties,Config), - [{t0,now()},{cc4,conf4}|Config]. -conf4_end(Config) -> - %% check 2s & 3s >= 5s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 5500000 -> exit({bad_parallel_exec,Ms}); - Ms < 5000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf5_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [] = ?config(tc_group_properties,Config), - [{t0,now()},{cc5,conf5}|Config]. -conf5_end(Config) -> - %% check 1s & 1s & (3s & 2s) & 1s = ~6s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 7000000 -> exit({bad_parallel_exec,Ms}); - Ms < 6000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf6_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - init = ?config(suite,Config), - [{t0,now()},{cc6,conf6}|Config]. -conf6_end(Config) -> - %% check 3s & 2s < 5s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); - Ms < 3000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf5(suite) -> % test specification - [{conf, conf5_init, [conf5_tc1, conf5_tc1, - - {conf, [parallel], conf6_init, [conf6_tc1, conf6_tc2], conf6_end}, - - conf5_tc2], conf5_end}]. - -conf7_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - [{t0,now()},{cc7,conf7}|Config]. -conf7_end(Config) -> - %% check 1s & 1s & (2s & 2s) & 1s = ~3s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 3500000 -> exit({bad_parallel_exec,Ms}); - Ms < 3000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - -conf8_init(Config) when is_list(Config) -> - test_server:comment(io_lib:format("~p",[now()])), - [parallel] = ?config(tc_group_properties,Config), - init = ?config(suite,Config), - [{t0,now()},{cc8,conf8}|Config]. -conf8_end(Config) -> - %% check 2s & 2s < 4s - Ms = timer:now_diff(now(),?config(t0,Config)), - test_server:comment(io_lib:format("~p",[now()])), - if Ms > 2500000 -> exit({bad_parallel_exec,Ms}); - Ms < 2000000 -> exit({bad_parallel_exec,Ms}); - true -> ok - end. - - -%%---------- test cases ---------- - -conf1_tc1(Config) when is_list(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc1 = ?config(tc11,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf1_tc2(Config) when is_list(Config) -> - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc2 = ?config(tc12,Config), - timer:sleep(3000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf2_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - undefined = ?config(cc1,Config), - undefined = ?config(tc11,Config), - conf2 = ?config(cc2,Config), - conf2_tc1 = ?config(tc21,Config), - timer:sleep(3000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf2_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - conf2 = ?config(cc2,Config), - undefined = ?config(tc21,Config), - conf2_tc2 = ?config(tc22,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf3_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - undefined = ?config(cc2,Config), - undefined = ?config(tc22,Config), - conf3 = ?config(cc3,Config), - conf3_tc1 = ?config(tc31,Config), - timer:sleep(6000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf3_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - conf3 = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(tc31,Config), - undefined = ?config(tc41,Config), - conf3_tc2 = ?config(tc32,Config), - timer:sleep(1000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf4_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - undefined = ?config(tc32,Config), - conf4_tc1 = ?config(tc41,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf4_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - undefined = ?config(tc41,Config), - conf4_tc2 = ?config(tc42,Config), - timer:sleep(3000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf5_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - undefined = ?config(tc42,Config), - conf5_tc1 = ?config(tc51,Config), - timer:sleep(1000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf5_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - undefined = ?config(cc6,Config), - undefined = ?config(tc51,Config), - undefined = ?config(tc62,Config), - conf5_tc2 = ?config(tc52,Config), - timer:sleep(1000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf6_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - undefined = ?config(tc52,Config), - conf6_tc1 = ?config(tc61,Config), - timer:sleep(3000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf6_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - undefined = ?config(tc61,Config), - conf6_tc2 = ?config(tc62,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf7_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(cc5,Config), - undefined = ?config(cc6,Config), - conf7 = ?config(cc7,Config), - undefined = ?config(tc62,Config), - conf7_tc1 = ?config(tc71,Config), - timer:sleep(1000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf7_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf7 = ?config(cc7,Config), - undefined = ?config(cc8,Config), - undefined = ?config(tc71,Config), - undefined = ?config(tc82,Config), - conf7_tc2 = ?config(tc72,Config), - timer:sleep(1000), - test_server:comment(io_lib:format("~p",[now()])), - ok. - -conf8_tc1(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(cc5,Config), - undefined = ?config(cc6,Config), - conf7 = ?config(cc7,Config), - conf8 = ?config(cc8,Config), - undefined = ?config(tc72,Config), - conf8_tc1 = ?config(tc81,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. -conf8_tc2(Config) when is_list(Config) -> - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf7 = ?config(cc7,Config), - conf8 = ?config(cc8,Config), - undefined = ?config(tc81,Config), - conf8_tc2 = ?config(tc82,Config), - timer:sleep(2000), - test_server:comment(io_lib:format("~p",[now()])), - ok. diff --git a/lib/test_server/test/test_server_shuffle01_SUITE.erl b/lib/test_server/test/test_server_shuffle01_SUITE.erl deleted file mode 100644 index 7ad269501d..0000000000 --- a/lib/test_server/test/test_server_shuffle01_SUITE.erl +++ /dev/null @@ -1,471 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% - -%%%------------------------------------------------------------------ -%%% Test Server self test. -%%%------------------------------------------------------------------ --module(test_server_shuffle01_SUITE). --include_lib("test_server/include/test_server.hrl"). - --compile(export_all). - -all(doc) -> ["Test simple conf case structure, with and without nested cases"]; -all(suite) -> - [ - {conf, [shuffle], conf1_init, [conf1_tc1, conf1_tc2, conf1_tc3], conf1_end}, - - {conf, [{shuffle,{1,2,3}}], conf2_init, [conf2_tc1, conf2_tc2, conf2_tc3], conf2_end}, - - {conf, [shuffle], conf3_init, [conf3_tc1, conf3_tc2, conf3_tc3, - - {conf, [], conf4_init, - [conf4_tc1, conf4_tc2], conf4_end}], - conf3_end}, - - conf5, - - {conf, [shuffle,{repeat,5},parallel], conf7_init, [conf7_tc1, - - {conf, [{shuffle,{3,2,1}},{repeat,3}], - conf8_init, [conf8_tc1, conf8_tc2, conf8_tc3], - conf8_end}, - - conf7_tc2, conf7_tc3], conf7_end} - - ]. - - -%%---------- conf cases ---------- - -init_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - [{suite,init}|Config]. -end_per_suite(Config) -> - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - ok. - -init_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - [{tc11,TC}|Config]; -init_per_testcase(TC=conf1_tc2, Config) -> - [{tc12,TC}|Config]; -init_per_testcase(TC=conf1_tc3, Config) -> - [{tc13,TC}|Config]; -init_per_testcase(TC=conf2_tc1, Config) -> - [{tc21,TC}|Config]; -init_per_testcase(TC=conf2_tc2, Config) -> - [{tc22,TC}|Config]; -init_per_testcase(TC=conf2_tc3, Config) -> - [{tc23,TC}|Config]; -init_per_testcase(TC=conf3_tc1, Config) -> - [{tc31,TC}|Config]; -init_per_testcase(TC=conf3_tc2, Config) -> - [{tc32,TC}|Config]; -init_per_testcase(TC=conf3_tc3, Config) -> - [{tc33,TC}|Config]; -init_per_testcase(TC=conf4_tc1, Config) -> - [{tc41,TC}|Config]; -init_per_testcase(TC=conf4_tc2, Config) -> - [{tc42,TC}|Config]; -init_per_testcase(TC=conf5_tc1, Config) -> - [{tc51,TC}|Config]; -init_per_testcase(TC=conf5_tc2, Config) -> - [{tc52,TC}|Config]; -init_per_testcase(TC=conf6_tc1, Config) -> - [{tc61,TC}|Config]; -init_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - [{tc62,TC}|Config]; -init_per_testcase(TC=conf6_tc3, Config) -> - [{tc63,TC}|Config]; -init_per_testcase(TC=conf7_tc1, Config) -> - [{tc71,TC}|Config]; -init_per_testcase(TC=conf7_tc2, Config) -> - [{tc72,TC}|Config]; -init_per_testcase(TC=conf7_tc3, Config) -> - [{tc73,TC}|Config]; -init_per_testcase(TC=conf8_tc1, Config) -> - [{tc81,TC}|Config]; -init_per_testcase(TC=conf8_tc2, Config) -> - init = ?config(suite,Config), - [{tc82,TC}|Config]; -init_per_testcase(TC=conf8_tc3, Config) -> - [{tc83,TC}|Config]. - -end_per_testcase(TC=conf1_tc1, Config) -> - init = ?config(suite,Config), - TC = ?config(tc11,Config), - ok; -end_per_testcase(TC=conf1_tc2, Config) -> - TC = ?config(tc12,Config), - ok; -end_per_testcase(TC=conf1_tc3, Config) -> - TC = ?config(tc13,Config), - ok; -end_per_testcase(TC=conf2_tc1, Config) -> - TC = ?config(tc21,Config), - ok; -end_per_testcase(TC=conf2_tc2, Config) -> - TC = ?config(tc22,Config), - ok; -end_per_testcase(TC=conf2_tc3, Config) -> - TC = ?config(tc23,Config), - ok; -end_per_testcase(TC=conf3_tc1, Config) -> - TC = ?config(tc31,Config), - ok; -end_per_testcase(TC=conf3_tc2, Config) -> - TC = ?config(tc32,Config), - ok; -end_per_testcase(TC=conf3_tc3, Config) -> - TC = ?config(tc33,Config), - ok; -end_per_testcase(TC=conf4_tc1, Config) -> - TC = ?config(tc41,Config), - ok; -end_per_testcase(TC=conf4_tc2, Config) -> - TC = ?config(tc42,Config), - ok; -end_per_testcase(TC=conf5_tc1, Config) -> - TC = ?config(tc51,Config), - ok; -end_per_testcase(TC=conf5_tc2, Config) -> - TC = ?config(tc52,Config), - ok; -end_per_testcase(TC=conf6_tc1, Config) -> - TC = ?config(tc61,Config), - ok; -end_per_testcase(TC=conf6_tc2, Config) -> - init = ?config(suite,Config), - TC = ?config(tc62,Config), - ok; -end_per_testcase(TC=conf6_tc3, Config) -> - TC = ?config(tc63,Config), - ok; -end_per_testcase(TC=conf7_tc1, Config) -> - TC = ?config(tc71,Config), - ok; -end_per_testcase(TC=conf7_tc2, Config) -> - TC = ?config(tc72,Config), - ok; -end_per_testcase(TC=conf7_tc3, Config) -> - TC = ?config(tc73,Config), - ok; -end_per_testcase(TC=conf8_tc1, Config) -> - TC = ?config(tc81,Config), - ok; -end_per_testcase(TC=conf8_tc2, Config) -> - init = ?config(suite,Config), - TC = ?config(tc82,Config), - ok; -end_per_testcase(TC=conf8_tc3, Config) -> - TC = ?config(tc83,Config), - ok. - - -conf1_init(Config) when is_list(Config) -> - init = ?config(suite,Config), - [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), - test_server:comment("Shuffle (random seed)"), - [{cc1,conf1}|Config]. -conf1_end(_Config) -> - ok. - -conf2_init(Config) when is_list(Config) -> - [{shuffle,{1,2,3}}] = ?config(tc_group_properties,Config), - test_server:comment("Shuffle (user seed)"), - [{cc2,conf2}|Config]. -conf2_end(_Config) -> - ok. - -conf3_init(Config) when is_list(Config) -> - [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), - test_server:comment("Shuffle (random)"), - [{cc3,conf3}|Config]. -conf3_end(_Config) -> - ok. - -conf4_init(Config) when is_list(Config) -> - [] = ?config(tc_group_properties,Config), - test_server:comment("No shuffle"), - [{cc4,conf4}|Config]. -conf4_end(_Config) -> - ok. - -conf5_init(Config) when is_list(Config) -> - [] = ?config(tc_group_properties,Config), - test_server:comment("No shuffle"), - [{cc5,conf5}|Config]. -conf5_end(_Config) -> - ok. - -conf6_init(Config) when is_list(Config) -> - [{shuffle,{_,_,_}}] = ?config(tc_group_properties,Config), - test_server:comment("Shuffle (random)"), - init = ?config(suite,Config), - [{cc6,conf6}|Config]. -conf6_end(_Config) -> - ok. - -conf5(suite) -> % test specification - [{conf, conf5_init, [conf5_tc1, - - {conf, [shuffle], conf6_init, - [conf6_tc1, conf6_tc2, conf6_tc3], - conf6_end}, - - conf5_tc2], conf5_end}]. - -conf7_init(Config) when is_list(Config) -> - test_server:comment("Group 7, Shuffle (random seed)"), - case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of - {_,_,_} -> ok - end, - [{cc7,conf7}|Config]. -conf7_end(_Config) -> - ok. - -conf8_init(Config) when is_list(Config) -> - test_server:comment("Group 8, Shuffle (user start seed)"), - case proplists:get_value(shuffle,?config(tc_group_properties,Config)) of - {_,_,_} -> ok - end, - init = ?config(suite,Config), - [{cc8,conf8}|Config]. -conf8_end(_Config) -> - ok. - - -%%---------- test cases ---------- - -conf1_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc1 = ?config(tc11,Config), - ok. -conf1_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - init = ?config(suite,Config), - conf1 = ?config(cc1,Config), - conf1_tc2 = ?config(tc12,Config), - ok. -conf1_tc3(suite) -> []; -conf1_tc3(_Config) -> - test_server:comment("Case 3"), - ok. - -conf2_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - undefined = ?config(cc1,Config), - conf2 = ?config(cc2,Config), - conf2_tc1 = ?config(tc21,Config), - ok. -conf2_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - conf2 = ?config(cc2,Config), - conf2_tc2 = ?config(tc22,Config), - ok. -conf2_tc3(suite) -> []; -conf2_tc3(_Config) -> - test_server:comment("Case 3"), - ok. - -conf3_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - conf3_tc1 = ?config(tc31,Config), - ok. -conf3_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - conf3 = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf3_tc2 = ?config(tc32,Config), - ok. -conf3_tc3(suite) -> []; -conf3_tc3(_Config) -> - test_server:comment("Case 3"), - ok. - -conf4_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - conf4_tc1 = ?config(tc41,Config), - ok. -conf4_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf3 = ?config(cc3,Config), - conf4 = ?config(cc4,Config), - conf4_tc2 = ?config(tc42,Config), - ok. - -conf5_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - conf5_tc1 = ?config(tc51,Config), - ok. -conf5_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - undefined = ?config(cc6,Config), - conf5_tc2 = ?config(tc52,Config), - ok. - -conf6_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - conf6_tc1 = ?config(tc61,Config), - ok. -conf6_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf5 = ?config(cc5,Config), - conf6 = ?config(cc6,Config), - conf6_tc2 = ?config(tc62,Config), - ok. -conf6_tc3(suite) -> []; -conf6_tc3(_Config) -> - test_server:comment("Case 3"), - ok. - -conf7_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(cc5,Config), - undefined = ?config(cc6,Config), - conf7 = ?config(cc7,Config), - conf7_tc1 = ?config(tc71,Config), - ok. -conf7_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf7 = ?config(cc7,Config), - undefined = ?config(cc8,Config), - conf7_tc2 = ?config(tc72,Config), - ok. -conf7_tc3(suite) -> []; -conf7_tc3(_Config) -> - test_server:comment("Case 3"), - ok. - -conf8_tc1(Config) when is_list(Config) -> - test_server:comment("Case 1"), - init = ?config(suite,Config), - case ?config(data_dir,Config) of - undefined -> exit(no_data_dir); - _ -> ok - end, - undefined = ?config(cc1,Config), - undefined = ?config(cc2,Config), - undefined = ?config(cc3,Config), - undefined = ?config(cc4,Config), - undefined = ?config(cc5,Config), - undefined = ?config(cc6,Config), - conf7 = ?config(cc7,Config), - conf8 = ?config(cc8,Config), - conf8_tc1 = ?config(tc81,Config), - ok. -conf8_tc2(Config) when is_list(Config) -> - test_server:comment("Case 2"), - init = ?config(suite,Config), - case ?config(priv_dir,Config) of - undefined -> exit(no_priv_dir); - _ -> ok - end, - conf7 = ?config(cc7,Config), - conf8 = ?config(cc8,Config), - conf8_tc2 = ?config(tc82,Config), - ok. -conf8_tc3(suite) -> []; -conf8_tc3(_Config) -> - test_server:comment("Case 3"), - ok. diff --git a/lib/test_server/test/test_server_skip_SUITE.erl b/lib/test_server/test/test_server_skip_SUITE.erl deleted file mode 100644 index 4037e1cc0e..0000000000 --- a/lib/test_server/test/test_server_skip_SUITE.erl +++ /dev/null @@ -1,43 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. -%% -%% The contents of this file are subject to the Erlang Public License, -%% Version 1.1, (the "License"); you may not use this file except in -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% --module(test_server_skip_SUITE). - --export([all/1, init_per_suite/1, end_per_suite/1]). --export([dummy/1]). - --include_lib("test_server/include/test_server.hrl"). --include_lib("test_server/include/test_server_line.hrl"). - -all(suite) -> - [dummy]. - -init_per_suite(Config) when is_list(Config) -> - {skip,"Skipping init_per_suite - check that \'dummy\' and" - " \'end_per_suite\' are also skipped"}. - -dummy(suite) -> []; -dummy(doc) -> ["This testcase should never be executed"]; -dummy(Config) when is_list(Config) -> - ?t:fail("This testcase should be executed since" - " init_per_suite/1 is skipped"). - -end_per_suite(doc) -> ["This testcase should never be executed"]; -end_per_suite(Config) when is_list(Config) -> - ?t:fail("end_per_suite/1 should not be executed when" - " init_per_suite/1 is skipped"). diff --git a/lib/test_server/test/test_server_test_lib.erl b/lib/test_server/test/test_server_test_lib.erl new file mode 100644 index 0000000000..66ff06e0ce --- /dev/null +++ b/lib/test_server/test/test_server_test_lib.erl @@ -0,0 +1,191 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +-module(test_server_test_lib). +-export([parse_suite/1]). +-export([init/2, pre_init_per_testcase/3, post_end_per_testcase/4]). + +-include("test_server_test_lib.hrl"). + +%% The CTH hooks all tests +init(_Id, _Opts) -> + []. + +pre_init_per_testcase(_TC,Config,State) -> + case os:type() of + {win32, _} -> + %% Extend timeout for windows as starting node + %% can take a long time there + test_server:timetrap( 120000 * test_server:timetrap_scale_factor()); + _ -> + ok + end, + {start_slave(Config, 50),State}. + +start_slave(Config,_Level) -> + [_,Host] = string:tokens(atom_to_list(node()), "@"), + + ct:log("Trying to start ~s~n", + ["test_server_tester@"++Host]), + case slave:start(Host, test_server_tester, []) of + {error,Reason} -> + test_server:fail(Reason); + {ok,Node} -> + ct:log("Node ~p started~n", [Node]), + IsCover = test_server:is_cover(), + if IsCover -> + cover:start(Node); + true-> + ok + end, + DataDir = proplists:get_value(data_dir, Config), + PrivDir = proplists:get_value(priv_dir, Config), + + %% PrivDir as well as directory of Test Server suites + %% have to be in code path on Test Server node. + [_ | Parts] = lists:reverse(filename:split(DataDir)), + TSDir = filename:join(lists:reverse(Parts)), + AddPathDirs = case proplists:get_value(path_dirs, Config) of + undefined -> []; + Ds -> Ds + end, + PathDirs = [PrivDir,TSDir | AddPathDirs], + [true = rpc:call(Node, code, add_patha, [D]) || D <- PathDirs], + io:format("Dirs added to code path (on ~w):~n", + [Node]), + [io:format("~s~n", [D]) || D <- PathDirs], + + true = rpc:call(Node, os, putenv, + ["TEST_SERVER_FRAMEWORK", "undefined"]), + + ok = rpc:call(Node, file, set_cwd, [PrivDir]), + [{node,Node} | Config] + end. + +post_end_per_testcase(_TC, Config, Return, State) -> + Node = proplists:get_value(node, Config), + cover:stop(Node), + slave:stop(Node), + + {Return, State}. + +%% Parse an .suite log file +parse_suite(FileName) -> + + case file:open(FileName, [read, raw, read_ahead]) of + {ok, Fd} -> + Data = parse_suite(Fd, #suite{ }), + file:close(Fd), + {ok, Data}; + _ -> + error + end. + +fline(Fd) -> + case prim_file:read_line(Fd) of + eof -> eof; + {ok, Line} -> Line + end. + +parse_suite(Fd, S) -> + _Started = fline(Fd), + _Starting = fline(Fd), + "=cases" ++ NCases = fline(Fd), + "=user" ++ _User = fline(Fd), + "=host" ++ Host = fline(Fd), + "=hosts" ++ _Hosts = fline(Fd), + "=emulator_vsn" ++ Evsn = fline(Fd), + "=emulator" ++ Emu = fline(Fd), + "=otp_release" ++ OtpRel = fline(Fd), + "=started" ++ Start = fline(Fd), + NewS = parse_cases(Fd, S#suite{ + n_cases_expected = list_to_int(clean(NCases)), + host = list_to_binary(clean(Host)), + emulator_vsn = list_to_binary(clean(Evsn)), + emulator = list_to_binary(clean(Emu)), + otp_release = list_to_binary(clean(OtpRel)), + started = list_to_binary(clean(Start)) + }), + "=failed" ++ Failed = fline(Fd), + "=successful" ++ Succ = fline(Fd), + "=user_skipped" ++ UsrSkip = fline(Fd), + "=auto_skipped" ++ AutSkip = fline(Fd), + NewS#suite{ n_cases_failed = list_to_int(clean(Failed)), + n_cases_succ = list_to_int(clean(Succ)), + n_cases_user_skip = list_to_int(clean(UsrSkip)), + n_cases_auto_skip = list_to_int(clean(AutSkip)) }. + + +parse_cases(Fd, #suite{ n_cases = N, + cases = Cases } = S) -> + case parse_case(Fd) of + finished -> S#suite{ log_ok = true }; + {eof, Tc} -> + S#suite{ n_cases = N + 1, + cases = [Tc#tc{ result = crashed }|Cases]}; + {ok, Case} -> + parse_cases(Fd, S#suite{ n_cases = N + 1, + cases = [Case|Cases]}) + end. + +parse_case(Fd) -> parse_case(Fd, #tc{}). +parse_case(Fd, Tc) -> parse_case(fline(Fd), Fd, Tc). + +parse_case(eof, _, Tc) -> {eof, Tc}; +parse_case("=case" ++ Case, Fd, Tc) -> + Name = list_to_binary(clean(Case)), + parse_case(fline(Fd), Fd, Tc#tc{ name = Name }); +parse_case("=logfile" ++ File, Fd, Tc) -> + Log = list_to_binary(clean(File)), + parse_case(fline(Fd), Fd, Tc#tc{ logfile = Log }); +parse_case("=elapsed" ++ Elapsed, Fd, Tc) -> + {ok, [Time], _} = io_lib:fread("~f", clean(Elapsed)), + parse_case(fline(Fd), Fd, Tc#tc{ elapsed = Time }); +parse_case("=result" ++ Result, _, Tc) -> + case clean(Result) of + "ok" ++ _ -> + {ok, Tc#tc{ result = ok } }; + "failed" ++ _ -> + {ok, Tc#tc{ result = failed } }; + "skipped" ++ _ -> + {ok, Tc#tc{ result = skip } } + end; +parse_case("=finished" ++ _ , _Fd, #tc{ name = undefined }) -> + finished; +parse_case(_, Fd, Tc) -> + parse_case(fline(Fd), Fd, Tc). + +skip([]) -> []; +skip([$ |Ts]) -> skip(Ts); +skip(Ts) -> Ts. + +%rmnl(L) -> L. +rmnl([]) -> []; +rmnl([$\n | Ts]) -> rmnl(Ts); +rmnl([T|Ts]) -> [T | rmnl(Ts)]. + +clean(L) -> + rmnl(skip(L)). + +list_to_int(L) -> + try + list_to_integer(L) + catch + _:_ -> + 0 + end. diff --git a/lib/test_server/test/test_server_test_lib.hrl b/lib/test_server/test/test_server_test_lib.hrl new file mode 100644 index 0000000000..27b7be9618 --- /dev/null +++ b/lib/test_server/test/test_server_test_lib.hrl @@ -0,0 +1,23 @@ +-record(tc, { + name, + result, + elapsed, + logfile + }). + +-record(suite, { + application, + n_cases = 0, + n_cases_failed = 0, + n_cases_expected = 0, + n_cases_succ, + n_cases_user_skip, + n_cases_auto_skip, + cases = [], + host, + emulator_vsn, + emulator, + otp_release, + started, + log_ok = false + }). -- cgit v1.2.3 From 26bff7f4c9b6477b18be4ab82204c3d294d58943 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 21 Dec 2010 14:49:54 +0100 Subject: Send warning instead of abort on EBUSY from pthread_mutex_destroy Due to a bug in glibc the runtime system could abort while trying to destroy a mutex. The runtime system will now issue a warning instead of aborting. --- erts/emulator/beam/erl_threads.h | 64 +++++++++++++++++++++++++++++++++++----- erts/emulator/beam/sys.h | 7 ++++- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h index 84a20b51f2..b78c67d053 100644 --- a/erts/emulator/beam/erl_threads.h +++ b/erts/emulator/beam/erl_threads.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -36,6 +36,16 @@ #include "erl_lock_count.h" #include "erl_term.h" +#if defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ < (2 << 16) + 4 +/* + * pthread_mutex_destroy() may return EBUSY when it shouldn't :( We have + * only seen this bug in glibc versions before 2.4. Note that condition + * variables, rwmutexes, spinlocks, and rwspinlocks also may be effected by + * this bug since these implementations may use mutexes internally. + */ +# define ERTS_THR_HAVE_BUSY_DESTROY_BUG +#endif + #define ERTS_THR_MEMORY_BARRIER ETHR_MEMORY_BARRIER #ifdef ERTS_ENABLE_LOCK_COUNT @@ -551,8 +561,16 @@ erts_mtx_destroy(erts_mtx_t *mtx) erts_lcnt_destroy_lock(&mtx->lcnt); #endif res = ethr_mutex_destroy(&mtx->mtx); - if (res) + if (res != 0) { +#ifdef ERTS_THR_HAVE_BUSY_DESTROY_BUG + if (res == EBUSY) { + char *warn = "Ignoring busy mutex destroy. " + "Most likely a bug in pthread implementation."; + erts_send_warning_to_logger_str_nogl(warn); + } +#endif erts_thr_fatal_error(res, "destroy mutex"); + } #endif } @@ -647,8 +665,16 @@ erts_cnd_destroy(erts_cnd_t *cnd) { #ifdef USE_THREADS int res = ethr_cond_destroy(cnd); - if (res) + if (res != 0) { +#ifdef ERTS_THR_HAVE_BUSY_DESTROY_BUG + if (res == EBUSY) { + char *warn = "Ignoring busy cond destroy. " + "Most likely a bug in pthread implementation."; + erts_send_warning_to_logger_str_nogl(warn); + } +#endif erts_thr_fatal_error(res, "destroy condition variable"); + } #endif } @@ -774,8 +800,16 @@ erts_rwmtx_destroy(erts_rwmtx_t *rwmtx) erts_lcnt_destroy_lock(&rwmtx->lcnt); #endif res = ethr_rwmutex_destroy(&rwmtx->rwmtx); - if (res != 0) + if (res != 0) { +#ifdef ERTS_THR_HAVE_BUSY_DESTROY_BUG + if (res == EBUSY) { + char *warn = "Ignoring busy rwmutex destroy. " + "Most likely a bug in pthread implementation."; + erts_send_warning_to_logger_str_nogl(warn); + } +#endif erts_thr_fatal_error(res, "destroy rwmutex"); + } #endif } @@ -1452,8 +1486,16 @@ erts_spinlock_destroy(erts_spinlock_t *lock) erts_lcnt_destroy_lock(&lock->lcnt); #endif res = ethr_spinlock_destroy(&lock->slck); - if (res) - erts_thr_fatal_error(res, "destroy spinlock"); + if (res != 0) { +#ifdef ERTS_THR_HAVE_BUSY_DESTROY_BUG + if (res == EBUSY) { + char *warn = "Ignoring busy spinlock destroy. " + "Most likely a bug in pthread implementation."; + erts_send_warning_to_logger_str_nogl(warn); + } +#endif + erts_thr_fatal_error(res, "destroy rwlock"); + } #else (void)lock; #endif @@ -1562,8 +1604,16 @@ erts_rwlock_destroy(erts_rwlock_t *lock) erts_lcnt_destroy_lock(&lock->lcnt); #endif res = ethr_rwlock_destroy(&lock->rwlck); - if (res) + if (res != 0) { +#ifdef ERTS_THR_HAVE_BUSY_DESTROY_BUG + if (res == EBUSY) { + char *warn = "Ignoring busy rwlock destroy. " + "Most likely a bug in pthread implementation."; + erts_send_warning_to_logger_str_nogl(warn); + } +#endif erts_thr_fatal_error(res, "destroy rwlock"); + } #else (void)lock; #endif diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index 5a4dad0a28..fbd8bafa6e 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -338,6 +338,10 @@ typedef unsigned char byte; (((size_t) 8) - (((size_t) (X)) & ((size_t) 7))) #include "erl_lock_check.h" + +/* needed by erl_smp.h */ +int erts_send_warning_to_logger_str_nogl(char *); + #include "erl_smp.h" #ifdef ERTS_WANT_BREAK_HANDLING @@ -524,7 +528,8 @@ int erts_send_info_to_logger_nogl(erts_dsprintf_buf_t *); int erts_send_warning_to_logger_nogl(erts_dsprintf_buf_t *); int erts_send_error_to_logger_nogl(erts_dsprintf_buf_t *); int erts_send_info_to_logger_str_nogl(char *); -int erts_send_warning_to_logger_str_nogl(char *); +/* needed by erl_smp.h (declared above) + int erts_send_warning_to_logger_str_nogl(char *); */ int erts_send_error_to_logger_str_nogl(char *); typedef struct preload { -- cgit v1.2.3 From 49d0e593698955e96fb6cf82473bd88cb2103bb4 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 25 Feb 2011 09:39:09 +0100 Subject: Fix trivial typos in supervisor_SUITE --- lib/stdlib/test/supervisor_SUITE.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl index 8aed93ce12..6e927da2ab 100644 --- a/lib/stdlib/test/supervisor_SUITE.erl +++ b/lib/stdlib/test/supervisor_SUITE.erl @@ -1310,7 +1310,7 @@ count_children_memory(Config) when is_list(Config) -> %% count_children consumes memory using an accumulator function, %% but the space can be reclaimed incrementally, - %% which_children may generate garbage that will reclaimed later. + %% which_children may generate garbage that will be reclaimed later. case (Size5 =< Size4) of true -> ok; false -> @@ -1338,8 +1338,8 @@ count_children_allocator_test(MemoryState) -> lists:all(fun(State) -> State == {e, true} end, AllocStates). %------------------------------------------------------------------------- do_not_save_start_parameters_for_temporary_children(doc) -> - ["Temporary children shall not be restarted so they should not" - "save start parameters, as it potentially can" + ["Temporary children shall not be restarted so they should not " + "save start parameters, as it potentially can " "take up a huge amount of memory for no purpose."]; do_not_save_start_parameters_for_temporary_children(suite) -> []; -- cgit v1.2.3 From feb08b2bc629530ab593c6497d2476e37d8a9251 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 25 Feb 2011 17:56:59 +0100 Subject: First batch of attempts to deal with dialyzer issues... --- lib/megaco/Makefile | 34 ++++- lib/megaco/doc/src/notes.xml | 86 ++++++++++-- lib/megaco/src/app/megaco.appup.src | 50 +++---- .../src/binary/megaco_binary_encoder_lib.erl | 31 +++- lib/megaco/src/engine/depend.mk | 4 +- lib/megaco/src/engine/megaco_config.erl | 156 +++++++-------------- lib/megaco/src/engine/megaco_config_misc.erl | 113 +++++++++++++++ lib/megaco/src/engine/megaco_filter.erl | 33 ++--- lib/megaco/src/engine/megaco_sdp.erl | 6 +- lib/megaco/src/engine/megaco_timer.erl | 14 +- lib/megaco/src/engine/modules.mk | 3 +- lib/megaco/src/flex/megaco_flex_scanner.erl | 18 +-- lib/megaco/vsn.mk | 25 +++- 13 files changed, 365 insertions(+), 208 deletions(-) create mode 100644 lib/megaco/src/engine/megaco_config_misc.erl diff --git a/lib/megaco/Makefile b/lib/megaco/Makefile index d4698eb558..10efaf667f 100644 --- a/lib/megaco/Makefile +++ b/lib/megaco/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2009. All Rights Reserved. +# Copyright Ericsson AB 1999-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -97,12 +97,19 @@ endif CONFIGURE_OPTS = $(FLEX_SCANNER_LINENO_ENABLER) $(FLEX_SCANNER_REENTRANT_ENABLER) +MEGACO_DIA_PLT = ./priv/megaco.plt +MEGACO_DIA_PLT_LOG = $(basename $(MEGACO_DIA_PLT)).dialyzer_plt_log +MEGACO_DIA_LOG = $(basename $(MEGACO_DIA_PLT)).dialyzer_log + # ---------------------------------------------------- # Default Subdir Targets # ---------------------------------------------------- include $(ERL_TOP)/make/otp_subdir.mk +.PHONY: reconf conf dconf econf configure setup info version \ + app_install dialyzer + reconf: (cd $(ERL_TOP) && \ ./otp_build autoconf && \ @@ -132,6 +139,10 @@ info: @echo "APP_TAR_FILE: $(APP_TAR_FILE)" @echo "OTP_INSTALL_DIR: $(OTP_INSTALL_DIR)" @echo "APP_INSTALL_DIR: $(APP_INSTALL_DIR)" + @echo "" + @echo "MEGACO_PLT = $(MEGACO_PLT)" + @echo "MEGACO_DIA_LOG = $(MEGACO_DIA_LOG)" + @echo "" version: @echo "$(VSN)" @@ -190,9 +201,18 @@ tar: $(APP_TAR_FILE) $(APP_TAR_FILE): $(APP_DIR) (cd $(APP_RELEASE_DIR); gtar zcf $(APP_TAR_FILE) $(DIR_NAME)) -dialyzer: - (cd ./ebin; \ - dialyzer --build_plt \ - --output_plt ../priv/megaco.plt \ - -r ../../megaco/ebin \ - --verbose) +dialyzer_plt: $(MEGACO_DIA_PLT) + +$(MEGACO_DIA_PLT): + @echo "Building megaco plt file" + @dialyzer --build_plt \ + --output_plt $@ \ + -r ../megaco/ebin \ + -o $(MEGACO_DIA_PLT_LOG) \ + --verbose + +dialyzer: $(MEGACO_DIA_PLT) + (dialyzer --plt $< \ + -o $(MEGACO_DIA_LOG) \ + ../megaco/ebin \ + && (shell cat $(MEGACO_DIA_LOG))) diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml index 81c9305542..4f678a2a1b 100644 --- a/lib/megaco/doc/src/notes.xml +++ b/lib/megaco/doc/src/notes.xml @@ -1,10 +1,10 @@ - +
- 20002010 + 20002011 Ericsson AB. All Rights Reserved. @@ -35,22 +35,90 @@ thus constitutes one section in this document. The title of each section is the version number of Megaco.

+ +
Megaco 3.15.1 + +

Version 3.15.1 supports code replacement in runtime from/to + version 3.15, 3.14.1.1, 3.14.1 and 3.14.

+ +
+ Improvements and new features + +

-

+ + + +
+ +
+ Fixed bugs and malfunctions + + + + + +

Fixing miscellaneous things detected by dialyzer.

+

Own Id: OTP-9075

+ +
+ +
+ +
+ +
+ +
Megaco 3.15
Improvements and New Features - + + + + + +

Fixing auto-import issues.

+

Own Id: OTP-8842

+
+
+
+ +
+ Fixed bugs and malfunctions +

-

+ + +
-
+
-
+ +
Megaco 3.14.1.1

Version 3.14.1.1 supports code replacement in runtime from/to diff --git a/lib/megaco/src/app/megaco.appup.src b/lib/megaco/src/app/megaco.appup.src index 66068f650f..495a9ec9ae 100644 --- a/lib/megaco/src/app/megaco.appup.src +++ b/lib/megaco/src/app/megaco.appup.src @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -133,50 +133,34 @@ %% | %% v %% 3.15 +%% | +%% v +%% 3.15.1 %% %% {"%VSN%", [ - {"3.14.1.1", + {"3.15", [ - {load_module, megaco_binary_transformer_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3c, soft_purge, soft_purge, []}, + {load_module, megaco_flex_scanner, soft_purge, soft_purge, []}, {load_module, megaco_sdp, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v3, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v3, soft_purge, soft_purge, []} + {load_module, megaco_filter, soft_purge, soft_purge, []}, + {load_module, megaco_timer, soft_purge, soft_purge, [megaco_config_misc]}, + {update, megaco_config, soft, soft_purge, soft_purge, + [megaco_timer, megaco_config_misc]}, + {add_module, megaco_config_misc} ] } ], [ - {"3.14.1.1", + {"3.15", [ - {load_module, megaco_binary_transformer_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_binary_transformer_prev3c, soft_purge, soft_purge, []}, + {load_module, megaco_flex_scanner, soft_purge, soft_purge, []}, {load_module, megaco_sdp, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v1, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v2, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3a, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3b, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_prev3c, soft_purge, soft_purge, []}, - {load_module, megaco_compact_text_encoder_v3, soft_purge, soft_purge, []}, - {load_module, megaco_pretty_text_encoder_v3, soft_purge, soft_purge, []} + {load_module, megaco_filter, soft_purge, soft_purge, []}, + {load_module, megaco_timer, soft_purge, soft_purge, [megaco_config]}, + {update, megaco_config, soft, soft_purge, soft_purge, []}, + {delete_module, megaco_config_misc} ] } ] diff --git a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl index 842d6b70d1..967ee93935 100644 --- a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl +++ b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2009. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -134,6 +134,12 @@ encode_transaction(EC, {Tag, _} = Trans, AsnMod, TransMod, Type) encode_transaction(_EC, T, _AsnMod, _TransMod, _Type) -> {error, {no_megaco_transaction, T}}. +-spec do_encode_transaction(EC :: list(), + Trans :: tuple(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. do_encode_transaction([native], _Trans, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; @@ -160,6 +166,12 @@ do_encode_transaction(EC, _Trans, _AsnMod, _TransMod, _Type) -> %% Convert a list of ActionRequest record's into a binary %% Return {ok, DeepIoList} | {error, Reason} %%---------------------------------------------------------------------- +-spec encode_action_requests(EC :: list(), + ARs :: list(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. encode_action_requests([native], _ARs, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; @@ -183,13 +195,20 @@ encode_action_requests(EC, _ARs, _AsnMod, _TransMod, _Type) -> %% Convert a ActionRequest record into a binary %% Return {ok, DeepIoList} | {error, Reason} %%---------------------------------------------------------------------- -encode_action_request([native], _ARs, _AsnMod, _TransMod, binary) -> + +-spec encode_action_request(EC :: list(), + AR :: tuple(), + AnsMod :: atom(), + TransMod :: atom(), + Type :: atom()) -> + {'ok', binary()} | {'error', any()}. +encode_action_request([native], _AR, _AsnMod, _TransMod, binary) -> %% asn1rt:encode(AsnMod, element(1, T), T); {error, not_implemented}; -encode_action_request(_EC, _ARs0, _AsnMod, _TransMod, binary) -> +encode_action_request(_EC, _AR, _AsnMod, _TransMod, binary) -> {error, not_implemented}; -encode_action_request(EC, ARs, AsnMod, TransMod, io_list) -> - case encode_action_request(EC, ARs, AsnMod, TransMod, binary) of +encode_action_request(EC, AR, AsnMod, TransMod, io_list) -> + case encode_action_request(EC, AR, AsnMod, TransMod, binary) of {ok, Bin} when is_binary(Bin) -> {ok, Bin}; {ok, DeepIoList} -> @@ -198,7 +217,7 @@ encode_action_request(EC, ARs, AsnMod, TransMod, io_list) -> {error, Reason} -> {error, Reason} end; -encode_action_request(EC, _ARs, _AsnMod, _TransMod, _Type) -> +encode_action_request(EC, _AR, _AsnMod, _TransMod, _Type) -> {error, {bad_encoding_config, EC}}. diff --git a/lib/megaco/src/engine/depend.mk b/lib/megaco/src/engine/depend.mk index 8d8c83e923..935eb813e5 100644 --- a/lib/megaco/src/engine/depend.mk +++ b/lib/megaco/src/engine/depend.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2003-2009. All Rights Reserved. +# Copyright Ericsson AB 2003-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -17,6 +17,8 @@ # # %CopyrightEnd% +$(EBIN)/megaco_config_misc.$(EMULATOR): megaco_config_misc.erl + $(EBIN)/megaco_config.$(EMULATOR): megaco_config.erl \ ../../include/megaco.hrl \ ../app/megaco_internal.hrl diff --git a/lib/megaco/src/engine/megaco_config.erl b/lib/megaco/src/engine/megaco_config.erl index 6805db790d..b65ddbe232 100644 --- a/lib/megaco/src/engine/megaco_config.erl +++ b/lib/megaco/src/engine/megaco_config.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -46,10 +46,10 @@ %% Verification functions verify_val/2, - verify_strict_uint/1, - verify_strict_int/1, verify_strict_int/2, - verify_uint/1, - verify_int/1, verify_int/2, +%% verify_strict_uint/1, +%% verify_strict_int/1, verify_strict_int/2, +%% verify_uint/1, +%% verify_int/1, verify_int/2, %% Reply limit counter @@ -1501,28 +1501,37 @@ verify_val(Item, Val) -> mid -> true; local_mid -> true; remote_mid -> true; - min_trans_id -> verify_strict_uint(Val, 4294967295); % uint32 - max_trans_id -> verify_uint(Val, 4294967295); % uint32 + min_trans_id -> + megaco_config_misc:verify_strict_uint(Val, 4294967295); % uint32 + max_trans_id -> + megaco_config_misc:verify_uint(Val, 4294967295); % uint32 request_timer -> verify_timer(Val); long_request_timer -> verify_timer(Val); - auto_ack -> verify_bool(Val); + auto_ack -> + megaco_config_misc:verify_bool(Val); - trans_ack -> verify_bool(Val); - trans_ack_maxcount -> verify_uint(Val); + trans_ack -> + megaco_config_misc:verify_bool(Val); + trans_ack_maxcount -> + megaco_config_misc:verify_uint(Val); - trans_req -> verify_bool(Val); - trans_req_maxcount -> verify_uint(Val); - trans_req_maxsize -> verify_uint(Val); + trans_req -> + megaco_config_misc:verify_bool(Val); + trans_req_maxcount -> + megaco_config_misc:verify_uint(Val); + trans_req_maxsize -> + megaco_config_misc:verify_uint(Val); - trans_timer -> verify_timer(Val) and (Val >= 0); - trans_sender when Val == undefined -> true; + trans_timer -> + verify_timer(Val) and (Val >= 0); + trans_sender when Val =:= undefined -> true; pending_timer -> verify_timer(Val); - sent_pending_limit -> verify_uint(Val) andalso - (Val > 0); - recv_pending_limit -> verify_uint(Val) andalso - (Val > 0); + sent_pending_limit -> + megaco_config_misc:verify_uint(Val) andalso (Val > 0); + recv_pending_limit -> + megaco_config_misc:verify_uint(Val) andalso (Val > 0); reply_timer -> verify_timer(Val); control_pid when is_pid(Val) -> true; monitor_ref -> true; % Internal usage only @@ -1530,110 +1539,43 @@ verify_val(Item, Val) -> send_handle -> true; encoding_mod when is_atom(Val) -> true; encoding_config when is_list(Val) -> true; - protocol_version -> verify_strict_uint(Val); + protocol_version -> + megaco_config_misc:verify_strict_uint(Val); auth_data -> true; user_mod when is_atom(Val) -> true; user_args when is_list(Val) -> true; reply_data -> true; - threaded -> verify_bool(Val); - strict_version -> verify_bool(Val); - long_request_resend -> verify_bool(Val); - call_proxy_gc_timeout -> verify_strict_uint(Val); - cancel -> verify_bool(Val); + threaded -> + megaco_config_misc:verify_bool(Val); + strict_version -> + megaco_config_misc:verify_bool(Val); + long_request_resend -> + megaco_config_misc:verify_bool(Val); + call_proxy_gc_timeout -> + megaco_config_misc:verify_strict_uint(Val); + cancel -> + megaco_config_misc:verify_bool(Val); resend_indication -> verify_resend_indication(Val); - segment_reply_ind -> verify_bool(Val); - segment_recv_acc -> verify_bool(Val); + segment_reply_ind -> + megaco_config_misc:verify_bool(Val); + segment_recv_acc -> + megaco_config_misc:verify_bool(Val); segment_recv_timer -> verify_timer(Val); segment_send -> verify_segmentation_window(Val); segment_send_timer -> verify_timer(Val); - max_pdu_size -> verify_int(Val) andalso (Val > 0); + max_pdu_size -> + megaco_config_misc:verify_int(Val) andalso (Val > 0); request_keep_alive_timeout -> - (verify_uint(Val) orelse (Val =:= plain)); + (megaco_config_misc:verify_uint(Val) orelse (Val =:= plain)); _ -> false end. -verify_bool(true) -> true; -verify_bool(false) -> true; -verify_bool(_) -> false. - verify_resend_indication(flag) -> true; -verify_resend_indication(Val) -> verify_bool(Val). - --spec verify_strict_int(Int :: integer()) -> boolean(). -verify_strict_int(Int) when is_integer(Int) -> true; -verify_strict_int(_) -> false. - --spec verify_strict_int(Int :: integer(), - Max :: integer() | 'infinity') -> boolean(). -verify_strict_int(Int, infinity) -> - verify_strict_int(Int); -verify_strict_int(Int, Max) -> - verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). - --spec verify_strict_uint(Int :: non_neg_integer()) -> boolean(). -verify_strict_uint(Int) when is_integer(Int) andalso (Int >= 0) -> true; -verify_strict_uint(_) -> false. - --spec verify_strict_uint(Int :: non_neg_integer(), - Max :: non_neg_integer() | 'infinity') -> boolean(). -verify_strict_uint(Int, infinity) -> - verify_strict_uint(Int); -verify_strict_uint(Int, Max) -> - verify_strict_int(Int, 0, Max). - --spec verify_uint(Val :: non_neg_integer() | 'infinity') -> boolean(). -verify_uint(infinity) -> true; -verify_uint(Val) -> verify_strict_uint(Val). - --spec verify_int(Val :: integer() | 'infinity') -> boolean(). -verify_int(infinity) -> true; -verify_int(Val) -> verify_strict_int(Val). - --spec verify_int(Int :: integer() | 'infinity', - Max :: integer() | 'infinity') -> boolean(). -verify_int(Int, infinity) -> - verify_int(Int); -verify_int(infinity, _Max) -> - true; -verify_int(Int, Max) -> - verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). - --spec verify_uint(Int :: non_neg_integer() | 'infinity', - Max :: non_neg_integer() | 'infinity') -> boolean(). -verify_uint(Int, infinity) -> - verify_uint(Int); -verify_uint(infinity, _Max) -> - true; -verify_uint(Int, Max) -> - verify_strict_int(Int, 0, Max). - --spec verify_strict_int(Int :: integer(), - Min :: integer(), - Max :: integer()) -> boolean(). -verify_strict_int(Val, Min, Max) - when (is_integer(Val) andalso - is_integer(Min) andalso - is_integer(Max) andalso - (Val >= Min) andalso - (Val =< Max)) -> - true; -verify_strict_int(_Val, _Min, _Max) -> - false. - --spec verify_int(Val :: integer() | 'infinity', - Min :: integer(), - Max :: integer() | 'infinity') -> boolean(). -verify_int(infinity, Min, infinity) -> - verify_strict_int(Min); -verify_int(Val, Min, infinity) -> - verify_strict_int(Val) andalso - verify_strict_int(Min) andalso (Val >= Min); -verify_int(Int, Min, Max) -> - verify_strict_int(Int, Min, Max). +verify_resend_indication(Val) -> megaco_config_misc:verify_bool(Val). verify_timer(Timer) -> megaco_timer:verify(Timer). @@ -1641,7 +1583,7 @@ verify_timer(Timer) -> verify_segmentation_window(none) -> true; verify_segmentation_window(K) -> - verify_int(K, 1, infinity). + megaco_config_misc:verify_int(K, 1, infinity). handle_stop_user(UserMid) -> case catch user_info(UserMid, mid) of diff --git a/lib/megaco/src/engine/megaco_config_misc.erl b/lib/megaco/src/engine/megaco_config_misc.erl new file mode 100644 index 0000000000..0a1601c766 --- /dev/null +++ b/lib/megaco/src/engine/megaco_config_misc.erl @@ -0,0 +1,113 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2011-2011. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% +%%---------------------------------------------------------------------- +%% Purpose: Utility module for megaco_config +%%---------------------------------------------------------------------- +%% + +-module(megaco_config_misc). + +%% Application internal exports +-export([ + verify_bool/1, + + verify_int/1, verify_int/2, verify_int/3, + verify_strict_int/1, verify_strict_int/2, verify_strict_int/3, + + verify_uint/1, verify_uint/2, + verify_strict_uint/1, verify_strict_uint/2 + ]). + + +%%%---------------------------------------------------------------------- +%%% API +%%%---------------------------------------------------------------------- + +verify_bool(true) -> true; +verify_bool(false) -> true; +verify_bool(_) -> false. + + +%% verify_int(Val) -> boolean() +verify_int(infinity) -> true; +verify_int(Val) -> verify_strict_int(Val). + +%% verify_int(Val, Max) -> boolean() +verify_int(Int, infinity) -> + verify_int(Int); +verify_int(infinity, _Max) -> + true; +verify_int(Int, Max) -> + verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). + +%% verify_int(Val, Min, Max) -> boolean() +verify_int(infinity, Min, infinity) -> + verify_strict_int(Min); +verify_int(Val, Min, infinity) -> + verify_strict_int(Val) andalso + verify_strict_int(Min) andalso (Val >= Min); +verify_int(Int, Min, Max) -> + verify_strict_int(Int, Min, Max). + +%% verify_strict_int(Val) -> boolean() +verify_strict_int(Int) when is_integer(Int) -> true; +verify_strict_int(_) -> false. + +%% verify_strict_int(Val, Max) -> boolean() +verify_strict_int(Int, infinity) -> + verify_strict_int(Int); +verify_strict_int(Int, Max) -> + verify_strict_int(Int) andalso verify_strict_int(Max) andalso (Int =< Max). + +%% verify_strict_int(Val, Min, Max) -> boolean() +verify_strict_int(Val, Min, Max) + when (is_integer(Val) andalso + is_integer(Min) andalso + is_integer(Max) andalso + (Val >= Min) andalso + (Val =< Max)) -> + true; +verify_strict_int(_Val, _Min, _Max) -> + false. + + +%% verify_uint(Val) -> boolean() +verify_uint(infinity) -> true; +verify_uint(Val) -> verify_strict_uint(Val). + +%% verify_uint(Val, Max) -> boolean() +verify_uint(Int, infinity) -> + verify_uint(Int); +verify_uint(infinity, _Max) -> + true; +verify_uint(Int, Max) -> + verify_strict_int(Int, 0, Max). + +%% verify_strict_uint(Val) -> boolean() +verify_strict_uint(Int) when is_integer(Int) andalso (Int >= 0) -> true; +verify_strict_uint(_) -> false. + +%% verify_strict_uint(Val, Max) -> boolean() +verify_strict_uint(Int, infinity) -> + verify_strict_uint(Int); +verify_strict_uint(Int, Max) -> + verify_strict_int(Int, 0, Max). + diff --git a/lib/megaco/src/engine/megaco_filter.erl b/lib/megaco/src/engine/megaco_filter.erl index 9df752789c..fb0c700a82 100644 --- a/lib/megaco/src/engine/megaco_filter.erl +++ b/lib/megaco/src/engine/megaco_filter.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,6 +21,7 @@ %%---------------------------------------------------------------------- %% Purpose : Megaco/H.248 customization of the Event Tracer tool %%---------------------------------------------------------------------- +%% -module(megaco_filter). @@ -33,6 +34,7 @@ -include_lib("megaco/src/app/megaco_internal.hrl"). -include_lib("et/include/et.hrl"). + %%---------------------------------------------------------------------- %% BUGBUG: There are some opportunities for improvements: %% @@ -43,7 +45,8 @@ %% records that already are defined in megaco_message_{v1,v2,v3}.hrl. %% * The records megaco_udp and megaco_tcp are copied from the files %% megaco_udp.hrl and megaco_tcp.hrl respectively, as we cannot include -%% both header files. They both defines the macros HEAP_SIZE and GC_MSG_LIMIT. +%% both header files. +%% They both defines the macros HEAP_SIZE and GC_MSG_LIMIT. %%-include("megaco_message_internal.hrl"). -record('megaco_transaction_reply', @@ -76,6 +79,8 @@ module = megaco, serialize = false % false: Spawn a new process for each message }). + + %%---------------------------------------------------------------------- start() -> @@ -360,28 +365,24 @@ pretty(_ConnData, MegaMsg) when is_record(MegaMsg, 'MegacoMessage') -> {ok, Bin} = megaco_pretty_text_encoder:encode_message([], MegaMsg), term_to_string(Bin); pretty(_ConnData, CmdReq) when is_record(CmdReq, 'CommandRequest') -> - {ok, IoList} = megaco_pretty_text_encoder:encode_command_request(CmdReq), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_command_request(CmdReq), + term_to_string(Bin); pretty(_ConnData, {complete_success, ContextId, RepList}) -> ActRep = #'ActionReply'{contextId = ContextId, commandReply = RepList}, - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(ActRep), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(ActRep), + term_to_string(Bin); pretty(_ConnData, AR) when is_record(AR, 'ActionReply') -> - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(AR), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(AR), + term_to_string(Bin); pretty(_ConnData, {partial_failure, ContextId, RepList}) -> ActRep = #'ActionReply'{contextId = ContextId, commandReply = RepList}, - {ok, IoList} = megaco_pretty_text_encoder:encode_action_reply(ActRep), - term_to_string(lists:flatten(IoList)); + {ok, Bin} = megaco_pretty_text_encoder:encode_action_reply(ActRep), + term_to_string(Bin); pretty(_ConnData, {trans, Trans}) -> - case megaco_pretty_text_encoder:encode_transaction(Trans) of - {ok, Bin} when is_binary(Bin) -> - term_to_string(binary_to_list(Bin)); - {ok, IoList} -> - term_to_string(lists:flatten(IoList)) - end; + {ok, Bin} = megaco_pretty_text_encoder:encode_transaction(Trans), + term_to_string(Bin); pretty(__ConnData, Other) -> term_to_string(Other). diff --git a/lib/megaco/src/engine/megaco_sdp.erl b/lib/megaco/src/engine/megaco_sdp.erl index 37f28cac59..96732584fb 100644 --- a/lib/megaco/src/engine/megaco_sdp.erl +++ b/lib/megaco/src/engine/megaco_sdp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2010. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -877,9 +877,7 @@ decode_bandwidth_bwt("CT") -> decode_bandwidth_bwt("AS") -> as; decode_bandwidth_bwt(BwType) when is_list(BwType) -> - BwType; -decode_bandwidth_bwt(BadBwType) -> - error({invalid_bandwidth_bwtype, BadBwType}). + BwType. encode_bandwidth_bwt(ct) -> "CT"; diff --git a/lib/megaco/src/engine/megaco_timer.erl b/lib/megaco/src/engine/megaco_timer.erl index 9f524523a8..1336be0b5b 100644 --- a/lib/megaco/src/engine/megaco_timer.erl +++ b/lib/megaco/src/engine/megaco_timer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -42,7 +42,7 @@ %% NewTimer = megaco_timer() %% TimeoutTime = infinity | integer() %% -init(SingleWaitFor) when SingleWaitFor == infinity -> +init(SingleWaitFor) when SingleWaitFor =:= infinity -> {SingleWaitFor, timeout}; init(SingleWaitFor) when is_integer(SingleWaitFor) and (SingleWaitFor >= 0) -> {SingleWaitFor, timeout}; @@ -76,17 +76,17 @@ verify(#megaco_incr_timer{wait_for = WaitFor, factor = Factor, incr = Incr, max_retries = MaxRetries}) -> - (megaco_config:verify_strict_uint(WaitFor) and - megaco_config:verify_strict_uint(Factor) and - megaco_config:verify_strict_int(Incr) and + (megaco_config_misc:verify_strict_uint(WaitFor) and + megaco_config_misc:verify_strict_uint(Factor) and + megaco_config_misc:verify_strict_int(Incr) and verify_max_retries(MaxRetries)); verify(Timer) -> - megaco_config:verify_uint(Timer). + megaco_config_misc:verify_uint(Timer). verify_max_retries(infinity_restartable) -> true; verify_max_retries(Val) -> - megaco_config:verify_uint(Val). + megaco_config_misc:verify_uint(Val). %%----------------------------------------------------------------- diff --git a/lib/megaco/src/engine/modules.mk b/lib/megaco/src/engine/modules.mk index 44bcadc37b..4bc57cd63e 100644 --- a/lib/megaco/src/engine/modules.mk +++ b/lib/megaco/src/engine/modules.mk @@ -2,7 +2,7 @@ # %CopyrightBegin% # -# Copyright Ericsson AB 2001-2009. All Rights Reserved. +# Copyright Ericsson AB 2001-2011. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in @@ -24,6 +24,7 @@ BEHAVIOUR_MODULES = \ MODULES = \ $(BEHAVIOUR_MODULES) \ + megaco_config_misc \ megaco_config \ megaco_digit_map \ megaco_erl_dist_encoder \ diff --git a/lib/megaco/src/flex/megaco_flex_scanner.erl b/lib/megaco/src/flex/megaco_flex_scanner.erl index e471412c13..508f8905e7 100644 --- a/lib/megaco/src/flex/megaco_flex_scanner.erl +++ b/lib/megaco/src/flex/megaco_flex_scanner.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%% Copyright Ericsson AB 2001-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -30,21 +30,11 @@ -define(SCHED_ID(), erlang:system_info(scheduler_id)). -define(SMP_SUPPORT_DEFAULT(), erlang:system_info(smp_support)). -is_enabled() -> - case ?ENABLE_MEGACO_FLEX_SCANNER of - true -> - true; - _ -> - false - end. +is_enabled() -> + (true =:= ?ENABLE_MEGACO_FLEX_SCANNER). is_reentrant_enabled() -> - case ?MEGACO_REENTRANT_FLEX_SCANNER of - true -> - true; - _ -> - false - end. + (true =:= ?MEGACO_REENTRANT_FLEX_SCANNER). is_scanner_port(Port, Port) when is_port(Port) -> true; diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk index 9fc0e0f2fa..5f71712360 100644 --- a/lib/megaco/vsn.mk +++ b/lib/megaco/vsn.mk @@ -1,4 +1,23 @@ +#-*-makefile-*- ; force emacs to enter makefile-mode + +# %CopyrightBegin% +# +# Copyright Ericsson AB 1997-2011. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% + APPLICATION = megaco -MEGACO_VSN = 3.15 -PRE_VSN = -APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" +MEGACO_VSN = 3.15.1 +PRE_VSN = +APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" -- cgit v1.2.3 From 9671856faa243ee4567f4059fba28fd85b5d9baa Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 25 Feb 2011 18:14:00 +0100 Subject: No auto import of error/1,2. --- lib/megaco/test/megaco_appup_test.erl | 3 ++- lib/megaco/test/megaco_codec_v1_test.erl | 6 +++++- lib/megaco/test/megaco_test_generator.erl | 6 +++++- lib/megaco/test/megaco_test_megaco_generator.erl | 4 +++- lib/megaco/test/megaco_test_msg_prev3a_lib.erl | 6 +++++- lib/megaco/test/megaco_test_msg_prev3b_lib.erl | 6 +++++- lib/megaco/test/megaco_test_msg_prev3c_lib.erl | 6 +++++- lib/megaco/test/megaco_test_msg_v1_lib.erl | 6 +++++- lib/megaco/test/megaco_test_msg_v2_lib.erl | 6 +++++- lib/megaco/test/megaco_test_msg_v3_lib.erl | 6 +++++- lib/megaco/test/megaco_test_tcp_generator.erl | 4 +++- lib/megaco/test/megaco_timer_test.erl | 4 +++- 12 files changed, 51 insertions(+), 12 deletions(-) diff --git a/lib/megaco/test/megaco_appup_test.erl b/lib/megaco/test/megaco_appup_test.erl index a49ab0a968..40eebcae86 100644 --- a/lib/megaco/test/megaco_appup_test.erl +++ b/lib/megaco/test/megaco_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -24,6 +24,7 @@ -module(megaco_appup_test). -compile(export_all). +-compile({no_auto_import,[error/1]}). -include("megaco_test_lib.hrl"). diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 7068d005da..8190407aec 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco.hrl"). -include_lib("megaco/include/megaco_message_v1.hrl"). -include("megaco_test_lib.hrl"). diff --git a/lib/megaco/test/megaco_test_generator.erl b/lib/megaco/test/megaco_test_generator.erl index a021d2451b..4fbc86262e 100644 --- a/lib/megaco/test/megaco_test_generator.erl +++ b/lib/megaco/test/megaco_test_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ -behaviour(gen_server). +-compile({no_auto_import,[error/2]}). + +%% ---- + -export([ start_link/3, start_link/4, diff --git a/lib/megaco/test/megaco_test_megaco_generator.erl b/lib/megaco/test/megaco_test_megaco_generator.erl index 21b33e4abc..f0c723d2cf 100644 --- a/lib/megaco/test/megaco_test_megaco_generator.erl +++ b/lib/megaco/test/megaco_test_megaco_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,8 @@ -behaviour(megaco_test_generator). +-compile({no_auto_import,[error/1]}). + %% API -export([ start_link/1, start_link/2, diff --git a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl index 2fb0752865..fad7f29831 100644 --- a/lib/megaco/test/megaco_test_msg_prev3a_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3a_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3a.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl index 6e042080b7..2f1a093728 100644 --- a/lib/megaco/test/megaco_test_msg_prev3b_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3b_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2010. All Rights Reserved. +%% Copyright Ericsson AB 2005-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3b.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl index c768105194..884e2f2bad 100644 --- a/lib/megaco/test/megaco_test_msg_prev3c_lib.erl +++ b/lib/megaco/test/megaco_test_msg_prev3c_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_prev3c.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v1_lib.erl b/lib/megaco/test/megaco_test_msg_v1_lib.erl index 424a66b7c9..76665cb575 100644 --- a/lib/megaco/test/megaco_test_msg_v1_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v1_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -28,6 +28,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v1.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v2_lib.erl b/lib/megaco/test/megaco_test_msg_v2_lib.erl index b29920006d..66e423284a 100644 --- a/lib/megaco/test/megaco_test_msg_v2_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v2_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2010. All Rights Reserved. +%% Copyright Ericsson AB 2004-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v2.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_msg_v3_lib.erl b/lib/megaco/test/megaco_test_msg_v3_lib.erl index fee61542b7..24492167ff 100644 --- a/lib/megaco/test/megaco_test_msg_v3_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v3_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,10 @@ %% ---- +-compile({no_auto_import,[error/1]}). + +%% ---- + -include_lib("megaco/include/megaco_message_v3.hrl"). -include_lib("megaco/include/megaco.hrl"). diff --git a/lib/megaco/test/megaco_test_tcp_generator.erl b/lib/megaco/test/megaco_test_tcp_generator.erl index 416d56d742..3ed4c49bab 100644 --- a/lib/megaco/test/megaco_test_tcp_generator.erl +++ b/lib/megaco/test/megaco_test_tcp_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -26,6 +26,8 @@ -behaviour(megaco_test_generator). +-compile({no_auto_import,[error/1]}). + %% API -export([ start_link/1, start_link/2, diff --git a/lib/megaco/test/megaco_timer_test.erl b/lib/megaco/test/megaco_timer_test.erl index cccf4651ab..9b9103c40b 100644 --- a/lib/megaco/test/megaco_timer_test.erl +++ b/lib/megaco/test/megaco_timer_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -23,6 +23,8 @@ %%---------------------------------------------------------------------- -module(megaco_timer_test). +-compile({no_auto_import,[error/1]}). + -export([ t/0, t/1, init_per_testcase/2, end_per_testcase/2, -- cgit v1.2.3 From 1b161433719e79d812b61672f1a864886a5aa8d3 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 25 Feb 2011 18:21:45 +0100 Subject: Teach cerl to handle newer valgrind --- erts/etc/unix/cerl.src | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index 73b1bafbe0..b873f04dd3 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -228,17 +228,26 @@ if [ $run_valgrind != yes ]; then fi if [ "x$GDB" = "x" ]; then if [ $run_valgrind = yes ]; then + valversion=`valgrind --version` + valmajor=`echo $valversion | sed 's,[a-z]*\-\([0-9]*\).*,\1,'` + valminor=`echo $valversion | sed 's,[a-z]*\-[0-9]*.\([0-9]*\).*,\1,'` emu_xargs=`echo $xargs | sed "s|+|-|g"` - if [ "x$VALGRIND_LOG_DIR" = "x" ]; then - valgrind_log= - else - valgrind_log="--log-file=$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU.log" - fi if [ "x$VALGRIND_LOG_XML" = "x" ]; then valgrind_xml= + log_file_prefix="--log-file=" else export VALGRIND_LOG_XML valgrind_xml="--xml=yes" + log_file_prefix="--xml-file=" + fi + if [ "x$VALGRIND_LOG_DIR" = "x" ]; then + valgrind_log= + else + if [ $valmajor -gt 2 -a $valminor -gt 4 ]; then + valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU.log.$$" + else + valgrind_log="$log_file_prefix$VALGRIND_LOG_DIR/$VALGRIND_LOGFILE_PREFIX$VALGRIND_LOGFILE_INFIX$EMU.log" + fi fi if [ "x$VALGRIND_MISC_FLAGS" = "x" ]; then valgrind_misc_flags= -- cgit v1.2.3 From cc7b5695f941db1fdce67b4e6286d126e6111a24 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 14 Feb 2011 21:52:41 +0100 Subject: Allow bindtype unbound when no cpu topology is available --- erts/emulator/beam/erl_cpu_topology.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/erts/emulator/beam/erl_cpu_topology.c b/erts/emulator/beam/erl_cpu_topology.c index 8a6b4d8d6c..bcf8bcf270 100644 --- a/erts/emulator/beam/erl_cpu_topology.c +++ b/erts/emulator/beam/erl_cpu_topology.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2010. All Rights Reserved. + * Copyright Ericsson AB 2010-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -630,13 +630,13 @@ write_schedulers_bind_change(erts_cpu_topology_t *cpudata, int size) int erts_init_scheduler_bind_type_string(char *how) { - if (erts_bind_to_cpu(cpuinfo, -1) == -ENOTSUP) + if (sys_strcmp(how, "u") == 0) + cpu_bind_order = ERTS_CPU_BIND_NONE; + else if (erts_bind_to_cpu(cpuinfo, -1) == -ENOTSUP) return ERTS_INIT_SCHED_BIND_TYPE_NOT_SUPPORTED; - - if (!system_cpudata && !user_cpudata) + else if (!system_cpudata && !user_cpudata) return ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_CPU_TOPOLOGY; - - if (sys_strcmp(how, "db") == 0) + else if (sys_strcmp(how, "db") == 0) cpu_bind_order = ERTS_CPU_BIND_DEFAULT_BIND; else if (sys_strcmp(how, "s") == 0) cpu_bind_order = ERTS_CPU_BIND_SPREAD; @@ -652,11 +652,8 @@ erts_init_scheduler_bind_type_string(char *how) cpu_bind_order = ERTS_CPU_BIND_NO_NODE_THREAD_SPREAD; else if (sys_strcmp(how, "ns") == 0) cpu_bind_order = ERTS_CPU_BIND_NO_SPREAD; - else if (sys_strcmp(how, "u") == 0) - cpu_bind_order = ERTS_CPU_BIND_NONE; else return ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_BAD_TYPE; - return ERTS_INIT_SCHED_BIND_TYPE_SUCCESS; } @@ -724,6 +721,11 @@ erts_bind_schedulers(Process *c_p, Eterm how) erts_smp_rwmtx_rwlock(&cpuinfo_rwmtx); if (erts_bind_to_cpu(cpuinfo, -1) == -ENOTSUP) { + if (cpu_bind_order == ERTS_CPU_BIND_NONE + && ERTS_IS_ATOM_STR("unbound", how)) { + res = bound_schedulers_term(ERTS_CPU_BIND_NONE); + goto done; + } ERTS_BIF_PREP_ERROR(res, c_p, EXC_NOTSUP); } else { -- cgit v1.2.3 From 53971af07fdd95f19d5da73771867c045eaa944b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 24 Feb 2011 17:11:36 +0100 Subject: Add the erts/emulator/utils/loaded script --- erts/emulator/utils/loaded | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 erts/emulator/utils/loaded diff --git a/erts/emulator/utils/loaded b/erts/emulator/utils/loaded new file mode 100644 index 0000000000..99a66e7fdb --- /dev/null +++ b/erts/emulator/utils/loaded @@ -0,0 +1,44 @@ +%% -*- erlang -*- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% Run like: +%% $ERL_TOP/bin/escript erts/emulator/utils/loaded + +-mode(compile). + +main(_) -> + LibDir = code:lib_dir(), + io:format("Library root is ~s\n", [LibDir]), + Wc = filename:join(LibDir, "*/ebin/*.beam"), + Beams = filelib:wildcard(Wc), + BeamFileSize = lists:sum([filelib:file_size(Beam) || Beam <- Beams]), + io:format("~w BEAM files containing ~w bytes\n", + [length(Beams),BeamFileSize]), + Ms = [list_to_atom(filename:rootname(filename:basename(Beam))) || + Beam <- Beams], + [{module,_} = code:ensure_loaded(M) || M <- Ms], + <<"Current code: ",T/binary>> = erlang:system_info(loaded), + Digits = grab_digits(T), + io:format("~w modules comprising ~s words when loaded\n", + [length(Ms),Digits]). + +grab_digits(<>) when $0 =< H, H =< $9 -> + [H|grab_digits(T)]; +grab_digits(<<$\n,_/binary>>) -> []. -- cgit v1.2.3 From 58426a1d5a75af9743eeeb57d30d2a2272d60de7 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 28 Feb 2011 11:53:31 +0100 Subject: Fixed end date in copyright note. --- erts/emulator/beam/beam_emu.c | 2 +- erts/emulator/beam/erl_alloc.c | 2 +- erts/emulator/beam/erl_alloc.h | 2 +- erts/emulator/beam/erl_alloc_util.c | 2 +- erts/emulator/beam/erl_alloc_util.h | 2 +- erts/emulator/beam/erl_process.c | 2 +- erts/emulator/utils/loaded | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c index af7ed064d3..34ea35edfe 100644 --- a/erts/emulator/beam/beam_emu.c +++ b/erts/emulator/beam/beam_emu.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 323c422c6d..775f4435a9 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h index dd4cc22171..17ff9c3b03 100644 --- a/erts/emulator/beam/erl_alloc.h +++ b/erts/emulator/beam/erl_alloc.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index c09f0bbd77..1394b7e829 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h index 5a8db5e29e..d296081714 100644 --- a/erts/emulator/beam/erl_alloc_util.h +++ b/erts/emulator/beam/erl_alloc_util.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index e4a871fd7e..fde69aa470 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/emulator/utils/loaded b/erts/emulator/utils/loaded index 99a66e7fdb..d124a64a78 100644 --- a/erts/emulator/utils/loaded +++ b/erts/emulator/utils/loaded @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2010. All Rights Reserved. +%% Copyright Ericsson AB 1998-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From 5dd7bdee141803099b5a9b4eba18c6f04048ba40 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Mon, 28 Feb 2011 11:57:02 +0100 Subject: Make crypto.c work with valgrind 3.6 and correct cerl.src --- erts/etc/unix/cerl.src | 6 +++++- lib/crypto/c_src/crypto.c | 14 ++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index b873f04dd3..69840daf69 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -238,7 +238,11 @@ if [ "x$GDB" = "x" ]; then else export VALGRIND_LOG_XML valgrind_xml="--xml=yes" - log_file_prefix="--xml-file=" + if [ $valmajor -gt 2 -a $valminor -gt 4 ]; then + log_file_prefix="--xml-file=" + else + log_file_prefix="--log-file=" + fi fi if [ "x$VALGRIND_LOG_DIR" = "x" ]; then valgrind_log= diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 92cc2b4dd9..0e7e63eb73 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -62,10 +62,16 @@ # define ERL_VALGRIND_MAKE_MEM_DEFINED(ptr,size) \ VALGRIND_MAKE_MEM_DEFINED(ptr,size) - # define ERL_VALGRIND_ASSERT_MEM_DEFINED(ptr,size) \ - ((void) ((VALGRIND_CHECK_MEM_IS_DEFINED(ptr,size) == 0) ? 1 : \ - (fprintf(stderr,"\r\n####### VALGRIND_ASSSERT(%p,%ld) failed at %s:%d\r\n",\ - (ptr),(long)(size), __FILE__, __LINE__), abort(), 0))) + # define ERL_VALGRIND_ASSERT_MEM_DEFINED(Ptr,Size) \ + do { \ + int __erl_valgrind_mem_defined = VALGRIND_CHECK_MEM_IS_DEFINED((Ptr),(Size)); \ + if (__erl_valgrind_mem_defined != 0) { \ + fprintf(stderr,"\r\n####### VALGRIND_ASSSERT(%p,%ld) failed at %s:%d\r\n", \ + (Ptr),(long)(Size), __FILE__, __LINE__); \ + abort(); \ + } \ + } while (0) + #else # define ERL_VALGRIND_MAKE_MEM_DEFINED(ptr,size) # define ERL_VALGRIND_ASSERT_MEM_DEFINED(ptr,size) -- cgit v1.2.3 From f00e9a7a31e7b58f1ac9e8f6e36183a5173f7eab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 10:43:43 +0100 Subject: Fixed wrong link (to non-existing snmpc ref-manual). --- lib/snmp/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 665c78f603..2efeb8ae3f 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -77,7 +77,7 @@

[compiler] Added a MIB compiler (frontend) escript, - snmpc.

+ snmpc.

Own Id: OTP-9004

-- cgit v1.2.3 From a33afe6f8f92f63c487cfdfaeacca4eadab45c11 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 10:48:00 +0100 Subject: Added new module (megaco_config_misc). --- lib/megaco/src/app/megaco.app.src | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/megaco/src/app/megaco.app.src b/lib/megaco/src/app/megaco.app.src index 503fcd7176..c0d8218ac8 100644 --- a/lib/megaco/src/app/megaco.app.src +++ b/lib/megaco/src/app/megaco.app.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -67,6 +67,7 @@ megaco_compact_text_encoder_prev3c, megaco_compact_text_encoder_v3, megaco_config, + megaco_config_misc, megaco_digit_map, megaco_encoder, megaco_edist_compress, -- cgit v1.2.3 From 85395e3bb931d1936c7fdd0a64a8cb448a21da6e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 10:49:55 +0100 Subject: Fixed megacos own test server again. Now added suite init and end. Also some cosmetic stuff (indenting). --- lib/megaco/test/megaco_SUITE.erl | 77 +++++----- lib/megaco/test/megaco_app_test.erl | 14 +- lib/megaco/test/megaco_codec_v1_test.erl | 182 ++++++++++++++--------- lib/megaco/test/megaco_test_lib.erl | 238 +++++++++++++++++++++---------- 4 files changed, 333 insertions(+), 178 deletions(-) diff --git a/lib/megaco/test/megaco_SUITE.erl b/lib/megaco/test/megaco_SUITE.erl index 4faa6736e6..007677ba4d 100644 --- a/lib/megaco/test/megaco_SUITE.erl +++ b/lib/megaco/test/megaco_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -46,42 +46,53 @@ init() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,1}]}]}]. +suite() -> [{ct_hooks, [{ts_install_cth, [{nodenames,1}]}]}]. all() -> - [{group, app_test}, {group, appup_test}, - {group, config}, {group, flex}, {group, udp}, - {group, tcp}, {group, examples}, {group, digit_map}, - {group, mess}, {group, measure}, - {group, binary_term_id}, {group, codec}, {group, sdp}, - {group, mib}, {group, trans}, {group, actions}, - {group, load}, {group, pending_limit}, - {group, segmented}, {group, timer}]. + [{group, app_test}, + {group, appup_test}, + {group, config}, + {group, flex}, + {group, udp}, + {group, tcp}, + {group, examples}, + {group, digit_map}, + {group, mess}, + {group, measure}, + {group, binary_term_id}, + {group, codec}, + {group, sdp}, + {group, mib}, + {group, trans}, + {group, actions}, + {group, load}, + {group, pending_limit}, + {group, segmented}, + {group, timer}]. groups() -> - [{tickets, [], [{group, mess}, {group, codec}]}, - {app_test, [], [{megaco_app_test, all}]}, - {appup_test, [], [{megaco_appup_test, all}]}, - {config, [], [{megaco_config_test, all}]}, - {call_flow, [], [{megaco_call_flow_test, all}]}, - {digit_map, [], [{megaco_digit_map_test, all}]}, - {mess, [], [{megaco_mess_test, all}]}, - {udp, [], [{megaco_udp_test, all}]}, - {tcp, [], [{megaco_tcp_test, all}]}, - {examples, [], [{megaco_examples_test, all}]}, - {measure, [], [{megaco_measure_test, all}]}, - {binary_term_id, [], - [{megaco_binary_term_id_test, all}]}, - {codec, [], [{megaco_codec_test, all}]}, - {sdp, [], [{megaco_sdp_test, all}]}, - {mib, [], [{megaco_mib_test, all}]}, - {trans, [], [{megaco_trans_test, all}]}, - {actions, [], [{megaco_actions_test, all}]}, - {load, [], [{megaco_load_test, all}]}, - {pending_limit, [], [{megaco_pending_limit_test, all}]}, - {segmented, [], [{megaco_segment_test, all}]}, - {timer, [], [{megaco_timer_test, all}]}, - {flex, [], [{megaco_flex_test, all}]}]. + [{tickets, [], [{group, mess}, {group, codec}]}, + {app_test, [], [{megaco_app_test, all}]}, + {appup_test, [], [{megaco_appup_test, all}]}, + {config, [], [{megaco_config_test, all}]}, + {call_flow, [], [{megaco_call_flow_test, all}]}, + {digit_map, [], [{megaco_digit_map_test, all}]}, + {mess, [], [{megaco_mess_test, all}]}, + {udp, [], [{megaco_udp_test, all}]}, + {tcp, [], [{megaco_tcp_test, all}]}, + {examples, [], [{megaco_examples_test, all}]}, + {measure, [], [{megaco_measure_test, all}]}, + {binary_term_id, [], [{megaco_binary_term_id_test, all}]}, + {codec, [], [{megaco_codec_test, all}]}, + {sdp, [], [{megaco_sdp_test, all}]}, + {mib, [], [{megaco_mib_test, all}]}, + {trans, [], [{megaco_trans_test, all}]}, + {actions, [], [{megaco_actions_test, all}]}, + {load, [], [{megaco_load_test, all}]}, + {pending_limit, [], [{megaco_pending_limit_test, all}]}, + {segmented, [], [{megaco_segment_test, all}]}, + {timer, [], [{megaco_timer_test, all}]}, + {flex, [], [{megaco_flex_test, all}]}]. init_per_suite(Config) -> Config. diff --git a/lib/megaco/test/megaco_app_test.erl b/lib/megaco/test/megaco_app_test.erl index 0bfa388ef6..00f7b7fb68 100644 --- a/lib/megaco/test/megaco_app_test.erl +++ b/lib/megaco/test/megaco_app_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -42,11 +42,17 @@ init_per_testcase(Case, Config) -> end_per_testcase(Case, Config) -> megaco_test_lib:end_per_testcase(Case, Config). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% all() -> - [fields, modules, exportall, app_depend, - undef_funcs]. + [ + fields, + modules, + exportall, + app_depend, + undef_funcs + ]. groups() -> []. @@ -112,7 +118,7 @@ fields(doc) -> []; fields(Config) when is_list(Config) -> AppFile = key1search(app_file, Config), - Fields = [vsn, description, modules, registered, applications], + Fields = [vsn, description, modules, registered, applications], case check_fields(Fields, AppFile, []) of [] -> ok; diff --git a/lib/megaco/test/megaco_codec_v1_test.erl b/lib/megaco/test/megaco_codec_v1_test.erl index 8190407aec..3a548c4d9e 100644 --- a/lib/megaco/test/megaco_codec_v1_test.erl +++ b/lib/megaco/test/megaco_codec_v1_test.erl @@ -462,76 +462,122 @@ end_per_testcase(Case, Config) -> %% Top test case all() -> - [{group, text}, {group, binary}, {group, erl_dist}, - {group, tickets}]. + [ + {group, text}, + {group, binary}, + {group, erl_dist}, + {group, tickets} + ]. groups() -> - [{text, [], - [{group, pretty}, {group, flex_pretty}, - {group, compact}, {group, flex_compact}]}, - {binary, [], - [{group, bin}, {group, ber}, {group, ber_bin}, - {group, per}, {group, per_bin}]}, - {erl_dist, [], [{group, erl_dist_m}]}, - {pretty, [], [pretty_test_msgs]}, - {compact, [], [compact_test_msgs]}, - {flex_pretty, [], flex_pretty_cases()}, - {flex_compact, [], flex_compact_cases()}, - {bin, [], [bin_test_msgs]}, {ber, [], [ber_test_msgs]}, - {ber_bin, [], [ber_bin_test_msgs]}, - {per, [], [per_test_msgs]}, - {per_bin, [], [per_bin_test_msgs]}, - {erl_dist_m, [], [erl_dist_m_test_msgs]}, - {tickets, [], - [{group, compact_tickets}, {group, pretty_tickets}, - {group, flex_compact_tickets}, - {group, flex_pretty_tickets}]}, - {compact_tickets, [], - [compact_otp4011_msg1, compact_otp4011_msg2, - compact_otp4011_msg3, compact_otp4013_msg1, - compact_otp4085_msg1, compact_otp4085_msg2, - compact_otp4280_msg1, compact_otp4299_msg1, - compact_otp4299_msg2, compact_otp4359_msg1, - compact_otp4920_msg0, compact_otp4920_msg1, - compact_otp4920_msg2, compact_otp4920_msg3, - compact_otp4920_msg4, compact_otp4920_msg5, - compact_otp4920_msg6, compact_otp4920_msg7, - compact_otp4920_msg8, compact_otp4920_msg9, - compact_otp4920_msg10, compact_otp4920_msg11, - compact_otp4920_msg12, compact_otp4920_msg20, - compact_otp4920_msg21, compact_otp4920_msg22, - compact_otp4920_msg23, compact_otp4920_msg24, - compact_otp4920_msg25, compact_otp5186_msg01, - compact_otp5186_msg02, compact_otp5186_msg03, - compact_otp5186_msg04, compact_otp5186_msg05, - compact_otp5186_msg06, compact_otp5793_msg01, - compact_otp5993_msg01, compact_otp5993_msg02, - compact_otp5993_msg03, compact_otp6017_msg01, - compact_otp6017_msg02, compact_otp6017_msg03]}, - {flex_compact_tickets, [], - flex_compact_tickets_cases()}, - {pretty_tickets, [], - [pretty_otp4632_msg1, pretty_otp4632_msg2, - pretty_otp4632_msg3, pretty_otp4632_msg4, - pretty_otp4710_msg1, pretty_otp4710_msg2, - pretty_otp4945_msg1, pretty_otp4945_msg2, - pretty_otp4945_msg3, pretty_otp4945_msg4, - pretty_otp4945_msg5, pretty_otp4945_msg6, - pretty_otp4949_msg1, pretty_otp4949_msg2, - pretty_otp4949_msg3, pretty_otp5042_msg1, - pretty_otp5068_msg1, pretty_otp5085_msg1, - pretty_otp5085_msg2, pretty_otp5085_msg3, - pretty_otp5085_msg4, pretty_otp5085_msg5, - pretty_otp5085_msg6, pretty_otp5085_msg7, - pretty_otp5600_msg1, pretty_otp5600_msg2, - pretty_otp5601_msg1, pretty_otp5793_msg01, - pretty_otp5882_msg01, pretty_otp6490_msg01, - pretty_otp6490_msg02, pretty_otp6490_msg03, - pretty_otp6490_msg04, pretty_otp6490_msg05, - pretty_otp6490_msg06, pretty_otp7671_msg01, - pretty_otp7671_msg02, pretty_otp7671_msg03, - pretty_otp7671_msg04, pretty_otp7671_msg05]}, - {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. + [{text, [], [{group, pretty}, + {group, flex_pretty}, + {group, compact}, + {group, flex_compact}]}, + {binary, [], [{group, bin}, + {group, ber}, + {group, ber_bin}, + {group, per}, + {group, per_bin}]}, + {erl_dist, [], [{group, erl_dist_m}]}, + {pretty, [], [pretty_test_msgs]}, + {compact, [], [compact_test_msgs]}, + {flex_pretty, [], flex_pretty_cases()}, + {flex_compact, [], flex_compact_cases()}, + {bin, [], [bin_test_msgs]}, + {ber, [], [ber_test_msgs]}, + {ber_bin, [], [ber_bin_test_msgs]}, + {per, [], [per_test_msgs]}, + {per_bin, [], [per_bin_test_msgs]}, + {erl_dist_m, [], [erl_dist_m_test_msgs]}, + {tickets, [], [{group, compact_tickets}, + {group, pretty_tickets}, + {group, flex_compact_tickets}, + {group, flex_pretty_tickets}]}, + {compact_tickets, [], [compact_otp4011_msg1, + compact_otp4011_msg2, + compact_otp4011_msg3, + compact_otp4013_msg1, + compact_otp4085_msg1, + compact_otp4085_msg2, + compact_otp4280_msg1, + compact_otp4299_msg1, + compact_otp4299_msg2, + compact_otp4359_msg1, + compact_otp4920_msg0, + compact_otp4920_msg1, + compact_otp4920_msg2, + compact_otp4920_msg3, + compact_otp4920_msg4, + compact_otp4920_msg5, + compact_otp4920_msg6, + compact_otp4920_msg7, + compact_otp4920_msg8, + compact_otp4920_msg9, + compact_otp4920_msg10, + compact_otp4920_msg11, + compact_otp4920_msg12, + compact_otp4920_msg20, + compact_otp4920_msg21, + compact_otp4920_msg22, + compact_otp4920_msg23, + compact_otp4920_msg24, + compact_otp4920_msg25, + compact_otp5186_msg01, + compact_otp5186_msg02, + compact_otp5186_msg03, + compact_otp5186_msg04, + compact_otp5186_msg05, + compact_otp5186_msg06, + compact_otp5793_msg01, + compact_otp5993_msg01, + compact_otp5993_msg02, + compact_otp5993_msg03, + compact_otp6017_msg01, + compact_otp6017_msg02, + compact_otp6017_msg03]}, + {flex_compact_tickets, [], flex_compact_tickets_cases()}, + {pretty_tickets, [], [pretty_otp4632_msg1, + pretty_otp4632_msg2, + pretty_otp4632_msg3, + pretty_otp4632_msg4, + pretty_otp4710_msg1, + pretty_otp4710_msg2, + pretty_otp4945_msg1, + pretty_otp4945_msg2, + pretty_otp4945_msg3, + pretty_otp4945_msg4, + pretty_otp4945_msg5, + pretty_otp4945_msg6, + pretty_otp4949_msg1, + pretty_otp4949_msg2, + pretty_otp4949_msg3, + pretty_otp5042_msg1, + pretty_otp5068_msg1, + pretty_otp5085_msg1, + pretty_otp5085_msg2, + pretty_otp5085_msg3, + pretty_otp5085_msg4, + pretty_otp5085_msg5, + pretty_otp5085_msg6, + pretty_otp5085_msg7, + pretty_otp5600_msg1, + pretty_otp5600_msg2, + pretty_otp5601_msg1, + pretty_otp5793_msg01, + pretty_otp5882_msg01, + pretty_otp6490_msg01, + pretty_otp6490_msg02, + pretty_otp6490_msg03, + pretty_otp6490_msg04, + pretty_otp6490_msg05, + pretty_otp6490_msg06, + pretty_otp7671_msg01, + pretty_otp7671_msg02, + pretty_otp7671_msg03, + pretty_otp7671_msg04, + pretty_otp7671_msg05]}, + {flex_pretty_tickets, [], flex_pretty_tickets_cases()}]. init_per_group(flex_pretty_tickets, Config) -> flex_pretty_init(Config); diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl index 0d2b4a3f4e..41f6c2c4cb 100644 --- a/lib/megaco/test/megaco_test_lib.erl +++ b/lib/megaco/test/megaco_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% Copyright Ericsson AB 1999-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -146,28 +146,28 @@ tickets(Mod, Func, Config) -> end, lists:map(Map, Cases); - {req, _, {conf, Init, Cases, Finish}} -> - case (catch Mod:Init(Config)) of - Conf when is_list(Conf) -> - io:format("Expand: ~p:~p ...~n", [Mod, Func]), - Map = fun({M,_}) when is_atom(M) -> - tickets(M, tickets, Config); - (F) when is_atom(F) -> - tickets(Mod, F, Config); - (Case) -> Case - end, - Res = lists:map(Map, Cases), - (catch Mod:Finish(Conf)), - Res; +%% {req, _, {conf, Init, Cases, Finish}} -> +%% case (catch Mod:Init(Config)) of +%% Conf when is_list(Conf) -> +%% io:format("Expand: ~p:~p ...~n", [Mod, Func]), +%% Map = fun({M,_}) when is_atom(M) -> +%% tickets(M, tickets, Config); +%% (F) when is_atom(F) -> +%% tickets(Mod, F, Config); +%% (Case) -> Case +%% end, +%% Res = lists:map(Map, Cases), +%% (catch Mod:Finish(Conf)), +%% Res; - {'EXIT', {skipped, Reason}} -> - io:format(" => skipping: ~p~n", [Reason]), - [{skipped, {Mod, Func}, Reason}]; +%% {'EXIT', {skipped, Reason}} -> +%% io:format(" => skipping: ~p~n", [Reason]), +%% [{skipped, {Mod, Func}, Reason}]; - Error -> - io:format(" => init failed: ~p~n", [Error]), - [{failed, {Mod, Func}, Error}] - end; +%% Error -> +%% io:format(" => init failed: ~p~n", [Error]), +%% [{failed, {Mod, Func}, Error}] +%% end; {'EXIT', {undef, _}} -> io:format("Undefined: ~p~n", [{Mod, Func}]), @@ -252,6 +252,8 @@ alloc_instance_mem_info(Key, InstanceInfo) -> end. +t([Case]) when is_atom(Case) -> + t(Case); t(Case) -> process_flag(trap_exit, true), MEM = fun() -> case (catch erlang:memory()) of @@ -266,11 +268,65 @@ t(Case) -> Res = lists:flatten(t(Case, default_config())), Alloc2 = alloc_info(), Mem2 = MEM(), - %% io:format("Res: ~p~n", [Res]), display_result(Res, Alloc1, Mem1, Alloc2, Mem2), Res. -t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> + +groups(Mod) when is_atom(Mod) -> + try Mod:groups() of + Groups when is_list(Groups) -> + Groups; + BadGroups -> + exit({bad_groups, Mod, BadGroups}) + catch + _:_ -> + [] + end. + +init_suite(Mod, Config) -> + Mod:init_per_suite(Config). + +end_suite(Mod, Config) -> + Mod:end_per_suite(Config). + +init_group(Mod, Group, Config) -> + Mod:init_per_group(Group, Config). + +end_group(Mod, Group, Config) -> + Mod:init_per_group(Group, Config). + +%% This is for sub-SUITEs +t({_Mod, {NewMod, all}, _Groups}, _Config) when is_atom(NewMod) -> + t(NewMod); +t({Mod, {group, Name} = Group, Groups}, Config) + when is_atom(Mod) andalso is_atom(Name) andalso is_list(Groups) -> + case lists:keysearch(Name, 1, Groups) of + {value, {Name, _Props, GroupsAndCases}} -> + try init_group(Mod, Name, Config) of + Config2 when is_list(Config2) -> + Res = [t({Mod, Case, Groups}, Config2) || + Case <- GroupsAndCases], + (catch end_group(Mod, Name, Config2)), + Res; + Error -> + io:format(" => group (~w) init failed: ~p~n", + [Name, Error]), + [{failed, {Mod, Group}, Error}] + catch + exit:{skipped, SkipReason} -> + io:format(" => skipping group: ~p~n", [SkipReason]), + [{skipped, {Mod, Group}, SkipReason, 0}]; + exit:{undef, _} -> + [t({Mod, Case, Groups}, Config) || + Case <- GroupsAndCases]; + T:E -> + [{failed, {Mod, Group}, {T,E}, 0}] + end; + false -> + exit({unknown_group, Mod, Name, Groups}) + end; +t({Mod, Fun, _}, Config) + when is_atom(Mod) andalso is_atom(Fun) -> case catch apply(Mod, Fun, [suite]) of [] -> io:format("Eval: ~p:", [{Mod, Fun}]), @@ -286,26 +342,6 @@ t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> end, t(lists:map(Map, Cases), Config); - {req, _, {conf, Init, Cases, Finish}} -> - case (catch apply(Mod, Init, [Config])) of - Conf when is_list(Conf) -> - io:format("Expand: ~p ...~n", [{Mod, Fun}]), - Map = fun(Case) when is_atom(Case) -> {Mod, Case}; - (Case) -> Case - end, - Res = t(lists:map(Map, Cases), Conf), - (catch apply(Mod, Finish, [Conf])), - Res; - - {'EXIT', {skipped, Reason}} -> - io:format(" => skipping: ~p~n", [Reason]), - [{skipped, {Mod, Fun}, Reason, 0}]; - - Error -> - io:format(" => failed: ~p~n", [Error]), - [{failed, {Mod, Fun}, Error, 0}] - end; - {'EXIT', {undef, _}} -> io:format("Undefined: ~p~n", [{Mod, Fun}]), [{nyi, {Mod, Fun}, ok, 0}]; @@ -315,10 +351,38 @@ t({Mod, Fun}, Config) when is_atom(Mod) andalso is_atom(Fun) -> [{failed, {Mod, Fun}, Error, 0}] end; t(Mod, Config) when is_atom(Mod) -> - Res = t({Mod, all}, Config), - Res; -t(Cases, Config) when is_list(Cases) -> - [t(Case, Config) || Case <- Cases]; + %% This is assumed to be a test suite, so we start by calling + %% the top test suite function(s) (all/0 and groups/0). + case (catch Mod:all()) of + Cases when is_list(Cases) -> + %% The list may contain atoms (actual test cases) and + %% group-tuples (a tuple naming a group of test cases). + %% A group is defined by the (optional) groups/0 function. + Groups = groups(Mod), + try init_suite(Mod, Config) of + Config2 when is_list(Config2) -> + Res = [t({Mod, Case, Groups}, Config2) || Case <- Cases], + (catch end_suite(Mod, Config2)), + Res; + Error -> + io:format(" => suite init failed: ~p~n", [Error]), + [{failed, {Mod, init_per_suite}, Error}] + catch + exit:{skipped, SkipReason} -> + io:format(" => skipping suite: ~p~n", [SkipReason]), + [{skipped, {Mod, init_per_suite}, SkipReason, 0}]; + exit:{undef, _} -> + [t({Mod, Case, Groups}, Config) || Case <- Cases]; + T:E -> + [{failed, {Mod, init_per_suite}, {T,E}, 0}] + end; + {'EXIT', {undef, _}} -> + io:format("Undefined: ~p~n", [{Mod, all}]), + [{nyi, {Mod, all}, ok, 0}]; + + Crap -> + Crap + end; t(Bad, _Config) -> [{badarg, Bad, ok, 0}]. @@ -495,28 +559,56 @@ do_display_memory([{Key, Mem1}|MemInfo1], MemInfo2) -> display_result([]) -> io:format("OK~n", []); display_result(Res) when is_list(Res) -> - Ok = [{MF, Time} || {ok, MF, _, Time} <- Res], - Nyi = [MF || {nyi, MF, _, _Time} <- Res], - Skipped = [{MF, Reason} || {skipped, MF, Reason, _Time} <- Res], - Failed = [{MF, Reason} || {failed, MF, Reason, _Time} <- Res], - Crashed = [{MF, Reason} || {crashed, MF, Reason, _Time} <- Res], - display_summery(Ok, Nyi, Skipped, Failed, Crashed), + Ok = [{MF, Time} || {ok, MF, _, Time} <- Res], + Nyi = [MF || {nyi, MF, _, _Time} <- Res], + SkippedGrps = [{{M,G}, Reason} || + {skipped, {M, {group, G}}, Reason, _Time} <- Res], + SkippedCases = [{MF, Reason} || + {skipped, {_M, F} = MF, Reason, _Time} <- Res, + is_atom(F)], + FailedGrps = [{{M,G}, Reason} || + {failed, {M, {group, G}}, Reason, _Time} <- Res], + FailedCases = [{MF, Reason} || + {failed, {_M, F} = MF, Reason, _Time} <- Res, + is_atom(F)], + Crashed = [{MF, Reason} || {crashed, MF, Reason, _Time} <- Res], + display_summery(Ok, Nyi, + SkippedGrps, SkippedCases, + FailedGrps, FailedCases, + Crashed), display_ok(Ok), - display_skipped(Skipped), - display_failed(Failed), + display_skipped("groups", SkippedGrps), + display_skipped("test cases", SkippedCases), + display_failed("groups", FailedGrps), + display_failed("test cases", FailedCases), display_crashed(Crashed). -display_summery(Ok, Nyi, Skipped, Failed, Crashed) -> +display_summery(Ok, Nyi, + SkippedGrps, SkippedCases, + FailedGrps, FailedCases, + Crashed) -> io:format("~nTest case summery:~n", []), - display_summery(Ok, "successfull"), - display_summery(Nyi, "not yet implemented"), - display_summery(Skipped, "skipped"), - display_summery(Failed, "failed"), - display_summery(Crashed, "crashed"), + display_summery(Ok, "test case", "successfull"), + display_summery(Nyi, "test case", "not yet implemented"), + display_summery(SkippedGrps, "group", "skipped"), + display_summery(SkippedCases, "test case", "skipped"), + display_summery(FailedGrps, "group", "failed"), + display_summery(FailedCases, "test case", "failed"), + display_summery(Crashed, "test case", "crashed"), io:format("~n", []). -display_summery(Res, Info) -> - io:format(" ~w test cases ~s~n", [length(Res), Info]). + +display_summery(Res, Kind, Info) -> + Len = length(Res), + if + Len =:= 1 -> + display_summery(Len, Kind ++ " " ++ Info); + true -> + display_summery(Len, Kind ++ "s " ++ Info) + end. + +display_summery(Len, Info) -> + io:format(" ~w ~s~n", [Len, Info]). display_ok([]) -> ok; @@ -528,20 +620,20 @@ display_ok(Ok) -> lists:foreach(F, Ok), io:format("~n", []). -display_skipped([]) -> +display_skipped(_, []) -> ok; -display_skipped(Skipped) -> - io:format("Skipped test cases:~n", []), - F = fun({MF, Reason}) -> io:format(" ~p => ~p~n", [MF, Reason]) end, +display_skipped(Pre, Skipped) -> + io:format("Skipped ~s:~n", [Pre]), + F = fun({X, Reason}) -> io:format(" ~p => ~p~n", [X, Reason]) end, lists:foreach(F, Skipped), io:format("~n", []). -display_failed([]) -> +display_failed(_, []) -> ok; -display_failed(Failed) -> - io:format("Failed test cases:~n", []), - F = fun({MF, Reason}) -> io:format(" ~p => ~p~n", [MF, Reason]) end, +display_failed(Pre, Failed) -> + io:format("Failed ~s:~n", [Pre]), + F = fun({X, Reason}) -> io:format(" ~p => ~p~n", [X, Reason]) end, lists:foreach(F, Failed), io:format("~n", []). @@ -837,5 +929,5 @@ start_nodes([Node | Nodes], File, Line) -> start_nodes([], _File, _Line) -> ok. -p(F,A) -> - io:format("~p" ++ F ++ "~n", [self()|A]). +p(F, A) -> + io:format("~p~w:" ++ F ++ "~n", [self(), ?MODULE |A]). -- cgit v1.2.3 From c4241524ea42871f6cb601783ea56e18449f7cc1 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 11:29:57 +0100 Subject: Wrong remove instruction. --- lib/megaco/src/app/megaco.appup.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/megaco/src/app/megaco.appup.src b/lib/megaco/src/app/megaco.appup.src index 495a9ec9ae..01b070d79f 100644 --- a/lib/megaco/src/app/megaco.appup.src +++ b/lib/megaco/src/app/megaco.appup.src @@ -160,7 +160,7 @@ {load_module, megaco_filter, soft_purge, soft_purge, []}, {load_module, megaco_timer, soft_purge, soft_purge, [megaco_config]}, {update, megaco_config, soft, soft_purge, soft_purge, []}, - {delete_module, megaco_config_misc} + {remove, {megaco_config_misc, soft_purge, brutal_purge}} ] } ] -- cgit v1.2.3 From ebcc15d9b60c0372b2b676f0fe013b19a7e669fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 1 Mar 2011 16:33:15 +0100 Subject: Add font edoc type spec for egd --- lib/percept/src/egd.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/percept/src/egd.erl b/lib/percept/src/egd.erl index 4fb5b6c46a..63e5c30572 100644 --- a/lib/percept/src/egd.erl +++ b/lib/percept/src/egd.erl @@ -42,6 +42,7 @@ %%========================================================================== %% @type egd_image() +%% @type font() %% @type point() = {integer(), integer()} %% @type color() %% @type render_option() = {render_engine, opaque} | {render_engine, alpha} -- cgit v1.2.3 From 435a89b9d156f3f6d88416dedb8e75b0489eba80 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 1 Mar 2011 16:47:09 +0100 Subject: Fix three dialyzer warnings in kernel Joint effort by Kostis, pan, egil & sverker --- erts/preloaded/src/erlang.erl | 16 +++++----------- erts/preloaded/src/prim_inet.erl | 4 ++-- lib/kernel/src/net_kernel.erl | 31 +++++++++++++------------------ 3 files changed, 20 insertions(+), 31 deletions(-) diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 935c2de253..d6dc070436 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -427,17 +427,11 @@ delay_trap(Result, Timeout) -> receive after Timeout -> Result end. %% have to reflect that, which we cannot forsee. %% set_cookie(Node, C) when Node =/= nonode@nohost, is_atom(Node) -> - Res = case C of - _ when is_atom(C) -> - auth:set_cookie(Node, C); - {CI,CO} when is_atom(CI), is_atom(CO) -> - auth:set_cookie(Node, {CI, CO}); - _ -> - error - end, - case Res of - error -> exit(badarg); - Other -> Other + case is_atom(C) of + true -> + auth:set_cookie(Node, C); + false -> + error(badarg) end. -spec get_cookie() -> atom(). diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl index 446656e45f..2e4a2866e6 100644 --- a/erts/preloaded/src/prim_inet.erl +++ b/erts/preloaded/src/prim_inet.erl @@ -1518,7 +1518,7 @@ enc_value_2(addr, {IP,Port}) when tuple_size(IP) =:= 4 -> [?INET_AF_INET,?int16(Port)|ip4_to_bytes(IP)]; enc_value_2(addr, {IP,Port}) when tuple_size(IP) =:= 8 -> [?INET_AF_INET6,?int16(Port)|ip6_to_bytes(IP)]; -enc_value_2(ether, [X1,X2,X3,X4,X5,X6]) -> [X1,X2,X3,X4,X5,X6]; +enc_value_2(ether, [_,_,_,_,_,_]=Xs) -> Xs; enc_value_2(sockaddr, any) -> [?INET_AF_ANY]; enc_value_2(sockaddr, loopback) -> @@ -1572,7 +1572,7 @@ dec_value(time, [X3,X2,X1,X0|T]) -> Val -> {Val, T} end; dec_value(ip, [A,B,C,D|T]) -> {{A,B,C,D}, T}; -dec_value(ether,[X1,X2,X3,X4,X5,X6|T]) -> {[X1,X2,X3,X4,X5,X6],T}; +%% dec_value(ether, [X1,X2,X3,X4,X5,X6|T]) -> {[X1,X2,X3,X4,X5,X6],T}; dec_value(sockaddr, [X|T]) -> get_ip(X, T); dec_value(linkaddr, [X1,X0|T]) -> diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl index f5e2820bbe..23db85e1f4 100644 --- a/lib/kernel/src/net_kernel.erl +++ b/lib/kernel/src/net_kernel.erl @@ -322,24 +322,19 @@ init({Name, LongOrShortNames, TickT}) -> process_flag(priority, max), Ticktime = to_integer(TickT), Ticker = spawn_link(net_kernel, ticker, [self(), Ticktime]), - case auth:get_cookie(Node) of - Cookie when is_atom(Cookie) -> - {ok, #state{name = Name, - node = Node, - type = LongOrShortNames, - tick = #tick{ticker = Ticker, time = Ticktime}, - connecttime = connecttime(), - connections = - ets:new(sys_dist,[named_table, - protected, - {keypos, 2}]), - listen = Listeners, - allowed = [], - verbose = 0 - }}; - _ELSE -> - {stop, {error,{bad_cookie, Node}}} - end; + {ok, #state{name = Name, + node = Node, + type = LongOrShortNames, + tick = #tick{ticker = Ticker, time = Ticktime}, + connecttime = connecttime(), + connections = + ets:new(sys_dist,[named_table, + protected, + {keypos, 2}]), + listen = Listeners, + allowed = [], + verbose = 0 + }}; Error -> {stop, Error} end. -- cgit v1.2.3 From e83fc28ced34c954f65eaa884e093fdd733f8992 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 1 Mar 2011 17:02:18 +0100 Subject: Update preloaded modules --- erts/preloaded/ebin/erl_prim_loader.beam | Bin 50384 -> 50384 bytes erts/preloaded/ebin/erlang.beam | Bin 24320 -> 24144 bytes erts/preloaded/ebin/init.beam | Bin 44876 -> 44876 bytes erts/preloaded/ebin/otp_ring0.beam | Bin 1432 -> 1432 bytes erts/preloaded/ebin/prim_file.beam | Bin 31552 -> 31548 bytes erts/preloaded/ebin/prim_inet.beam | Bin 65060 -> 64888 bytes erts/preloaded/ebin/prim_zip.beam | Bin 22432 -> 22432 bytes erts/preloaded/ebin/zlib.beam | Bin 10616 -> 10616 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam index 87ff5119fd..bff3f7f9de 100644 Binary files a/erts/preloaded/ebin/erl_prim_loader.beam and b/erts/preloaded/ebin/erl_prim_loader.beam differ diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam index 6b0d96ff8e..5d2f187435 100644 Binary files a/erts/preloaded/ebin/erlang.beam and b/erts/preloaded/ebin/erlang.beam differ diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam index 8a7a9a1314..7e492057da 100644 Binary files a/erts/preloaded/ebin/init.beam and b/erts/preloaded/ebin/init.beam differ diff --git a/erts/preloaded/ebin/otp_ring0.beam b/erts/preloaded/ebin/otp_ring0.beam index 5d544ff4aa..c443866671 100644 Binary files a/erts/preloaded/ebin/otp_ring0.beam and b/erts/preloaded/ebin/otp_ring0.beam differ diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam index 3ed02ecd44..4a75e43e73 100644 Binary files a/erts/preloaded/ebin/prim_file.beam and b/erts/preloaded/ebin/prim_file.beam differ diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam index 79a8d22366..30bbfb0943 100644 Binary files a/erts/preloaded/ebin/prim_inet.beam and b/erts/preloaded/ebin/prim_inet.beam differ diff --git a/erts/preloaded/ebin/prim_zip.beam b/erts/preloaded/ebin/prim_zip.beam index 3cc8c6b8be..6681466767 100644 Binary files a/erts/preloaded/ebin/prim_zip.beam and b/erts/preloaded/ebin/prim_zip.beam differ diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam index 3f9e867542..593bb8dbed 100644 Binary files a/erts/preloaded/ebin/zlib.beam and b/erts/preloaded/ebin/zlib.beam differ -- cgit v1.2.3 From cf7f5f99f46708db185d927d0c7681fc4f6f3a0e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 1 Mar 2011 18:00:33 +0100 Subject: Fixed an error detected by dialyzer: The second argument to the definitions_loop function should be the record dldata and not the atome false... --- lib/snmp/src/compile/snmpc.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl index c4b3d7090f..195c238184 100644 --- a/lib/snmp/src/compile/snmpc.erl +++ b/lib/snmp/src/compile/snmpc.erl @@ -894,12 +894,12 @@ definitions_loop([{#mc_object_type{name = NameOfEntry, definitions_loop([{#mc_notification{name = TrapName, status = deprecated}, Line}|T], - false) -> + #dldata{deprecated = false} = Data) -> ?vinfo2("defloop -> notification ~w is deprecated => ignored", [TrapName], Line), update_status(TrapName, deprecated), ensure_macro_imported('NOTIFICATION-TYPE', Line), - definitions_loop(T, false); + definitions_loop(T, Data); definitions_loop([{#mc_notification{name = TrapName, status = obsolete}, Line}|T], -- cgit v1.2.3 From 804bb7f78fcf94609f31a9d429b82c37d1f1173b Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Wed, 2 Mar 2011 09:32:09 +0200 Subject: Document exiting and garbage_collecting process statuses --- erts/doc/src/erlang.xml | 3 ++- lib/hipe/cerl/erl_bif_types.erl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 78d58a1e56..c3f06982f5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -3980,7 +3980,8 @@ os_prompt% {status, Status}

Status is the status of the process. Status - is waiting (waiting for a message), running, + is exiting, garbage_collecting, + waiting (for a message), running, runnable (ready to run, but another process is running), or suspended (suspended on a "busy" port or by the erlang:suspend_process/[1,2] BIF).

diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 309c118107..6c6a207b3c 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -4807,7 +4807,8 @@ t_process_priority_level() -> t_sup([t_atom('max'), t_atom('high'), t_atom('normal'), t_atom('low')]). t_process_status() -> - t_sup([t_atom('runnable'), t_atom('running'), + t_sup([t_atom('exiting'), t_atom('garbage_collecting'), + t_atom('runnable'), t_atom('running'), t_atom('suspended'), t_atom('waiting')]). t_raise_errorclass() -> -- cgit v1.2.3 From a3a4dbb5f8b11a04f4ac1530cfd96478f881763b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 2 Mar 2011 10:24:54 +0100 Subject: Fix bug where failing to make a testcase caused an errornous failure reason --- lib/test_server/src/ts_install_cth.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_server/src/ts_install_cth.erl b/lib/test_server/src/ts_install_cth.erl index f8b4e5a4f8..d1a24525ab 100644 --- a/lib/test_server/src/ts_install_cth.erl +++ b/lib/test_server/src/ts_install_cth.erl @@ -112,7 +112,7 @@ pre_init_per_suite(_Suite,Config,State) -> catch Error:Reason -> Stack = erlang:get_stacktrace(), ct:pal("~p failed! ~p:{~p,~p}",[?MODULE,Error,Reason,Stack]), - {fail,{?MODULE,{Error,Reason, Stack}}} + {{fail,{?MODULE,{Error,Reason, Stack}}},State} end. %% @doc Called after init_per_suite. -- cgit v1.2.3 From e6c038125fd204d9c2f8fa3df282ec1b75bc31b1 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 13 Jan 2011 11:46:42 +0100 Subject: Fixed coredump when graphics could not be initiated For instance when DISPLAY was not set --- lib/wx/c_src/wxe_driver.c | 3 +-- lib/wx/c_src/wxe_impl.cpp | 5 ++++- lib/wx/src/wxe_master.erl | 28 ++++++++++++++-------------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c index 310325ea26..14a9d1e982 100644 --- a/lib/wx/c_src/wxe_driver.c +++ b/lib/wx/c_src/wxe_driver.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * Copyright Ericsson AB 2008-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -146,7 +146,6 @@ static void wxe_driver_unload(void) { // fprintf(stderr, "%s:%d: UNLOAD \r\n", __FILE__,__LINE__); - meta_command(WXE_SHUTDOWN, wxe_master); stop_native_gui(wxe_master); unload_native_gui(); free(wxe_master); diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 79d1a29519..8bccdc0a68 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * Copyright Ericsson AB 2008-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -117,6 +117,9 @@ int start_native_gui(wxe_data *sd) void stop_native_gui(wxe_data *sd) { + if(wxe_status == WXE_INITIATED) { + meta_command(WXE_SHUTDOWN, sd); + } erl_drv_thread_join(wxe_thread, NULL); erl_drv_mutex_destroy(wxe_status_m); erl_drv_cond_destroy(wxe_status_c); diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl index d8592c133b..9efe59054c 100644 --- a/lib/wx/src/wxe_master.erl +++ b/lib/wx/src/wxe_master.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -128,19 +128,19 @@ init([]) -> process_flag(trap_exit, true), DriverWithArgs = DriverName ++ " " ++ code:priv_dir(wx) ++ [0], - case catch open_port({spawn, DriverWithArgs},[binary]) of - {'EXIT', Err} -> - erlang:error({open_port,Err}); - Port -> - wx_debug_info = ets:new(wx_debug_info, [named_table]), - wx_non_consts = ets:new(wx_non_consts, [named_table]), - true = ets:insert(wx_debug_info, wxdebug_table()), - spawn_link(fun() -> debug_ping(Port) end), - receive - {wx_consts, List} -> - true = ets:insert(wx_non_consts, List) - end, - {ok, #state{cb_port=Port, driver=DriverName, users=gb_sets:empty()}} + try + Port = open_port({spawn, DriverWithArgs},[binary]), + wx_debug_info = ets:new(wx_debug_info, [named_table]), + wx_non_consts = ets:new(wx_non_consts, [named_table]), + true = ets:insert(wx_debug_info, wxdebug_table()), + spawn_link(fun() -> debug_ping(Port) end), + receive + {wx_consts, List} -> + true = ets:insert(wx_non_consts, List) + end, + {ok, #state{cb_port=Port, driver=DriverName, users=gb_sets:empty()}} + catch _:Err -> + error({Err, "Could not initiate graphics"}) end. %%-------------------------------------------------------------------- -- cgit v1.2.3 From d0fd9b48bdfccd228fe659ed95de096c79db46eb Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 2 Feb 2011 15:08:01 +0100 Subject: Fix start args --- lib/wx/c_src/wxe_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 8bccdc0a68..2a2ec1e40b 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -185,8 +185,8 @@ void *wxe_main_loop(void *vpdl) { int result; int argc = 1; - char * temp = (char *) "Erlang\0"; - char ** argv = &temp; + char * temp = (char *) "Erlang"; + char * argv[] = {temp,NULL}; ErlDrvPDL pdl = (ErlDrvPDL) vpdl; driver_pdl_inc_refc(pdl); -- cgit v1.2.3 From 1bf0af6284aca47a6b3a823c4dd682e8fb8d4135 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 15 Feb 2011 16:49:31 +0100 Subject: Fix bad string copy during initialization This may have caused the core dump on ubuntu-64 which have happend for some people. --- lib/wx/c_src/wxe_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/wx/c_src/wxe_driver.c b/lib/wx/c_src/wxe_driver.c index 14a9d1e982..2404b13cc3 100644 --- a/lib/wx/c_src/wxe_driver.c +++ b/lib/wx/c_src/wxe_driver.c @@ -117,8 +117,7 @@ wxe_driver_start(ErlDrvPort port, char *buff) if(WXE_DRV_PORT == 0) { for(; *buff != 32; buff++); buff++; - erl_wx_privdir = malloc(strlen(buff)); - strcpy(erl_wx_privdir, buff); + erl_wx_privdir = strdup(buff); WXE_DRV_PORT = port; wxe_master = data; -- cgit v1.2.3 From e12038dc74b081e6b5dfd2b3f266dc01a09ed523 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 25 Feb 2011 18:11:28 +0100 Subject: Make MacOS (NS) wx use the main thread --- erts/emulator/beam/erl_drv_thread.c | 59 ++++++++++++++++++++++++++++++++++++- erts/emulator/sys/unix/sys.c | 41 ++++++++++++++++++++++++++ lib/wx/c_src/wxe_impl.cpp | 31 +++++++++++++++++-- lib/wx/c_src/wxe_ps_init.c | 2 +- 4 files changed, 129 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c index 17b08a71d4..08a35387f2 100644 --- a/erts/emulator/beam/erl_drv_thread.c +++ b/erts/emulator/beam/erl_drv_thread.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2007-2010. All Rights Reserved. + * Copyright Ericsson AB 2007-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -24,6 +24,10 @@ #include "global.h" #include +#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) +#define __DARWIN__ 1 +#endif + #define ERL_DRV_THR_OPTS_SIZE(LAST_FIELD) \ (((size_t) &((ErlDrvThreadOpts *) 0)->LAST_FIELD) \ + sizeof(((ErlDrvThreadOpts *) 0)->LAST_FIELD)) @@ -692,3 +696,56 @@ erl_drv_thread_join(ErlDrvTid tid, void **respp) #endif } +#if defined(__DARWIN__) && defined(USE_THREADS) && defined(ERTS_SMP) +extern int erts_darwin_main_thread_pipe[2]; + + +int +erl_drv_stolen_main_thread_join(ErlDrvTid tid, void **respp) +{ + void *dummy; + void **x; + if (respp == NULL) + x = &dummy; + else + x = respp; + read(erts_darwin_main_thread_pipe[0],x,sizeof(void *)); + return 0; +} + +int +erl_drv_steal_main_thread(char *name, + ErlDrvTid *tid, + void* (*func)(void*), + void* arg, + ErlDrvThreadOpts *opts) +{ + char buff[sizeof(void* (*)(void*)) + sizeof(void *)]; + int buff_sz = sizeof(void* (*)(void*)) + sizeof(void *); + /*struct ErlDrvTid_ *dtid; + + dtid = erts_alloc_fnf(ERTS_ALC_T_DRV_TID, + (sizeof(struct ErlDrvTid_) + + (name ? sys_strlen(name) + 1 : 0))); + if (!dtid) + return ENOMEM; + memset(dtid,0,sizeof(ErlDrvTid_)); + dtid->tid = (void * ) -1; + dtid->drv_thr = 1; + dtid->func = func; + dtid->arg = arg; + dtid->tsd = NULL; + dtid->tsd_len = 0; + dtid->name = no_name; + *tid = (ErlDrvTid) dtid; + */ + *tid = NULL; + /* Ignore options and name... */ + + memcpy(buff,&func,sizeof(void* (*)(void*))); + memcpy(buff + sizeof(void* (*)(void*)),&arg,sizeof(void *)); + write(erts_darwin_main_thread_pipe[1],buff,buff_sz); + return 0; +} + +#endif diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index bc940d2084..5f38d73359 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -53,6 +53,11 @@ #define WANT_NONBLOCKING /* must define this to pull in defs from sys.h */ #include "sys.h" +#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) +#define __DARWIN__ 1 +#endif + + #ifdef USE_THREADS #include "erl_threads.h" #endif @@ -2989,11 +2994,25 @@ init_smp_sig_notify(void) NULL, &thr_opts); } +#ifdef __DARWIN__ + +int erts_darwin_main_thread_pipe[2]; + +static void initialize_darwin_main_thread_pipe(void) +{ + if (pipe(erts_darwin_main_thread_pipe) < 0) { + erl_exit(1,"Fatal error initializing Darwin main thread stealing"); + } +} +#endif void erts_sys_main_thread(void) { erts_thread_disable_fpe(); +#ifdef __DARWIN__ + initialize_darwin_main_thread_pipe(); +#endif /* Become signal receiver thread... */ #ifdef ERTS_ENABLE_LOCK_CHECK erts_lc_set_thread_name("signal_receiver"); @@ -3002,6 +3021,27 @@ erts_sys_main_thread(void) smp_sig_notify(0); /* Notify initialized */ while (1) { /* Wait for a signal to arrive... */ +#ifdef __DARWIN__ + /* + * The wx driver needs to be able to steal the main thread for Cocoa to + * work properly. + */ + fd_set readfds; + int res; + + FD_ZERO(&readfds); + FD_SET(erts_darwin_main_thread_pipe[0], &readfds); + res = select(erts_darwin_main_thread_pipe[0] + 1, &readfds, NULL, NULL, NULL); + if (res > 0 && FD_ISSET(erts_darwin_main_thread_pipe[0],&readfds)) { + void* (*func)(void*); + void* arg; + void *resp; + read(erts_darwin_main_thread_pipe[0],&func,sizeof(void* (*)(void*))); + read(erts_darwin_main_thread_pipe[0],&arg, sizeof(void*)); + resp = (*func)(arg); + write(erts_darwin_main_thread_pipe[1],&resp,sizeof(void *)); + } +#else #ifdef DEBUG int res = #else @@ -3010,6 +3050,7 @@ erts_sys_main_thread(void) select(0, NULL, NULL, NULL, NULL); ASSERT(res < 0); ASSERT(errno == EINTR); +#endif } } diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 2a2ec1e40b..365fb691a1 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -78,6 +78,21 @@ extern void erts_thread_disable_fpe(void); } #endif +#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) +#define __DARWIN__ 1 +#endif + +#ifdef __DARWIN__ +extern "C" { + int erl_drv_stolen_main_thread_join(ErlDrvTid tid, void **respp); + int erl_drv_steal_main_thread(char *name, + ErlDrvTid *dtid, + void* (*func)(void*), + void* arg, + ErlDrvThreadOpts *opts); +} +#endif + void *wxe_main_loop(void * ); /* ************************************************************ @@ -99,8 +114,14 @@ int start_native_gui(wxe_data *sd) wxe_batch_locker_c = erl_drv_cond_create((char *)"wxe_batch_locker_c"); init_caller = driver_connected(sd->port); - if((res = erl_drv_thread_create((char *)"wxwidgets", - &wxe_thread,wxe_main_loop,(void *) sd->pdl,NULL)) == 0) { +#ifdef __DARWIN__ + res = erl_drv_steal_main_thread((char *)"wxwidgets", + &wxe_thread,wxe_main_loop,(void *) sd->pdl,NULL); +#else + res = erl_drv_thread_create((char *)"wxwidgets", + &wxe_thread,wxe_main_loop,(void *) sd->pdl,NULL); +#endif + if(res == 0) { erl_drv_mutex_lock(wxe_status_m); for(;wxe_status == WXE_NOT_INITIATED;) { erl_drv_cond_wait(wxe_status_c, wxe_status_m); @@ -120,7 +141,11 @@ void stop_native_gui(wxe_data *sd) if(wxe_status == WXE_INITIATED) { meta_command(WXE_SHUTDOWN, sd); } +#ifdef __DARWIN__ + erl_drv_stolen_main_thread_join(wxe_thread, NULL); +#else erl_drv_thread_join(wxe_thread, NULL); +#endif erl_drv_mutex_destroy(wxe_status_m); erl_drv_cond_destroy(wxe_status_c); erl_drv_mutex_destroy(wxe_batch_locker_m); @@ -205,7 +230,9 @@ void *wxe_main_loop(void *vpdl) /* We are done try to make a clean exit */ wxe_status = WXE_EXITED; driver_pdl_dec_refc(pdl); +#ifndef __DARWIN__ erl_drv_thread_exit(NULL); +#endif return NULL; } else { erl_drv_mutex_lock(wxe_status_m); diff --git a/lib/wx/c_src/wxe_ps_init.c b/lib/wx/c_src/wxe_ps_init.c index e787c214bd..a85f751024 100644 --- a/lib/wx/c_src/wxe_ps_init.c +++ b/lib/wx/c_src/wxe_ps_init.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2009. All Rights Reserved. + * Copyright Ericsson AB 2008-2011. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in -- cgit v1.2.3 From be3218dc1bf7dec1217bcac82492a5550da7ee17 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 2 Mar 2011 12:00:19 +0100 Subject: Fix dialyzer warning in os:start_port_srv_loop Rewrote the code a bit to silence dialyzer. Seems dialyzer can't handle a function that either returns or loops forever depending on function argument. --- lib/kernel/src/os.erl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl index ce8c581e08..95a2f71ec0 100644 --- a/lib/kernel/src/os.erl +++ b/lib/kernel/src/os.erl @@ -231,9 +231,13 @@ start_port_srv(Request) -> catch error:_ -> false end, - start_port_srv_loop(Request, StayAlive). + start_port_srv_handle(Request), + case StayAlive of + true -> start_port_srv_loop(); + false -> exiting + end. -start_port_srv_loop({Ref,Client}, StayAlive) -> +start_port_srv_handle({Ref,Client}) -> Reply = try open_port({spawn, ?SHELL},[stream]) of Port when is_port(Port) -> (catch port_connect(Port, Client)), @@ -243,20 +247,18 @@ start_port_srv_loop({Ref,Client}, StayAlive) -> error:Reason -> {Reason,erlang:get_stacktrace()} end, - Client ! {Ref,Reply}, - case StayAlive of - true -> start_port_srv_loop(get_open_port_request(), true); - false -> exiting - end. + Client ! {Ref,Reply}. -get_open_port_request() -> + +start_port_srv_loop() -> receive {Ref, Client} = Request when is_reference(Ref), is_pid(Client) -> - Request; + start_port_srv_handle(Request); _Junk -> - get_open_port_request() - end. + ignore + end, + start_port_srv_loop(). %% %% unix_get_data(Port) -> Result -- cgit v1.2.3 From c971c489dc8318ca4e92e9ba40d739dc4ee50982 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 2 Mar 2011 14:23:22 +0100 Subject: Remove race in main thread stealing due to reading and writing to pipe from same thread --- erts/emulator/beam/erl_drv_thread.c | 3 ++- erts/emulator/sys/unix/sys.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/erts/emulator/beam/erl_drv_thread.c b/erts/emulator/beam/erl_drv_thread.c index 08a35387f2..39bbe9633b 100644 --- a/erts/emulator/beam/erl_drv_thread.c +++ b/erts/emulator/beam/erl_drv_thread.c @@ -698,6 +698,7 @@ erl_drv_thread_join(ErlDrvTid tid, void **respp) #if defined(__DARWIN__) && defined(USE_THREADS) && defined(ERTS_SMP) extern int erts_darwin_main_thread_pipe[2]; +extern int erts_darwin_main_thread_result_pipe[2]; int @@ -709,7 +710,7 @@ erl_drv_stolen_main_thread_join(ErlDrvTid tid, void **respp) x = &dummy; else x = respp; - read(erts_darwin_main_thread_pipe[0],x,sizeof(void *)); + read(erts_darwin_main_thread_result_pipe[0],x,sizeof(void *)); return 0; } diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 5f38d73359..bafbbb0f6c 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -2997,10 +2997,12 @@ init_smp_sig_notify(void) #ifdef __DARWIN__ int erts_darwin_main_thread_pipe[2]; +int erts_darwin_main_thread_result_pipe[2]; -static void initialize_darwin_main_thread_pipe(void) +static void initialize_darwin_main_thread_pipes(void) { - if (pipe(erts_darwin_main_thread_pipe) < 0) { + if (pipe(erts_darwin_main_thread_pipe) < 0 || + pipe(erts_darwin_main_thread_result_pipe) < 0) { erl_exit(1,"Fatal error initializing Darwin main thread stealing"); } } @@ -3011,7 +3013,7 @@ erts_sys_main_thread(void) { erts_thread_disable_fpe(); #ifdef __DARWIN__ - initialize_darwin_main_thread_pipe(); + initialize_darwin_main_thread_pipes(); #endif /* Become signal receiver thread... */ #ifdef ERTS_ENABLE_LOCK_CHECK @@ -3039,7 +3041,7 @@ erts_sys_main_thread(void) read(erts_darwin_main_thread_pipe[0],&func,sizeof(void* (*)(void*))); read(erts_darwin_main_thread_pipe[0],&arg, sizeof(void*)); resp = (*func)(arg); - write(erts_darwin_main_thread_pipe[1],&resp,sizeof(void *)); + write(erts_darwin_main_thread_result_pipe[1],&resp,sizeof(void *)); } #else #ifdef DEBUG -- cgit v1.2.3 From 01873381c2288a12e93b4bdb13b68c8f80039988 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 2 Mar 2011 14:55:57 +0100 Subject: Update unavailable test case to do setup and teardown --- lib/os_mon/test/disksup_SUITE.erl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/os_mon/test/disksup_SUITE.erl b/lib/os_mon/test/disksup_SUITE.erl index 6e015ef74a..a3c6c7782d 100644 --- a/lib/os_mon/test/disksup_SUITE.erl +++ b/lib/os_mon/test/disksup_SUITE.erl @@ -41,10 +41,16 @@ end_per_suite(Config) when is_list(Config) -> ?line ok = application:stop(os_mon), Config. +init_per_testcase(unavailable, Config) -> + terminate(Config), + init_per_testcase(dummy, Config); init_per_testcase(_Case, Config) -> Dog = ?t:timetrap(?default_timeout), [{watchdog,Dog} | Config]. +end_per_testcase(unavailable, Config) -> + restart(Config), + end_per_testcase(dummy, Config); end_per_testcase(_Case, Config) -> Dog = ?config(watchdog, Config), ?t:timetrap_cancel(Dog), -- cgit v1.2.3 From 7c94e6f3a69462968cfd352fb40389454bd42e7e Mon Sep 17 00:00:00 2001 From: Imre Horvath Date: Tue, 14 Dec 2010 23:03:44 +0100 Subject: Add ISO week number calculation functions to the calendar module in stdlib This new feature adds the missing week number function to the calendar module of the stdlib application. The implementation conforms to the ISO 8601 standard. The new feature has been implemented tested and documented. --- lib/stdlib/doc/src/calendar.xml | 32 +++++++++++++++++++++++ lib/stdlib/src/calendar.erl | 53 ++++++++++++++++++++++++++++++++++++++ lib/stdlib/test/calendar_SUITE.erl | 22 +++++++++++++--- 3 files changed, 103 insertions(+), 4 deletions(-) diff --git a/lib/stdlib/doc/src/calendar.xml b/lib/stdlib/doc/src/calendar.xml index 36f0c03162..f90d8308b6 100644 --- a/lib/stdlib/doc/src/calendar.xml +++ b/lib/stdlib/doc/src/calendar.xml @@ -63,6 +63,14 @@ given as local time, they must be converted to universal time, in order to get the correct value of the elapsed time between epochs. Use of the function time_difference/2 is discouraged.

+

There exists different definitions for the week of the year. + The calendar module contains a week of the year implementation + which conforms to the ISO 8601 standard. Since the week number for + a given date can fall on the previous, the current or on the next + year it is important to provide the information which year is it + together with the week number. The function iso_week_number/0 + and iso_week_number/1 returns a tuple of the year and the + week number.

@@ -153,6 +161,30 @@ time() = {Hour, Minute, Second}

This function checks if a year is a leap year.

+ + iso_week_number() -> IsoWeekNumber + Compute the iso week number for the actual date + + IsoWeekNumber = {int(), int()} + + +

This function returns the tuple {Year, WeekNum} representing + the iso week number for the actual date. For determining the + actual date, the function local_time/0 is used.

+
+
+ + iso_week_number(Date) -> IsoWeekNumber + Compute the iso week number for the given date + + Date = date() + IsoWeekNumber = {int(), int()} + + +

This function returns the tuple {Year, WeekNum} representing + the iso week number for the given date.

+
+
last_day_of_the_month(Year, Month) -> int() Compute the number of days in a month diff --git a/lib/stdlib/src/calendar.erl b/lib/stdlib/src/calendar.erl index ddc0666f77..57b7c28dee 100644 --- a/lib/stdlib/src/calendar.erl +++ b/lib/stdlib/src/calendar.erl @@ -28,6 +28,8 @@ gregorian_days_to_date/1, gregorian_seconds_to_datetime/1, is_leap_year/1, + iso_week_number/0, + iso_week_number/1, last_day_of_the_month/2, local_time/0, local_time_to_universal_time/1, @@ -70,6 +72,7 @@ -type second() :: 0..59. -type daynum() :: 1..7. -type ldom() :: 28 | 29 | 30 | 31. % last day of month +-type weeknum() :: 1..53. -type t_now() :: {non_neg_integer(),non_neg_integer(),non_neg_integer()}. @@ -77,6 +80,7 @@ -type t_time() :: {hour(),minute(),second()}. -type t_datetime() :: {t_date(),t_time()}. -type t_datetime1970() :: {{year1970(),month(),day()},t_time()}. +-type t_yearweeknum() :: {year(),weeknum()}. %%---------------------------------------------------------------------- @@ -172,6 +176,42 @@ is_leap_year1(Year) when Year rem 400 =:= 0 -> is_leap_year1(_) -> false. +%% +%% Calculates the iso week number for the current date. +%% +-spec iso_week_number() -> t_yearweeknum(). +iso_week_number() -> + {Date, _} = local_time(), + iso_week_number(Date). + + +%% +%% Calculates the iso week number for the given date. +%% +-spec iso_week_number(t_date()) -> t_yearweeknum(). +iso_week_number({Year, Month, Day}) -> + D = date_to_gregorian_days({Year, Month, Day}), + W01_1_Year = gregorian_days_of_iso_w01_1(Year), + W01_1_NextYear = gregorian_days_of_iso_w01_1(Year + 1), + if W01_1_Year =< D andalso D < W01_1_NextYear -> + % Current Year Week 01..52(,53) + {Year, (D - W01_1_Year) div 7 + 1}; + D < W01_1_Year -> + % Previous Year 52 or 53 + PWN = case day_of_the_week(Year - 1, 1, 1) of + 4 -> 53; + _ -> case day_of_the_week(Year - 1, 12, 31) of + 4 -> 53; + _ -> 52 + end + end, + {Year - 1, PWN}; + W01_1_NextYear =< D -> + % Next Year, Week 01 + {Year + 1, 1} + end. + + %% last_day_of_the_month(Year, Month) %% %% Returns the number of days in a month. @@ -377,6 +417,19 @@ dty(Y, D1, D2) when D1 < D2 -> dty(Y, _D1, D2) -> {Y, D2}. +%% +%% The Gregorian days of the iso week 01 day 1 for a given year. +%% +-spec gregorian_days_of_iso_w01_1(year()) -> non_neg_integer(). +gregorian_days_of_iso_w01_1(Year) -> + D0101 = date_to_gregorian_days(Year, 1, 1), + DOW = day_of_the_week(Year, 1, 1), + if DOW =< 4 -> + D0101 - DOW + 1; + true -> + D0101 + 7 - DOW + 1 + end. + %% year_day_to_date(Year, DayOfYear) = {Month, DayOfMonth} %% %% Note: 1 is the first day of the month. diff --git a/lib/stdlib/test/calendar_SUITE.erl b/lib/stdlib/test/calendar_SUITE.erl index 81b0299118..8192d035ca 100644 --- a/lib/stdlib/test/calendar_SUITE.erl +++ b/lib/stdlib/test/calendar_SUITE.erl @@ -28,7 +28,8 @@ day_of_the_week_calibrate/1, leap_years/1, last_day_of_the_month/1, - local_time_to_universal_time_dst/1]). + local_time_to_universal_time_dst/1, + iso_week_number/1]). -define(START_YEAR, 1947). -define(END_YEAR, 2012). @@ -38,7 +39,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [gregorian_days, gregorian_seconds, day_of_the_week, day_of_the_week_calibrate, leap_years, - last_day_of_the_month, local_time_to_universal_time_dst]. + last_day_of_the_month, local_time_to_universal_time_dst, iso_week_number]. groups() -> []. @@ -55,7 +56,6 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. - gregorian_days(doc) -> "Tests that date_to_gregorian_days and gregorian_days_to_date " "are each others inverses from ?START_YEAR-01-01 up to ?END_YEAR-01-01. " @@ -170,6 +170,15 @@ local_time_to_universal_time_dst_x(Config) when is_list(Config) -> {comment,"Bug in mktime() in this OS"} end. +iso_week_number(doc) -> + "Test the iso week number calculation for all three possibilities." + " When the date falls on the last week of the previous year," + " when the date falls on a week within the given year and finally," + " when the date falls on the first week of the next year."; +iso_week_number(suite) -> + []; +iso_week_number(Config) when is_list(Config) -> + ?line check_iso_week_number(). %% %% LOCAL FUNCTIONS @@ -259,7 +268,12 @@ check_last_day_of_the_month({SYr, SMon}, {EYr, EMon}) when SYr < EYr -> check_last_day_of_the_month(_, _) -> ok. - +%% check_iso_week_number +%% +check_iso_week_number() -> + ?line {2004, 53} = calendar:iso_week_number({2005, 1, 1}), + ?line {2007, 1} = calendar:iso_week_number({2007, 1, 1}), + ?line {2009, 1} = calendar:iso_week_number({2008, 12, 29}). -- cgit v1.2.3 From 24c45e5d18eafbc8fc85b0c49622980dac3f6fe2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 2 Mar 2011 16:23:04 +0100 Subject: * On some windows machines dirs seem to vanish sometime between the call to init_per_testcase (when they are created) and the call to the actual test case (when they are used). * Try to handle systems where crypto is not built better. This *is* handled by application, but the test case snmp_app_test:undef_funcs could do a better job (which it hopefully does now :). --- lib/snmp/test/snmp_app_test.erl | 44 ++++++++++-- lib/snmp/test/snmp_manager_config_test.erl | 105 +++++++++++++++++++---------- 2 files changed, 106 insertions(+), 43 deletions(-) diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index 64dd638f83..27a7b4af2e 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -300,6 +300,25 @@ undef_funcs(Config) when is_list(Config) -> xref:stop(XRef), analyze_undefined_function_calls(Undefs, Mods, []). +valid_undef(crypto = CalledMod) -> + case (catch CalledMod:version()) of + Version when is_list(Version) -> + %% The called module was crypto and the version + %% function returns a valid value. + %% This means that the function is + %% actually undefined... + true; + _ -> + %% The called module was crypto but the version + %% function does *not* return a valid value. + %% This means the crypto was not actually not + %% build, which is an case snmp handles. + false + end; +valid_undef(_) -> + true. + + analyze_undefined_function_calls([], _, []) -> ok; analyze_undefined_function_calls([], _, AppUndefs) -> @@ -312,14 +331,25 @@ analyze_undefined_function_calls([{{Mod, _F, _A}, _C} = AppUndef|Undefs], {Calling,Called} = AppUndef, {Mod1,Func1,Ar1} = Calling, {Mod2,Func2,Ar2} = Called, - io:format("undefined function call: " - "~n ~w:~w/~w calls ~w:~w/~w~n", - [Mod1,Func1,Ar1,Mod2,Func2,Ar2]), - analyze_undefined_function_calls(Undefs, AppModules, - [AppUndef|AppUndefs]); + %% If the called module is crypto, then we will *not* + %% fail if crypto is not built (since crypto is actually + %% not built for all platforms) + case valid_undef(Mod2) of + true -> + io:format("undefined function call: " + "~n ~w:~w/~w calls ~w:~w/~w~n", + [Mod1,Func1,Ar1,Mod2,Func2,Ar2]), + analyze_undefined_function_calls( + Undefs, AppModules, [AppUndef|AppUndefs]); + false -> + io:format("skipping ~p (calling ~w:~w/~w)~n", + [Mod, Mod2, Func2, Ar2]), + analyze_undefined_function_calls(Undefs, + AppModules, AppUndefs) + end; false -> - io:format("dropping ~p~n", [Mod]), - analyze_undefined_function_calls(Undefs, AppModules, AppUndefs) + io:format("dropping ~p~n", [Mod]), + analyze_undefined_function_calls(Undefs, AppModules, AppUndefs) end. %% This function is used simply to avoid cut-and-paste errors later... diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index a72dd0cc22..e38a99d413 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -169,36 +169,41 @@ all() -> groups() -> [{start_and_stop, [], - [simple_start_and_stop, start_without_mandatory_opts1, - start_without_mandatory_opts2, - start_with_all_valid_opts, start_with_unknown_opts, - start_with_incorrect_opts, - start_with_invalid_manager_conf_file1, - start_with_invalid_users_conf_file1, - start_with_invalid_agents_conf_file1, - start_with_invalid_usm_conf_file1]}, - {normal_op, [], - [{group, system}, {group, agents}, {group, users}, - {group, usm_users}, {group, counter}, - {group, stats_counter}]}, - {system, [], [simple_system_op]}, - {users, [], - [register_user_using_file, register_user_using_function, - register_user_failed_using_function1]}, - {agents, [], - [register_agent_using_file, - register_agent_using_function, - register_agent_failed_using_function1]}, - {usm_users, [], - [register_usm_user_using_file, - register_usm_user_using_function, - register_usm_user_failed_using_function1, - update_usm_user_info]}, - {counter, [], [create_and_increment]}, - {stats_counter, [], [stats_create_and_increment]}, - {tickets, [], [otp_7219, {group, otp_8395}]}, - {otp_8395, [], - [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. + [simple_start_and_stop, + start_without_mandatory_opts1, + start_without_mandatory_opts2, + start_with_all_valid_opts, start_with_unknown_opts, + start_with_incorrect_opts, + start_with_invalid_manager_conf_file1, + start_with_invalid_users_conf_file1, + start_with_invalid_agents_conf_file1, + start_with_invalid_usm_conf_file1]}, + {normal_op, [], + [{group, system}, + {group, agents}, + {group, users}, + {group, usm_users}, + {group, counter}, + {group, stats_counter}]}, + {system, [], [simple_system_op]}, + {users, [], + [register_user_using_file, + register_user_using_function, + register_user_failed_using_function1]}, + {agents, [], + [register_agent_using_file, + register_agent_using_function, + register_agent_failed_using_function1]}, + {usm_users, [], + [register_usm_user_using_file, + register_usm_user_using_function, + register_usm_user_failed_using_function1, + update_usm_user_info]}, + {counter, [], [create_and_increment]}, + {stats_counter, [], [stats_create_and_increment]}, + {tickets, [], [otp_7219, {group, otp_8395}]}, + {otp_8395, [], + [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. init_per_group(_GroupName, Config) -> Config. @@ -816,7 +821,10 @@ start_with_invalid_users_conf_file1(Conf) when is_list(Conf) -> p("start"), process_flag(trap_exit, true), ConfDir = ?config(manager_conf_dir, Conf), - DbDir = ?config(manager_db_dir, Conf), + DbDir = ?config(manager_db_dir, Conf), + + verify_dir_existing(conf, ConfDir), + verify_dir_existing(db, DbDir), Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], @@ -917,7 +925,10 @@ start_with_invalid_agents_conf_file1(Conf) when is_list(Conf) -> p("start"), process_flag(trap_exit, true), ConfDir = ?config(manager_conf_dir, Conf), - DbDir = ?config(manager_db_dir, Conf), + DbDir = ?config(manager_db_dir, Conf), + + verify_dir_existing(conf, ConfDir), + verify_dir_existing(db, DbDir), Opts = [{versions, [v1]}, {config, [{verbosity, trace}, {dir, ConfDir}, {db_dir, DbDir}]}], @@ -2022,7 +2033,6 @@ register_usm_user_using_file(Conf) when is_list(Conf) -> %% -- p("done"), ok. -%% ?SKIP(not_yet_implemented). %% @@ -2651,9 +2661,21 @@ write_usm_conf2(Dir, Str) -> write_conf_file(Dir, File, Str) -> - ?line {ok, Fd} = file:open(filename:join(Dir, File), write), - ?line ok = io:format(Fd, "~s", [Str]), - file:close(Fd). + case file:open(filename:join(Dir, File), write) of + {ok, Fd} -> + ?line ok = io:format(Fd, "~s", [Str]), + file:close(Fd); + {error, Reason} -> + Info = + [{dir, Dir, case (catch file:read_file_info(Dir)) of + {ok, FI} -> + FI; + _ -> + undefined + end}, + {file, File}], + exit({failed_writing_conf_file, Info, Reason}) + end. maybe_start_crypto() -> @@ -2677,6 +2699,17 @@ maybe_stop_crypto() -> end. +%% ------ + +verify_dir_existing(DirName, Dir) -> + case file:read_file_info(Dir) of + {ok, _} -> + ok; + {error, Reason} -> + exit({non_existing_dir, DirName, Dir, Reason}) + end. + + %% ------ str(X) -> -- cgit v1.2.3 From 748dbeb1524122229373c5964334a8d8f18a525d Mon Sep 17 00:00:00 2001 From: Christian von Roques Date: Wed, 15 Dec 2010 17:36:09 -0400 Subject: inets/httpc: Polish documentation * Assure store_cookies (and verify_cookies) is documented instead of the nonexistent store_cookie and verify_cookie. * Make sure the cookies option is not called cookie in comments. * Sprinkle ... arround symbols and code snippets in text. * Grammar, wording, and punctuation fixes. * Formalize See gen_tcp:connect/3,4 using . --- lib/inets/doc/src/http_client.xml | 8 ++-- lib/inets/doc/src/httpc.xml | 88 ++++++++++++++++++------------------- lib/inets/src/http_client/httpc.erl | 2 +- lib/kernel/doc/src/gen_tcp.xml | 1 + 4 files changed, 50 insertions(+), 49 deletions(-) diff --git a/lib/inets/doc/src/http_client.xml b/lib/inets/doc/src/http_client.xml index 672ea3fa98..4542211d71 100644 --- a/lib/inets/doc/src/http_client.xml +++ b/lib/inets/doc/src/http_client.xml @@ -42,10 +42,10 @@ dynamically in runtime. Each client profile will spawn a new process to handle each request unless there is a possibility to use a persistent connection with or without pipelining. - The client will add a host header and an empty - te header if there are no such headers present in the request.

+ The client will add a host header and an empty + te header if there are no such headers present in the request.

-

The clients supports ipv6 as long as the underlying mechanisms also do +

The client supports ipv6 as long as the underlying mechanisms also do so.

@@ -87,7 +87,7 @@ httpc:request("http://www.erlang.org").

An ordinary asynchronous request. The result will be sent - to the calling process on the form {http, {ReqestId, Result}}

+ to the calling process in the form {http, {ReqestId, Result}}

5 > {ok, RequestId} = httpc:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]). diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 69e1009bc2..5d1f027e24 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -117,7 +117,7 @@ ssl_options() = {verify, code()} | application or started dynamically in runtime by calling the inets application API inets:start(httpc, ServiceConfig), or inets:start(httpc, ServiceConfig, How) - see inets(3) Below follows a + see inets(3). Below follows a description of the available configuration options.

{profile, profile()} @@ -129,8 +129,8 @@ ssl_options() = {verify, code()} | as session cookies.
-

The client can be stopped using inets:stop(httpc, Pid) or - inets:stop(httpc, Profile).

+

The client can be stopped using inets:stop(httpc, Pid) or + inets:stop(httpc, Profile).

@@ -148,7 +148,7 @@ ssl_options() = {verify, code()} | Reason = term() -

Equivalent to httpc:request(get, {Url, []}, [], []).

+

Equivalent to httpc:request(get, {Url, []}, [], []).

@@ -201,7 +201,7 @@ ssl_options() = {verify, code()} |

Sends a HTTP-request. The function can be both synchronous and asynchronous. In the later case the function will return - {ok, RequestId} and later on the information will be delivered + {ok, RequestId} and later on the information will be delivered to the receiver depending on that value.

Http option (http_option()) details:

@@ -267,12 +267,12 @@ ssl_options() = {verify, code()} | HTTP/0.9 client. By default this is an HTTP/1.1 client. When using HTTP/1.0 persistent connections will not be used.

-

Defaults to the trsing "HTTP/1.1".

+

Defaults to the string "HTTP/1.1".

-

If set to true workarounds for known server deviations from +

If set to true workarounds for known server deviations from the HTTP-standard are enabled.

Defaults to false.

@@ -297,20 +297,20 @@ ssl_options() = {verify, code()} |

Streams the body of a 200 or 206 response to the calling process or to a file. When streaming to the calling process using the option self the following stream messages - will be sent to that process: {http, {RequestId, + will be sent to that process: {http, {RequestId, stream_start, Headers}, {http, {RequestId, stream, - BinBodyPart}, {http, {RequestId, stream_end, Headers}. When - streaming to the calling processes using the option + BinBodyPart}, {http, {RequestId, stream_end, Headers}. When + streaming to to the calling processes using the option {self, once} the first message will have an additional - element e.i. {http, {RequestId, stream_start, Headers, Pid}, + element e.i. {http, {RequestId, stream_start, Headers, Pid}, this is the process id that should be used as an argument to - http:stream_next/1 to trigger the next message to be sent to + http:stream_next/1 to trigger the next message to be sent to the calling process.

Note that it is possible that chunked encoding will add - headers so that there are more headers in the stream_end - message than in the stream_start. + headers so that there are more headers in the stream_end + message than in the stream_start. When streaming to a file and the request is asynchronous the - message {http, {RequestId, saved_to_file}} will be sent.

+ message {http, {RequestId, saved_to_file}} will be sent.

Defaults to none.

@@ -358,13 +358,13 @@ ssl_options() = {verify, code()} | request handler.

By default the socket options set by the set_options/1,2 - function are used when establishing the connection.

+ function are used when establishing a connection.

-

Defines how the client will deliver the result for an - asynchronous request (sync has the value +

Defines how the client will deliver the result of an + asynchroneous request (sync has the value false).

@@ -395,7 +395,7 @@ apply(Module, Function, [ReplyInfo | Args])
-

In all cases above, ReplyInfo has the following +

In all of the above cases, ReplyInfo has the following structure:

@@ -470,46 +470,46 @@ apply(Module, Function, [ReplyInfo | Args])
         IpDesc = string()
         ex: "134.138" or "[FEDC:BA98" (all IP-addresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP-address).
         MaxSessions = integer() 
-        Default is 2. 
+        Default is 2.
           Maximum number of persistent connections to a host.
 	MaxKeepAlive = integer() 
-        Default is 5. 
+        Default is 5.
           Maximum number of outstanding requests on the same connection to 
           a host.
         KeepAliveTimeout = integer() 
-        Default is 120000 (= 2 min). 
+        Default is 120000 (= 2 min).
           If a persistent connection is idle longer than the 
-          keep_alive_timeout the client will close the connection. 
-          The server may also have such a timeout but you should
+          keep_alive_timeout the client will close the connection.
+          The server may also have such a time out but you should
           not count on it!
 	MaxPipeline = integer() 
-        Default is 2. 
+        Default is 2.
           Maximum number of outstanding requests on a pipelined connection to a host.
         PipelineTimeout = integer() 
-        Default is 0, 
+        Default is 0,
           which will result in pipelining not being used. 
           If a persistent connection is idle longer than the 
-          pipeline_timeout the client will close the connection. 
+          pipeline_timeout the client will close the connection. 
         CookieMode = enabled | disabled | verify 
-        Default is disabled. 
+        Default is disabled.
           If Cookies are enabled all valid cookies will automatically be 
           saved in the client manager's cookie database. 
-          If the option verify is used the function http:verify_cookie/2 
-          has to be called for the cookie to be saved.
+          If the option verify is used the function store_cookies/2
+          has to be called for the cookies to be saved.
         IpFamily = inet | inet6 | inet6fb4 
-        By default inet. 
+        By default inet.
           When it is set to inet6fb4 you can use both ipv4 and ipv6. 
           It first tries inet6 and if that does not works falls back to inet. 
           The option is here to provide a workaround for buggy ipv6 stacks to ensure that 
           ipv4 will always work.
 	IpAddress = ip_address() 
         If the host has several network interfaces, this option specifies which one to use. 
-          See gen_tcp:connect/3,4 for more info. 
+          See gen_tcp:connect/3,4 for more info. 
 	Port = integer() 
         Specify which local port number to use. 
-          See gen_tcp:connect/3,4 for more info. 
+          See gen_tcp:connect/3,4 for more info. 
         VerboseMode = false | verbose | debug | trace 
-        Default is false. 
+        Default is false.
           This option is used to switch on (or off) 
           different levels of erlang trace on the client. 
           It is a debug feature.
@@ -523,14 +523,14 @@ apply(Module, Function, [ReplyInfo | Args])
             alive and use persistent connections
 	    with  or without pipeline depending on configuration
 	    and current circumstances. The HTTP/1.1 specification does not
-            provide a guideline for how many requests that would be
+            provide a guideline for how many requests would be
             ideal to be sent on a persistent connection,
 	    this very much depends on the
             application. Note that a very long queue of requests may cause a
             user perceived delay as earlier requests may take a long time
             to complete. The HTTP/1.1 specification does suggest a
             limit of 2 persistent connections per server, which is the
-            default value of the max_sessions option. 

+ default value of the max_sessions option.

@@ -549,14 +549,14 @@ apply(Module, Function, [ReplyInfo | Args])

Triggers the next message to be streamed, e.i. same behavior as active once for sockets.

- - + + - store_cookie(SetCookieHeaders, Url) -> - store_cookie(SetCookieHeaders, Url, Profile) -> ok | {error, Reason} + store_cookies(SetCookieHeaders, Url) -> + store_cookies(SetCookieHeaders, Url, Profile) -> ok | {error, Reason} Saves the cookies defined in SetCookieHeaders in the client profile's cookie database. SetCookieHeaders = headers() - where field = "set-cookie" @@ -566,7 +566,7 @@ apply(Module, Function, [ReplyInfo | Args])

Saves the cookies defined in SetCookieHeaders in the client profile's cookie database. You need to - call this function if you set the option cookies to verify. + call this function if you have set the option cookies to verify. If no profile is specified the default profile will be used.

@@ -578,14 +578,14 @@ apply(Module, Function, [ReplyInfo | Args]) cookie_header(Url) -> cookie_header(Url, Profile) -> header() | {error, Rason} Returns the cookie header that would be sent when - making a request to Url using the profile Profile. + making a request to Url using the profile Profile. Url = url() Profile = profile()

Returns the cookie header that would be sent - when making a request to Url using the profile Profile. + when making a request to Url using the profile Profile. If no profile is specified the default profile will be used.

@@ -602,7 +602,7 @@ apply(Module, Function, [ReplyInfo | Args]) Profile = profile()
-

Resets (clears) the cookie database for the specified Profile. +

Resets (clears) the cookie database for the specified Profile. If no profile is specified the default profile will be used.

diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index ae754fab94..04fae13b20 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -252,7 +252,7 @@ set_option(Key, Value, Profile) -> %% Description: Store the cookies from %% in the cookie database %% for the profile . This function shall be used when the option -%% cookie is set to verify. +%% cookies is set to verify. %%------------------------------------------------------------------------- store_cookies(SetCookieHeaders, Url) -> store_cookies(SetCookieHeaders, Url, default_profile()). diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index 8e7192a496..aa171c77c2 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -74,6 +74,7 @@ posix() socket() as returned by accept/1,2 and connect/3,4
+
-- cgit v1.2.3 From e38a935df26ca0f37fa17c6df771430de18f9043 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 9 Jan 2011 18:09:29 +0100 Subject: Fix typo in httpc documentation --- lib/inets/doc/src/httpc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 5d1f027e24..bcdd2913e0 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -576,7 +576,7 @@ apply(Module, Function, [ReplyInfo | Args]) cookie_header(Url) -> - cookie_header(Url, Profile) -> header() | {error, Rason} + cookie_header(Url, Profile) -> header() | {error, Reason} Returns the cookie header that would be sent when making a request to Url using the profile Profile. -- cgit v1.2.3 From 92b2fd6b18d052cd49e8921626ad0abbcedc0b0b Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 3 Mar 2011 18:32:59 +0100 Subject: Added documentation file (snmpc_cmd.xml) for the snmpc command line tool. Also updated the central .gitignore file. --- .gitignore | 1 + lib/snmp/doc/src/snmpc_cmd.xml | 191 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 lib/snmp/doc/src/snmpc_cmd.xml diff --git a/.gitignore b/.gitignore index 54bfadea9a..0bd5e1ff2c 100644 --- a/.gitignore +++ b/.gitignore @@ -303,6 +303,7 @@ make/win32/ # snmp /lib/snmp/bin/snmp-v2tov1 +/lib/snmp/bin/snmpc /lib/snmp/examples/ex1/EX1-MIB.bin /lib/snmp/mibs/Makefile /lib/snmp/mibs/v1/OTP-SNMPEA-MIB.mib.v1 diff --git a/lib/snmp/doc/src/snmpc_cmd.xml b/lib/snmp/doc/src/snmpc_cmd.xml new file mode 100644 index 0000000000..18ff71631c --- /dev/null +++ b/lib/snmp/doc/src/snmpc_cmd.xml @@ -0,0 +1,191 @@ + + + + +
+ + 20112011 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + snmpc + + + + + + + + snmpc_cmd.xml +
+ snmpc + SNMP MIB compiler frontend + +

The program provides a way to run + the SNMP MIB compiler of the Erlang system.

+
+ + + + snmpc [options] file.mib | file.bin + Compile MIBs + +

compile a SNMP MIB file, + see compile/1,2 for + more info.

+

It can also be used to generate a header file (.hrl) + with definitions of Erlang constants for the objects in + the MIB, see + mib_to_hrl/1.

+
+
+
+ +
+ Compiler options +

The following options are supported (note that most of these relate + to the compilation of the MIB file):

+ + --help + +

Prints help info.

+
+ + --version + +

Prints application and mib format version.

+
+ + --verbosity verbosity + +

Print debug info.

+

verbosity = trace | debug | log | info | silence

+

Defaults to silence.

+
+ + --warnings + +

Print warning messages.

+
+ + --o directory + +

The directory where the compiler should place the output files. + If not specified, output files will be placed in the current working + directory.

+
+ + --i Directory + +

Specifies the path to search for imported (compiled) MIB files. + By default, the current working directory is always included.

+

This option can be present several times, each time specifying + one path.

+
+ + --il Directory + +

This option (include_lib), specifies a list of directories to + search for imported MIBs. It assumes that the first element in + the directory name corresponds to an OTP application. The compiler + will find the current installed version. For example, the value + ["snmp/mibs/"] will be replaced by ["snmp-3.1.1/mibs/"] (or what + the current version may be in the system). The current directory + and the "snmp-home"/priv/mibs/ are always listed last in the + include path.

+
+ + --sgc + +

This option (skip group check), if present, disables the + group check of the mib compiler. + That is, should the OBJECT-GROUP and the NOTIFICATION-GROUP + macro(s) be checked for correctness or not.

+
+ + --dep + +

Keep deprecated definition(s). + If not specified the compiler will ignore deprecated definitions.

+
+ + --desc + +

The DESCRIPTION field will be included.

+
+ + --ref + +

The REFERENCE field will be included.

+
+ + --imp + +

The IMPORTS field will be included.

+
+ + --mi + +

The MODULE-IDENTITY field will be included.

+
+ + --mc + +

The MODULE-COMPLIANCE field will be included.

+
+ + --ac + +

The AGENT-CAPABILITIES field will be included.

+
+ + --mod module + +

The module which implements all the instrumentation functions.

+

The name of all instrumentation functions must be the + same as the corresponding managed object it implements.

+
+ + --nd + +

The default instrumentation functions will not be + used if a managed object have no instrumentation function. + Instead this will be reported as an error, and the compilation + aborts.

+
+ + --rrnac + +

This option, if present, specifies that the row name assign check + shall not be done strictly according to the SMI (which allows only + the value 1).

+

With this option, all values greater than zero is allowed (>= 1). + This means that the error will be converted to a warning.

+

By default it is not included, but if this option is present + it will be.

+
+ +
+
+ +
+ SEE ALSO +

erlc(1), + compile(3), + snmpc(3)

+
+
+ -- cgit v1.2.3