Skip to content

Commit 6002a29

Browse files
Pkg.test: document that coverage can be a string (#3957)
1 parent 77f0225 commit 6002a29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Pkg.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export UpgradeLevel, UPLEVEL_MAJOR, UPLEVEL_MINOR, UPLEVEL_PATCH
1717
export PreserveLevel, PRESERVE_TIERED_INSTALLED, PRESERVE_TIERED, PRESERVE_ALL_INSTALLED, PRESERVE_ALL, PRESERVE_DIRECT, PRESERVE_SEMVER, PRESERVE_NONE
1818
export 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

2323
depots() = 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+
278282
Run the tests for package `pkg`, or for the current project (which thus needs to be a package) if no
279283
positional argument is given to `Pkg.test`. A package is tested by running its
280284
`test/runtests.jl` file.

0 commit comments

Comments
 (0)