Skip to content

Commit b87fa69

Browse files
DilumAluthgeKristofferC
authored andcommitted
choosetests: return a namedtuple (instead of a tuple) (#42723)
to make it easier to add more information in the future (cherry picked from commit 9e3cfc0)
1 parent c9a1618 commit b87fa69

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/choosetests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ const STDLIBS = filter!(x -> isfile(joinpath(STDLIB_DIR, x, "src", "$(x).jl")),
77

88
"""
99
10-
`tests, net_on, exit_on_error, seed = choosetests(choices)` selects a set of tests to be
10+
`(; tests, net_on, exit_on_error, seed) = choosetests(choices)` selects a set of tests to be
1111
run. `choices` should be a vector of test names; if empty or set to
1212
`["all"]`, all tests are selected.
1313
1414
This function also supports "test collections": specifically, "linalg"
1515
refers to collections of tests in the correspondingly-named
1616
directories.
1717
18-
Upon return:
18+
The function returns a named tuple with the following elements:
1919
- `tests` is a vector of fully-expanded test names,
2020
- `net_on` is true if networking is available (required for some tests),
2121
- `exit_on_error` is true if an error in one test should cancel
@@ -205,5 +205,5 @@ function choosetests(choices = [])
205205
empty!(tests)
206206
end
207207

208-
tests, net_on, exit_on_error, use_revise, seed
208+
return (; tests, net_on, exit_on_error, use_revise, seed)
209209
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using Base: Experimental
1010
include("choosetests.jl")
1111
include("testenv.jl")
1212

13-
tests, net_on, exit_on_error, use_revise, seed = choosetests(ARGS)
13+
(; tests, net_on, exit_on_error, use_revise, seed) = choosetests(ARGS)
1414
tests = unique(tests)
1515

1616
if use_revise

0 commit comments

Comments
 (0)