5 Pathname.glob("**/*.gcda").sort.each do |gcda|
6 if gcda.fnmatch("ext/*")
7 cwd, gcda = gcda.split.map {|s| s.to_s }
9 elsif gcda.fnmatch("rubyspec_temp/*")
12 cwd, objdir, gcda = ".", gcda.dirname.to_s, gcda.to_s
14 puts "$ gcov -lpbc -o #{ objdir } #{ gcda }"
15 out, err, _status = Open3.capture3("gcov", "-lpbc", "-o", objdir, gcda, chdir: cwd)
19 # a black list of source files that contains wrong #line directives
22 Cannot\ open\ source\ file\ (
31 raise "Unexpected gcov output"
36 File\ .*\nLines\ executed:.*\n
38 Branches\ executed:.*\n
39 Taken\ at\ least\ once:.*\n
51 (Lines\ executed:.*\n)?\z
53 raise "Unexpected gcov output"