mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-30 19:54:26 +01:00
Fixing Rubocop code style
This commit is contained in:
@@ -54,13 +54,13 @@ class ParseOutput
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Set the flag to indicate if there will be an XML output file or not
|
# Set the flag to indicate if there will be an XML output file or not
|
||||||
def set_test_suite_name(cli_arg)
|
def test_suite_name=(cli_arg)
|
||||||
@real_test_suite_name = cli_arg['-suite'.length..-1]
|
@real_test_suite_name = cli_arg
|
||||||
puts 'Real test suite name will be \'' + @real_test_suite_name + '\''
|
puts 'Real test suite name will be \'' + @real_test_suite_name + '\''
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_encode_s(s)
|
def xml_encode_s(str)
|
||||||
return s.encode(:xml => :attr)
|
str.encode(:xml => :attr)
|
||||||
end
|
end
|
||||||
|
|
||||||
# If write our output to XML
|
# If write our output to XML
|
||||||
@@ -277,7 +277,7 @@ class ParseOutput
|
|||||||
puts '=================== RESULTS ====================='
|
puts '=================== RESULTS ====================='
|
||||||
puts ''
|
puts ''
|
||||||
# Apply binary encoding. Bad symbols will be unchanged
|
# Apply binary encoding. Bad symbols will be unchanged
|
||||||
File.open(file_name, "rb").each do |line|
|
File.open(file_name, 'rb').each do |line|
|
||||||
# Typical test lines look like these:
|
# Typical test lines look like these:
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# 1. normal output:
|
# 1. normal output:
|
||||||
@@ -333,16 +333,16 @@ class ParseOutput
|
|||||||
@test_ignored += 1
|
@test_ignored += 1
|
||||||
elsif line_array.size >= 4
|
elsif line_array.size >= 4
|
||||||
# We will check output from color compilation
|
# We will check output from color compilation
|
||||||
if line_array[@result_usual_idx..-1].any? {|l| l.include? 'PASS'}
|
if line_array[@result_usual_idx..-1].any? { |l| l.include? 'PASS' }
|
||||||
test_passed(line_array)
|
test_passed(line_array)
|
||||||
@test_passed += 1
|
@test_passed += 1
|
||||||
elsif line_array[@result_usual_idx..-1].any? {|l| l.include? 'FAIL'}
|
elsif line_array[@result_usual_idx..-1].any? { |l| l.include? 'FAIL' }
|
||||||
test_failed(line_array)
|
test_failed(line_array)
|
||||||
@test_failed += 1
|
@test_failed += 1
|
||||||
elsif line_array[@result_usual_idx..-2].any? {|l| l.include? 'IGNORE'}
|
elsif line_array[@result_usual_idx..-2].any? { |l| l.include? 'IGNORE' }
|
||||||
test_ignored(line_array)
|
test_ignored(line_array)
|
||||||
@test_ignored += 1
|
@test_ignored += 1
|
||||||
elsif line_array[@result_usual_idx..-1].any? {|l| l.include? 'IGNORE'}
|
elsif line_array[@result_usual_idx..-1].any? { |l| l.include? 'IGNORE' }
|
||||||
line_array.push('No reason given (' + get_test_time(line_array[@result_usual_idx..-1]).to_s + ' ms)')
|
line_array.push('No reason given (' + get_test_time(line_array[@result_usual_idx..-1]).to_s + ' ms)')
|
||||||
test_ignored(line_array)
|
test_ignored(line_array)
|
||||||
@test_ignored += 1
|
@test_ignored += 1
|
||||||
@@ -374,7 +374,7 @@ if ARGV.size >= 1
|
|||||||
if arg == '-xml'
|
if arg == '-xml'
|
||||||
parse_my_file.set_xml_output
|
parse_my_file.set_xml_output
|
||||||
elsif arg.start_with?('-suite')
|
elsif arg.start_with?('-suite')
|
||||||
parse_my_file.set_test_suite_name(arg)
|
parse_my_file.test_suite_name = arg.delete_prefix('-suite')
|
||||||
else
|
else
|
||||||
parse_my_file.process(arg)
|
parse_my_file.process(arg)
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user