diff --git a/doc/src/reference.adoc b/doc/src/reference.adoc index 5d8f8ace5..688bcae11 100644 --- a/doc/src/reference.adoc +++ b/doc/src/reference.adoc @@ -352,6 +352,11 @@ The `` makes it possible to treat warnings as errors and abort compilation on a warning. The value `on` enables this behavior. The default value is `off`. +[[bbv2.builtin.features.coverage]]`coverage`:: +The `` feature controls whether the code is instrumented to +generate coverage data during execution. +The value `on` enables this. The default value is `off`. + [[bbv2.builtin.features.build]]`build`:: *Allowed values:* `no` + diff --git a/src/tools/builtin.py b/src/tools/builtin.py index a417f13e0..59edd0c4d 100644 --- a/src/tools/builtin.py +++ b/src/tools/builtin.py @@ -197,6 +197,11 @@ def register_globals (): 'on'], # Fail the compilation if there are warnings. ['incidental', 'propagated']) + feature.feature('coverage', [ + 'off', # Disable coverage generation for the tool. + 'on'], # Enable coverage generation for the tool. + ['incidental', 'propagated']) + feature.feature('c++-template-depth', [str(i) for i in range(64,1024+1,64)] + [str(i) for i in range(20,1000+1,10)] + diff --git a/src/tools/features/coverage-feature.jam b/src/tools/features/coverage-feature.jam index 80ef3122e..f0d8ccdfe 100644 --- a/src/tools/features/coverage-feature.jam +++ b/src/tools/features/coverage-feature.jam @@ -1,12 +1,13 @@ # Copyright 2019 Rene Rivera +# Copyright 2019 Hans Dembinski # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -# What kind of coverage information to generate. - import feature ; feature.feature coverage - : off all test profile - : propagated optional ; + : + off # Disable coverage generation for the tool (default). + on # Enable coverage generation for the tool. + : incidental propagated ; diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index f4a36089c..d60da1fc2 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -738,9 +738,7 @@ toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize= toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread ; toolset.flags gcc.compile.c++ OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak ; -toolset.flags gcc.compile.c++ OPTIONS all : --coverage ; -toolset.flags gcc.compile.c++ OPTIONS profile : -fprofile-arcs ; -toolset.flags gcc.compile.c++ OPTIONS test : -ftest-coverage ; +toolset.flags gcc.compile.c++ OPTIONS on : --coverage ; # configure Dinkum STL to match compiler options toolset.flags gcc.compile.c++ DEFINES off/vxworks : _NO_RTTI ; @@ -889,9 +887,7 @@ toolset.flags gcc.link OPTIONS norecover : -fsanitize=address toolset.flags gcc.link OPTIONS norecover : -fsanitize=undefined -fno-sanitize-recover=undefined ; toolset.flags gcc.link OPTIONS norecover : -fsanitize=thread -fno-sanitize-recover=thread ; toolset.flags gcc.link OPTIONS norecover : -fsanitize=leak -fno-sanitize-recover=leak ; -toolset.flags gcc.link OPTIONS all : --coverage ; -toolset.flags gcc.link OPTIONS profile : -fprofile-arcs ; -toolset.flags gcc.link OPTIONS test : -lgcov ; +toolset.flags gcc.link OPTIONS on : --coverage ; toolset.flags gcc.link.dll .IMPLIB-COMMAND windows : "-Wl,--out-implib," ; toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib," ;