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
4 # found in the LICENSE file.
9 _script_dir = os.path.dirname(os.path.abspath(__file__))
10 sys.path.insert(0, os.path.join(_script_dir, "pylib"))
12 from mojo_python_tests_runner import MojoPythonTestRunner
15 class PythonBindingsTestRunner(MojoPythonTestRunner):
17 def add_custom_commandline_options(self, parser):
18 parser.add_argument('--build-dir', action='store',
19 help='path to the build output directory')
21 def apply_customization(self, args):
23 python_build_dir = os.path.join(args.build_dir, 'python')
24 if python_build_dir not in sys.path:
25 sys.path.append(python_build_dir)
26 python_gen_dir = os.path.join(
28 'gen', 'mojo', 'public', 'interfaces', 'bindings', 'tests')
29 if python_gen_dir not in sys.path:
30 sys.path.append(python_gen_dir)
34 runner = PythonBindingsTestRunner(os.path.join('mojo', 'python', 'tests'))
35 sys.exit(runner.run())
38 if __name__ == '__main__':