Skip to content

Commit c3d35c0

Browse files
authored
Test for versioninfo with ENV variable (#1279)
Explicitly check that setting an environment variable updates the `versioninfo`. One concern here is that `withenv` isn't thread-safe, but we're probably not running these tests multi threaded? In any case, it's unlikely that setting the number of MKL threads will impact anything.
2 parents 830ea2f + 7a891e9 commit c3d35c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ end
2323
r"OPENBLAS_NUM_THREADS = [0-9]+",
2424
r"GOTO_NUM_THREADS = [0-9]+",
2525
r"OMP_NUM_THREADS = [0-9]+", r"\[none\]"])
26+
27+
withenv("MKL_NUM_THREADS" => 1) do
28+
vinfo = sprint(LinearAlgebra.versioninfo)
29+
vars = strip(split(vinfo, "Relevant environment variables:")[end])
30+
@test occursin("MKL_NUM_THREADS = 1", vars)
31+
end
2632
end

0 commit comments

Comments
 (0)