Kouhei Sutou
null+****@clear*****
Sun Feb 5 10:37:10 JST 2017
Kouhei Sutou 2017-02-05 10:37:10 +0900 (Sun, 05 Feb 2017) New Revision: 1287e7dce7e77c513a52329637c3ba2b1bc696e6 https://github.com/groonga/grntest/commit/1287e7dce7e77c513a52329637c3ba2b1bc696e6 Message: Normalize "file" in error Modified files: lib/grntest/test-runner.rb Modified: lib/grntest/test-runner.rb (+15 -6) =================================================================== --- lib/grntest/test-runner.rb 2017-01-19 14:03:28 +0900 (ad982ae) +++ lib/grntest/test-runner.rb 2017-02-05 10:37:10 +0900 (466918d) @@ -637,12 +637,17 @@ http { }) else error = header["error"] + normalized_values = {} message = error["message"] - message = normalize_path_in_error_message(message) + normalized_values["message"] = normalize_error_message(message) + file = error["file"] + if file + normalized_values["file"] = normalize_error_file_path(file) + end header.merge({ "start_time" => 0.0, "elapsed_time" => 0.0, - "error" => error.merge({"message" => message}) + "error" => error.merge(normalized_values), }) end else @@ -653,7 +658,7 @@ http { else message, backtrace = rest _ = backtrace # for suppress warnings - message = normalize_path_in_error_message(message) + message = normalize_error_message(message) [[return_code, 0.0, 0.0], message] end end @@ -665,7 +670,7 @@ http { if body["exception"] exception = Marshal.load(Marshal.dump(body["exception"])) message = exception["message"] - exception["message"] = normalize_path_in_error_message(message) + exception["message"] = normalize_error_message(message) body.merge("exception" => exception) else body.each do |key, value| @@ -683,11 +688,11 @@ http { end def normalize_error(content) - content = normalize_path_in_error_message(content) + content = normalize_error_message(content) normalize_raw_content(content) end - def normalize_path_in_error_message(content) + def normalize_error_message(content) case content when /\A(.*: fopen: failed to open mruby script file: )<(.+?)>?\z/ pre = $1 @@ -698,6 +703,10 @@ http { end end + def normalize_error_file_path(path) + File.basename(path) + end + def normalize_plugin_path(path) path.gsub(/\.libs\//, "").gsub(/\.dll\z/, ".so") end -------------- next part -------------- HTML����������������������������... Descargar