From 8b4b6f744552cb4e03dd5d3767a57aa1ffe8516c Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Wed, 20 Oct 2021 19:25:17 -0400 Subject: [PATCH] `choosetests`: return a `NamedTuple` (instead of a `Tuple`), to make it easier to add more information in the future --- test/choosetests.jl | 6 +++--- test/runtests.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/choosetests.jl b/test/choosetests.jl index 229b881744ad6..e81e82cee237e 100644 --- a/test/choosetests.jl +++ b/test/choosetests.jl @@ -33,7 +33,7 @@ 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. @@ -41,7 +41,7 @@ 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 @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index ea94fca877057..4dea6fb4d535e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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()