@@ -56,7 +56,7 @@ def set_xml_output
5656 # Set the flag to indicate if there will be an XML output file or not
5757 def test_suite_name = ( cli_arg )
5858 @real_test_suite_name = cli_arg
59- puts ' Real test suite name will be \'' + @real_test_suite_name + '\''
59+ puts " Real test suite name will be ' #{ @real_test_suite_name } '"
6060 end
6161
6262 def xml_encode_s ( str )
@@ -75,28 +75,28 @@ def write_xml_output
7575 # Pushes the suite info as xml to the array list, which will be written later
7676 def push_xml_output_suite_info
7777 # Insert opening tag at front
78- heading = ' <testsuite name=' + xml_encode_s ( @real_test_suite_name ) + ' tests="' + @total_tests . to_s + ' " failures="' + @test_failed . to_s + '"' + ' skips="' + @test_ignored . to_s + '">'
78+ heading = " <testsuite name=#{ xml_encode_s ( @real_test_suite_name ) } tests=\" #{ @total_tests } \ " failures=\" #{ @test_failed } \" skips=\" #{ @test_ignored } \" >"
7979 @array_list . insert ( 0 , heading )
8080 # Push back the closing tag
8181 @array_list . push '</testsuite>'
8282 end
8383
8484 # Pushes xml output data to the array list, which will be written later
8585 def push_xml_output_passed ( test_name , execution_time = 0 )
86- @array_list . push ' <testcase classname=' + xml_encode_s ( @test_suite ) + ' name=' + xml_encode_s ( test_name ) + ' time=' + xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) + ' />'
86+ @array_list . push " <testcase classname=#{ xml_encode_s ( @test_suite ) } name=#{ xml_encode_s ( test_name ) } time=#{ xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) } />"
8787 end
8888
8989 # Pushes xml output data to the array list, which will be written later
9090 def push_xml_output_failed ( test_name , reason , execution_time = 0 )
91- @array_list . push ' <testcase classname=' + xml_encode_s ( @test_suite ) + ' name=' + xml_encode_s ( test_name ) + ' time=' + xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) + '>'
92- @array_list . push ' <failure type="ASSERT FAILED">' + reason + ' </failure>'
91+ @array_list . push " <testcase classname=#{ xml_encode_s ( @test_suite ) } name=#{ xml_encode_s ( test_name ) } time=#{ xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) } >"
92+ @array_list . push " <failure type=\ " ASSERT FAILED\" > #{ reason } </failure>"
9393 @array_list . push ' </testcase>'
9494 end
9595
9696 # Pushes xml output data to the array list, which will be written later
9797 def push_xml_output_ignored ( test_name , reason , execution_time = 0 )
98- @array_list . push ' <testcase classname=' + xml_encode_s ( @test_suite ) + ' name=' + xml_encode_s ( test_name ) + ' time=' + xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) + '>'
99- @array_list . push ' <skipped type="TEST IGNORED">' + reason + ' </skipped>'
98+ @array_list . push " <testcase classname=#{ xml_encode_s ( @test_suite ) } name=#{ xml_encode_s ( test_name ) } time=#{ xml_encode_s ( ( execution_time / 1000.0 ) . to_s ) } >"
99+ @array_list . push " <skipped type=\ " TEST IGNORED\" > #{ reason } </skipped>"
100100 @array_list . push ' </testcase>'
101101 end
102102
@@ -144,7 +144,7 @@ def test_failed_unity_fixture(array)
144144 test_name = array [ 1 ]
145145 test_suite_verify ( class_name )
146146 reason_array = array [ 2 ] . split ( ':' )
147- reason = reason_array [ -1 ] . lstrip . chomp + ' at line: ' + reason_array [ -4 ]
147+ reason = " #{ reason_array [ -1 ] . lstrip . chomp } at line: #{ reason_array [ -4 ] } "
148148
149149 printf "%-40s FAILED\n " , test_name
150150
@@ -189,12 +189,12 @@ def test_passed(array)
189189 def test_failed ( array )
190190 # ':' symbol will be valid in function args now
191191 real_method_name = array [ @result_usual_idx - 1 ..-3 ] . join ( ':' )
192- array = array [ 0 ..@result_usual_idx - 3 ] + [ real_method_name ] + array [ -2 ..- 1 ]
192+ array = array [ 0 ..@result_usual_idx - 3 ] + [ real_method_name ] + array [ -2 ..]
193193
194194 last_item = array . length - 1
195195 test_time = get_test_time ( array [ last_item ] )
196196 test_name = array [ last_item - 2 ]
197- reason = array [ last_item ] . chomp . lstrip + ' at line: ' + array [ last_item - 3 ]
197+ reason = " #{ array [ last_item ] . chomp . lstrip } at line: #{ array [ last_item - 3 ] } "
198198 class_name = array [ @class_name_idx ]
199199
200200 if test_name . start_with? 'TEST('
@@ -217,7 +217,7 @@ def test_failed(array)
217217 def test_ignored ( array )
218218 # ':' symbol will be valid in function args now
219219 real_method_name = array [ @result_usual_idx - 1 ..-3 ] . join ( ':' )
220- array = array [ 0 ..@result_usual_idx - 3 ] + [ real_method_name ] + array [ -2 ..- 1 ]
220+ array = array [ 0 ..@result_usual_idx - 3 ] + [ real_method_name ] + array [ -2 ..]
221221
222222 last_item = array . length - 1
223223 test_time = get_test_time ( array [ last_item ] )
@@ -268,7 +268,7 @@ def detect_os_specifics(line)
268268 def process ( file_name )
269269 @array_list = [ ]
270270
271- puts ' Parsing file: ' + file_name
271+ puts " Parsing file: #{ file_name } "
272272
273273 @test_passed = 0
274274 @test_failed = 0
@@ -333,17 +333,17 @@ def process(file_name)
333333 @test_ignored += 1
334334 elsif line_array . size >= 4
335335 # We will check output from color compilation
336- if line_array [ @result_usual_idx ..- 1 ] . any? { |l | l . include? 'PASS' }
336+ if line_array [ @result_usual_idx ..] . any? { |l | l . include? 'PASS' }
337337 test_passed ( line_array )
338338 @test_passed += 1
339- elsif line_array [ @result_usual_idx ..- 1 ] . any? { |l | l . include? 'FAIL' }
339+ elsif line_array [ @result_usual_idx ..] . any? { |l | l . include? 'FAIL' }
340340 test_failed ( line_array )
341341 @test_failed += 1
342342 elsif line_array [ @result_usual_idx ..-2 ] . any? { |l | l . include? 'IGNORE' }
343343 test_ignored ( line_array )
344344 @test_ignored += 1
345- elsif line_array [ @result_usual_idx ..- 1 ] . any? { |l | l . include? 'IGNORE' }
346- line_array . push ( ' No reason given (' + get_test_time ( line_array [ @result_usual_idx ..- 1 ] ) . to_s + ' ms)' )
345+ elsif line_array [ @result_usual_idx ..] . any? { |l | l . include? 'IGNORE' }
346+ line_array . push ( " No reason given (#{ get_test_time ( line_array [ @result_usual_idx ..] ) } ms)" )
347347 test_ignored ( line_array )
348348 @test_ignored += 1
349349 end
@@ -353,9 +353,9 @@ def process(file_name)
353353 puts ''
354354 puts '=================== SUMMARY ====================='
355355 puts ''
356- puts ' Tests Passed : ' + @test_passed . to_s
357- puts ' Tests Failed : ' + @test_failed . to_s
358- puts ' Tests Ignored : ' + @test_ignored . to_s
356+ puts " Tests Passed : #{ @test_passed } "
357+ puts " Tests Failed : #{ @test_failed } "
358+ puts " Tests Ignored : #{ @test_ignored } "
359359
360360 return unless @xml_out
361361
0 commit comments