diff options
Diffstat (limited to 'lib/reltool')
-rw-r--r-- | lib/reltool/doc/src/notes.xml | 26 | ||||
-rw-r--r-- | lib/reltool/doc/src/reltool.xml | 78 | ||||
-rw-r--r-- | lib/reltool/doc/src/reltool_examples.xml | 2 | ||||
-rw-r--r-- | lib/reltool/doc/src/reltool_usage.xml | 72 | ||||
-rw-r--r-- | lib/reltool/src/reltool.app.src | 4 | ||||
-rw-r--r-- | lib/reltool/src/reltool.erl | 45 | ||||
-rw-r--r-- | lib/reltool/src/reltool.hrl | 100 | ||||
-rw-r--r-- | lib/reltool/src/reltool_mod_win.erl | 4 | ||||
-rw-r--r-- | lib/reltool/src/reltool_server.erl | 113 | ||||
-rw-r--r-- | lib/reltool/src/reltool_target.erl | 27 | ||||
-rw-r--r-- | lib/reltool/test/Makefile | 9 | ||||
-rw-r--r-- | lib/reltool/test/reltool.cover | 2 | ||||
-rw-r--r-- | lib/reltool/test/reltool.spec | 3 | ||||
-rw-r--r-- | lib/reltool/test/reltool_app_SUITE.erl | 47 | ||||
-rw-r--r-- | lib/reltool/test/reltool_server_SUITE.erl | 70 | ||||
-rw-r--r-- | lib/reltool/test/reltool_test_lib.erl | 8 | ||||
-rw-r--r-- | lib/reltool/test/reltool_wx_SUITE.erl | 29 | ||||
-rw-r--r-- | lib/reltool/test/rtt.erl | 2 | ||||
-rw-r--r-- | lib/reltool/vsn.mk | 29 |
19 files changed, 346 insertions, 324 deletions
diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml index 95e379db53..a791f2ce03 100644 --- a/lib/reltool/doc/src/notes.xml +++ b/lib/reltool/doc/src/notes.xml @@ -5,7 +5,7 @@ <header> <copyright> <year>2009</year> - <year>2009</year> + <year>2011</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> @@ -37,7 +37,29 @@ thus constitutes one section in this document. The title of each section is the version number of Reltool.</p> - <section><title>Reltool 0.5.4</title> + <section><title>Reltool 0.5.5</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + The reltool module contained two seriously erroneous + specs which caused bogus warnings when dialyzing reltool + and some correct code of users. These were fixed (specs + for start_link/1 and eval_server/3)</p> + <p> + - Code cleanups and simplifications - Fix a bug in the + calculation of circular dependencies - Eliminate two + dialyzer warnings - Put files alphabetically</p> + <p> + Own Id: OTP-9120</p> + </item> + </list> + </section> + +</section> + +<section><title>Reltool 0.5.4</title> <section><title>Improvements and New Features</title> <list> diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml index 0c2b7d2a2b..31e15e34e7 100644 --- a/lib/reltool/doc/src/reltool.xml +++ b/lib/reltool/doc/src/reltool.xml @@ -5,7 +5,7 @@ <header> <copyright> <year>2009</year> - <year>2009</year> + <year>2011</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> @@ -48,8 +48,8 @@ <c>root_dir</c> is the root directory of the analysed system and it defaults to the system executing <c>reltool</c>. Applications may also be located outside <c>root_dir</c>. <c>lib_dirs</c> - defines additional library directories where applications - additional may reside and it defaults to the the directories + defines library directories where additional applications + may reside and it defaults to the directories listed by the operating system environment variable <c>ERL_LIBS</c>. See the module <c>code</c> for more info. Finally single modules and entire applications may be read from @@ -58,10 +58,10 @@ <p>Some configuration parameters control the behavior of Reltool on system (<c>sys</c>) level. Others provide control on application (<c>app</c>) level and yet others are on module - (<c>mod</c>) level. Module level parameters overrides application - level parameters and application level parameters overrides system + (<c>mod</c>) level. Module level parameters override application + level parameters and application level parameters override system level parameters. Escript <c>escript</c> level parameters - overrides system level parameters.</p> + override system level parameters.</p> <p>The following top level <c>options</c> are supported:</p> @@ -74,7 +74,7 @@ a name of a <c>file</c> containing a sys tuple.</p> </item> - <tag><c>trap_exit></c></tag> + <tag><c>trap_exit</c></tag> <item> <p>This option controls the error handling behavior of <c>reltool</c>. By default the window processes traps @@ -123,10 +123,10 @@ defaults to <c>all</c> which means that if an application is included (either explicitly or implicitly) all modules in that application will be included. This implies that both modules - that exists on the <c>ebin</c> directory of the application, + that exist in the <c>ebin</c> directory of the application, as well as modules that are named in the <c>app</c> file will be included. If the parameter is set to <c>ebin</c>, both - modules on the <c>ebin</c> directory and derived modules are + modules in the <c>ebin</c> directory and derived modules are included. If the parameter is set to <c>app</c>, both modules in the <c>app</c> file and derived modules are included. <c>derived</c> means that only modules that are used by other @@ -138,13 +138,13 @@ <item> <p>This parameter controls the application and escript inclusion policy. It defaults to <c>derived</c> which means - that the applications that not have any explicit + that the applications that do not have any explicit <c>incl_cond</c> setting, will only be included if any other (explicitly or implicitly included) application uses it. The value <c>include</c> implies that all applications and - escripts that that not have any explicit <c>incl_cond</c> + escripts that do not have any explicit <c>incl_cond</c> setting will be included. <c>exclude</c> implies that all - applications and escripts) that that not have any explicit + applications and escripts) that do not have any explicit <c>incl_cond</c> setting will be excluded.</p> </item> @@ -158,7 +158,7 @@ <tag><c>rel</c></tag> <item> <p>Release specific configuration. Each release maps to a - <c>rel</c>, <c>script</c> and <c>boot </c> file. See the + <c>rel</c>, <c>script</c> and <c>boot</c> file. See the module <c>systools</c> for more info about the details. Each release has a name, a version and a set of applications with a few release specific parameters such as type and included @@ -168,7 +168,7 @@ <tag><c>relocatable</c></tag> <item> <p>This parameter controls whether the <c>erl</c> executable - in the target system automatically should determine where it + in the target system should automatically determine where it is installed or if it should use a hardcoded path to the installation. In the latter case the target system must be installed with <c>reltool:install/2</c> before it can be @@ -182,7 +182,7 @@ <p>The creation of the specification for a target system is performed in two steps. In the first step a complete specification is generated. It will likely contain much more - files than you are interested in your customized target + files than you are interested in in your customized target system. In the second step the specification will be filtered according to your filters. There you have the ability to specify filters per application as well as system wide @@ -224,12 +224,12 @@ <tag><c>incl_sys_filters</c></tag> <item> <p>This parameter normally contains a list of regular - expressions that controls which files in the system that + expressions that controls which files in the system should be included. Each file in the target system must match at least one of the listed regular expressions in order to be included. Further the files may not match any filter in <c>excl_sys_filters</c> in order to be included. Which - application files that should be included are controlled with + application files should be included is controlled with the parameters <c>incl_app_filters</c> and <c>excl_app_filters</c>. This parameter defaults to <c>[".*"]</c>.</p> @@ -238,8 +238,8 @@ <tag><c>excl_sys_filters</c></tag> <item> <p>This parameter normally contains a list of regular - expressions that controls which files in the system that not - should be included in the target system. In order to be + expressions that controls which files in the system should + not be included in the target system. In order to be included, a file must match some filter in <c>incl_sys_filters</c> but not any filter in <c>excl_sys_filters</c>. This parameter defaults to @@ -260,7 +260,7 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which application specific files - that not should be included in the target system. In order to + should not be included in the target system. In order to be included, a file must match some filter in <c>incl_app_filters</c> but not any filter in <c>excl_app_filters</c>. This parameter defaults to @@ -271,8 +271,8 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which top level directories in an - application that should be included in an archive file (as - opposed of beeing included as a regular directory outside the + application should be included in an archive file (as + opposed to being included as a regular directory outside the archive). Each top directory in the application must match at least one of the listed regular expressions in order to be included. Further the files may not match any filter in @@ -284,7 +284,7 @@ <item> <p>This parameter normally contains a list of regular expressions that controls which top level directories in an - application that not should be included in an archive file. In + application should not be included in an archive file. In order to be included in the application archive, a top directory must match some filter in <c>incl_archive_filters</c> but not any filter in <c>excl_archive_filters</c>. This @@ -295,15 +295,15 @@ <item> <p>This parameter contains a list of options that are given to <c>zip:create/3</c> when application specific files are - packaged into an archive. All options are not supported. The - most useful options in this context, are the ones that - controls which types of files that should be compressed. This + packaged into an archive. Only a subset of the options are + supported. The most useful options in this context are the ones + that control which types of files should be compressed. This parameter defaults to <c>[]</c>.</p> </item> </taglist> - <p>On application (<c>escript</c>) level,the following options are + <p>On application (<c>escript</c>) level, the following options are supported:</p> <taglist> @@ -314,7 +314,7 @@ </item> </taglist> - <p>On application (<c>app</c>) level,the following options are + <p>On application (<c>app</c>) level, the following options are supported:</p> <taglist> @@ -322,8 +322,8 @@ <item> <p>The version of the application. In an installed system there may exist several versions of an application. The <c>vsn</c> parameter - controls which version of the application that will be choosen. If it - is omitted, the latest version will be choosen.</p> + controls which version of the application will be chosen. If it + is omitted, the latest version will be chosen.</p> </item> <tag><c>mod</c></tag> <item> @@ -380,7 +380,7 @@ </item> </taglist> - <p>On module (<c>mod</c>) level,the following options are + <p>On module (<c>mod</c>) level, the following options are supported:</p> <taglist> @@ -391,9 +391,9 @@ will be used to control whether the module is included or not. The value of <c>incl_cond</c> overrides the module inclusion policy. <c>include</c> implies that the module is included, while - <c>exclude</c> implies that the module not is included. - <c>derived</c> implies that the is included if any included uses the - module.</p> + <c>exclude</c> implies that the module is not included. + <c>derived</c> implies that the module is included if it is used + by any other included module.</p> </item> <tag><c>debug_info</c></tag> <item> @@ -546,12 +546,12 @@ target_spec() = [target_spec()] files are by default copied to the target system. The <c>releases</c> directory contains generated <c>rel</c>, <c>script</c>, and <c>boot</c> files. The <c>lib</c> directory - contains the applications. Which applications that are included + contains the applications. Which applications are included and if they should be customized (archived, stripped from debug info etc.) is specified with various configuration parameters. The files in the <c>bin</c> directory are copied from the <c>erts-vsn/bin</c> directory, but only those files - that was originally included in <c>bin</c> directory of the + that were originally included in the <c>bin</c> directory of the source system.</p> <p>If the configuration parameter <c>relocatable</c> was set to @@ -584,10 +584,10 @@ target_spec() = [target_spec()] <v>Reason = reason()</v> </type> <desc><p>Get reltool configuration. Normally, only the explicit - configuration parameters with values that differs from their + configuration parameters with values that differ from their defaults are interesting. But the builtin default values can be returned by setting <c>InclDefaults</c> to <c>true</c>. The - derived configuration can be return by setting + derived configuration can be returned by setting <c>InclDerived</c> to <c>true</c>.</p></desc> </func> @@ -705,7 +705,7 @@ target_spec() = [target_spec()] <v>Reason = reason()</v> </type> <desc><p>Start a server process with options. The server process - identity can be given as argument to several other functions in the + identity can be given as an argument to several other functions in the API.</p></desc> </func> diff --git a/lib/reltool/doc/src/reltool_examples.xml b/lib/reltool/doc/src/reltool_examples.xml index bce9413b52..19a3f37819 100644 --- a/lib/reltool/doc/src/reltool_examples.xml +++ b/lib/reltool/doc/src/reltool_examples.xml @@ -5,7 +5,7 @@ <header> <copyright> <year>2009</year> - <year>2009</year> + <year>2011</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/reltool/doc/src/reltool_usage.xml b/lib/reltool/doc/src/reltool_usage.xml index 885828d1f0..d128e80a77 100644 --- a/lib/reltool/doc/src/reltool_usage.xml +++ b/lib/reltool/doc/src/reltool_usage.xml @@ -5,7 +5,7 @@ <header> <copyright> <year>2009</year> - <year>2009</year> + <year>2011</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> @@ -44,7 +44,7 @@ <section> <title>System window</title> <p>The system window is started with the function - <c>reltool:start/1</c>. At startup the tool will process the all + <c>reltool:start/1</c>. At startup the tool will process all <c>beam</c> files and <c>app</c> files in order to find out dependencies between applications and their modules. Once all this information has been derived, it will be possible to explore the tool.</p> @@ -67,29 +67,29 @@ <section> <title>Libraries</title> <p>On the library page it is possible to control which sources - that the tool will use. The page is organized as a tree which + the tool will use. The page is organized as a tree which can be expanded and collapsed by clicking on the little symbol in the beginning of the expandable/collapsible lines.</p> <p>The <c>Root directory</c> can be edited by selecting the line where the path of the root directory is displayed and - clicking with the right mouse button. Choose edit in the menu - that pops up. </p> + clicking the right mouse button. Choose edit in the menu + that pops up.</p> <p>Library directories can be added, edited or deleted. This is done by selecting the line where the path to a library - directory is displayed and clicking with the right mouse + directory is displayed and clicking the right mouse button. Choose add, edit or delete in the menu that pops up. New library directories can also be added by selecting the - line <c>Library directories</c> and clicking with the right + line <c>Library directories</c> and clicking the right mouse button. Choose add in the menu that pops up.</p> <p>Escript files can be added, edited or deleted. This is done by selecting the line where the path to an escript file is - displayed and clicking with the right mouse button. Choose + displayed and clicking the right mouse button. Choose add, edit or delete in the menu that pops up. New escripts can also be added by selecting the line <c>Escript files</c> and - clicking with the right mouse button. Choose add in the menu + clicking the right mouse button. Choose add in the menu that pops up.</p> <p>When libraries and escripts are expanded, the names of @@ -102,7 +102,7 @@ <p>On the system settings page it is possible to control some global settings that are used as defaults for all applications. Set the <c>Application inclusion policy</c> to - <c>include</c> to include all applications that not are + <c>include</c> to include all applications that are not explicitly excluded. See <c>incl_cond</c> (application inclusion) and <c>mod_cond</c> (module inclusion) in the reference manual for the module <c>reltool</c> for more @@ -131,14 +131,14 @@ <p>The symbols in front of the application names are intended to describe the status of the application. There are error - symbols and warning symbols that means that there are - something that needs attention. The tick symbol means that the + and warning symbols to signalize that there is + something which needs attention. The tick symbol means that the application is included or derived and no problem has been detected. The cross symbol means that the application is excluded or available and no problem has been detected. Applications with error symbols are listed first in - each category, then comes the warnings and the normal ones - (ticks and crosses) are found at the end.</p> + each category and are followed by the warnings and the + normal ones (ticks and crosses) at the end.</p> <p>Double click on an application to launch its application window.</p> @@ -175,8 +175,8 @@ </item> <item> <p><c>Save configuration</c> - Saves the current - configuration to file. Normally, only the explictit - configuration parameters with values that differs from their + configuration to file. Normally, only the explicit + configuration parameters with values that differ from their defaults are saved. But the configuration with or without default values and with or without derived values may also be saved.</p> @@ -204,21 +204,21 @@ <p>It is possible to perform some limited manipulations of the graph. Nodes can be moved, selected, locked or deleted. Move a single node or the entire graph by moving the mouse while the - left mouse button is pressed. A node is can be locked into a fix + left mouse button is pressed. A node can be locked into a fix position by holding down the shift button when the left mouse button is released. Select several nodes by moving the mouse - while the control key and the left mouse button i + while the control key and the left mouse button are pressed. Selected nodes can be locked, unlocked or deleted by - klicking on a suitable button.</p> + clicking on a suitable button.</p> <p>The algorithm that is used to draw a graph with as few crossed links as possible is called force graph. A force graph - consists of nodes and directed link between nodes. Each node is + consists of nodes and directed links between nodes. Each node is associated with a repulsive force that pushes nodes away from each other. This force can be adjusted with the left slider or with the mouse wheel. Each link is associated with an attractive - force that pulls the nodes nearer each other. This force can be - adjusted with the right slider. If this force becomes to strong, + force that pulls the nodes nearer to each other. This force can be + adjusted with the right slider. If this force becomes too strong, the graph will be unstable. The third parameter that can be adjusted is the length of the links. It is adjusted with the middle slider.</p> @@ -256,7 +256,7 @@ <p>Select version of the application in the <c>Source selection policy</c> part of the page. By default the latest version of the application is selected, but it is possible to override this by - explicitly select another version.</p> + explicitly selecting another version.</p> <p>By default the <c>Application inclusion policy</c> on system level is used for all applications. Set the value to @@ -272,10 +272,10 @@ want actually used modules to be included. Set it to <c>app</c> if you, besides derived modules, also want the modules listed in the app file to be included. Set it to <c>ebin</c> if you, besides - derived modules, also want the modules that exists as beam files - on the ebin directory to be included. Set it to <c>all</c> if you + derived modules, also want the modules that exist as beam files + in the ebin directory to be included. Set it to <c>all</c> if you want all modules to be included, that is the union of modules - found on the ebin directory and listed in the app file.</p> + found in the ebin directory and listed in the app file.</p> <p>The application settings page is rather incomplete.</p> </section> @@ -299,16 +299,16 @@ undone.</p> <p>The symbols in front of the module names are intended to - describe the status of the module. There are error symbols - and warning symbols that means that there are something that needs + describe the status of the module. There are error and + and warning symbols to signalize that there is something that needs attention. The tick symbol means that the module is included or derived and no problem has been detected. The cross symbol means that the module is excluded or available and no problem has been detected. Modules with error symbols are listed - first in each category, then comes the warnings and the normal - ones (ticks and crosses) are found at the end.</p> + first in each category and are followed by warnings and the + normal ones (ticks and crosses) at the end.</p> - <p>Double click on an module to launch its module window.</p> + <p>Double click on a module to launch its module window.</p> </section> @@ -323,7 +323,7 @@ <c>app</c> file. If the application includes other applications, these are listed under <c>Included</c>. These applications are listed in the <c>included_applications</c> part of the <c>app</c> - file. If the application uses modules other applications, these + file. If the application uses other applications, these are listed under <c>Uses</c>.</p> <p>Double click on an application name to launch an application window.</p> @@ -336,7 +336,7 @@ <p>There are two categories of modules on the <c>Module dependencies</c> page. If the module is used by other modules, these are listed under <c>Modules used by others</c>. If the - module uses modules other modules, these are listed under <c>Used + module uses other modules, these are listed under <c>Used modules</c>.</p> <p>Double click on an module name to launch a module window.</p> @@ -365,8 +365,8 @@ <p>There are two categories of modules on the <c>Dependencies</c> page. If the module is used by other modules, these are listed - under <c>Modules used by others</c>. If the module uses modules - other modules, these are listed under <c>Used modules</c>.</p> + under <c>Modules used by others</c>. If the module uses other + modules, these are listed under <c>Used modules</c>.</p> <p>Double click on an module name to launch a module window.</p> @@ -378,7 +378,7 @@ <p>On the <c>Code</c> page the Erlang source code is displayed. It is possible to search forwards and backwards for text in the module. Enter a regular expression in the <c>Find</c> field and - press enter. It is also possible to goto a certain line on the + press enter. It is also possible to go to a certain line in the module. The <c>Back</c> button can be used to go back to the previous position.</p> diff --git a/lib/reltool/src/reltool.app.src b/lib/reltool/src/reltool.app.src index b80753e8fc..4188f341f1 100644 --- a/lib/reltool/src/reltool.app.src +++ b/lib/reltool/src/reltool.app.src @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -22,8 +22,8 @@ {vsn, "%VSN%"}, {modules, [ - reltool_app_win, reltool, + reltool_app_win, reltool_fgraph, reltool_fgraph_win, reltool_mod_win, diff --git a/lib/reltool/src/reltool.erl b/lib/reltool/src/reltool.erl index 9dd0a24f46..54eb1ca9e1 100644 --- a/lib/reltool/src/reltool.erl +++ b/lib/reltool/src/reltool.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -38,26 +38,26 @@ start() -> %% Start main window process -spec start(options()) -> {ok, window_pid()} | {error, reason()}. -start(Options)when is_list(Options) -> +start(Options) when is_list(Options) -> case start_link(Options) of - {ok, WinPid} -> + {ok, WinPid} = OK -> unlink(WinPid), - {ok, WinPid}; - Other-> - Other + OK; + {error, _Reason} = Error -> + Error end. %% Start main window process with wx debugging enabled --spec debug() -> {ok, window_pid()} | {error, reason()}. +-spec debug() -> {ok, window_pid()} | {error, reason()}. debug() -> start([{wx_debug, 2}]). %% Start main window process with options --spec start_link(options()) -> {ok, window_pid() | {error, reason()}}. +-spec start_link(options()) -> {ok, window_pid()} | {error, reason()}. start_link(Options) when is_list(Options) -> case reltool_sys_win:start_link(Options) of - {ok, WinPid} -> - {ok, WinPid}; + {ok, _WinPid} = OK -> + OK; {error, Reason} -> {error, lists:flatten(io_lib:format("~p", [Reason]))} end. @@ -76,8 +76,8 @@ start_server(Options) -> -spec get_server(window_pid()) -> {ok, server_pid()} | {error, reason()}. get_server(WinPid) -> case reltool_sys_win:get_server(WinPid) of - {ok, ServerPid} -> - {ok, ServerPid}; + {ok, _ServerPid} = OK -> + OK; {error, Reason} -> {error, lists:flatten(io_lib:format("~p", [Reason]))} end. @@ -96,9 +96,9 @@ stop(Pid) when is_pid(Pid) -> end. %% Internal library function --spec eval_server(server(), boolean(), fun((server_pid()) -> term())) -> - {ok, server_pid()} | {error, reason()}. -eval_server(Pid, DisplayWarnings, Fun) +-spec eval_server(server(), boolean(), fun((server_pid()) -> Ret)) -> + Ret | {error, reason()} when Ret :: term(). +eval_server(Pid, _DisplayWarnings, Fun) when is_pid(Pid) -> Fun(Pid); eval_server(Options, DisplayWarnings, Fun) @@ -107,8 +107,8 @@ eval_server(Options, DisplayWarnings, Fun) Res = case start_server(Options) of {ok, Pid} -> apply_fun(Pid, DisplayWarnings, Fun); - {error, Reason} -> - {error, Reason} + {error, _Reason} = Error -> + Error end, process_flag(trap_exit, TrapExit), Res. @@ -122,21 +122,18 @@ apply_fun(Pid, true, Fun) -> {ok, Warnings} -> [io:format("~p: ~s\n", [?APPLICATION, W]) || W <- Warnings], apply_fun(Pid, false, Fun); - {error, Reason} -> + {error, _Reason} = Error -> stop(Pid), - {error, Reason} + Error end. %% Get status about the configuration -type warning() :: string(). --spec get_status(server()) -> - {ok, [warning()]} | {error, reason()}. +-spec get_status(server()) -> {ok, [warning()]} | {error, reason()}. get_status(PidOrOptions) when is_pid(PidOrOptions); is_list(PidOrOptions) -> eval_server(PidOrOptions, false, - fun(Pid) -> - reltool_server:get_status(Pid) - end). + fun(Pid) -> reltool_server:get_status(Pid) end). %% Get reltool configuration -spec get_config(server()) -> {ok, config()} | {error, reason()}. diff --git a/lib/reltool/src/reltool.hrl b/lib/reltool/src/reltool.hrl index 1a34ced89d..93f47f6381 100644 --- a/lib/reltool/src/reltool.hrl +++ b/lib/reltool/src/reltool.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -20,8 +20,8 @@ -define(MISSING_APP_NAME, '*MISSING*'). -define(MISSING_APP_TEXT, "*MISSING*"). --type file() :: string(). --type dir() :: string(). +-type file() :: file:filename(). +-type dir() :: file:filename(). %% app - Include all modules in app file %% ebin - Include all modules on ebin directory %% derived - Include only those modules that others are dependent on @@ -48,7 +48,7 @@ -type mod_name() :: atom(). -type app_name() :: atom(). -type app_vsn() :: string(). % e.g. "4.7" --type app_label() :: string().% e.g. "mnesia" or "mnesia-4.7" +-type app_label() :: string(). % e.g. "mnesia" or "mnesia-4.7" -type app_type() :: permanent | transient | temporary | load | none. -type incl_app() :: app_name(). -type emu_name() :: string(). @@ -93,10 +93,10 @@ | {escript, escript_file(), [escript()]} | {app, app_name(), [app()]}. -type config() :: {sys, [sys()]}. --type option() :: {wx_debug, term()} | - {trap_exit, boolean()} | - config() | - {config, config() | file()}. +-type option() :: {wx_debug, term()} + | {trap_exit, boolean()} + | config() + | {config, config() | file()}. -type options() :: [option()]. -type server_pid() :: pid(). -type window_pid() :: pid(). @@ -110,32 +110,30 @@ -type top_dir() :: file(). -type top_file() :: file(). -type target_spec() :: [target_spec()] - | {create_dir, base_dir(), [target_spec()]} - | {create_dir, base_dir(), top_dir(), [target_spec()]} - | {archive, base_file(), [archive_opt()], [target_spec()]} - | {copy_file, base_file()} - | {copy_file, base_file(), top_file()} - | {write_file, base_file(), iolist()} - | {strip_beam_file, base_file()}. --type target_dir() :: dir(). --type incl_defaults() :: boolean(). --type incl_derived() :: boolean(). --type ets_tab() :: term(). --type status() :: missing | ok. + | {create_dir, base_dir(), [target_spec()]} + | {create_dir, base_dir(), top_dir(), [target_spec()]} + | {archive, base_file(), [archive_opt()], [target_spec()]} + | {copy_file, base_file()} + | {copy_file, base_file(), top_file()} + | {write_file, base_file(), iolist()} + | {strip_beam_file, base_file()}. +-type target_dir() :: dir(). +-type incl_defaults() :: boolean(). +-type incl_derived() :: boolean(). +-type status() :: missing | ok. -record(common, { sys_debug :: term(), wx_debug :: term(), trap_exit :: boolean(), - app_tab :: ets_tab(), - mod_tab :: ets_tab(), - mod_used_by_tab :: ets_tab() - }). - + app_tab :: ets:tab(), + mod_tab :: ets:tab(), + mod_used_by_tab :: ets:tab() + }). -record(mod, - {%% Static + { %% Static name :: mod_name(), app_name :: app_name(), incl_cond :: incl_cond() | undefined, @@ -144,13 +142,12 @@ is_ebin_mod :: boolean(), uses_mods :: [mod_name()], exists :: boolean(), - %% Dynamic status :: status(), used_by_mods :: [mod_name()], is_pre_included :: boolean() | undefined, is_included :: boolean() | undefined - }). + }). -record(app_info, { @@ -166,10 +163,12 @@ env = [] :: [{atom(), term()}], mod = undefined :: {mod_name(), [term()]} | undefined, start_phases = undefined :: [{atom(), term()}] | undefined - }). + }). + +-record(regexp, {source, compiled}). -record(app, - {%% Static info + { %% Static info name :: app_name(), is_escript :: boolean(), use_selected_vsn :: boolean() | undefined, @@ -188,10 +187,10 @@ debug_info :: debug_info() | undefined, app_file :: app_file() | undefined, app_type :: app_type() | undefined, - incl_app_filters :: incl_app_filters(), - excl_app_filters :: excl_app_filters(), - incl_archive_filters :: incl_archive_filters(), - excl_archive_filters :: excl_archive_filters(), + incl_app_filters :: [#regexp{}], + excl_app_filters :: [#regexp{}], + incl_archive_filters :: [#regexp{}], + excl_archive_filters :: [#regexp{}], archive_opts :: [archive_opt()], %% Dynamic @@ -203,13 +202,13 @@ is_pre_included :: boolean(), is_included :: boolean(), rels :: [rel_name()] - }). + }). -record(rel_app, { - name :: app_name(), - app_type :: app_type(), - incl_apps :: [incl_app()] + name :: app_name(), + app_type :: app_type() | undefined, + incl_apps = [] :: [incl_app()] }). -record(rel, @@ -217,11 +216,10 @@ name :: rel_name(), vsn :: rel_vsn(), rel_apps :: [#rel_app{}] - }). + }). -record(sys, - { - %% Sources + { %% Sources root_dir :: dir(), lib_dirs :: [dir()], escripts :: [file()], @@ -234,21 +232,19 @@ rels :: [#rel{}], emu_name :: emu_name(), profile :: profile(), - incl_sys_filters :: incl_sys_filters(), - excl_sys_filters :: excl_sys_filters(), - incl_app_filters :: incl_app_filters(), - excl_app_filters :: excl_app_filters(), - incl_archive_filters :: incl_archive_filters(), - excl_archive_filters :: excl_archive_filters(), + incl_sys_filters :: [#regexp{}], + excl_sys_filters :: [#regexp{}], + incl_app_filters :: [#regexp{}], + excl_app_filters :: [#regexp{}], + incl_archive_filters :: [#regexp{}], + excl_archive_filters :: [#regexp{}], archive_opts :: [archive_opt()], relocatable :: boolean(), rel_app_type :: app_type(), embedded_app_type :: app_type() | undefined, app_file :: app_file(), debug_info :: debug_info() - }). - --record(regexp, {source, compiled}). + }). -define(ERR_IMAGE, 0). -define(WARN_IMAGE, 1). @@ -275,7 +271,7 @@ -define(DEFAULT_INCL_ARCHIVE_FILTERS, [".*"]). -define(DEFAULT_EXCL_ARCHIVE_FILTERS, ["^include\$", "^priv\$"]). --define(DEFAULT_ARCHIVE_OPTS, []). +-define(DEFAULT_ARCHIVE_OPTS, []). -define(DEFAULT_INCL_SYS_FILTERS, [".*"]). -define(DEFAULT_EXCL_SYS_FILTERS, []). @@ -305,5 +301,5 @@ "^erts.*/bin/(start|escript|to_erl|run_erl)(|\\.exe)\$", "^erts.*/bin/.*(debug|pdb)"]). -define(STANDALONE_INCL_APP_FILTERS, ["^ebin", - "^priv"]). + "^priv"]). -define(STANDALONE_EXCL_APP_FILTERS, ["^ebin/.*\\.appup\$"]). diff --git a/lib/reltool/src/reltool_mod_win.erl b/lib/reltool/src/reltool_mod_win.erl index 281d2c8ad4..e1c2fa5100 100644 --- a/lib/reltool/src/reltool_mod_win.erl +++ b/lib/reltool/src/reltool_mod_win.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -744,7 +744,7 @@ create_editor(Parent) -> wxStyledTextCtrl:styleSetFont(Ed, Style, FixedFont), wxStyledTextCtrl:styleSetForeground(Ed, Style, Color) end, - [SetStyle(Style) || Style <- Styles], + lists:foreach(fun (Style) -> SetStyle(Style) end, Styles), wxStyledTextCtrl:setKeyWords(Ed, 0, keyWords()), %% Margins Markers diff --git a/lib/reltool/src/reltool_server.erl b/lib/reltool/src/reltool_server.erl index 039ad56aa8..9743289ca6 100644 --- a/lib/reltool/src/reltool_server.erl +++ b/lib/reltool/src/reltool_server.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -498,8 +498,8 @@ more_apps_in_rels([{RelName, AppName} = RA | RelApps], Apps, Acc, Status) -> true -> more_apps_in_rels(RelApps, Apps, Acc, Status); false -> - case lists:keysearch(AppName, #app.name, Apps) of - {value, #app{info = #app_info{applications = InfoApps}}} -> + case lists:keyfind(AppName, #app.name, Apps) of + #app{info = #app_info{applications = InfoApps}} -> Extra = [{RelName, N} || N <- InfoApps], {Acc2, Status2} = more_apps_in_rels(Extra, Apps, [RA | Acc], Status), @@ -743,9 +743,9 @@ mod_propagate_is_used_by(_C, []) -> read_apps(C, Sys, [#app{mods = Mods, is_included = IsIncl} = A | Apps], Acc) -> {Mods2, IsIncl2} = read_apps(C, Sys, A, Mods, [], IsIncl), Status = - case lists:keysearch(missing, #mod.status, Mods2) of - {value, _} -> missing; - false -> ok + case lists:keymember(missing, #mod.status, Mods2) of + true -> missing; + false -> ok end, UsesMods = [M#mod.uses_mods || M <- Mods2, M#mod.is_included =:= true], UsesMods2 = lists:usort(lists:flatten(UsesMods)), @@ -820,22 +820,14 @@ filter_app(A) -> A#app.use_selected_vsn =:= undefined -> false; true -> - {Dir, Dirs} = + {Dir, Dirs, OptVsn} = case A#app.use_selected_vsn of undefined -> - {shrinked, []}; + {shrinked, [], undefined}; false -> - {shrinked, []}; + {shrinked, [], undefined}; true -> - {A#app.active_dir, [A#app.active_dir]}; - _ when A#app.is_escript -> - {A#app.active_dir, [A#app.active_dir]} - end, - OptVsn = - case A#app.use_selected_vsn of - undefined -> undefined; - false -> undefined; - true -> A#app.vsn + {A#app.active_dir, [A#app.active_dir], A#app.vsn} end, {true, A#app{active_dir = Dir, sorted_dirs = Dirs, @@ -1087,8 +1079,8 @@ missing_mod(ModName, AppName) -> add_mod_config(Mods, ModConfigs) -> AddConfig = fun(Config, Acc) -> - case lists:keysearch(Config#mod.name, #mod.name, Mods) of - {value, M} -> + case lists:keyfind(Config#mod.name, #mod.name, Mods) of + #mod{} = M -> M2 = M#mod{incl_cond = Config#mod.incl_cond}, lists:keystore(Config#mod.name, #mod.name, Acc, M2); false -> @@ -1179,10 +1171,10 @@ read_config(OldSys, {sys, KeyVals}, Status) -> end, NewSys2 = NewSys#sys{apps = lists:sort(Apps), rels = lists:sort(Rels)}, - case lists:keysearch(NewSys2#sys.boot_rel, + case lists:keymember(NewSys2#sys.boot_rel, #rel.name, NewSys2#sys.rels) of - {value, _} -> + true -> {NewSys2, Status2}; false -> Text2 = lists:concat(["Release " ++ NewSys2#sys.boot_rel, @@ -1326,7 +1318,7 @@ decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) -> Val =:= none; Val =:= undefined -> {Sys#sys{embedded_app_type = Val}, Status}; - app_file when Val =:= keep; Val =:= strip, Val =:= all -> + app_file when Val =:= keep; Val =:= strip; Val =:= all -> {Sys#sys{app_file = Val}, Status}; debug_info when Val =:= keep; Val =:= strip -> {Sys#sys{debug_info = Val}, Status}; @@ -1418,27 +1410,27 @@ decode(#mod{} = Mod, [{Key, Val} | KeyVals], Status) -> end, decode(Mod2, KeyVals, Status2); decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals], Status) -> - RA = + {ValidTypesAssigned, RA} = case RelApp of Name when is_atom(Name) -> - #rel_app{name = Name, app_type = undefined, incl_apps = []}; + {true, #rel_app{name = Name}}; {Name, Type} when is_atom(Name) -> - #rel_app{name = Name, app_type = Type, incl_apps = []}; + {is_type(Type), #rel_app{name = Name, app_type = Type}}; {Name, InclApps} when is_atom(Name), is_list(InclApps) -> - #rel_app{name = Name, - app_type = undefined, - incl_apps = InclApps}; + VI = lists:all(fun erlang:is_atom/1, InclApps), + {VI, #rel_app{name = Name, incl_apps = InclApps}}; {Name, Type, InclApps} when is_atom(Name), is_list(InclApps) -> - #rel_app{name = Name, app_type = Type, incl_apps = InclApps}; + VT = is_type(Type), + VI = lists:all(fun erlang:is_atom/1, InclApps), + {VT andalso VI, + #rel_app{name = Name, app_type = Type, incl_apps = InclApps}}; _ -> - #rel_app{incl_apps = []} + {false, #rel_app{incl_apps = []}} end, - IsType = is_type(RA#rel_app.app_type), - NonAtoms = [IA || IA <- RA#rel_app.incl_apps, not is_atom(IA)], - if - IsType, NonAtoms =:= [] -> + case ValidTypesAssigned of + true -> decode(Rel#rel{rel_apps = RelApps ++ [RA]}, KeyVals, Status); - true -> + false -> Text = lists:flatten(io_lib:format("~p", [RelApp])), Status2 = reltool_utils:return_first_error(Status, @@ -1542,10 +1534,9 @@ check_rel(RelName, RelApps, Status) -> patch_erts_version(RootDir, Apps, Status) -> AppName = erts, - case lists:keysearch(AppName, #app.name, Apps) of - {value, Erts} -> + case lists:keyfind(AppName, #app.name, Apps) of + #app{vsn = Vsn} = Erts -> LocalRoot = code:root_dir(), - Vsn = Erts#app.vsn, if LocalRoot =:= RootDir, Vsn =:= "" -> Vsn2 = erlang:system_info(version), @@ -1773,20 +1764,20 @@ files_to_apps(_Escript, [], Acc, _Apps, _OldApps, Status) -> {lists:keysort(#app.name, Acc), Status}. merge_escript_app(AppName, Dir, Info, Mods, Apps, OldApps, Status) -> - case lists:keysearch(AppName, #app.name, OldApps) of - {value, App} -> - ok; - false -> - App = default_app(AppName, Dir) - end, - App2 = App#app{is_escript = true, - label = filename:basename(Dir, ".escript"), - info = Info, - mods = Mods, - active_dir = Dir, - sorted_dirs = [Dir]}, - case lists:keysearch(AppName, #app.name, Apps) of - {value, _} -> + App1 = case lists:keyfind(AppName, #app.name, OldApps) of + #app{} = App -> + App; + false -> + default_app(AppName, Dir) + end, + App2 = App1#app{is_escript = true, + label = filename:basename(Dir, ".escript"), + info = Info, + mods = Mods, + active_dir = Dir, + sorted_dirs = [Dir]}, + case lists:keymember(AppName, #app.name, Apps) of + true -> Error = lists:concat([AppName, ": Application name clash. ", "Escript ", Dir," contains application ", AppName, "."]), @@ -1804,12 +1795,15 @@ merge_app_dirs([{Name, Dir} | Rest], Apps, OldApps) -> %% Initate app Apps2 = sort_app_dirs(Apps), Apps4 = - case lists:keysearch(Name, #app.name, Apps) of + case lists:keyfind(Name, #app.name, Apps) of false -> - case lists:keysearch(Name, #app.name, OldApps) of - {value, OldApp} when OldApp#app.active_dir =:= Dir -> + case lists:keyfind(Name, #app.name, OldApps) of + false -> + App = default_app(Name, Dir), + [App | Apps2]; + #app{active_dir = Dir} = OldApp -> [OldApp | Apps2]; - {value, OldApp} -> + OldApp -> App = case filter_app(OldApp) of {true, NewApp} -> @@ -1818,12 +1812,9 @@ merge_app_dirs([{Name, Dir} | Rest], Apps, OldApps) -> false -> default_app(Name, Dir) end, - [App | Apps2]; - false -> - App = default_app(Name, Dir), [App | Apps2] end; - {value, OldApp} -> + OldApp -> Apps3 = lists:keydelete(Name, #app.name, Apps2), App = OldApp#app{sorted_dirs = [Dir | OldApp#app.sorted_dirs]}, [App | Apps3] diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl index dd6f75b9fc..0fcf89a360 100644 --- a/lib/reltool/src/reltool_target.erl +++ b/lib/reltool/src/reltool_target.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -90,11 +90,11 @@ do_gen_config(#sys{root_dir = RootDir, debug_info = DebugInfo}, InclDefs) -> ErtsItems = - case lists:keysearch(erts, #app.name, Apps) of - {value, Erts} -> - [{erts, do_gen_config(Erts, InclDefs)}]; - false -> - [] + case lists:keyfind(erts, #app.name, Apps) of + false -> + []; + Erts -> + [{erts, do_gen_config(Erts, InclDefs)}] end, AppsItems = [do_gen_config(A, InclDefs) @@ -521,7 +521,6 @@ sort_apps([#app{name = Name, info = Info} = App | Apps], Visited, [], []), - Missing1 = NotFnd1 ++ NotFnd2 ++ Missing, case Uses ++ Incs of [] -> @@ -533,7 +532,7 @@ sort_apps([#app{name = Name, info = Info} = App | Apps], %% The apps in L must be started before the app. %% Check if we have already taken care of some app in L, %% in that case we have a circular dependency. - NewCircular = [N1 || N1 <- L, N2 <- Visited, N1 =:= N2], + NewCircular = [N || #app{name = N} <- L, N2 <- Visited, N =:= N2], Circular1 = case NewCircular of [] -> Circular; _ -> [Name | NewCircular] ++ Circular @@ -558,9 +557,9 @@ sort_apps([], Missing, Circular, _) -> [make_set(Circular), make_set(Missing)]). find_all(CheckingApp, [Name | Names], Apps, Visited, Found, NotFound) -> - case lists:keysearch(Name, #app.name, Apps) of - {value, #app{info = Info} = App} -> - %% It is OK to have a dependecy like + case lists:keyfind(Name, #app.name, Apps) of + #app{info = Info} = App -> + %% It is OK to have a dependency like %% X includes Y, Y uses X. case lists:member(CheckingApp, Info#app_info.incl_apps) of true -> @@ -1232,7 +1231,7 @@ do_eval_spec({strip_beam, File}, _OrigSourceDir, SourceDir, TargetDir) -> reltool_utils:write_file(TargetFile, BeamBin2). cleanup_spec(List, TargetDir) when is_list(List) -> - lists:foreach(fun(F)-> cleanup_spec(F, TargetDir) end, List); + lists:foreach(fun(F) -> cleanup_spec(F, TargetDir) end, List); %% cleanup_spec({source_dir, _SourceDir, Spec}, TargetDir) -> %% cleanup_spec(Spec, TargetDir); cleanup_spec({create_dir, Dir, Files}, TargetDir) -> @@ -1444,8 +1443,8 @@ subst([], _Vars, Result) -> subst_var([$%| Rest], Vars, Result, VarAcc) -> Key = lists:reverse(VarAcc), - case lists:keysearch(Key, 1, Vars) of - {value, {Key, Value}} -> + case lists:keyfind(Key, 1, Vars) of + {Key, Value} -> subst(Rest, Vars, lists:reverse(Value, Result)); false -> subst(Rest, Vars, [$% | VarAcc ++ [$% | Result]]) diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile index 34781ae720..62fe05238b 100644 --- a/lib/reltool/test/Makefile +++ b/lib/reltool/test/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2009-2010. All Rights Reserved. +# Copyright Ericsson AB 2009-2011. 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 @@ -73,9 +73,10 @@ release_spec: opt release_tests_spec: opt $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) reltool.spec $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) - $(INSTALL_PROGRAM) rtt $(INSTALL_PROGS) $(RELSYSDIR) -# chmod -f -R u+w $(RELSYSDIR) + $(INSTALL_DATA) reltool.spec reltool.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR) + $(INSTALL_SCRIPT) rtt $(INSTALL_PROGS) $(RELSYSDIR) + $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR) +# chmod -R u+w $(RELSYSDIR) # @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) release_docs_spec: diff --git a/lib/reltool/test/reltool.cover b/lib/reltool/test/reltool.cover new file mode 100644 index 0000000000..ca425b9f98 --- /dev/null +++ b/lib/reltool/test/reltool.cover @@ -0,0 +1,2 @@ +{incl_app,reltool,details}. + diff --git a/lib/reltool/test/reltool.spec b/lib/reltool/test/reltool.spec index 252232e09d..2995720105 100644 --- a/lib/reltool/test/reltool.spec +++ b/lib/reltool/test/reltool.spec @@ -1,2 +1 @@ -{topcase, {dir, "../reltool_test"}}. - +{suites,"../reltool_test",all}. diff --git a/lib/reltool/test/reltool_app_SUITE.erl b/lib/reltool/test/reltool_app_SUITE.erl index f8433f73d0..a6e00cde08 100644 --- a/lib/reltool/test/reltool_app_SUITE.erl +++ b/lib/reltool/test/reltool_app_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010. All Rights Reserved. +%% Copyright Ericsson AB 2010-2011. 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 @@ -45,35 +45,36 @@ init_per_suite(Config) -> end_per_suite(Config) -> reltool_test_lib:end_per_suite(Config). +init_per_testcase(undef_funcs=Case, Config) -> + case test_server:is_debug() of + true -> + {skip,"Debug-compiled emulator -- far too slow"}; + false -> + Config2 = [{tc_timeout, timer:minutes(10)} | Config], + reltool_test_lib:init_per_testcase(Case, Config2) + end; init_per_testcase(Case, Config) -> - Config2 = - case Case of - undef_funcs -> - [{tc_timeout, timer:minutes(10)} | Config]; - _ -> - Config - end, - reltool_test_lib:init_per_testcase(Case, Config2). + reltool_test_lib:init_per_testcase(Case, Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Case, Config) -> - reltool_test_lib:end_per_testcase(Case, Config). - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all() -> - all(suite). - -all(suite) -> - [ - fields, - modules, - export_all, - app_depend, - undef_funcs - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [fields, modules, export_all, app_depend, undef_funcs]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index faf1bdbba2..b77560db94 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009-2010. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -18,8 +18,9 @@ -module(reltool_server_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -42,25 +43,27 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% SUITE specification -all() -> - all(suite). -all(suite) -> - [ - start_server, - set_config, - create_release, - create_script, - create_target, - create_embedded, - create_standalone, - create_old_target - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [start_server, set_config, create_release, + create_script, create_target, create_embedded, + create_standalone, create_old_target, + otp_9135]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases @@ -108,6 +111,37 @@ set_config(_Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% OTP-9135, test that app_file option can be set to all | keep | strip + +otp_9135(TestInfo) when is_atom(TestInfo) -> + reltool_test_lib:tc_info(TestInfo); +otp_9135(_Config) -> + Libs = lists:sort(erl_libs()), + StrippedDefaultSys = + case Libs of + [] -> []; + _ -> {lib_dirs, Libs} + end, + + Config1 = {sys,[{app_file, keep}]}, % this is the default + {ok, Pid1} = ?msym({ok, _}, reltool:start_server([{config, Config1}])), + ?m({ok, {sys,StrippedDefaultSys}}, reltool:get_config(Pid1)), + ?m(ok, reltool:stop(Pid1)), + + Config2 = {sys,[{app_file, strip}]}, + {ok, Pid2} = ?msym({ok, _}, reltool:start_server([{config, Config2}])), + ExpectedConfig2 = StrippedDefaultSys++[{app_file,strip}], + ?m({ok, {sys,ExpectedConfig2}}, reltool:get_config(Pid2)), + ?m(ok, reltool:stop(Pid2)), + + Config3 = {sys,[{app_file, all}]}, + {ok, Pid3} = ?msym({ok, _}, reltool:start_server([{config, Config3}])), + ExpectedConfig3 = StrippedDefaultSys++[{app_file,all}], + ?m({ok, {sys,ExpectedConfig3}}, reltool:get_config(Pid3)), + ?m(ok, reltool:stop(Pid3)), + ok. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Generate releases create_release(TestInfo) when is_atom(TestInfo) -> diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl index 5390b0a75e..b8bcbcd009 100644 --- a/lib/reltool/test/reltool_test_lib.erl +++ b/lib/reltool/test/reltool_test_lib.erl @@ -97,7 +97,7 @@ wx_init_per_suite(Config) -> exit({skipped, "Can not test on MacOSX"}); {unix, _} -> io:format("DISPLAY ~s~n", [os:getenv("DISPLAY")]), - case proplists:get_value(xserver, Config, none) of + case ct:get_config(xserver, none) of none -> ignore; Server -> os:putenv("DISPLAY", Server) end; @@ -295,7 +295,7 @@ eval_test_case(Mod, Fun, Config) -> test_case_evaluator(Mod, Fun, [Config]) -> NewConfig = Mod:init_per_testcase(Fun, Config), R = apply(Mod, Fun, [NewConfig]), - Mod:fin_per_testcase(Fun, NewConfig), + Mod:end_per_testcase(Fun, NewConfig), exit({test_case_ok, R}). wait_for_evaluator(Pid, Mod, Fun, Config) -> @@ -311,12 +311,12 @@ wait_for_evaluator(Pid, Mod, Fun, Config) -> {'EXIT', Pid, {skipped, Reason}} -> log("<WARNING> Test case ~w skipped, because ~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {skip, {Mod, Fun}, Reason}; {'EXIT', Pid, Reason} -> log("<ERROR> Eval process ~w exited, because\n\t~p~n", [{Mod, Fun}, Reason]), - Mod:fin_per_testcase(Fun, Config), + Mod:end_per_testcase(Fun, Config), {crash, {Mod, Fun}, Reason} end. diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl index 2e2b355e07..424bc7d189 100644 --- a/lib/reltool/test/reltool_wx_SUITE.erl +++ b/lib/reltool/test/reltool_wx_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2009-2011. 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 @@ -18,8 +18,9 @@ -module(reltool_wx_SUITE). --export([all/0, init_per_suite/1, end_per_suite/1, - init_per_testcase/2, fin_per_testcase/2, end_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, + init_per_testcase/2, end_per_testcase/2]). -compile(export_all). @@ -36,16 +37,22 @@ init_per_testcase(Func,Config) -> reltool_test_lib:init_per_testcase(Func,Config). end_per_testcase(Func,Config) -> reltool_test_lib:end_per_testcase(Func,Config). -fin_per_testcase(Func,Config) -> %% For test_server - reltool_test_lib:end_per_testcase(Func,Config). %% SUITE specification -all() -> - all(suite). -all(suite) -> - [ - start_all_windows - ]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [start_all_windows]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% The test cases diff --git a/lib/reltool/test/rtt.erl b/lib/reltool/test/rtt.erl index 6755b8400f..437009e26a 100644 --- a/lib/reltool/test/rtt.erl +++ b/lib/reltool/test/rtt.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2009. All Rights Reserved. +%% Copyright Ericsson AB 2010. 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 diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk index f23a7e84a2..484f84788d 100644 --- a/lib/reltool/vsn.mk +++ b/lib/reltool/vsn.mk @@ -1,28 +1 @@ -# This is an -*-makefile-*- file. -# %CopyrightBegin% -# -# Copyright Ericsson AB 2009-2010. 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 -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. -# -# %CopyrightEnd% - -RELTOOL_VSN = 0.5.4 - -TICKETS = OTP-8521 OTP-8590 -TICKETS_0_5_3 = OTP-8057 -TICKETS_0_5_2 = OTP-8254 -TICKETS_0_5_1 = OTP-8199 -TICKETS_0_5 = OTP-7949 -TICKETS_0_2_2 = OTP-7999 -TICKETS_2_2_1 = OTP-7840 -TICKETS_0_2 = OTP-7805 +RELTOOL_VSN = 0.5.5 |