diff options
author | Lukas Larsson <[email protected]> | 2010-10-12 10:43:56 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-02-17 17:25:13 +0100 |
commit | 3d0f4a3085f11389e5b22d10f96f0cbf08c9337f (patch) | |
tree | 1103c2da64be7f08e523b499d9c5b35c6f6901c2 /lib/compiler | |
parent | a424e5a7dffcbf4685ee3be9fdec7002fa03294b (diff) | |
download | otp-3d0f4a3085f11389e5b22d10f96f0cbf08c9337f.tar.gz otp-3d0f4a3085f11389e5b22d10f96f0cbf08c9337f.tar.bz2 otp-3d0f4a3085f11389e5b22d10f96f0cbf08c9337f.zip |
Update compiler tests to conform with common_test standard
Diffstat (limited to 'lib/compiler')
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 <[email protected]> %% 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('[email protected]'). --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. |