| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client 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 """Run all python tests in this directory.""" | 6 """Run all python tests in this directory.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 import unittest | 10 import unittest |
| 11 | 11 |
| 12 MODULES = [ | 12 MODULES = [ |
| 13 'expand_response_file_test', | 13 'expand_response_file_test', |
| 14 'help_message_test', | 14 'help_message_test', |
| 15 'strip_test', | 15 'strip_test', |
| 16 'translate_options_test', |
| 16 ] | 17 ] |
| 17 | 18 |
| 18 # The tested modules live in the parent directory. Set up the import path | 19 # The tested modules live in the parent directory. Set up the import path |
| 19 # accordingly. | 20 # accordingly. |
| 20 my_dir = os.path.dirname(sys.argv[0]) | 21 my_dir = os.path.dirname(sys.argv[0]) |
| 21 sys.path.append(os.path.join(my_dir, '..')) | 22 sys.path.append(os.path.join(my_dir, '..')) |
| 22 | 23 |
| 23 suite = unittest.TestLoader().loadTestsFromNames(MODULES) | 24 suite = unittest.TestLoader().loadTestsFromNames(MODULES) |
| 24 result = unittest.TextTestRunner(verbosity=2).run(suite) | 25 result = unittest.TextTestRunner(verbosity=2).run(suite) |
| 25 if result.wasSuccessful(): | 26 if result.wasSuccessful(): |
| 26 sys.exit(0) | 27 sys.exit(0) |
| 27 else: | 28 else: |
| 28 sys.exit(1) | 29 sys.exit(1) |
| OLD | NEW |