|
1 | 1 | # This file is a part of Julia. License is MIT: https://julialang.org/license |
2 | 2 |
|
3 | | -using Test, Profile, Serialization |
| 3 | +using Test, Profile, Serialization, Logging |
4 | 4 |
|
5 | 5 | Profile.clear() |
6 | 6 | Profile.init() |
@@ -60,11 +60,13 @@ let iobuf = IOBuffer() |
60 | 60 | end |
61 | 61 |
|
62 | 62 | @testset "Profile.print() groupby options" begin |
63 | | - for tasks in [typemin(UInt):typemax(UInt), UInt(0), UInt(0):UInt(1), [UInt(0), UInt(3)]] |
64 | | - for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,3]] |
65 | | - for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]] |
66 | | - @testset "tasks = $tasks threads = $threads groupby = $groupby" begin |
67 | | - Profile.print(devnull; groupby, threads, tasks) |
| 63 | + iobuf = IOBuffer() |
| 64 | + with_logger(NullLogger()) do |
| 65 | + @testset for format in [:flat, :tree] |
| 66 | + @testset for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,2]] |
| 67 | + @testset for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]] |
| 68 | + Profile.print(iobuf; groupby, threads, format) |
| 69 | + @test !isempty(String(take!(iobuf))) |
68 | 70 | end |
69 | 71 | end |
70 | 72 | end |
|
0 commit comments