Bug 929125 - Set shared library path in jit-test harness; r=terrence
authorDan Minor <dminor@mozilla.com>
Tue, 22 Oct 2013 13:57:54 -0400
changeset 166614 24db71586336fbf01e04aceb7accf9c27e18627b
parent 166613 4f5ad1f42a3261d3d7cca37185d0a786b5515ffa
child 166615 9687708309c56eb4e7a82404cc9fbb4e5d65c3e1
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs929125
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 929125 - Set shared library path in jit-test harness; r=terrence
js/src/tests/lib/jittests.py
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -295,16 +295,31 @@ def run_test(test, prefix, options):
         run = run_cmd_avoid_stdio
     else:
         run = run_cmd
 
     env = os.environ.copy()
     if test.tz_pacific:
         env['TZ'] = 'PST8PDT'
 
+    # Ensure interpreter directory is in shared library path.
+    pathvar = ''
+    if sys.platform.startswith('linux'):
+        pathvar = 'LD_LIBRARY_PATH'
+    elif sys.platform.startswith('darwin'):
+        pathvar = 'DYLD_LIBRARY_PATH'
+    elif sys.platform.startswith('win'):
+        pathvar = 'PATH'
+    if pathvar:
+        bin_dir = os.path.dirname(cmd[0])
+        if pathvar in env:
+            env[pathvar] = '%s%s%s' % (bin_dir, os.pathsep, env[pathvar])
+        else:
+            env[pathvar] = bin_dir
+
     out, err, code, timed_out = run(cmd, env, options.timeout)
     return TestOutput(test, cmd, out, err, code, None, timed_out)
 
 def run_test_remote(test, device, prefix, options):
     cmd = test.command(prefix, posixpath.join(options.remote_test_root, 'lib/'), posixpath.join(options.remote_test_root, 'tests'))
     if options.show_cmd:
         print(subprocess.list2cmdline(cmd))