aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/tests/fix_pythonpath.py
diff options
context:
space:
mode:
authorGravatar epoger <epoger@google.com>2014-07-17 12:54:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-17 12:54:16 -0700
commit66ed8dc4bfd63e4552a213cb17909f9fbbf59abd (patch)
tree4d48cfa8ba43750c051f542f23b48b5f953e58ea /tools/tests/fix_pythonpath.py
parent733418f91e4d90f4ec250d9a97120618a5a89b49 (diff)
combine base_unittest.py modules from gm and tools
general cleanup, which will also help with http://skbug.com/2752 ('split existing "gpu" GM results into "gl" and "gles"') R=rmistry@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/397103003
Diffstat (limited to 'tools/tests/fix_pythonpath.py')
-rwxr-xr-xtools/tests/fix_pythonpath.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/tests/fix_pythonpath.py b/tools/tests/fix_pythonpath.py
new file mode 100755
index 0000000000..a746a18937
--- /dev/null
+++ b/tools/tests/fix_pythonpath.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+"""
+Copyright 2014 Google Inc.
+
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+
+Adds possibly-needed directories to PYTHONPATH, if they aren't already there.
+"""
+
+import os
+import sys
+
+TRUNK_DIRECTORY = os.path.abspath(os.path.join(
+ os.path.dirname(__file__), os.pardir, os.pardir))
+for subdir in ['tools']:
+ fullpath = os.path.join(TRUNK_DIRECTORY, subdir)
+ if fullpath not in sys.path:
+ sys.path.append(fullpath)