Skip to content

Commit

Permalink
Add execution test for perf integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Zentrik committed Apr 26, 2024
1 parent 1b02997 commit 20bf97b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/ExecutionTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module ExecutionTests
using BenchmarkTools
using Profile
using Test
using LinuxPerf

seteq(a, b) = length(a) == length(b) == length(intersect(a, b))

Expand Down Expand Up @@ -383,4 +384,24 @@ b = x = nothing
GC.gc()
@test x_finalized

##################################
# Linux Perf Integration #
##################################

b = @benchmarkable sin(42.)
results = run(b, seconds=1, enable_linux_perf=true)
@test results.linux_perf_stats !== nothing
@test any(reults.linux_perf_stats.threads) do thread
clock = LinuxPerf.scaledcount(thread["task-clock"])
!isnan(clock) && clock > 0
end

b = @benchmarkable sin(42.)
results = run(b, seconds=1, enable_linux_perf=false)
@test results.linux_perf_stats === nothing

b = @benchmarkable sin(42.)
results = run(b, seconds=1)
@test results.linux_perf_stats === nothing

end # module

0 comments on commit 20bf97b

Please sign in to comment.