OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 # Self-test for skimage. | 6 # Self-test for skimage. |
7 | 7 |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 | 42 |
43 # Run skimage twice, first to create an expectations file, and then | 43 # Run skimage twice, first to create an expectations file, and then |
44 # comparing to it. | 44 # comparing to it. |
45 | 45 |
46 # Both commands will run the binary, reading from resources. | 46 # Both commands will run the binary, reading from resources. |
47 cmd_line = [skimage_binary] | 47 cmd_line = [skimage_binary] |
48 resources_dir = os.path.join(trunk_dir, 'resources') | 48 resources_dir = os.path.join(trunk_dir, 'resources') |
49 cmd_line.extend(["-r", resources_dir]) | 49 cmd_line.extend(["-r", resources_dir]) |
50 | 50 |
51 # Create the expectations file | 51 # Create the expectations file |
52 results_file = os.path.join(file_dir, "skimage", "self_test_results.json") | 52 results_file = os.path.join(file_dir, "skimage", "output-actual", |
53 "json-selftest", "results.json") | |
scroggo
2013/06/13 16:17:37
Does json-selftest exist?
epoger
2013/06/13 16:24:47
Yes, just doesn't show up in the diff.
| |
53 create_expectations_cmd = cmd_line + ["--createExpectationsPath", | 54 create_expectations_cmd = cmd_line + ["--createExpectationsPath", |
54 results_file] | 55 results_file] |
55 subprocess.check_call(create_expectations_cmd) | 56 subprocess.check_call(create_expectations_cmd) |
56 | 57 |
57 # Now read from the expectations file | 58 # Now read from the expectations file |
58 check_expectations_cmd = cmd_line + ["--readExpectationsPath", | 59 check_expectations_cmd = cmd_line + ["--readExpectationsPath", |
59 results_file] | 60 results_file] |
60 subprocess.check_call(check_expectations_cmd) | 61 subprocess.check_call(check_expectations_cmd) |
61 print "Self tests succeeded!" | 62 print "Self tests succeeded!" |
62 | 63 |
63 if __name__ == "__main__": | 64 if __name__ == "__main__": |
64 main() | 65 main() |
OLD | NEW |