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

Side by Side Diff: mojo/dart/dart_snapshotter/test/dart_snapshotter_test.py

Issue 1273743005: Dart: Adds a program to create snapshots of Mojo apps. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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 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())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698