Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Aug 8, 2021
1 parent 3d23b69 commit 52aff04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions stdlib/Profile/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Serialization"]
test = ["Logging", "Serialization", "Test"]
14 changes: 8 additions & 6 deletions stdlib/Profile/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, Profile, Serialization
using Test, Profile, Serialization, Logging

Profile.clear()
Profile.init()
Expand Down Expand Up @@ -60,11 +60,13 @@ let iobuf = IOBuffer()
end

@testset "Profile.print() groupby options" begin
for tasks in [typemin(UInt):typemax(UInt), UInt(0), UInt(0):UInt(1), [UInt(0), UInt(3)]]
for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,3]]
for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]]
@testset "tasks = $tasks threads = $threads groupby = $groupby" begin
Profile.print(devnull; groupby, threads, tasks)
iobuf = IOBuffer()
with_logger(NullLogger()) do
@testset for format in [:flat, :tree]
@testset for threads in [1:Threads.nthreads(), 1, 1:1, 1:2, [1,2]]
@testset for groupby in [:none, :thread, :task, [:thread, :task], [:task, :thread]]
Profile.print(iobuf; groupby, threads, format)
@test !isempty(String(take!(iobuf)))
end
end
end
Expand Down

0 comments on commit 52aff04

Please sign in to comment.