Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ inherit_from:
- "https://www.goodcop.style/tabs.yml"

AllCops:
SuggestExtensions: false
TargetRubyVersion: 3.1
35 changes: 19 additions & 16 deletions lib/quickdraw/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ def initialize(backtrace: false, processes:, threads:, files:, seed:)
end

def call
load_tests
enable_yjit if yjit_supported?

if @processes > 1
fork_processes
@cluster.wait
else
@tests.each do |(context, description, skip, block)|
context.new(description:, skip:, block:).run(self)
elapsed = Quickdraw::Timer::time do
load_tests
enable_yjit if yjit_supported?

if @processes > 1
fork_processes
@cluster.wait
else
@tests.each do |(context, description, skip, block)|
context.new(description:, skip:, block:).run(self)
end
end
end

Expand All @@ -55,11 +57,11 @@ def call
"\e[3munexpected \e[1m#{error['name']}\e[0m",
error["message"],
*error["backtrace"]
.take_while { |it| @backtrace || !it.include?('Quickdraw::Runner') }
.take_while { |it| @backtrace || !it.include?("Quickdraw::Runner") }
.map { |it| it.gsub(":in `", " in `") },
].each_with_index do |line, i|
puts "#{' ' * i}#{line}"
end
].each_with_index do |line, i|
puts "#{' ' * i}#{line}"
end
end

@failures.each do |failure|
Expand All @@ -70,16 +72,17 @@ def call
"\e[4m#{failure['test_path']}:#{failure['test_line']}\e[0m",
"\e[1m#{(failure['description'])}\e[0m",
"\e[4m#{failure['path']}:#{failure['line']}\e[0m",
].each_with_index do |line, i|
puts "#{' ' * i}#{line}"
end
].each_with_index do |line, i|
puts "#{' ' * i}#{line}"
end

puts
puts "\e[3m#{(failure['message'])}\e[0m"
end

puts

puts "Elapsed: #{elapsed} | Seed: #{@seed}"
puts "Passed: #{@successes.value} | Failed: #{@failures.size} | Errors: #{@errors.size}"

exit(1) if @failures.any? || @errors.any?
Expand Down