diff --git a/auto/stylize_as_junit.rb b/auto/stylize_as_junit.rb index e003918a..05f8ee6b 100755 --- a/auto/stylize_as_junit.rb +++ b/auto/stylize_as_junit.rb @@ -6,6 +6,7 @@ # SPDX-License-Identifier: MIT # ========================================================================= +require 'cgi' require 'fileutils' require 'optparse' require 'ostruct' @@ -143,6 +144,7 @@ def get_details(_result_file, lines) lines.each do |line| line = line.tr('\\', '/') _src_file, src_line, test_name, status, msg = line.split(/:/) + test_name = CGI.escapeHTML(test_name.to_s) case status when 'IGNORE' then results[:ignores] << { test: test_name, line: src_line, message: msg } when 'FAIL' then results[:failures] << { test: test_name, line: src_line, message: msg }