diff options
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/Makefile | 4 | ||||
-rw-r--r-- | lib/compiler/test/bs_match_SUITE.erl | 75 | ||||
-rw-r--r-- | lib/compiler/test/bs_utf_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/compiler/test/guard_SUITE.erl | 11 | ||||
-rw-r--r-- | lib/compiler/test/lc_SUITE.erl | 7 |
5 files changed, 55 insertions, 46 deletions
diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile index 961b589035..2d08e71e09 100644 --- a/lib/compiler/test/Makefile +++ b/lib/compiler/test/Makefile @@ -59,9 +59,13 @@ INLINE= \ bs_bincomp \ bs_bit_binaries \ bs_construct \ + bs_match \ + bs_utf \ core_fold \ float \ fun \ + guard \ + lc \ match \ misc \ num_bif \ diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 5c2797170b..0451e7e9e2 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -302,15 +302,15 @@ partitioned_bs_match(Config) when is_list(Config) -> ?line error = partitioned_bs_match(10, <<7,8,15,13>>), ?line error = partitioned_bs_match(100, {a,tuple,is,'not',a,binary}), ?line ok = partitioned_bs_match(0, <<>>), - ?line {'EXIT',{function_clause,[{?MODULE,partitioned_bs_match,[-1,blurf]}|_]}} = - (catch partitioned_bs_match(-1, blurf)), - ?line {'EXIT',{function_clause,[{?MODULE,partitioned_bs_match,[-1,<<1,2,3>>]}|_]}} = - (catch partitioned_bs_match(-1, <<1,2,3>>)), - + ?line fc(partitioned_bs_match, [-1,blurf], + catch partitioned_bs_match(-1, blurf)), + ?line fc(partitioned_bs_match, [-1,<<1,2,3>>], + catch partitioned_bs_match(-1, <<1,2,3>>)), ?line {17,<<1,2,3>>} = partitioned_bs_match_2(1, <<17,1,2,3>>), ?line {7,<<1,2,3>>} = partitioned_bs_match_2(7, <<17,1,2,3>>), - ?line {'EXIT',{function_clause,[{?MODULE,partitioned_bs_match_2,[4,<<0:17>>]}|_]}} = - (catch partitioned_bs_match_2(4, <<0:17>>)), + + ?line fc(partitioned_bs_match_2, [4,<<0:17>>], + catch partitioned_bs_match_2(4, <<0:17>>)), ok. partitioned_bs_match(_, <<42:8,T/binary>>) -> @@ -327,12 +327,10 @@ partitioned_bs_match_2(Len, <<_:8,T/binary>>) -> function_clause(Config) when is_list(Config) -> ?line ok = function_clause_1(<<0,7,0,7,42>>), - ?line {'EXIT',{function_clause, - [{?MODULE,function_clause_1,[<<0,1,2,3>>]}|_]}} = - (catch function_clause_1(<<0,1,2,3>>)), - ?line {'EXIT',{function_clause, - [{?MODULE,function_clause_1,[<<0,1,2,3>>]}|_]}} = - (catch function_clause_1(<<0,7,0,1,2,3>>)), + ?line fc(function_clause_1, [<<0,1,2,3>>], + catch function_clause_1(<<0,1,2,3>>)), + ?line fc(function_clause_1, [<<0,1,2,3>>], + catch function_clause_1(<<0,7,0,1,2,3>>)), ok. function_clause_1(<<0:8,7:8,T/binary>>) -> @@ -349,22 +347,17 @@ unit(Config) when is_list(Config) -> ?line 99 = peek8(<<99>>), ?line 100 = peek8(<<100,101>>), - ?line {'EXIT',{function_clause,[{?MODULE,peek8,[<<100,101,0:1>>]}|_]}} = - (catch peek8(<<100,101,0:1>>)), + ?line fc(peek8, [<<100,101,0:1>>], catch peek8(<<100,101,0:1>>)), ?line 37484 = peek16(<<37484:16>>), ?line 37489 = peek16(<<37489:16,5566:16>>), - ?line {'EXIT',{function_clause,[{?MODULE,peek16,[<<8>>]}|_]}} = - (catch peek16(<<8>>)), - ?line {'EXIT',{function_clause,[{?MODULE,peek16,[<<42:15>>]}|_]}} = - (catch peek16(<<42:15>>)), - ?line {'EXIT',{function_clause,[{?MODULE,peek16,[<<1,2,3,4,5>>]}|_]}} = - (catch peek16(<<1,2,3,4,5>>)), + ?line fc(peek16, [<<8>>], catch peek16(<<8>>)), + ?line fc(peek16, [<<42:15>>], catch peek16(<<42:15>>)), + ?line fc(peek16, [<<1,2,3,4,5>>], catch peek16(<<1,2,3,4,5>>)), ?line 127 = peek7(<<127:7>>), ?line 100 = peek7(<<100:7,19:7>>), - ?line {'EXIT',{function_clause,[{?MODULE,peek7,[<<1,2>>]}|_]}} = - (catch peek7(<<1,2>>)), + ?line fc(peek7, [<<1,2>>], catch peek7(<<1,2>>)), ok. peek1(<<B:8,_/bitstring>>) -> B. @@ -533,15 +526,13 @@ bs_sum(Config) when is_list(Config) -> ?line 6 = bs_sum_1([1,2,3|0]), ?line 7 = bs_sum_1([1,2,3|one]), - ?line {'EXIT',{function_clause,_}} = (catch bs_sum_1({too,big,tuple})), - ?line {'EXIT',{function_clause,_}} = (catch bs_sum_1([1,2,3|{too,big,tuple}])), + ?line fc(catch bs_sum_1({too,big,tuple})), + ?line fc(catch bs_sum_1([1,2,3|{too,big,tuple}])), ?line [] = sneaky_alias(<<>>), ?line [559,387655] = sneaky_alias(id(<<559:32,387655:32>>)), - ?line {'EXIT',{function_clause,[{?MODULE,sneaky_alias,[<<1>>]}|_]}} = - (catch sneaky_alias(id(<<1>>))), - ?line {'EXIT',{function_clause,[{?MODULE,sneaky_alias,[[1,2,3,4]]}|_]}} = - (catch sneaky_alias(lists:seq(1, 4))), + ?line fc(sneaky_alias, [<<1>>], catch sneaky_alias(id(<<1>>))), + ?line fc(sneaky_alias, [[1,2,3,4]], catch sneaky_alias(lists:seq(1, 4))), ok. bs_sum_1(<<H,T/binary>>) -> H+bs_sum_1(T); @@ -559,9 +550,9 @@ sneaky_alias(<<From:32,L/binary>>) -> [From|sneaky_alias(L)]. coverage(Config) when is_list(Config) -> ?line 0 = coverage_fold(fun(B, A) -> A+B end, 0, <<>>), ?line 6 = coverage_fold(fun(B, A) -> A+B end, 0, <<1,2,3>>), - ?line {'EXIT',{function_clause,_}} = (catch coverage_fold(fun(B, A) -> - A+B - end, 0, [a,b,c])), + ?line fc(catch coverage_fold(fun(B, A) -> + A+B + end, 0, [a,b,c])), ?line {<<>>,not_a_tuple} = coverage_build(<<>>, <<>>, not_a_tuple), ?line {<<16#76,"abc",16#A9,"abc">>,{x,42,43}} = @@ -573,9 +564,8 @@ coverage(Config) when is_list(Config) -> ?line do_coverage_bin_to_term_list([]), ?line do_coverage_bin_to_term_list([lists:seq(0, 10),{a,b,c},<<23:42>>]), - ?line {'EXIT',{function_clause, - [{?MODULE,coverage_bin_to_term_list,[<<0,0,0,7>>]}|_]}} = - (catch do_coverage_bin_to_term_list_1(<<7:32>>)), + ?line fc(coverage_bin_to_term_list, [<<0,0,0,7>>], + catch do_coverage_bin_to_term_list_1(<<7:32>>)), ?line <<>> = coverage_per_key(<<4:32>>), ?line <<$a,$b,$c>> = coverage_per_key(<<7:32,"abc">>), @@ -731,13 +721,12 @@ encode_octet_string(<<OctetString/binary>>, Len) -> simon(Config) when is_list(Config) -> ?line one = simon(blurf, <<>>), ?line two = simon(0, <<42>>), - ?line {'EXIT',{function_clause,[{?MODULE,simon,[17,<<1>>]}|_]}} = (catch simon(17, <<1>>)), - ?line {'EXIT',{function_clause,[{?MODULE,simon,[0,<<1,2,3>>]}|_]}} = (catch simon(0, <<1,2,3>>)), + ?line fc(simon, [17,<<1>>], catch simon(17, <<1>>)), + ?line fc(simon, [0,<<1,2,3>>], catch simon(0, <<1,2,3>>)), ?line one = simon2(blurf, <<9>>), ?line two = simon2(0, <<9,1>>), - ?line {'EXIT',{function_clause,[{?MODULE,simon2,[0,<<9,10,11>>]}|_]}} = - (catch simon2(0, <<9,10,11>>)), + ?line fc(simon2, [0,<<9,10,11>>], catch simon2(0, <<9,10,11>>)), ok. simon(_, <<>>) -> one; @@ -985,6 +974,14 @@ haystack_2(Haystack) -> B end || {X,Y} <- Subs ]. +fc({'EXIT',{function_clause,_}}) -> ok; +fc({'EXIT',{{case_clause,_},_}}) when ?MODULE =:= bs_match_inline_SUITE -> ok. + +fc(Name, Args, {'EXIT',{function_clause,[{?MODULE,Name,Args}|_]}}) -> ok; +fc(_, Args, {'EXIT',{{case_clause,ActualArgs},_}}) + when ?MODULE =:= bs_match_inline_SUITE -> + Args = tuple_to_list(ActualArgs). + check(F, R) -> R = F(). diff --git a/lib/compiler/test/bs_utf_SUITE.erl b/lib/compiler/test/bs_utf_SUITE.erl index d93bdef73d..d1a74f4393 100644 --- a/lib/compiler/test/bs_utf_SUITE.erl +++ b/lib/compiler/test/bs_utf_SUITE.erl @@ -314,7 +314,7 @@ coverage(Config) when is_list(Config) -> ?line 0 = coverage_2(<<4096/utf8,65536/utf8,0>>), ?line 1 = coverage_2(<<1024/utf8,1025/utf8,1>>), - ?line {'EXIT',{function_clause,_}} = (catch coverage_3(1)), + ?line fc(catch coverage_3(1)), %% Cover beam_flatten (combining the heap allocation in %% a subsequent test_heap instruction into the bs_init2 @@ -394,3 +394,5 @@ utf32_data() -> <<16#41:32/little,NotIdentical:32/little, 16#0391:32/little,16#2E:32/little>>}. +fc({'EXIT',{function_clause,_}}) -> ok; +fc({'EXIT',{{case_clause,_},_}}) when ?MODULE =:= bs_utf_inline_SUITE -> ok. diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index 5ae41f13e7..7343d0f8ca 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -1316,11 +1316,11 @@ cqlc(M, F, As, St) -> andalso_semi(Config) when is_list(Config) -> ?line ok = andalso_semi_foo(0), ?line ok = andalso_semi_foo(1), - ?line {'EXIT',{function_clause,_}} = (catch andalso_semi_foo(2)), + ?line fc(catch andalso_semi_foo(2)), ?line ok = andalso_semi_bar([a,b,c]), ?line ok = andalso_semi_bar(1), - ?line {'EXIT',{function_clause,_}} = (catch andalso_semi_bar([a,b])), + ?line fc(catch andalso_semi_bar([a,b])), ok. andalso_semi_foo(Bar) when is_integer(Bar) andalso Bar =:= 0; Bar =:= 1 -> @@ -1332,8 +1332,8 @@ andalso_semi_bar(Bar) when is_list(Bar) andalso length(Bar) =:= 3; Bar =:= 1 -> tuple_size(Config) when is_list(Config) -> ?line 10 = do_tuple_size({1,2,3,4}), - ?line {'EXIT',{function_clause,_}} = (catch do_tuple_size({1,2,3})), - ?line {'EXIT',{function_clause,_}} = (catch do_tuple_size(42)), + ?line fc(catch do_tuple_size({1,2,3})), + ?line fc(catch do_tuple_size(42)), ?line error = ludicrous_tuple_size({a,b,c}), ?line error = ludicrous_tuple_size([a,b,c]), @@ -1374,3 +1374,6 @@ check(F, Result) -> io:format(" Got: ~p\n", [Other]), test_server:fail() end. + +fc({'EXIT',{function_clause,_}}) -> ok; +fc({'EXIT',{{case_clause,_},_}}) when ?MODULE =:= guard_inline_SUITE -> ok. diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index e62b2cd77e..2960615b7e 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -66,8 +66,7 @@ basic(Config) when is_list(Config) -> ?line {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]), ?line [] = [X || X <- L1, X+1 < 2], ?line {'EXIT',_} = (catch [X || X <- L1, odd(X)]), - ?line {'EXIT',{function_clause,[{?MODULE,_,[x]}|_]}} = - (catch [E || E <- id(x)]), + ?line fc([x], catch [E || E <- id(x)]), ok. tuple_list() -> @@ -160,3 +159,7 @@ empty_generator(Config) when is_list(Config) -> id(I) -> I. +fc(Args, {'EXIT',{function_clause,[{?MODULE,_,Args}|_]}}) -> ok; +fc(Args, {'EXIT',{{case_clause,ActualArgs},_}}) + when ?MODULE =:= lc_inline_SUITE -> + Args = tuple_to_list(ActualArgs). |