Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: tools/skpdiff/skpdiff_server.py

Issue 22650009: fix path issues on mac and win for skpdiff_server.py (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpdiff/skpdiff_server.py
diff --git a/tools/skpdiff/skpdiff_server.py b/tools/skpdiff/skpdiff_server.py
index 053291af9a6caf71297475ab5c50b8e7a1bdcaa1..15ff8a9dab5c8803c15be7d3c9a353ba3a34b2ec 100755
--- a/tools/skpdiff/skpdiff_server.py
+++ b/tools/skpdiff/skpdiff_server.py
@@ -68,7 +68,11 @@ def get_skpdiff_path(user_path=None):
possible_paths.append(os.path.join(SKIA_ROOT_DIR, 'out',
'Release', 'skpdiff'))
possible_paths.append(os.path.join(SKIA_ROOT_DIR, 'out',
+ 'Release', 'skpdiff.exe'))
+ possible_paths.append(os.path.join(SKIA_ROOT_DIR, 'out',
'Debug', 'skpdiff'))
+ possible_paths.append(os.path.join(SKIA_ROOT_DIR, 'out',
+ 'Debug', 'skpdiff.exe'))
# Use the first path that actually points to the binary
for possible_path in possible_paths:
if os.path.isfile(possible_path):
@@ -159,8 +163,9 @@ def get_head_version(path):
"""
# git-show will not work with absolute paths. This ensures we give it a path
- # relative to the skia root.
- git_path = os.path.relpath(path, SKIA_ROOT_DIR)
+ # relative to the skia root. This path also has to use forward slashes, even
+ # on windows.
+ git_path = os.path.relpath(path, SKIA_ROOT_DIR).replace('\\', '/')
git_show_proc = subprocess.Popen(['git', 'show', 'HEAD:' + git_path],
stdout=subprocess.PIPE)
@@ -221,8 +226,10 @@ class ExpectationsManager:
# Create a temporary file tree that makes sense for skpdiff to operate
- # on.
- image_output_dir = tempfile.mkdtemp('skpdiff')
+ # on. We take the realpath of the new temp directory because some OSs
+ # (*cough* osx) put the temp directory behind a symlink that gets
+ # resolved later down the pipeline and breaks the image map.
+ image_output_dir = os.path.realpath(tempfile.mkdtemp('skpdiff'))
expected_image_dir = os.path.join(image_output_dir, 'expected')
actual_image_dir = os.path.join(image_output_dir, 'actual')
os.mkdir(expected_image_dir)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698