Skip to content

Commit 41a1cc1

Browse files
committed
run benchee tests with the builtin profilers automatically as well
1 parent 5565f25 commit 41a1cc1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/benchee/profile.ex

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ defmodule Benchee.Profile do
2626
@builtin_profilers [:cprof, :eprof, :fprof]
2727
# https://hexdocs.pm/mix/1.17.0/Mix.Tasks.Profile.Tprof.html
2828
# Tprof was introduced in elixir 1.17.0 and requires OTP 27
29-
# Elixir errors out fine, but our test kind of put their trust into `builtin_profilers` being runnable.
30-
if Version.match?(System.version(), ">= 1.17.0") && String.to_integer(System.otp_release()) >= 27 do
29+
# Elixir errors out fine, but our test kind of put their trust into `builtin_profilers`
30+
# being runnable.
31+
if Version.match?(System.version(), ">= 1.17.0") &&
32+
String.to_integer(System.otp_release()) >= 27 do
3133
@builtin_profilers [:tprof | @builtin_profilers]
3234
end
3335

test/benchee_test.exs

+1-2
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ defmodule BencheeTest do
925925
assert output =~ end_of_profiling_regex(Profile.default_profiler())
926926
end
927927

928-
@profilers [:cprof, :eprof, :fprof]
929-
for profiler <- @profilers do
928+
for profiler <- Benchee.Profile.builtin_profilers() do
930929
@profiler profiler
931930
test "integration profiling runs #{inspect(@profiler)} profiler" do
932931
output =

0 commit comments

Comments
 (0)