From c4375a62cfaabfd8de757f59714623ba1a8cb915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 19 Oct 2012 12:07:01 +0200 Subject: compiler: Run testcases in parallel Run testcases in parallel will make the test suite run slightly faster. Another reason for this change is that we want more testing of parallel testcase support in common_test. --- lib/compiler/test/andor_SUITE.erl | 7 +++--- lib/compiler/test/beam_validator_SUITE.erl | 19 +++++++------- lib/compiler/test/bs_bit_binaries_SUITE.erl | 12 +++++---- lib/compiler/test/bs_construct_SUITE.erl | 10 +++++--- lib/compiler/test/bs_match_SUITE.erl | 24 ++++++++++-------- lib/compiler/test/compilation_SUITE.erl | 39 ++++++++++++++++------------- lib/compiler/test/core_SUITE.erl | 8 +++--- lib/compiler/test/core_fold_SUITE.erl | 8 +++--- lib/compiler/test/error_SUITE.erl | 19 ++++++++------ lib/compiler/test/guard_SUITE.erl | 19 +++++++------- lib/compiler/test/inline_SUITE.erl | 31 ++++++++++++----------- lib/compiler/test/match_SUITE.erl | 8 +++--- lib/compiler/test/misc_SUITE.erl | 7 +++--- lib/compiler/test/receive_SUITE.erl | 6 +++-- lib/compiler/test/record_SUITE.erl | 10 +++++--- lib/compiler/test/test_lib.erl | 15 ++++++++++- lib/compiler/test/trycatch_SUITE.erl | 12 +++++---- lib/compiler/test/warnings_SUITE.erl | 14 ++++++----- 18 files changed, 157 insertions(+), 111 deletions(-) (limited to 'lib') diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl index f7388f1614..fe69aeeb43 100644 --- a/lib/compiler/test/andor_SUITE.erl +++ b/lib/compiler/test/andor_SUITE.erl @@ -29,11 +29,12 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [t_case, t_and_or, t_andalso, t_orelse, inside, overlap, - combined, in_case, before_and_inside_if]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [t_case,t_and_or,t_andalso,t_orelse,inside,overlap, + combined,in_case,before_and_inside_if]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/beam_validator_SUITE.erl b/lib/compiler/test/beam_validator_SUITE.erl index 902867bc19..c84c83795a 100644 --- a/lib/compiler/test/beam_validator_SUITE.erl +++ b/lib/compiler/test/beam_validator_SUITE.erl @@ -47,17 +47,18 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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]. + [beam_files,{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [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]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/bs_bit_binaries_SUITE.erl b/lib/compiler/test/bs_bit_binaries_SUITE.erl index 30276f1259..897b4769f1 100644 --- a/lib/compiler/test/bs_bit_binaries_SUITE.erl +++ b/lib/compiler/test/bs_bit_binaries_SUITE.erl @@ -34,13 +34,15 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [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]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index a393aaeffd..4ea5235bb6 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -36,12 +36,14 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [two, test1, fail, float_bin, in_guard, in_catch, - nasty_literals, side_effect, opt, otp_7556, float_arith, - otp_8054]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [two,test1,fail,float_bin,in_guard,in_catch, + nasty_literals,side_effect,opt,otp_7556,float_arith, + otp_8054]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 0e9d0bbc17..1bef409be0 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -44,19 +44,21 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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, matched_out_size]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [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,matched_out_size]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl index 34f105b5fc..bec97b0199 100644 --- a/lib/compiler/test/compilation_SUITE.erl +++ b/lib/compiler/test/compilation_SUITE.erl @@ -28,26 +28,29 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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, - {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,split_cases]. + [self_compile_old_inliner,self_compile, + {group,p}]. groups() -> - [{vsn, [], [vsn_1, vsn_2, vsn_3]}]. + [{vsn,[parallel],[vsn_1,vsn_2,vsn_3]}, + {p,test_lib:parallel(), + [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,split_cases]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl index 06185bfc34..a40dc32d59 100644 --- a/lib/compiler/test/core_SUITE.erl +++ b/lib/compiler/test/core_SUITE.erl @@ -43,11 +43,13 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [dehydrated_itracer,nested_tries,seq_in_guard,make_effect_seq, - eval_is_boolean,unsafe_case,nomatch_shadow,reversed_annos]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [dehydrated_itracer,nested_tries,seq_in_guard,make_effect_seq, + eval_is_boolean,unsafe_case,nomatch_shadow,reversed_annos]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 54bd52947e..2adc71c237 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -31,11 +31,13 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [t_element, setelement, t_length, append, t_apply, bifs, - eq, nested_call_in_case, guard_try_catch, coverage]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [t_element,setelement,t_length,append,t_apply,bifs, + eq,nested_call_in_case,guard_try_catch,coverage]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl index e798023cd8..859c4571ea 100644 --- a/lib/compiler/test/error_SUITE.erl +++ b/lib/compiler/test/error_SUITE.erl @@ -32,10 +32,11 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [head_mismatch_line, warnings_as_errors, bif_clashes, transforms]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [head_mismatch_line,warnings_as_errors,bif_clashes,transforms]}]. init_per_suite(Config) -> Config. @@ -282,12 +283,14 @@ filter(X) -> %% Compiles a test module and returns the list of errors and warnings. test_filename(Conf) -> - Filename = "errors_test.erl", + Filename = ["errors_test_",test_lib:uniq(),".erl"], DataDir = ?config(priv_dir, Conf), filename:join(DataDir, Filename). run_test(Test0, File, Warnings, WriteBeam) -> - ?line Test = ["-module(errors_test). ", Test0], + ModName = filename:rootname(filename:basename(File), ".erl"), + Mod = list_to_atom(ModName), + Test = ["-module(",ModName,"). ",Test0], ?line Opts = case WriteBeam of dont_write_beam -> [binary,return_errors|Warnings]; @@ -301,17 +304,17 @@ run_test(Test0, File, Warnings, WriteBeam) -> %% Test result of compilation. ?line Res = case compile:file(File, Opts) of - {ok,errors_test,_,[{_File,Ws}]} -> + {ok,Mod,_,[{_File,Ws}]} -> %io:format("compile:file(~s,~p) ->~n~p~n", % [File,Opts,Ws]), {warning,Ws}; - {ok,errors_test,_,[]} -> + {ok,Mod,_,[]} -> %io:format("compile:file(~s,~p) ->~n~p~n", % [File,Opts,Ws]), []; - {ok,errors_test,[{_File,Ws}]} -> + {ok,Mod,[{_File,Ws}]} -> {warning,Ws}; - {ok,errors_test,[]} -> + {ok,Mod,[]} -> []; {error,[{XFile,Es}],Ws} = _ZZ when is_list(XFile) -> %io:format("compile:file(~s,~p) ->~n~p~n", diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 40711783ed..66c0b9a295 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -39,17 +39,18 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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, - bad_constants]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [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, + bad_constants]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl index 2e17d3fde6..e2eb6a0dec 100644 --- a/lib/compiler/test/inline_SUITE.erl +++ b/lib/compiler/test/inline_SUITE.erl @@ -32,17 +32,22 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [attribute, bsdecode, bsdes, barnes2, decode1, smith, - itracer, pseudoknot, comma_splitter, lists, really_inlined, otp_7223, - coverage]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [attribute,bsdecode,bsdes,barnes2,decode1,smith, + itracer,pseudoknot,comma_splitter,lists,really_inlined,otp_7223, + coverage]}]. init_per_suite(Config) -> - Config. + Pa = "-pa " ++ filename:dirname(code:which(?MODULE)), + {ok,Node} = start_node(compiler, Pa), + [{testing_node,Node}|Config]. -end_per_suite(_Config) -> +end_per_suite(Config) -> + Node = ?config(testing_node, Config), + ?t:stop_node(Node), ok. init_per_group(_GroupName, Config) -> @@ -81,6 +86,7 @@ attribute(Config) when is_list(Config) -> ?comp(comma_splitter). try_inline(Mod, Config) -> + Node = ?config(testing_node, Config), ?line Src = filename:join(?config(data_dir, Config), atom_to_list(Mod)), ?line Out = ?config(priv_dir,Config), @@ -89,8 +95,6 @@ try_inline(Mod, Config) -> ?line {ok,Mod} = compile:file(Src, [{outdir,Out},report,bin_opt_info,clint]), ?line Dog = test_server:timetrap(test_server:minutes(10)), - ?line Pa = "-pa " ++ filename:dirname(code:which(?MODULE)), - ?line {ok,Node} = start_node(compiler, Pa), ?line NormalResult = rpc:call(Node, ?MODULE, load_and_call, [Out,Mod]), ?line test_server:timetrap_cancel(Dog), @@ -125,7 +129,6 @@ try_inline(Mod, Config) -> %% Delete Beam file. ?line ok = file:delete(filename:join(Out, atom_to_list(Mod)++code:objfile_extension())), - ?line ?t:stop_node(Node), ok. compare(Same, Same) -> ok; @@ -293,9 +296,9 @@ otp_7223_2({a}) -> 1. coverage(Config) when is_list(Config) -> - ?line Src = filename:join(?config(data_dir, Config), bsdecode), - ?line Out = ?config(priv_dir,Config), - ?line {ok,Mod} = compile:file(Src, [{outdir,Out},report,{inline,0},clint]), - ?line {ok,Mod} = compile:file(Src, [{outdir,Out},report,{inline,20},verbose,clint]), - ?line ok = file:delete(filename:join(Out, "bsdecode"++code:objfile_extension())), + Mod = bsdecode, + Src = filename:join(?config(data_dir, Config), Mod), + {ok,Mod,_} = compile:file(Src, [binary,report,{inline,0},clint]), + {ok,Mod,_} = compile:file(Src, [binary,report,{inline,20}, + verbose,clint]), ok. diff --git a/lib/compiler/test/match_SUITE.erl b/lib/compiler/test/match_SUITE.erl index 9406d7de8f..de44926d81 100644 --- a/lib/compiler/test/match_SUITE.erl +++ b/lib/compiler/test/match_SUITE.erl @@ -30,11 +30,13 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [pmatch, mixed, aliases, match_in_call, untuplify, - shortcut_boolean, letify_guard, selectify, underscore, coverage]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [pmatch,mixed,aliases,match_in_call,untuplify, + shortcut_boolean,letify_guard,selectify,underscore,coverage]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl index 6df8b2ac30..44c7161530 100644 --- a/lib/compiler/test/misc_SUITE.erl +++ b/lib/compiler/test/misc_SUITE.erl @@ -57,11 +57,12 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. -spec all() -> misc_SUITE_test_cases(). all() -> test_lib:recompile(?MODULE), - [tobias, empty_string, md5, silly_coverage, - confused_literals, integer_encoding, override_bif]. + [{group,p}]. groups() -> - []. + [{p,[],%%test_lib:parallel(), + [tobias,empty_string,md5,silly_coverage, + confused_literals,integer_encoding,override_bif]}]. init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl index 2a67615e5e..55aaa0e5d9 100644 --- a/lib/compiler/test/receive_SUITE.erl +++ b/lib/compiler/test/receive_SUITE.erl @@ -40,10 +40,12 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [recv, coverage, otp_7980, ref_opt, export]. + [{group,p}]. groups() -> - []. + {p,test_lib:parallel(), + [recv,coverage,otp_7980,ref_opt,export]}. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/record_SUITE.erl b/lib/compiler/test/record_SUITE.erl index 363422ec7e..96f3712be9 100644 --- a/lib/compiler/test/record_SUITE.erl +++ b/lib/compiler/test/record_SUITE.erl @@ -42,12 +42,14 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> 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, coverage]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [errors,record_test_2,record_test_3, + record_access_in_guards,guard_opt,eval_once,foobar, + missing_test_heap,nested_access,coverage]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl index 2295592a38..996c369705 100644 --- a/lib/compiler/test/test_lib.erl +++ b/lib/compiler/test/test_lib.erl @@ -20,7 +20,8 @@ -include("test_server.hrl"). -compile({no_auto_import,[binary_part/2]}). --export([recompile/1,opt_opts/1,get_data_dir/1,smoke_disasm/1,p_run/2,binary_part/2]). +-export([recompile/1,parallel/0,uniq/0,opt_opts/1,get_data_dir/1, + smoke_disasm/1,p_run/2,binary_part/2]). recompile(Mod) when is_atom(Mod) -> case whereis(cover_server) of @@ -43,6 +44,18 @@ smoke_disasm(File) when is_list(File) -> Res = beam_disasm:file(File), {beam_file,_Mod} = {element(1, Res),element(2, Res)}. +parallel() -> + case ?t:is_cover() orelse erlang:system_info(schedulers) =:= 1 of + true -> []; + false -> [parallel] + end. + +uniq() -> + U0 = erlang:ref_to_list(make_ref()), + U1 = re:replace(U0, "^#Ref", ""), + U = re:replace(U1, "[^[A-Za-z0-9_]+", "_", [global]), + re:replace(U, "_*$", "", [{return,list}]). + %% Retrieve the "interesting" compiler options (options for optimization %% and compatibility) for the given module. diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index 29119c0f5d..4530d08c77 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -32,13 +32,15 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [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, get_in_try]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [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,get_in_try]}]. + init_per_suite(Config) -> Config. diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index f6a572abfa..9ce0df5ec4 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -55,12 +55,13 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> test_lib:recompile(?MODULE), - [pattern, pattern2, pattern3, pattern4, guard, - bad_arith, bool_cases, bad_apply, files, effect, - bin_opt_info, bin_construction]. + [{group,p}]. groups() -> - []. + [{p,test_lib:parallel(), + [pattern,pattern2,pattern3,pattern4,guard, + bad_arith,bool_cases,bad_apply,files,effect, + bin_opt_info,bin_construction]}]. init_per_suite(Config) -> Config. @@ -556,9 +557,10 @@ run(Config, Tests) -> %% Compiles a test module and returns the list of errors and warnings. run_test(Conf, Test0, Warnings) -> - Filename = 'warnings_test.erl', + Mod = "warnings_"++test_lib:uniq(), + Filename = Mod ++ ".erl", ?line DataDir = ?privdir, - ?line Test = ["-module(warnings_test). ", Test0], + Test = ["-module(", Mod, "). ", Test0], ?line File = filename:join(DataDir, Filename), ?line Opts = [binary,export_all,return|Warnings], ?line ok = file:write_file(File, Test), -- cgit v1.2.3 From d18ab0179e83f378026cea87dea026cae1077bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 23 Oct 2012 11:20:33 +0200 Subject: Correct typo in test suite name It should be beam_except_SUITE, since it tests the beam_except module (introduced in 726f6e4c7afe8ce37b30eedbebe583e7b9bfc51b). --- lib/compiler/test/Makefile | 4 +- lib/compiler/test/beam_except_SUITE.erl | 67 +++++++++++++++++++++++++++++++++ lib/compiler/test/beam_expect_SUITE.erl | 67 --------------------------------- 3 files changed, 69 insertions(+), 69 deletions(-) create mode 100644 lib/compiler/test/beam_except_SUITE.erl delete mode 100644 lib/compiler/test/beam_expect_SUITE.erl (limited to 'lib') diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile index e047166ade..3b065ec3b9 100644 --- a/lib/compiler/test/Makefile +++ b/lib/compiler/test/Makefile @@ -10,7 +10,7 @@ MODULES= \ apply_SUITE \ beam_validator_SUITE \ beam_disasm_SUITE \ - beam_expect_SUITE \ + beam_except_SUITE \ bs_bincomp_SUITE \ bs_bit_binaries_SUITE \ bs_construct_SUITE \ @@ -39,7 +39,7 @@ MODULES= \ NO_OPT= \ andor \ apply \ - beam_expect \ + beam_except \ bs_construct \ bs_match \ bs_utf \ diff --git a/lib/compiler/test/beam_except_SUITE.erl b/lib/compiler/test/beam_except_SUITE.erl new file mode 100644 index 0000000000..6b55224a42 --- /dev/null +++ b/lib/compiler/test/beam_except_SUITE.erl @@ -0,0 +1,67 @@ +%% +%% %CopyrightBegin% +%% +%% 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 +%% 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_except_SUITE). + +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + coverage/1]). + +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [coverage]. + +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +coverage(_) -> + File = {file,"fake.erl"}, + ok = fc(a), + {'EXIT',{function_clause, + [{?MODULE,fc,[[x]],[File,{line,2}]}|_]}} = + (catch fc([x])), + {'EXIT',{function_clause, + [{?MODULE,fc,[y],[File,{line,2}]}|_]}} = + (catch fc(y)), + {'EXIT',{function_clause, + [{?MODULE,fc,[[a,b,c]],[File,{line,6}]}|_]}} = + (catch fc([a,b,c])), + + {'EXIT',{undef,[{erlang,error,[a,b,c],_}|_]}} = + (catch erlang:error(a, b, c)), + ok. + +-file("fake.erl", 1). +fc(a) -> %Line 2 + ok; %Line 3 +fc(L) when length(L) > 2 -> %Line 4 + %% Not the same as a "real" function_clause error. + error(function_clause, [L]). %Line 6 diff --git a/lib/compiler/test/beam_expect_SUITE.erl b/lib/compiler/test/beam_expect_SUITE.erl deleted file mode 100644 index 6f216eac4f..0000000000 --- a/lib/compiler/test/beam_expect_SUITE.erl +++ /dev/null @@ -1,67 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% 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 -%% 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_expect_SUITE). - --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, - coverage/1]). - -suite() -> [{ct_hooks,[ts_install_cth]}]. - -all() -> - [coverage]. - -groups() -> - []. - -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - -coverage(_) -> - File = {file,"fake.erl"}, - ok = fc(a), - {'EXIT',{function_clause, - [{?MODULE,fc,[[x]],[File,{line,2}]}|_]}} = - (catch fc([x])), - {'EXIT',{function_clause, - [{?MODULE,fc,[y],[File,{line,2}]}|_]}} = - (catch fc(y)), - {'EXIT',{function_clause, - [{?MODULE,fc,[[a,b,c]],[File,{line,6}]}|_]}} = - (catch fc([a,b,c])), - - {'EXIT',{undef,[{erlang,error,[a,b,c],_}|_]}} = - (catch erlang:error(a, b, c)), - ok. - --file("fake.erl", 1). -fc(a) -> %Line 2 - ok; %Line 3 -fc(L) when length(L) > 2 -> %Line 4 - %% Not the same as a "real" function_clause error. - error(function_clause, [L]). %Line 6 -- cgit v1.2.3