summaryrefslogtreecommitdiffstats
path: root/tools/emacs
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 00:38:50 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 00:38:50 +0000
commit1b38cfbe09d7d1ea3274dff972526bfc0825e986 (patch)
tree2192fcca94f5e66298ea5dcf58d8c5b9b30af91d /tools/emacs
parent8a0818124dd29399c4ad9b0121595d5e6b9a1f73 (diff)
downloadchromium_src-1b38cfbe09d7d1ea3274dff972526bfc0825e986.zip
chromium_src-1b38cfbe09d7d1ea3274dff972526bfc0825e986.tar.gz
chromium_src-1b38cfbe09d7d1ea3274dff972526bfc0825e986.tar.bz2
Check in an emacs helper for using trybot output.
Review URL: http://codereview.chromium.org/5377006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/emacs')
-rw-r--r--tools/emacs/trybot-windows.txt57
-rw-r--r--tools/emacs/trybot.el79
2 files changed, 136 insertions, 0 deletions
diff --git a/tools/emacs/trybot-windows.txt b/tools/emacs/trybot-windows.txt
new file mode 100644
index 0000000..95853cd
--- /dev/null
+++ b/tools/emacs/trybot-windows.txt
@@ -0,0 +1,57 @@
+This file contains sample trybot output from a Windows trybot run.
+It contains a warning and an error but has otherwise been shortened
+for length.
+
+"C:\Program Files (x86)\Xoreax\IncrediBuild\BuildConsole.exe" e:\b\build\slave\win\build\src\build\all.sln "/Cfg=Debug|Win32"
+
+-----------------------------------------------------------------
+IncrediBuild Console 3.60 Internal (build 1156)
+Copyright (C) 2001-2010 Xoreax Software Ltd. All rights reserved.
+-----------------------------------------------------------------
+--------------------Configuration: toolband_proxy_lib - Debug|Win32------------
+Compiling...
+toolband_p.c
+toolband_proxy.cc
+toolband_dlldata.c
+Creating library...
+
+toolband_proxy_lib - 0 error(s), 0 warning(s)
+--------------------Configuration: webcore_bindings - Debug|Win32--------------
+Compiling...
+CSSGrammar.cpp
+e:\b\build\slave\win\build\src\third_party\webkit\javascriptcore\wtf\text\StringImpl.h(90) : warning C4355: 'this' : used in base member initializer list
+e:\b\build\slave\win\build\src\third_party\webkit\webcore\dom\ViewportArguments.h(78) : warning C4305: 'initializing' : truncation from '' to 'bool'
+e:\b\build\slave\win\build\src\build\Debug\obj\global_intermediate\webkit\CSSGrammar.cpp(1930) : warning C4065: switch statement contains 'default' but no 'case' labels
+V8DerivedSources1.cpp
+--------------------Configuration: run_testserver - Debug|Win32----------------
+Compiling...
+run_testserver.cc
+Linking...
+Embedding manifest...
+Embedding manifest... (rc.exe)
+Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
+
+Copyright (C) Microsoft Corporation. All rights reserved.
+
+Embedding manifest... (link.exe)
+
+run_testserver - 0 error(s), 0 warning(s)
+--------------------Configuration: browser - Debug|Win32-----------------------
+Compiling...
+bookmark_manager_resources_map.cc
+theme_resources_map.cc
+shared_resources_map.cc
+process_singleton_win.cc
+e:\b\build\slave\win\build\src\chrome\browser\process_singleton_win.cc(95) : error C2664: 'PathService::Get' : cannot convert parameter 2 from 'std::wstring *' to 'FilePath *'
+ Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
+gpu_process_host.cc
+ntp_background_util.cc
+
+browser - 6 error(s), 0 warning(s)
+
+1 build system warning(s):
+ - PDB instance limit is enabled
+
+---------------------- Done ----------------------
+
+ Build: 244 succeeded, 1 failed, 233 up-to-date, 42 skipped
diff --git a/tools/emacs/trybot.el b/tools/emacs/trybot.el
new file mode 100644
index 0000000..5953ade
--- /dev/null
+++ b/tools/emacs/trybot.el
@@ -0,0 +1,79 @@
+; To use this,
+; 1) Add to init.el:
+; (setq-default chrome-root "/path/to/chrome/src/")
+; (add-to-list 'load-path (concat chrome-root "tools/emacs"))
+; (require 'trybot)
+; 2) Run on trybot output:
+; M-x trybot
+;
+; To hack on this,
+; M-x eval-buffer
+; M-x trybot-test
+
+(defvar chrome-root nil
+ "Path to the src/ directory of your Chrome checkout.")
+
+(defun get-chrome-root ()
+ (or chrome-root default-directory))
+
+(defun trybot-fixup ()
+ "Parse and fixup the contents of the current buffer as trybot output."
+
+ ;; Fixup paths.
+ (cd (get-chrome-root))
+
+ ;; Delete Windows \r.
+ (delete-trailing-whitespace)
+
+ ;; Fix up path references.
+ ; XXX is there something I should so so this stuff doesn't end up on the
+ ; undo stack?
+ (goto-char (point-min))
+ ; Fix Windows paths ("d:\...\src\").
+ ; TODO: need to fix case; e.g. third_party/webkit -> third_party/WebKit. :(
+ (while (re-search-forward "^.:\\\\.*\\\\src\\\\" nil t)
+ (replace-match "")
+ ; Line now looks like:
+ ; foo\bar\baz.cc error message here
+ ; We want to fixup backslashes in path into forward slashes, without
+ ; modifying the error message.
+ ; XXX current eats backslashes after the filename; how can I limit it to
+ ; changing from current point up to the first space?
+ (subst-char-in-region (point) (line-end-position) ?\\ ?/))
+ (goto-char (point-min))
+
+ ;; Switch into compilation mode.
+ (compilation-mode))
+
+(defun trybot-test ()
+ "Load our test data and do the trybot parse on it."
+ (interactive)
+
+ (switch-to-buffer (get-buffer-create "*trybot-test*"))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert-file-contents-literally
+ (concat (get-chrome-root) "tools/emacs/trybot-windows.txt"))
+
+ (trybot-fixup)))
+
+(defun trybot (url)
+ "Fetch a trybot URL and fix up the output into a compilation-mode buffer."
+ (interactive "sURL to trybot stdout (leave empty to use clipboard): ")
+
+ ;; Yank URL from clipboard if necessary.
+ (when (= (length url) 0)
+ (with-temp-buffer
+ (clipboard-yank)
+ (setq url (buffer-string))))
+
+ ;; TODO: fixup URL to append /text if necessary.
+
+ ;; Extract the body out of the URL.
+ ; TODO: delete HTTP headers somehow.
+ (switch-to-buffer (get-buffer-create "*trybot*"))
+ (buffer-swap-text (url-retrieve-synchronously url))
+
+ (trybot-fixup))
+
+(provide 'trybot)