Skip to content

Commit ee33e04

Browse files
committed
add example for distributed execution with hijack
1 parent 04eea4e commit ee33e04

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/src/index.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,28 @@ it can be filtered out.
142142
## Running tests in parallel with `Distributed`
143143

144144
Currently, the tests are automatically run in parallel whenever there are
145-
multiple workers, which have to be set manually. The workflow looks like:
145+
multiple workers, which have to be set manually. Running the tests looks like:
146146
```julia
147147
using Distributed
148148
addprocs(2)
149149
@everywhere include("test/tests.jl")
150150
MyPackageTests.runtests()
151151
```
152152

153+
If the test code doesn't use `ReTest`
154+
(cf. [Working with test files which use `Test`](@ref)), this can be done as
155+
follows:
156+
```julia
157+
using Distributed
158+
addprocs(2)
159+
using ReTest
160+
@everywhere begin
161+
using ReTest, MyPackage
162+
ReTest.hijack(MyPackage)
163+
end
164+
MyPackageTests.runtests()
165+
```
166+
153167
!!! note
154168

155169
As was already mentioned, testset-for iterators are evaluated at load time in

0 commit comments

Comments
 (0)