Home | History | Annotate | Download | only in src
      1 #!/usr/bin/env python
      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
      4 # found in the LICENSE file.
      5 
      6 import os
      7 import sys
      8 import unittest
      9 
     10 # add tools folder to sys.path
     11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
     12 sys.path.append(os.path.join(SCRIPT_DIR, 'tools', 'tests'))
     13 sys.path.append(os.path.join(SCRIPT_DIR, 'build_tools', 'tests'))
     14 
     15 TEST_MODULES = [
     16     'create_html_test',
     17     'create_nmf_test',
     18     'easy_template_test',
     19     'fix_deps_test',
     20     'getos_test',
     21     'httpd_test',
     22     'oshelpers_test',
     23     'parse_dsc_test',
     24     'quote_test',
     25     'sdktools_commands_test',
     26     'sdktools_config_test',
     27     'sdktools_test',
     28     'sel_ldr_test',
     29     'update_nacl_manifest_test',
     30     'verify_filelist_test',
     31     'verify_ppapi_test',
     32 ]
     33 
     34 def main():
     35   suite = unittest.TestSuite()
     36   for module_name in TEST_MODULES:
     37     module = __import__(module_name)
     38     suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module))
     39 
     40   result = unittest.TextTestRunner(verbosity=2).run(suite)
     41   return int(not result.wasSuccessful())
     42 
     43 if __name__ == '__main__':
     44   sys.exit(main())
     45