From 913c7f82cf3f2594d2f0731fd73b79cd82502ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 9 Jun 2010 19:42:42 +0200 Subject: Fix eprof to handle error cases --- lib/tools/test/eprof_SUITE.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/tools/test') diff --git a/lib/tools/test/eprof_SUITE.erl b/lib/tools/test/eprof_SUITE.erl index cad67fd617..67607c6cf2 100644 --- a/lib/tools/test/eprof_SUITE.erl +++ b/lib/tools/test/eprof_SUITE.erl @@ -59,6 +59,7 @@ basic(Config) when is_list(Config) -> ?line profiling_stopped = eprof:stop_profiling(), %% with fun + ?line {ok, _} = eprof:profile(fun() -> eprof_test:go(10) end), ?line profiling = eprof:profile([self()]), ?line {error, already_profiling} = eprof:profile(fun() -> eprof_test:go(10) end), @@ -72,6 +73,17 @@ basic(Config) when is_list(Config) -> ?line {ok, _} = eprof:profile([], fun() -> eprof_test:go(10) end, {eprof_test, go, 1}), ?line {ok, _} = eprof:profile([], fun() -> eprof_test:go(10) end, {eprof_test, dec, 1}), + %% error case + + ?line error = eprof:profile([Pid], fun() -> eprof_test:go(10) end), + ?line Pid = whereis(eprof), + ?line error = eprof:profile([Pid], fun() -> eprof_test:go(10) end), + ?line A = spawn(fun() -> receive _ -> ok end end), + ?line profiling = eprof:profile([A]), + ?line true = exit(A, kill_it), + ?line profiling_stopped = eprof:stop_profiling(), + ?line {error,_} = eprof:profile(fun() -> a = b end), + %% with mfa ?line {ok, _} = eprof:profile([], eprof_test, go, [10]), -- cgit v1.2.3