aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-12-22 12:26:11 +0100
committerHans Bolinder <[email protected]>2017-12-22 12:26:11 +0100
commitc0af217b1255361ad11d0508e6591b8e649ebc7a (patch)
tree98d5c21a2e7fabebb0b558480791dbf72d91080f /lib/tools/test
parent7661f39054e5e8f98ba2371f73f25fe739bd04a1 (diff)
parentf74a8e01a0ce954f4566007d521088a7ea1f146b (diff)
downloadotp-c0af217b1255361ad11d0508e6591b8e649ebc7a.tar.gz
otp-c0af217b1255361ad11d0508e6591b8e649ebc7a.tar.bz2
otp-c0af217b1255361ad11d0508e6591b8e649ebc7a.zip
Merge branch 'hasse/cover/fix_counting/OTP-14817/PR-1641' into maint
* hasse/cover/fix_counting/OTP-14817/PR-1641: tools: Correct a counting bug in Cover
Diffstat (limited to 'lib/tools/test')
-rw-r--r--lib/tools/test/cover_SUITE.erl28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index 90e113c178..161b0105b9 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ all() ->
distribution, reconnect, die_and_reconnect,
dont_reconnect_after_stop, stop_node_after_disconnect,
export_import, otp_5031, otp_6115,
- otp_8270, otp_10979_hanging_node],
+ otp_8270, otp_10979_hanging_node, otp_14817],
case whereis(cover_server) of
undefined ->
[coverage,StartStop ++ NoStartStop];
@@ -1574,6 +1574,30 @@ otp_10979_hanging_node(_Config) ->
ok.
+otp_14817(Config) when is_list(Config) ->
+ Test = <<"-module(otp_14817).
+ -export([a/0, b/0, c/0, d/0]).
+ a() -> ok. b() -> ok. c() -> ok.
+ d() -> ok.
+ ">>,
+ File = cc_mod(otp_14817, Test, Config),
+ ok = otp_14817:a(),
+ ok = otp_14817:b(),
+ ok = otp_14817:c(),
+ ok = otp_14817:d(),
+ {ok,[{{otp_14817,3},1},
+ {{otp_14817,3},1},
+ {{otp_14817,3},1},
+ {{otp_14817,4},1}]} =
+ cover:analyse(otp_14817, calls, line),
+ {ok, CovOut} = cover:analyse_to_file(otp_14817),
+ {ok, Bin} = file:read_file(CovOut),
+ <<"3..|",_/binary>> = string:find(Bin, "3..|"),
+ <<"1..|",_/binary>> = string:find(Bin, "1..|"),
+ ok = file:delete(File),
+ ok = file:delete(CovOut),
+ ok.
+
%% Take compiler options from beam in cover:compile_beam
compile_beam_opts(Config) when is_list(Config) ->
{ok, Cwd} = file:get_cwd(),