Parallel testing

parallel testing

  • How i make parallel test for many testfunctions with separate outputs?
  • The test sources use in many ways stdout, stderr.
  • A redirect is for threads separatly not possible!?
  • The example has only one testfunction
    • the output is unreadable confusion
using Test

function testfcn(i)
    id = Threads.threadid()
    println(i, id)
    @testset "$id" begin
        for k in 1:20rand()
            w = rand()
            @show w
            @test w > .5
            if rand() < .1
                @warn "to low"
            end
            println(w^2)
        end
    end
end

Threads.@threads for i in 0:9
    testfcn(i)
end

Threads.@threads for i in 0:9
    testfcn(i)
end
1 Like