You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify description of command line args argument to runtests
The current docstring had conflicting information: the signature showed only
`ParsedArgs` was accepted, but the description suggested only a vector of
strings (like `Base.ARGS`) was accepted.
Copy file name to clipboardExpand all lines: docs/src/api.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,10 @@ default_njobs
41
41
42
42
## Internal Types
43
43
44
+
These are internal types, not subject to semantic versioning contract (could be changed or removed at any point without notice), not intended for consumption by end-users.
45
+
They are documented here exclusively for `ParallelTestRunner` developers and contributors.
Copy file name to clipboardExpand all lines: src/ParallelTestRunner.jl
+22-7Lines changed: 22 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -499,6 +499,21 @@ function find_tests(dir::String)
499
499
return tests
500
500
end
501
501
502
+
"""
503
+
ParsedArgs
504
+
505
+
Struct representing parsed command line arguments, to be passed to [`runtests`](@ref).
506
+
`ParsedArgs` objects are typically obtained by using [`parse_args`](@ref).
507
+
508
+
Fields are
509
+
510
+
* `jobs::Union{Some{Int}, Nothing}`: the number of jobs
511
+
* `verbose::Union{Some{Nothing}, Nothing}`: whether verbose printing was enabled
512
+
* `quickfail::Union{Some{Nothing}, Nothing}`: whether quick fail was enabled
513
+
* `list::Union{Some{Nothing}, Nothing}`: whether tests should be listed
514
+
* `custom::Dict{String,Any}`: a dictionary of custom arguments
515
+
* `positionals::Vector{String}`: the list of positional arguments passed on the command line, i.e. the explicit list of test files (to be matches with `startswith`)
516
+
"""
502
517
struct ParsedArgs
503
518
jobs::Union{Some{Int}, Nothing}
504
519
verbose::Union{Some{Nothing}, Nothing}
@@ -544,7 +559,7 @@ option was not specified, or `Some(optional_value=nothing)` when it was.
544
559
545
560
Custom arguments can be specified via the `custom` keyword argument, which should be
546
561
an array of strings representing custom flag names (without the `--` prefix). Presence
547
-
of these flags will be recorded in the `custom` field of the returned `ParsedArgs` object.
562
+
of these flags will be recorded in the `custom` field of the returned [`ParsedArgs`](@ref) object.
@@ -628,14 +643,14 @@ Run Julia tests in parallel across multiple worker processes.
628
643
## Arguments
629
644
630
645
- `mod`: The module calling runtests
631
-
- `ARGS`: Command line arguments array, typically from `Base.ARGS`. When you run the tests
632
-
with `Pkg.test`, this can be changed with the `test_args` keyword argument. If the caller
633
-
needs to accept args too, consider using [`parse_args`](@ref) to parse the arguments first.
646
+
- `ARGS`: Command line arguments. This can be either the vector of strings of the arguments, typically from [`Base.ARGS`](https://docs.julialang.org/en/v1/base/constants/#Base.ARGS), or a [`ParsedArgs`](@ref) object, typically constructed with [`parse_args`](@ref).
647
+
When you run the tests with [`Pkg.test`](https://pkgdocs.julialang.org/v1/api/#Pkg.test), the command line arguments passed to the script can be changed with the `test_args` keyword argument.
648
+
If the caller needs to accept arguments too, consider using [`parse_args`](@ref) to parse the arguments first.
634
649
635
650
Several keyword arguments are also supported:
636
651
637
652
- `testsuite`: Dictionary mapping test names to expressions to execute (default: [`find_tests(pwd())`](@ref)).
638
-
By default, automatically discovers all `.jl` files in the test directory.
653
+
By default, automatically discovers all `.jl` files in the test directory and its subdirectories.
639
654
- `init_code`: Code use to initialize each test's sandbox module (e.g., import auxiliary
640
655
packages, define constants, etc).
641
656
- `test_worker`: Optional function that takes a test name and returns a specific worker.
@@ -1160,6 +1175,6 @@ function runtests(mod::Module, args::ParsedArgs;
0 commit comments