# Parallel testing

**URL:** <https://discourse.julialang.org/t/parallel-testing/45574>\
**Category:** General Usage\
**Created:** [August 26, 2020, 12:56pm UTC](https://discourse.julialang.org/t/parallel-testing/45574 "2020-08-26T12:56:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kulowf](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kulowf](https://discourse.julialang.org/u/kulowf)\
**Post date:** [August 26, 2020, 12:56pm UTC](https://discourse.julialang.org/t/parallel-testing/45574/1 "2020-08-26T12:56:48Z")

</div>

# 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

```julia
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

```
