Skip to content

Commit

Permalink
choosetests: return a namedtuple (instead of a tuple) (#42723)
Browse files Browse the repository at this point in the history
to make it easier to add more information in the future
  • Loading branch information
DilumAluthge committed Oct 21, 2021
1 parent 9557259 commit 9e3cfc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const TESTNAMES = [

"""
`tests, net_on, exit_on_error, seed = choosetests(choices)` selects a set of tests to be
`(; tests, net_on, exit_on_error, seed) = choosetests(choices)` selects a set of tests to be
run. `choices` should be a vector of test names; if empty or set to
`["all"]`, all tests are selected.
This function also supports "test collections": specifically, "linalg"
refers to collections of tests in the correspondingly-named
directories.
Upon return:
The function returns a named tuple with the following elements:
- `tests` is a vector of fully-expanded test names,
- `net_on` is true if networking is available (required for some tests),
- `exit_on_error` is true if an error in one test should cancel
Expand Down Expand Up @@ -205,5 +205,5 @@ function choosetests(choices = [])
empty!(tests)
end

tests, net_on, exit_on_error, use_revise, seed
return (; tests, net_on, exit_on_error, use_revise, seed)
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using Base: Experimental
include("choosetests.jl")
include("testenv.jl")

tests, net_on, exit_on_error, use_revise, seed = choosetests(ARGS)
(; tests, net_on, exit_on_error, use_revise, seed) = choosetests(ARGS)
tests = unique(tests)

if Sys.islinux()
Expand Down

0 comments on commit 9e3cfc0

Please sign in to comment.