aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/cover.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tools/src/cover.erl')
-rw-r--r--lib/tools/src/cover.erl35
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/tools/src/cover.erl b/lib/tools/src/cover.erl
index 5a908174d7..468225dc13 100644
--- a/lib/tools/src/cover.erl
+++ b/lib/tools/src/cover.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -705,7 +705,9 @@ main_process_loop(State) ->
remote_collect('_',Nodes,true),
reply(From, ok),
Nodes1 = State#main_state.nodes--Nodes,
- main_process_loop(State#main_state{nodes=Nodes1});
+ LostNodes1 = State#main_state.lost_nodes--Nodes,
+ main_process_loop(State#main_state{nodes=Nodes1,
+ lost_nodes=LostNodes1});
{From, {flush,Nodes}} ->
remote_collect('_',Nodes,false),
@@ -792,8 +794,15 @@ main_process_loop(State) ->
{'DOWN', _MRef, process, {?SERVER,Node}, _Info} ->
%% A remote cover_server is down, mark as lost
- Nodes = State#main_state.nodes--[Node],
- Lost = [Node|State#main_state.lost_nodes],
+ {Nodes,Lost} =
+ case lists:member(Node,State#main_state.nodes) of
+ true ->
+ N = State#main_state.nodes--[Node],
+ L = [Node|State#main_state.lost_nodes],
+ {N,L};
+ false -> % node stopped
+ {State#main_state.nodes,State#main_state.lost_nodes}
+ end,
main_process_loop(State#main_state{nodes=Nodes,lost_nodes=Lost});
{nodeup,Node} ->
@@ -815,7 +824,7 @@ main_process_loop(State) ->
main_process_loop(State);
get_status ->
- io:format("~p~n",[State]),
+ io:format("~tp~n",[State]),
main_process_loop(State)
end.
@@ -880,7 +889,7 @@ remote_process_loop(State) ->
remote_process_loop(State);
get_status ->
- io:format("~p~n",[State]),
+ io:format("~tp~n",[State]),
remote_process_loop(State);
M ->
@@ -998,7 +1007,7 @@ do_start_nodes(Nodes, State) ->
erlang:monitor(process,{?SERVER,Node}),
[Node|Acc];
Error ->
- io:format("Could not start cover on ~w: ~p\n",
+ io:format("Could not start cover on ~w: ~tp\n",
[Node,Error]),
Acc
end
@@ -1214,7 +1223,7 @@ do_get_all_importfiles([],Acc) ->
imported_info(Text,Module,Imported) ->
case lists:keysearch(Module,1,Imported) of
{value,{Module,_File,ImportFiles}} ->
- io:format("~s includes data from imported files\n~p\n",
+ io:format("~ts includes data from imported files\n~tp\n",
[Text,ImportFiles]);
false ->
ok
@@ -1228,7 +1237,7 @@ add_imported(Module, File, ImportFile, Imported) ->
add_imported(M, F1, ImportFile, [{M,_F2,ImportFiles}|Imported], Acc) ->
case lists:member(ImportFile,ImportFiles) of
true ->
- io:fwrite("WARNING: Module ~w already imported from ~p~n"
+ io:fwrite("WARNING: Module ~w already imported from ~tp~n"
"Not importing again!~n",[M,ImportFile]),
dont_import;
false ->
@@ -1246,7 +1255,7 @@ remove_imported(Module,Imported) ->
case lists:keysearch(Module,1,Imported) of
{value,{Module,_,ImportFiles}} ->
io:fwrite("WARNING: Deleting data for module ~w imported from~n"
- "~p~n",[Module,ImportFiles]),
+ "~tp~n",[Module,ImportFiles]),
lists:keydelete(Module,1,Imported);
false ->
Imported
@@ -1510,12 +1519,6 @@ aux_var(Vars, N) ->
%% This way we will be able to exclude functions defined in include files.
munge({function,0,module_info,_Arity,_Clauses},_Vars,_MainFile,_Switch) ->
ignore; % module_info will be added again when the forms are recompiled
-munge(Form={function,_,'MNEMOSYNE QUERY',_,_},Vars,_MainFile,Switch) ->
- {Form,Vars,Switch}; % No bumps in Mnemosyne code.
-munge(Form={function,_,'MNEMOSYNE RULE',_,_},Vars,_MainFile,Switch) ->
- {Form,Vars,Switch};
-munge(Form={function,_,'MNEMOSYNE RECFUNDEF',_,_},Vars,_MainFile,Switch) ->
- {Form,Vars,Switch};
munge({function,Line,Function,Arity,Clauses},Vars,_MainFile,on) ->
Vars2 = Vars#vars{function=Function,
arity=Arity,