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

Side by Side Diff: examples/dart/example_tests.py

Issue 1571823002: Dart: Adds tests of a couple Dart examples. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
(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))
OLDNEW
« no previous file with comments | « no previous file | examples/dart/hello_world/hello/lib/main.dart » ('j') | mojo/tools/get_test_list.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698