diff options
author | Hans Bolinder <[email protected]> | 2017-12-22 12:30:19 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-12-22 12:30:19 +0100 |
commit | 51fa0ae8543f65b7c3ef08eb49a53a0921c35972 (patch) | |
tree | 24d5204f26f304acfa52589896387985f5e116c0 /lib/tools/test/cover_SUITE.erl | |
parent | fd86c54f8918dc4efffcc8af99054ab34eb4a666 (diff) | |
parent | c0af217b1255361ad11d0508e6591b8e649ebc7a (diff) | |
download | otp-51fa0ae8543f65b7c3ef08eb49a53a0921c35972.tar.gz otp-51fa0ae8543f65b7c3ef08eb49a53a0921c35972.tar.bz2 otp-51fa0ae8543f65b7c3ef08eb49a53a0921c35972.zip |
Merge branch 'maint'
* maint:
tools: Correct a counting bug in Cover
Diffstat (limited to 'lib/tools/test/cover_SUITE.erl')
-rw-r--r-- | lib/tools/test/cover_SUITE.erl | 28 |
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(), |