https://bugs.webkit.org/show_bug.cgi?id=77058
Reviewed by Eric Seidel.
r105935 broke executive_unittest by changing which script we
were running and not ensuring that the PYTHONPATH was set up
properly.
This change also fixes a regression introduced recently where
test-webkitpy wasn't figuring out the path to Tools/Scripts
right, either (so running ./test-webkitpy would fail).
* Scripts/test-webkitpy:
* Scripts/webkitpy/common/system/executive_unittest.py:
(script_dir):
(ExecutiveTest.setUp):
(ExecutiveTest):
(ExecutiveTest.tearDown):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105954
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-25 Dirk Pranke <dpranke@chromium.org>
+
+ test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
+ https://bugs.webkit.org/show_bug.cgi?id=77058
+
+ Reviewed by Eric Seidel.
+
+ r105935 broke executive_unittest by changing which script we
+ were running and not ensuring that the PYTHONPATH was set up
+ properly.
+
+ This change also fixes a regression introduced recently where
+ test-webkitpy wasn't figuring out the path to Tools/Scripts
+ right, either (so running ./test-webkitpy would fail).
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ (script_dir):
+ (ExecutiveTest.setUp):
+ (ExecutiveTest):
+ (ExecutiveTest.tearDown):
+
2012-01-25 Adam Barth <abarth@webkit.org>
Disable tests on the mac-ews while we sort out hte stability issues.
if __name__ == "__main__":
- webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+ webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# FIXME: We should probably test each package separately to avoid naming conflicts.
dirs = [
return [sys.executable, __file__, '--' + cmd] + list(args)
+def script_dir():
+ return os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+
+
class ExecutiveTest(unittest.TestCase):
+ def setUp(self):
+ # We need this so that we can launch 'python executive_unittests.py' directly (to test
+ # actually spawning subprocesses) and have 'from webkitpy...' imports work reliably.
+ self.orig_pythonpath = os.environ.get('PYTHONPATH')
+ os.environ['PYTHONPATH'] = script_dir()
+
+ def tearDown(self):
+ if self.orig_pythonpath is not None:
+ os.environ['PYTHONPATH'] = self.orig_pythonpath
+ else:
+ del os.environ['PYTHONPATH']
+
def assert_interpreter_for_content(self, intepreter, content):
fs = MockFileSystem()
file_path = None