diff options
author | Björn Gustavsson <[email protected]> | 2019-02-13 06:37:30 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-02-13 06:37:30 +0100 |
commit | e872bc4d9f51f65a746d8ffd8daa408bb4096ca6 (patch) | |
tree | aa6ced48ee39682c18a2a708b1060fa016598133 /lib/common_test | |
parent | 03ede8910696037c60874a345fd5a9a7c99c5b48 (diff) | |
parent | 89efd8081c32b3f56ebec5c1f44750aa3e96c0f6 (diff) | |
download | otp-e872bc4d9f51f65a746d8ffd8daa408bb4096ca6.tar.gz otp-e872bc4d9f51f65a746d8ffd8daa408bb4096ca6.tar.bz2 otp-e872bc4d9f51f65a746d8ffd8daa408bb4096ca6.zip |
Merge pull request #2137 from bjorng/bjorn/tools/cover
Use the counters module to speed up cover
OTP-15575
Diffstat (limited to 'lib/common_test')
-rw-r--r-- | lib/common_test/src/ct_cover.erl | 5 | ||||
-rw-r--r-- | lib/common_test/src/ct_run.erl | 8 | ||||
-rw-r--r-- | lib/common_test/src/ct_util.hrl | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_cover.erl b/lib/common_test/src/ct_cover.erl index d286f20a4d..bcd98dcc58 100644 --- a/lib/common_test/src/ct_cover.erl +++ b/lib/common_test/src/ct_cover.erl @@ -262,6 +262,11 @@ get_app_info(App=#cover{app=Name}, [{src_files,Name,Src1}|Terms], Dir) -> Src = App#cover.src, get_app_info(App#cover{src=Src++Src1},Terms,Dir); +get_app_info(App=#cover{app=none}, [{local_only,Bool}|Terms], Dir) -> + get_app_info(App, [{local_only,none,Bool}|Terms], Dir); +get_app_info(App=#cover{app=Name}, [{local_only,Name,Bool}|Terms], Dir) -> + get_app_info(App#cover{local_only=Bool},Terms,Dir); + get_app_info(App, [_|Terms], Dir) -> get_app_info(App, Terms, Dir); diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index c9d406f1fd..960252a6fe 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -2345,18 +2345,24 @@ start_cover(Opts=#opts{coverspec=CovData,cover_stop=CovStop},LogDir) -> CovImport, _CovExport, #cover{app = CovApp, + local_only = LocalOnly, level = CovLevel, excl_mods = CovExcl, incl_mods = CovIncl, cross = CovCross, src = _CovSrc}} = CovData, + case LocalOnly of + true -> cover:local_only(); + false -> ok + end, ct_logs:log("COVER INFO", "Using cover specification file: ~ts~n" "App: ~w~n" + "Local only: ~w~n" "Cross cover: ~w~n" "Including ~w modules~n" "Excluding ~w modules", - [CovFile,CovApp,CovCross, + [CovFile,CovApp,LocalOnly,CovCross, length(CovIncl),length(CovExcl)]), %% Tell test_server to print a link in its coverlog diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl index 039c8168ec..d5c93d05ba 100644 --- a/lib/common_test/src/ct_util.hrl +++ b/lib/common_test/src/ct_util.hrl @@ -62,6 +62,7 @@ merge_tests=true}). -record(cover, {app=none, + local_only=false, level=details, excl_mods=[], incl_mods=[], |