From 07602308294c5f30b4d732cd87bd98d0c5e6a693 Mon Sep 17 00:00:00 2001 From: Fabian Zahn Date: Mon, 29 Jan 2018 21:00:46 +0100 Subject: [PATCH 1/3] Some minor changes - String split now works correctly for windows and unix (cross platform) - Removed unnecessary whitespaces in the xml output (beautifies the output) - Added support for TEST_IGNORE() (without message) --- auto/parse_output.rb | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/auto/parse_output.rb b/auto/parse_output.rb index f16cdb0..f3e076f 100644 --- a/auto/parse_output.rb +++ b/auto/parse_output.rb @@ -47,7 +47,12 @@ class ParseOutput @test_flag = true # Split the path name - test_name = test_suite_name.split('/') + test_name = if @class_name == 1 + test_suite_name.split('\\') # Windows + else + test_suite_name.split('/') # Unix based + end + # Remove the extension base_name = test_name[test_name.size - 1].split('.') @test_suite = 'test.' + base_name[0] @@ -78,11 +83,11 @@ class ParseOutput @array_list.push ' ' end - # Test was flagged as being ingored so format the output + # Test was flagged as being ignored so format the output def test_ignored(array) last_item = array.length - 1 test_name = array[last_item - 2] - reason = array[last_item].chomp + reason = array[last_item].chomp.lstrip test_suite_verify(array[@class_name]) printf "%-40s IGNORED\n", test_name @@ -96,7 +101,7 @@ class ParseOutput return unless @xml_out @array_list.push ' ' - @array_list.push ' ' + reason + ' ' + @array_list.push ' ' + reason + '' @array_list.push ' ' end @@ -104,7 +109,7 @@ class ParseOutput def test_failed(array) last_item = array.length - 1 test_name = array[last_item - 2] - reason = array[last_item].chomp + ' at line: ' + array[last_item - 3] + reason = array[last_item].chomp.lstrip + ' at line: ' + array[last_item - 3] test_suite_verify(array[@class_name]) printf "%-40s FAILED\n", test_name @@ -118,11 +123,11 @@ class ParseOutput return unless @xml_out @array_list.push ' ' - @array_list.push ' ' + reason + ' ' + @array_list.push ' ' + reason + '' @array_list.push ' ' end - # Figure out what OS we are running on. For now we are assuming if it's not Windows it must + # Figure out what OS we are running on. For now we are assuming if it's not Windows it must # be Unix based. def detect_os os = RUBY_PLATFORM.split('-') @@ -168,12 +173,16 @@ class ParseOutput if line.include? ':PASS' test_passed(line_array) test_pass += 1 - elsif line.include? ':FAIL:' + elsif line.include? ':FAIL' test_failed(line_array) test_fail += 1 elsif line.include? ':IGNORE:' test_ignored(line_array) test_ignore += 1 + elsif line.include? ':IGNORE' + line_array.push('No reason given') + test_ignored(line_array) + test_ignore += 1 elsif line.start_with? 'TEST(' if line.include? ' PASS' line_array = line.split(' ') @@ -199,7 +208,7 @@ class ParseOutput return unless @xml_out - heading = '' + heading = '' @array_list.insert(0, heading) write_xml_output end From dc9c7a7b4b316cb4e0605283f1ce981d7d6dfac9 Mon Sep 17 00:00:00 2001 From: Fabian Zahn Date: Sun, 11 Feb 2018 13:02:26 +0100 Subject: [PATCH 2/3] Removed leading whitespace --- auto/parse_output.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto/parse_output.rb b/auto/parse_output.rb index f3e076f..0f9de4d 100644 --- a/auto/parse_output.rb +++ b/auto/parse_output.rb @@ -123,7 +123,7 @@ class ParseOutput return unless @xml_out @array_list.push ' ' - @array_list.push ' ' + reason + '' + @array_list.push ' ' + reason + '' @array_list.push ' ' end From 4dfb512a275370a1ad2f9328d25946d9a650d4c6 Mon Sep 17 00:00:00 2001 From: Fabian Zahn Date: Mon, 12 Feb 2018 06:44:26 +0100 Subject: [PATCH 3/3] Added ".to_s" to the test suite name (explicit type conversion) --- auto/parse_output.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto/parse_output.rb b/auto/parse_output.rb index 0f9de4d..b5132a0 100644 --- a/auto/parse_output.rb +++ b/auto/parse_output.rb @@ -208,7 +208,7 @@ class ParseOutput return unless @xml_out - heading = '' + heading = '' @array_list.insert(0, heading) write_xml_output end