OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import os.path | 7 import os.path |
8 import sys | 8 import sys |
9 from filecmp import dircmp | 9 from filecmp import dircmp |
10 from shutil import rmtree | 10 from shutil import rmtree |
11 from tempfile import mkdtemp | 11 from tempfile import mkdtemp |
| 12 |
| 13 import add_sdk_tools_to_path |
12 from mopy.paths import Paths | 14 from mopy.paths import Paths |
13 | 15 |
14 paths = Paths() | 16 paths = Paths() |
15 | |
16 sys.path.insert(0, os.path.join(paths.mojo_dir, "public", "tools", "bindings", | 17 sys.path.insert(0, os.path.join(paths.mojo_dir, "public", "tools", "bindings", |
17 "pylib")) | 18 "pylib")) |
| 19 |
18 from mojom_tests.support.find_files import FindFiles | 20 from mojom_tests.support.find_files import FindFiles |
19 from mojom_tests.support.run_bindings_generator import RunBindingsGenerator | 21 from mojom_tests.support.run_bindings_generator import RunBindingsGenerator |
20 | 22 |
21 | 23 |
22 def _ProcessDircmpResults(results, verbose=False): | 24 def _ProcessDircmpResults(results, verbose=False): |
23 """Prints results of directory comparison and returns true if they are | 25 """Prints results of directory comparison and returns true if they are |
24 identical (note: the "left" directory should be the golden directory).""" | 26 identical (note: the "left" directory should be the golden directory).""" |
25 rv = not (bool(results.left_only) or bool(results.right_only) or \ | 27 rv = not (bool(results.left_only) or bool(results.right_only) or \ |
26 bool(results.common_funny) or bool(results.funny_files) or \ | 28 bool(results.common_funny) or bool(results.funny_files) or \ |
27 bool(results.diff_files)) | 29 bool(results.diff_files)) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if not identical: | 96 if not identical: |
95 print "FAILURE: current output differs from golden files" | 97 print "FAILURE: current output differs from golden files" |
96 return 1 | 98 return 1 |
97 | 99 |
98 print "SUCCESS: current output identical to golden files" | 100 print "SUCCESS: current output identical to golden files" |
99 return 0 | 101 return 0 |
100 | 102 |
101 | 103 |
102 if __name__ == '__main__': | 104 if __name__ == '__main__': |
103 sys.exit(main()) | 105 sys.exit(main()) |
OLD | NEW |