From f1e60ef101b6bb6e262c2387cf1b408c66b94c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 18 Mar 2010 13:51:28 +0100 Subject: compiler tests: Compile a few more modules with 'inline' Since a function_clause exception in an inlined function will be changed to a case_clause exception, we must test for both. --- lib/compiler/test/lc_SUITE.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/compiler/test/lc_SUITE.erl') 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). -- cgit v1.2.3 From 7832064bf7783f2f00e4e2cdc460a05d4f075146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 18 Mar 2010 15:48:28 +0100 Subject: compiler tests: Cope with missing args in function_clause for native code Native-compiled code generates a different stack trace for function_clause exceptions - instead of the arguments for the function, only the arity is reported. Accept missing arguments if the test suite is native-compiled. --- lib/compiler/test/lc_SUITE.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/compiler/test/lc_SUITE.erl') diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index 2960615b7e..0c1373924c 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -160,6 +160,9 @@ 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}|_]}}) + when length(Args) =:= Arity -> + true = test_server:is_native(?MODULE); fc(Args, {'EXIT',{{case_clause,ActualArgs},_}}) when ?MODULE =:= lc_inline_SUITE -> Args = tuple_to_list(ActualArgs). -- cgit v1.2.3