mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add profile summary to TAP output
This commit is contained in:
parent
291a927f1e
commit
df6431f2d7
1 changed files with 18 additions and 1 deletions
|
@ -35,7 +35,24 @@ module Spectator::Formatting
|
|||
|
||||
# Displays profiling information.
|
||||
private def profile(profile)
|
||||
raise NotImplementedError.new("profile")
|
||||
@io.puts(Comment.new(ProfileSummary.new(profile)))
|
||||
|
||||
indent = Indent.new(@io)
|
||||
indent.increase do
|
||||
profile.each do |result|
|
||||
profile_entry(indent, result)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Adds a profile result entry to the output.
|
||||
private def profile_entry(indent, result)
|
||||
@io << "# "
|
||||
indent.line(result.example)
|
||||
indent.increase do
|
||||
@io << "# "
|
||||
indent.line(SourceTiming.new(result.elapsed, result.example.source))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue