Bug 1377007 - autospider.py,runcppunittests.py export the path to directory js/src,r=Yoric
☠☠ backed out by d0d709880f19 ☠ ☠
authorDavid Teller <dteller@mozilla.com>
Fri, 08 Dec 2017 11:14:12 +0100
changeset 448245 33fdf9e531e216c00b704ec043677e720cf89d9d
parent 448244 267abdb38036fa113551f7c7ed06f85fb7af5eb9
child 448246 c30bc5d5adbc17de3d4b6d883d2f04e7ee30a5ff
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1377007
milestone59.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 1377007 - autospider.py,runcppunittests.py export the path to directory js/src,r=Yoric Some tests need to find out js/src to locate their test data. Exporting this information as part of the environment. MozReview-Commit-ID: JAefL2arhJL
js/src/devtools/automation/autospider.py
testing/runcppunittests.py
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -27,16 +27,17 @@ def directories(pathmodule, cwd, fixup=l
     return Dirs(scripts, js_src, source, tooltool)
 
 # Some scripts will be called with sh, which cannot use backslashed
 # paths. So for direct subprocess.* invocation, use normal paths from
 # DIR, but when running under the shell, use POSIX style paths.
 DIR = directories(os.path, os.getcwd())
 PDIR = directories(posixpath, os.environ["PWD"],
                    fixup=lambda s: re.sub(r'^(\w):', r'/\1', s))
+env['CPP_UNIT_TESTS_DIR_JS_SRC'] = DIR.js_src
 
 parser = argparse.ArgumentParser(
     description='Run a spidermonkey shell build job')
 parser.add_argument('--dep', action='store_true',
                     help='do not clobber the objdir before building')
 parser.add_argument('--keep', action='store_true',
                     help='do not delete the sanitizer output directory (for testing)')
 parser.add_argument('--platform', '-p', type=str, metavar='PLATFORM',
--- a/testing/runcppunittests.py
+++ b/testing/runcppunittests.py
@@ -3,25 +3,29 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import with_statement
 import sys
 import os
 from optparse import OptionParser
+from os import environ as env
 import manifestparser
 import mozprocess
 import mozinfo
 import mozcrash
 import mozfile
 import mozlog
 
 SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
 
+# Export directory js/src for tests that need it.
+env['CPP_UNIT_TESTS_DIR_JS_SRC'] = os.path.abspath(os.path.join(SCRIPT_DIR, "..", ".."))
+
 
 class CPPUnitTests(object):
     # Time (seconds) to wait for test process to complete
     TEST_PROC_TIMEOUT = 900
     # Time (seconds) in which process will be killed if it produces no output.
     TEST_PROC_NO_OUTPUT_TIMEOUT = 300
 
     def run_one_test(self, prog, env, symbols_path=None, interactive=False,