Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2016 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. | |
| 5 | |
| 6 """Runs Dart example tests""" | |
| 7 | |
| 8 import argparse | |
| 9 import os | |
| 10 import subprocess | |
| 11 import sys | |
| 12 | |
| 13 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| 14 SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR)) | |
| 15 | |
| 16 DART_SDK = os.path.join(SRC_DIR, 'third_party', 'dart-sdk', 'dart-sdk', 'bin') | |
| 17 DART = os.path.join(DART_SDK, 'dart') | |
| 18 | |
| 19 # Add paths to test scripts here relative to //examples/dart. | |
| 20 TESTS = [ | |
| 21 os.path.join('hello_world', 'hello', 'test', 'hello_test.dart'), | |
| 22 os.path.join('wget', 'test', 'wget_test.dart'), | |
|
Cutch
2016/01/11 21:10:58
I'd prefer to just list the directory:
TESTS = [
zra
2016/01/11 22:11:18
Done.
| |
| 23 ] | |
| 24 | |
| 25 def main(build_dir, package_root): | |
| 26 for test in TESTS: | |
| 27 subprocess.check_call( | |
| 28 [DART, '-p', package_root, '--checked', os.path.join(SCRIPT_DIR, test), | |
| 29 '--mojo-shell', os.path.join(build_dir, 'mojo_shell'),]) | |
| 30 | |
| 31 if __name__ == '__main__': | |
| 32 parser = argparse.ArgumentParser(description="Run Dart example tests") | |
| 33 parser.add_argument('-b', '--build-dir', | |
| 34 dest='build_dir', | |
| 35 metavar='<build-directory>', | |
| 36 type=str, | |
| 37 required=True, | |
| 38 help='The build output directory. E.g. out/Debug') | |
| 39 args = parser.parse_args() | |
| 40 package_root = os.path.join( | |
| 41 SRC_DIR, args.build_dir, 'gen', 'dart-pkg', 'packages') | |
| 42 sys.exit(main(args.build_dir, package_root)) | |
| OLD | NEW |