OLD | NEW |
---|---|
(Empty) | |
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. | |
5 | |
6 import argparse | |
7 import os | |
8 import subprocess | |
9 import sys | |
10 import tempfile | |
11 | |
12 def main(): | |
13 parser = argparse.ArgumentParser(description='Tests Dart snapshotting') | |
14 parser.add_argument("--build-dir", | |
15 dest="build_dir", | |
16 metavar="<build-directory>", | |
17 type=str, | |
18 required=True, | |
19 help="The directory containing the Mojo build.") | |
20 args = parser.parse_args() | |
21 dart_snapshotter = os.path.join(args.build_dir, 'dart_snapshotter') | |
22 package_root = os.path.join(args.build_dir, 'gen', 'dart-pkg', 'packages') | |
23 main_dart = os.path.join( | |
24 args.build_dir, 'gen', 'dart-pkg', 'mojo_dart_hello', 'main.dart') | |
25 snapshot = tempfile.mktemp() | |
26 | |
27 if not os.path.isfile(dart_snapshotter): | |
28 print "file not found: " + dart_snapshotter | |
29 return 1 | |
30 subprocess.check_call([ | |
31 dart_snapshotter, | |
32 main_dart, | |
33 '--package-root=%s' % package_root, | |
34 '--snapshot=%s' % snapshot, | |
35 ]) | |
36 if not os.path.isfile(snapshot): | |
Cutch
2015/08/11 14:18:06
Is there at least a magic number at the front of t
zra
2015/08/11 17:03:21
Done. Not sure how robust it is, but this test wil
| |
37 return 1 | |
38 | |
39 if __name__ == '__main__': | |
40 sys.exit(main()) | |
OLD | NEW |