Skip to content

Commit

Permalink
choosetests: add the --force-net option, which will throw an erro…
Browse files Browse the repository at this point in the history
…r if networking is unavailable (#42889)
  • Loading branch information
DilumAluthge authored Nov 1, 2021
1 parent cae3571 commit 31b9fd2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function choosetests(choices = [])
exit_on_error = false
use_revise = false
seed = rand(RandomDevice(), UInt128)
force_net = false
dryrun = false

for (i, t) in enumerate(choices)
Expand All @@ -77,6 +78,8 @@ function choosetests(choices = [])
use_revise = true
elseif startswith(t, "--seed=")
seed = parse(UInt128, t[8:end])
elseif t == "--force-net"
force_net = true
elseif t == "--help-list"
dryrun = true
elseif t == "--help"
Expand Down Expand Up @@ -149,7 +152,12 @@ function choosetests(choices = [])
net_on = true
try
ipa = getipaddr()
catch
catch ex
if force_net
msg = "Networking is unavailable, and the `--force-net` option was passed"
@error msg
rethrow()
end
@warn "Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]"
net_on = false
end
Expand Down

0 comments on commit 31b9fd2

Please sign in to comment.