diff options
author | Björn Gustavsson <[email protected]> | 2019-02-11 13:37:43 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-02-11 14:56:27 +0100 |
commit | f2b6259a43dca0eafa4813c5cf63186d3dba3a0e (patch) | |
tree | 5943836d7f2a99fee09de43538c944f903e87ede /lib/common_test/src | |
parent | e6bdde9e927ad0933aaf36120cc740e2380567dc (diff) | |
download | otp-f2b6259a43dca0eafa4813c5cf63186d3dba3a0e.tar.gz otp-f2b6259a43dca0eafa4813c5cf63186d3dba3a0e.tar.bz2 otp-f2b6259a43dca0eafa4813c5cf63186d3dba3a0e.zip |
common_test: Add support for running cover:local_only/0
Diffstat (limited to 'lib/common_test/src')
-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=[], |