Skip to content

Commit

Permalink
fix(tests): Prevent MPI from breaking doc tests
Browse files Browse the repository at this point in the history
Initialization of MPI occasionally results in output warning that
features are unavailable, etc.  This is not relevant to the doc tests,
but can break them by writing to stderr.

Initialize MPI before running any other tests.

Fixes #71
  • Loading branch information
musoke committed Aug 31, 2023
1 parent a6f5232 commit b8a460f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ using Test, Documenter
using SafeTestsets
using MPI

# Initialise MPI before running any tests.
# This prevents spurious warnings from breaking doc tests by changing stderr.
if ~MPI.Initialized()
MPI.Init()
end
@test MPI.Initialized()

doctest(UltraDark)

@safetestset "grids.jl" begin
Expand Down

0 comments on commit b8a460f

Please sign in to comment.