# Test summary in julia 0.6

**URL:** <https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461>\
**Category:** General Usage\
**Tags:** testing\
**Created:** [January 13, 2017, 12:24pm UTC](https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461 "2017-01-13T12:24:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [January 13, 2017, 12:24pm UTC](https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461/1 "2017-01-13T12:24:42Z")

</div>

I am trying to implement test code example from this page: [http://docs.julialang.org/en/latest/stdlib/test.html](http://docs.julialang.org/en/latest/stdlib/test.html)

```julia
julia> using Base.Test

julia> foo(x) = length(x)^2
foo (generic function with 1 method)

julia> @testset "Foo Tests" begin
                  @testset "Animals" begin
                      @testset "Felines" begin
                          @test foo("cat") == 9
                      end
                      @testset "Canines" begin
                          @test foo("dog") == 9
                      end
                  end
                  @testset "Arrays" begin
                      @test foo(zeros(2)) == 4
                      @test foo(ones(4)) == 15
                  end
              end
Arrays: Test Failed
  Expression: foo(ones(4)) == 15
   Evaluated: 16 == 15
Stacktrace:
 [1] macro expansion; at ./REPL[3]:12 [inlined]
 [2] macro expansion; at ./test.jl:801 [inlined]
 [3] macro expansion; at ./REPL[3]:0 [inlined]
 [4] macro expansion; at ./test.jl:801 [inlined]
 [5] anonymous at ./<missing>:?
ERROR: Some tests did not pass: 3 passed, 1 failed, 0 errored, 0 broken.

```

but i do not get this test summary in output:

```julia
Test Summary: | Pass Fail Total
Foo Tests | 3 1 4
  Animals | 2 2
  Arrays | 1 1 2

```

I am using this julia version:

```julia
julia> versioninfo()
Julia Version 0.6.0-dev.2021
Commit 6b1b4f6 (2017-01-10 01:39 UTC)

```

There is nice test summary output in julia 0.5. Is it possible to get it back somehow?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)\
**Post date:** [January 14, 2017, 4:30pm UTC](https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461/3 "2017-01-14T16:30:43Z")

</div>

Hmm, actually the `@testset` summary doesn’t print even when the tests are successful. Not sure if this was intentional, see [https://github.com/JuliaLang/julia/pull/18738#issuecomment-272634901](https://github.com/JuliaLang/julia/pull/18738#issuecomment-272634901)

You can manually print the result with:

```julia
julia> r = @testset "Foo Tests" begin
               ...

julia> Base.Test.print_test_results(r)
Test Summary: | Pass Total
  Foo Tests | 4 4

```

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [January 14, 2017, 9:50pm UTC](https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461/4 "2017-01-14T21:50:25Z")

</div>

Thank you, it is very useful.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 25, 2017, 8:43am UTC](https://discourse.julialang.org/t/test-summary-in-julia-0-6/1461/5 "2017-01-25T08:43:08Z")

</div>

I’ve made a pull request that should bring this back [https://github.com/JuliaLang/julia/pull/20221](https://github.com/JuliaLang/julia/pull/20221)
