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 """A "smart" test runner for gtest unit tests (that caches successes).""" | 6 """A "smart" test runner for gtest unit tests (that caches successes).""" |
7 | 7 |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import subprocess | 10 import subprocess |
11 import sys | 11 import sys |
12 | 12 |
13 _logging = logging.getLogger() | 13 _logging = logging.getLogger() |
14 | 14 |
15 _script_dir = os.path.dirname(os.path.realpath(__file__)) | 15 _script_dir = os.path.dirname(os.path.abspath(__file__)) |
16 sys.path.insert(0, os.path.join(_script_dir, "pylib")) | 16 sys.path.insert(0, os.path.join(_script_dir, "pylib")) |
17 | 17 |
18 from transitive_hash import transitive_hash | 18 from transitive_hash import transitive_hash |
19 | 19 |
20 def main(argv): | 20 def main(argv): |
21 logging.basicConfig() | 21 logging.basicConfig() |
22 # Uncomment to debug: | 22 # Uncomment to debug: |
23 # _logging.setLevel(logging.DEBUG) | 23 # _logging.setLevel(logging.DEBUG) |
24 | 24 |
25 if len(argv) < 3 or len(argv) > 4: | 25 if len(argv) < 3 or len(argv) > 4: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 print " Failed to start test" | 99 print " Failed to start test" |
100 return 1 | 100 return 1 |
101 print "All tests succeeded" | 101 print "All tests succeeded" |
102 if successes_cache_file: | 102 if successes_cache_file: |
103 successes_cache_file.close() | 103 successes_cache_file.close() |
104 | 104 |
105 return 0 | 105 return 0 |
106 | 106 |
107 if __name__ == '__main__': | 107 if __name__ == '__main__': |
108 sys.exit(main(sys.argv)) | 108 sys.exit(main(sys.argv)) |
OLD | NEW |