| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 import sys | 6 import sys |
| 7 import unittest | 7 import unittest |
| 8 import os | 8 import os |
| 9 | 9 |
| 10 # add tools folder to sys.path | 10 # add tools folder to sys.path |
| 11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 12 SDK_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR)) | 12 SDK_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR)) |
| 13 sys.path.append(os.path.join(SDK_DIR, 'tools')) | 13 sys.path.append(os.path.join(SDK_DIR, 'tools', 'tests')) |
| 14 | 14 |
| 15 TEST_MODULES = [ | 15 TEST_MODULES = [ |
| 16 'zip_test', | 16 'oshelpers_test', |
| 17 'test_sdktools', | 17 'httpd_test', |
| 18 'test_sdktools_commands', | 18 'sdktools_test', |
| 19 'test_update_nacl_manifest', | 19 'sdktools_commands_test', |
| 20 'update_nacl_manifest_test', |
| 21 'generate_make_test' |
| 20 ] | 22 ] |
| 21 | 23 |
| 22 def main(): | 24 def main(): |
| 23 suite = unittest.TestSuite() | 25 suite = unittest.TestSuite() |
| 24 for module_name in TEST_MODULES: | 26 for module_name in TEST_MODULES: |
| 25 __import__(module_name) | 27 __import__(module_name) |
| 26 module = sys.modules[module_name] | 28 module = sys.modules[module_name] |
| 27 suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) | 29 suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) |
| 28 | 30 |
| 29 result = unittest.TextTestRunner(verbosity=2).run(suite) | 31 result = unittest.TextTestRunner(verbosity=2).run(suite) |
| 30 return int(not result.wasSuccessful()) | 32 return int(not result.wasSuccessful()) |
| 31 | 33 |
| 32 if __name__ == '__main__': | 34 if __name__ == '__main__': |
| 33 sys.exit(main()) | 35 sys.exit(main()) |
| OLD | NEW |