Skip to content

Commit e4d20c0

Browse files
committed
test: restore simplecov
It was broken by #3280, but see simplecov-ruby/simplecov#1032 for discussion that led to this workaround.
1 parent e04f160 commit e4d20c0

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

rakelib/test.rake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ end
121121
def nokogiri_test_task_configuration(t)
122122
t.libs << "test"
123123
t.verbose = true if ENV["TESTGLOB"]
124+
t.test_prelude = 'require "simplecov_prelude"' if t.respond_to?(:test_prelude)
124125
end
125126

126127
def nokogiri_test_case_configuration(t)

test/helper.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
# - NOKOGIRI_MEMORY_SUITE: read more in test/test_memory_usage.rb
1313
#
1414

15-
unless ENV["RUBY_MEMCHECK_RUNNING"] || ENV["NCPU"]
16-
require "simplecov"
17-
SimpleCov.start do
18-
add_filter "/test/"
19-
enable_coverage :branch
20-
end
21-
end
22-
2315
$VERBOSE = true
2416

2517
require "fileutils"

test/simplecov_prelude.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# https://github.com/simplecov-ruby/simplecov/issues/1032
4+
unless ENV["RUBY_MEMCHECK_RUNNING"] || ENV["NCPU"].to_i > 1
5+
require "simplecov"
6+
SimpleCov.start do
7+
add_filter "/test/"
8+
enable_coverage :branch
9+
end
10+
end

0 commit comments

Comments
 (0)