Browse files

Added process all Option

  • Loading branch information...
1 parent 8e07da1 commit 5456eab7ac464f2898466c7f8209b6741128ac51 Gianfranco committed Jun 30, 2011
Showing with 10 additions and 10 deletions.
  1. +8 −3 src/frame_axiom.erl
  2. +2 −7 test/frame_axiom_tests.erl
View
11 src/frame_axiom.erl
@@ -45,9 +45,8 @@ snapshot(SnapShots) when is_list(SnapShots) ->
snapshot(Ets,{process,Options}) when is_list(Options) ->
lists:foldl(fun(Option,EtsAcc) -> snapshot(EtsAcc,process,Option)
end,Ets,Options);
-snapshot(Ets,{proces,all}) ->
- snapshot(Ets,{process,[creation,death,received_messages,consumed_messages,
- creation_named,death_named,replaced_named]});
+snapshot(Ets,{process,all}) ->
+ snapshot(Ets,{process,all(process)});
snapshot(Ets,process) ->
Processes = erlang:processes(),
@@ -119,6 +118,8 @@ diff(Ets,DiffSpecs) when is_list(DiffSpecs) ->
Key = diffspec_key(DiffSpec),
Res++[{Key,diff(Ets,DiffSpec)}]
end,[],DiffSpecs);
+diff(Ets,{process,all}) ->
+ diff(Ets,{process,all(process)});
diff(Ets,{process,Options}) when is_list(Options) ->
lists:foldl(fun(Option,Res) -> Res++diff(Ets,process,Option)
end,[],Options);
@@ -234,6 +235,10 @@ diff(Ets,process,consumed_messages) ->
%% Helpers section
%% ----------------------------------------------------------
+all(process) ->
+ [creation,death,received_messages,consumed_messages,
+ creation_named,death_named,replaced_named].
+
collect(ExactP,Path) ->
case filelib:is_dir(Path) of
true ->
View
9 test/frame_axiom_tests.erl
@@ -89,13 +89,8 @@ named_process_replaced_diff_test() ->
?assertEqual([{replaced,named_process_c}],frame_axiom:diff(Ref,[{process,Options}])),
synchronoulsy_kill_process(Pid2).
-named_process_no_diff_test() ->
- Options = [death_named,creation_named,replaced_named],
- Ref = frame_axiom:snapshot([{process,Options}]),
- ?assertEqual([],frame_axiom:diff(Ref,[{process,Options}])).
-
-process_no_change_diff_test() ->
- Options = [death,creation],
+all_no_change_diff_test() ->
+ Options = all,
Ref = frame_axiom:snapshot([{process,Options}]),
?assertEqual([],frame_axiom:diff(Ref,[{process,Options}])).

0 comments on commit 5456eab

Please sign in to comment.