OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2014 The Crashpad Authors. All rights reserved. | 3 # Copyright 2014 The Crashpad Authors. All rights reserved. |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 12 matching lines...) Expand all Loading... |
23 # that are run is maintained in-tree, rather than in a separate infrastructure | 23 # that are run is maintained in-tree, rather than in a separate infrastructure |
24 # location in the recipe. | 24 # location in the recipe. |
25 def main(args): | 25 def main(args): |
26 if len(args) != 1: | 26 if len(args) != 1: |
27 print >>sys.stderr, 'usage: run_tests.py {Debug|Release}' | 27 print >>sys.stderr, 'usage: run_tests.py {Debug|Release}' |
28 return 1; | 28 return 1; |
29 | 29 |
30 crashpad_dir = \ | 30 crashpad_dir = \ |
31 os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) | 31 os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) |
32 | 32 |
33 binary_dir = os.path.join(crashpad_dir, 'out', args[0]) | 33 # In a standalone Crashpad build, the out directory is in the Crashpad root. |
| 34 out_dir = os.path.join(crashpad_dir, 'out') |
| 35 if not os.path.exists(out_dir): |
| 36 # In an in-Chromium build, the out directory is in the Chromium root, and |
| 37 # the Crashpad root is in third_party/crashpad/crashpad relative to the |
| 38 # Chromium root. |
| 39 chromium_dir = os.path.join(crashpad_dir, os.pardir, os.pardir, os.pardir) |
| 40 out_dir = os.path.join(chromium_dir, 'out') |
| 41 if not os.path.exists(out_dir): |
| 42 raise Exception('could not determine out_dir', crashpad_dir) |
| 43 |
| 44 binary_dir = os.path.join(out_dir, args[0]) |
| 45 |
34 tests = [ | 46 tests = [ |
35 'crashpad_client_test', | 47 'crashpad_client_test', |
36 'crashpad_minidump_test', | 48 'crashpad_minidump_test', |
37 'crashpad_snapshot_test', | 49 'crashpad_snapshot_test', |
38 'crashpad_util_test', | 50 'crashpad_util_test', |
39 ] | 51 ] |
40 for test in tests: | 52 for test in tests: |
41 print '-' * 80 | 53 print '-' * 80 |
42 print test | 54 print test |
43 print '-' * 80 | 55 print '-' * 80 |
44 subprocess.check_call(os.path.join(binary_dir, test)) | 56 subprocess.check_call(os.path.join(binary_dir, test)) |
45 return 0 | 57 return 0 |
46 | 58 |
47 | 59 |
48 if __name__ == '__main__': | 60 if __name__ == '__main__': |
49 sys.exit(main(sys.argv[1:])) | 61 sys.exit(main(sys.argv[1:])) |
OLD | NEW |