diff --git a/rebar.config b/rebar.config index 75836147..c3a639b5 100644 --- a/rebar.config +++ b/rebar.config @@ -21,7 +21,6 @@ {erl_opts, [ {lager_extra_sinks, ['__lager_test_sink']}, - {platform_define, "^(19|20|21|22|23|24)", test_statem}, {platform_define, "^18", 'FUNCTION_NAME', unavailable}, {platform_define, "^18", 'FUNCTION_ARITY', 0}, debug_info, diff --git a/test/crash_statem.erl b/test/crash_statem.erl index cf6bb150..c39c380f 100644 --- a/test/crash_statem.erl +++ b/test/crash_statem.erl @@ -1,6 +1,5 @@ -module(crash_statem). %% we're only going to compile this on OTP 19+ --ifdef(test_statem). -behaviour(gen_statem). -export([ @@ -45,11 +44,3 @@ handle_event({call, _From}, timeout, _Arg, _Data) -> {keep_state_and_data, [{state_timeout, 0, timeout}]}; handle_event({call, _From}, {stop, Reason}, state1, _Data) -> {stop, Reason}. - --else. --export([start/0, crash/0]). - -start() -> ok. -crash() -> ok. - --endif. diff --git a/test/pr_stacktrace_test.erl b/test/pr_stacktrace_test.erl index 2853a228..502bcde1 100644 --- a/test/pr_stacktrace_test.erl +++ b/test/pr_stacktrace_test.erl @@ -2,14 +2,6 @@ -compile([{parse_transform, lager_transform}]). --ifdef(OTP_RELEASE). %% this implies 21 or higher --define(EXCEPTION(Class, Reason, Stacktrace), Class:Reason:Stacktrace). --define(GET_STACK(Stacktrace), Stacktrace). --else. --define(EXCEPTION(Class, Reason, _), Class:Reason). --define(GET_STACK(_), erlang:get_stacktrace()). --endif. - -include_lib("eunit/include/eunit.hrl"). make_throw() -> @@ -25,8 +17,8 @@ pr_stacktrace_throw_test() -> Got = try make_throw() catch - ?EXCEPTION(Class, Reason, Stacktrace) -> - lager:pr_stacktrace(?GET_STACK(Stacktrace), {Class, Reason}) + Class:Reason:Stacktrace -> + lager:pr_stacktrace(Stacktrace, {Class, Reason}) end, Want = "pr_stacktrace_test:pr_stacktrace_throw_test/0 line 26\n pr_stacktrace_test:make_throw/0 line 16\nthrow:{test,exception}", ?assertNotEqual(nomatch, string:find(Got, Want)). @@ -35,8 +27,8 @@ pr_stacktrace_bad_arg_test() -> Got = try bad_arg() catch - ?EXCEPTION(Class, Reason, Stacktrace) -> - lager:pr_stacktrace(?GET_STACK(Stacktrace), {Class, Reason}) + Class:Reason:Stacktrace -> + lager:pr_stacktrace(Stacktrace, {Class, Reason}) end, Want = "pr_stacktrace_test:pr_stacktrace_bad_arg_test/0 line 36\n pr_stacktrace_test:bad_arg/0 line 22\nerror:badarg", ?assertNotEqual(nomatch, string:find(Got, Want)). @@ -45,8 +37,8 @@ pr_stacktrace_bad_arity_test() -> Got = try bad_arity() catch - ?EXCEPTION(Class, Reason, Stacktrace) -> - lager:pr_stacktrace(?GET_STACK(Stacktrace), {Class, Reason}) + Class:Reason:Stacktrace -> + lager:pr_stacktrace(Stacktrace, {Class, Reason}) end, Want = "pr_stacktrace_test:pr_stacktrace_bad_arity_test/0 line 46\n lists:concat([], [])\nerror:undef", ?assertNotEqual(nomatch, string:find(Got, Want)). @@ -56,8 +48,8 @@ pr_stacktrace_no_reverse_test() -> Got = try bad_arity() catch - ?EXCEPTION(Class, Reason, Stacktrace) -> - lager:pr_stacktrace(?GET_STACK(Stacktrace), {Class, Reason}) + Class:Reason:Stacktrace -> + lager:pr_stacktrace(Stacktrace, {Class, Reason}) end, Want = "error:undef\n lists:concat([], [])\n pr_stacktrace_test:pr_stacktrace_bad_arity_test/0 line 57", ?assertEqual(nomatch, string:find(Got, Want)).