Chromium Code Reviews| 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 test runner for gtest application tests.""" | 6 """A test runner for gtest application tests.""" |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import platform | 10 import platform |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 print 72 * '-' | 57 print 72 * '-' |
| 58 print e.output | 58 print e.output |
| 59 print 72 * '-' | 59 print 72 * '-' |
| 60 return 1 | 60 return 1 |
| 61 except OSError as e: | 61 except OSError as e: |
| 62 print " Failed to start test" | 62 print " Failed to start test" |
| 63 return 1 | 63 return 1 |
| 64 | 64 |
| 65 test_list = gtest_list_tests(list_output) | 65 test_list = gtest_list_tests(list_output) |
| 66 for test in test_list: | 66 for test in test_list: |
| 67 command_line = [mojo_shell, apptest + " --gtest_filter=" + test] | 67 command_line = [mojo_shell, '--example_apptest_arg', |
|
msw
2014/11/20 21:59:12
1) Does this actually work? I thought the only arg
Chris Masone
2014/11/20 23:35:19
You were right, this wasn't actually working.
| |
| 68 apptest + " --gtest_filter=" + test] | |
| 68 | 69 |
| 69 _logging.debug("Running %s..." % command_line) | 70 _logging.debug("Running %s..." % command_line) |
| 70 try: | 71 try: |
| 71 # TODO(msw): Need to fail on errors! mojo_shell always exits with 0! | 72 # TODO(msw): Need to fail on errors! mojo_shell always exits with 0! |
| 72 subprocess.check_output(command_line, stderr=subprocess.STDOUT) | 73 subprocess.check_output(command_line, stderr=subprocess.STDOUT) |
| 73 _logging.debug("Succeeded") | 74 _logging.debug("Succeeded") |
| 74 except subprocess.CalledProcessError as e: | 75 except subprocess.CalledProcessError as e: |
| 75 print "Failed with exit code %d and output:" % e.returncode | 76 print "Failed with exit code %d and output:" % e.returncode |
| 76 print 72 * '-' | 77 print 72 * '-' |
| 77 print e.output | 78 print e.output |
| 78 print 72 * '-' | 79 print 72 * '-' |
| 79 return 1 | 80 return 1 |
| 80 except OSError as e: | 81 except OSError as e: |
| 81 print " Failed to start test" | 82 print " Failed to start test" |
| 82 return 1 | 83 return 1 |
| 83 print "Succeeded" | 84 print "Succeeded" |
| 84 | 85 |
| 85 return 0 | 86 return 0 |
| 86 | 87 |
| 87 if __name__ == '__main__': | 88 if __name__ == '__main__': |
| 88 sys.exit(main(sys.argv)) | 89 sys.exit(main(sys.argv)) |
| OLD | NEW |