diff options
author | Stavros Aronis <[email protected]> | 2011-04-02 18:57:42 +0300 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-05-04 15:06:15 +0200 |
commit | ca4633fd683527097451ca1398c90c87bb5c14fc (patch) | |
tree | 3d8e18c9becd4feb7d3ceb1eed24bdce2ef69dd6 /lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl | |
parent | bc619f0cbf9555df6dfc44a499f0cd9cee8bd1be (diff) | |
download | otp-ca4633fd683527097451ca1398c90c87bb5c14fc.tar.gz otp-ca4633fd683527097451ca1398c90c87bb5c14fc.tar.bz2 otp-ca4633fd683527097451ca1398c90c87bb5c14fc.zip |
Rename suite data directories
Diffstat (limited to 'lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl')
-rw-r--r-- | lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl b/lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl deleted file mode 100644 index bd7fa4982e..0000000000 --- a/lib/dialyzer/test/small_tests_SUITE_data/src/toth.erl +++ /dev/null @@ -1,99 +0,0 @@ --module(toth). --export([sys_table_view/1]). - -%%% Constants --define(sysTabETS,1). --define(sysTabMnesia,2). --define(sysTabBoth,3). - -sys_table_view([CpId,{match,Pattern},TableType, ViewType]) -> - AllTableList = - case TableType of - ?sysTabMnesia -> - lists:sort(mnesia:system_info(tables)); - ?sysTabBoth -> - lists:sort(rpc:call(CpId,ets,all,[])); - ?sysTabETS -> - lists:sort(rpc:call(CpId,ets,all,[]) -- - mnesia:system_info(tables)); - _ -> %%% Happens at registration only - [ok] - end, - %% Filter the matching table names, skip unnamed tables first: - NamedTableList = lists:filter(fun (X) -> is_atom(X) end, AllTableList), - TablesShown = - case Pattern of - "" -> - NamedTableList; - _ -> - %% Filter the ones whose name begins with the Pattern: - Filter = fun(T) -> - lists:prefix(Pattern, atom_to_list(T)) - end, - lists:filter(Filter, NamedTableList) - end, - - Fields = [{text, [{value,"CpId: " ++ atom_to_list(CpId)}]}, - {text, [{value,"TabSpec=" ++ Pattern}, - {value_format, term}]}, - {text, [{value,"Table type: " ++ formatTableType(TableType)}, - {value_format, term}]}], - - Template = [[{type, index}, - {link, {?MODULE, sys_table_browse, - [{"CpId",CpId},{"TableType",TableType}, - {"View", ViewType}, - {"FirstKey",1}, {"KeyPattern",""}]}}], - - [{type, data}, - {title, "Table name"}, - {display_value, {erlang, atom_to_list}}], %%% else crash - - [{type,data}, - {title, "No of rows"}, - {display_value, term}], - - [{type,data}, - {title, "Memory"}, - {display_value, term}] - ], - - TableAttr = [{rows, [[T,T|tableSize(T,TableType,CpId)] || - T <- TablesShown]}, - {template,Template}], - - Page = [{header, {"Filter tables", "Selected tables"}}, - {buttons, [reload, back]}, - {layout, [{form, Fields}, - {table, TableAttr}]} - ], - Page. - -%%-------------------------------------------------------------------- -%% tableSize/3 -%% @spec tableSize(T::atom(),TableType::integer(),CpId::atom()) -> -%% list(integer()) -%% @doc Return the table size and memory size of the table. -%% @end -%%--------------------------------------------------------------------- - -tableSize(T, TableType, CpId) -> - case TableType of - ?sysTabETS -> - [rpc:call(CpId, ets, info, [T, size]), - rpc:call(CpId, ets, info, [T, memory])]; - ?sysTabMnesia -> - [mnesia:table_info(T, size),mnesia:table_info(T, memory)]; - _ -> %%% Registration - [0,0] - end. - -formatTableType(T) -> - case T of - ?sysTabETS -> - "ETS"; - ?sysTabMnesia -> - "mnesia"; - _ -> %%% Registration ! - "ETS + mnesia" - end. |