Roll src/third_party/WebKit 6a61df7:51aa64b (svn 201111:201112)
[chromium-blink-merge.git] / infra / scripts / runtest_wrapper.py
blobfe9835f3bf401773b545420dd8f05374044d2bc1
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """Wrapper for runtest.py, makes it possible to control src-side
7 which file gets used and test the changes on trybots before landing."""
10 import argparse
11 import copy
12 import os
13 import subprocess
14 import sys
17 SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
20 def main(argv):
21 parser = argparse.ArgumentParser()
22 # TODO(phajdan.jr): Remove after cleaning up build repo side.
23 parser.add_argument(
24 '--path-build', help='Path to the build repo')
25 parser.add_argument('args', nargs='*', help='Arguments to pass to runtest.py')
26 args = parser.parse_args(argv)
28 env = copy.copy(os.environ)
29 # Reset PYTHONPATH to make sure we're not accidentally using
30 # the buildbot-provided value and build-side modules. That would make
31 # changes inside this directory not take effect on buildbot.
32 pythonpath = []
33 pythonpath.append(os.path.join(
34 SRC_DIR, 'infra', 'scripts', 'legacy', 'scripts'))
35 pythonpath.append(os.path.join(
36 SRC_DIR, 'infra', 'scripts', 'legacy', 'site_config'))
37 pythonpath.append(os.path.join(
38 SRC_DIR, 'third_party'))
39 env['PYTHONPATH'] = os.pathsep.join(pythonpath)
41 return subprocess.call([
42 sys.executable,
43 os.path.join(SRC_DIR, 'infra', 'scripts', 'legacy',
44 'scripts', 'slave', 'runtest.py')
45 ] + args.args, env=env)
48 if __name__ == '__main__':
49 sys.exit(main(sys.argv[1:]))