@@ -17,7 +17,7 @@ export UpgradeLevel, UPLEVEL_MAJOR, UPLEVEL_MINOR, UPLEVEL_PATCH
1717export PreserveLevel, PRESERVE_TIERED_INSTALLED, PRESERVE_TIERED, PRESERVE_ALL_INSTALLED, PRESERVE_ALL, PRESERVE_DIRECT, PRESERVE_SEMVER, PRESERVE_NONE
1818export Registry, RegistrySpec
1919
20- public activate, add, build, compat, develop, free, gc, generate, instantiate,
20+ public activate, add, build, compat, develop, free, gc, generate, instantiate,
2121 pin, precompile, redo, rm, resolve, status, test, undo, update, why
2222
2323depots () = Base. DEPOT_PATH
@@ -267,14 +267,18 @@ const update = API.up
267267 Pkg.test(pkgs::Union{PackageSpec, Vector{PackageSpec}}; kwargs...)
268268
269269**Keyword arguments:**
270- - `coverage::Bool=false`: enable or disable generation of coverage statistics.
270+ - `coverage::Union{Bool,String}=false`: enable or disable generation of coverage statistics for the tested package.
271+ If a string is passed it is passed directly to `--code-coverage` in the test process so e.g. "user" will test all user code.
271272 - `allow_reresolve::Bool=true`: allow Pkg to reresolve the package versions in the test environment
272273 - `julia_args::Union{Cmd, Vector{String}}`: options to be passed the test process.
273274 - `test_args::Union{Cmd, Vector{String}}`: test arguments (`ARGS`) available in the test process.
274275
275276!!! compat "Julia 1.9"
276277 `allow_reresolve` requires at least Julia 1.9.
277278
279+ !!! compat "Julia 1.9"
280+ Passing a string to `coverage` requires at least Julia 1.9.
281+
278282Run the tests for package `pkg`, or for the current project (which thus needs to be a package) if no
279283positional argument is given to `Pkg.test`. A package is tested by running its
280284`test/runtests.jl` file.
0 commit comments