aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test/cover_SUITE.erl
diff options
context:
space:
mode:
authorShunichi Shinohara <[email protected]>2011-05-06 11:51:12 +0900
committerShunichi Shinohara <[email protected]>2011-05-06 11:51:12 +0900
commit7c1b371290b3e06834fcc4de7e5d0c89f43e818c (patch)
treecb626d9bae1cc93515cbb63b1fbb78911ea984e8 /lib/tools/test/cover_SUITE.erl
parent0568a0ea0f8bf115b639589f060f62d0435a956a (diff)
downloadotp-7c1b371290b3e06834fcc4de7e5d0c89f43e818c.tar.gz
otp-7c1b371290b3e06834fcc4de7e5d0c89f43e818c.tar.bz2
otp-7c1b371290b3e06834fcc4de7e5d0c89f43e818c.zip
Add a check logic to prevent file descriptor leak
cover module handle files as raw in export and import. Assert counts of ports are the same at the beginning and at the end of the test case.
Diffstat (limited to 'lib/tools/test/cover_SUITE.erl')
-rw-r--r--lib/tools/test/cover_SUITE.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index b5c8e8a1b7..fe7f92de78 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -395,6 +395,7 @@ export_import(suite) -> [];
export_import(Config) when is_list(Config) ->
?line DataDir = ?config(data_dir, Config),
?line ok = file:set_cwd(DataDir),
+ ?line PortCount = length(erlang:ports()),
%% Export one module
?line {ok,f} = cover:compile(f),
@@ -484,6 +485,9 @@ export_import(Config) when is_list(Config) ->
?line ?t:capture_stop(),
?line check_f_calls(1,0),
+ %% Check no raw files are left open
+ ?line PortCount = length(erlang:ports()),
+
%% Cleanup
?line ok = cover:stop(),
?line Files = lsfiles(),