File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,28 @@ def invoke_simplecov_formatter
70
70
res = Marshal . load ( File . binread ( TEST_COVERAGE_DATA_FILE ) )
71
71
simplecov_result = { }
72
72
base_dir = File . dirname ( __dir__ )
73
+ cur_dir = Dir . pwd
73
74
74
75
res . each do |path , cov |
75
- next unless path . start_with? ( base_dir )
76
+ next unless path . start_with? ( base_dir ) || path . start_with? ( cur_dir )
76
77
next if path . start_with? ( File . join ( base_dir , "test" ) )
77
78
simplecov_result [ path ] = cov [ :lines ]
78
79
end
79
80
81
+ a , b = base_dir , cur_dir
82
+ until a == b
83
+ if a . size > b . size
84
+ a = File . dirname ( a )
85
+ else
86
+ b = File . dirname ( b )
87
+ end
88
+ end
89
+ root_dir = a
90
+
91
+ SimpleCov . configure do
92
+ root ( root_dir )
93
+ coverage_dir ( File . join ( cur_dir , "coverage" ) )
94
+ end
80
95
res = SimpleCov ::Result . new ( simplecov_result )
81
96
res . command_name = "Ruby's `make test-all`"
82
97
SimpleCov ::Formatter ::HTMLFormatter . new . format ( res )
You can’t perform that action at this time.
0 commit comments