Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: mojo/tools/run_mojo_python_bindings_tests.py

Issue 549123002: mojo: Fix python bindings tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import sys 7 import sys
8 8
9 _script_dir = os.path.dirname(os.path.abspath(__file__)) 9 _script_dir = os.path.dirname(os.path.abspath(__file__))
10 sys.path.insert(0, os.path.join(_script_dir, "pylib")) 10 sys.path.insert(0, os.path.join(_script_dir, "pylib"))
11 11
12 from mojo_python_tests_runner import MojoPythonTestRunner 12 from mojo_python_tests_runner import MojoPythonTestRunner
13 13
14 14
15 class PythonBindingsTestRunner(MojoPythonTestRunner): 15 class PythonBindingsTestRunner(MojoPythonTestRunner):
16 16
17 def add_custom_commandline_options(self, parser): 17 def add_custom_commandline_options(self, parser):
18 parser.add_argument('--build_dir', action='store', 18 parser.add_argument('--build-dir', action='store',
19 help='path to the build output directory') 19 help='path to the build output directory')
20 20
21 def apply_customization(self, args): 21 def apply_customization(self, args):
22 if args.build_dir: 22 if args.build_dir:
23 python_build_dir = os.path.join(args.build_dir, 'python') 23 python_build_dir = os.path.join(args.build_dir, 'python')
24 if python_build_dir not in sys.path: 24 if python_build_dir not in sys.path:
25 sys.path.append(python_build_dir) 25 sys.path.append(python_build_dir)
26 python_gen_dir = os.path.join( 26 python_gen_dir = os.path.join(
27 args.build_dir, 27 args.build_dir,
28 'gen', 'mojo', 'public', 'interfaces', 'bindings', 'tests') 28 'gen', 'mojo', 'public', 'interfaces', 'bindings', 'tests')
29 print python_gen_dir
30 if python_gen_dir not in sys.path: 29 if python_gen_dir not in sys.path:
31 sys.path.append(python_gen_dir) 30 sys.path.append(python_gen_dir)
32 31
33 32
34 def main(): 33 def main():
35 runner = PythonBindingsTestRunner(os.path.join('mojo', 'python', 'tests')) 34 runner = PythonBindingsTestRunner(os.path.join('mojo', 'python', 'tests'))
36 sys.exit(runner.run()) 35 sys.exit(runner.run())
37 36
38 37
39 if __name__ == '__main__': 38 if __name__ == '__main__':
40 sys.exit(main()) 39 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698