Skip to content

Commit

Permalink
Fix update_suite.rb crashing on é in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 25, 2022
1 parent 593d8be commit 694375b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/update_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def report

def collect_warnings
warnings[-1] = "term"
lines = IO.readlines(warnfile)
lines = IO.readlines(warnfile, :encoding => "UTF-8")
lines.each do |l|
if l =~ /Function 'main' does not return/ then warnings[-1] = "noterm" end
if l =~ /vars = (\d*).*evals = (\d+)/ then
Expand Down Expand Up @@ -208,7 +208,7 @@ def compare_warnings
end

def time_to_html
lines = IO.readlines(statsfile)
lines = IO.readlines(statsfile, :encoding => "UTF-8")
res = lines.grep(/^TOTAL\s*(.*) s.*$/) { $1 }
errors = lines.grep(/Error:/)
if res == [] or not errors == [] then
Expand All @@ -221,7 +221,7 @@ def time_to_html

def problems_to_html
id = "#{p.id} #{p.group}/#{p.name}"
lines = IO.readlines(statsfile)
lines = IO.readlines(statsfile, :encoding => "UTF-8")
if correct + ignored == tests.size && ok then
"<td style =\"color: green\">NONE</td>"
else
Expand Down Expand Up @@ -418,7 +418,7 @@ def create_test_set(lines)
@testset.p = self
`patch -p0 -b <#{patch_path}`
status = $?.exitstatus
lines_incr = IO.readlines(path)
lines_incr = IO.readlines(path, :encoding => "UTF-8")
`patch -p0 -b -R <#{patch_path}`
if status != 0
puts "Failed to apply patch: #{patch_path}"
Expand Down Expand Up @@ -512,7 +512,7 @@ def run ()
testname = f[3..-3]
next unless only.nil? or testname == only
path = File.expand_path(f, grouppath)
lines = IO.readlines(path)
lines = IO.readlines(path, :encoding => "UTF-8")

next if not future and only.nil? and lines[0] =~ /SKIP/
next if marshal and lines[0] =~ /NOMARSHAL/
Expand Down

0 comments on commit 694375b

Please sign in to comment.