MSE: Reduce spurious buffered range discontinuities
[chromium-blink-merge.git] / native_client_sdk / src / test_all.py
blob6f2113a79e7d3f93c1851deb3f786ed3b18d1371
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.
6 import os
7 import subprocess
8 import sys
9 import unittest
11 # add tools folder to sys.path
12 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
13 TOOLS_DIR = os.path.join(SCRIPT_DIR, 'tools')
14 BUILD_TOOLS_DIR = os.path.join(SCRIPT_DIR, 'build_tools')
16 sys.path.append(TOOLS_DIR)
17 sys.path.append(os.path.join(TOOLS_DIR, 'tests'))
18 sys.path.append(os.path.join(TOOLS_DIR, 'lib', 'tests'))
19 sys.path.append(BUILD_TOOLS_DIR)
20 sys.path.append(os.path.join(BUILD_TOOLS_DIR, 'tests'))
22 import build_paths
24 PKG_VER_DIR = os.path.join(build_paths.NACL_DIR, 'build', 'package_version')
25 TAR_DIR = os.path.join(build_paths.NACL_DIR, 'toolchain', '.tars')
27 PKG_VER = os.path.join(PKG_VER_DIR, 'package_version.py')
29 EXTRACT_PACKAGES = ['nacl_x86_glibc']
30 TOOLCHAIN_OUT = os.path.join(build_paths.OUT_DIR, 'sdk_tests', 'toolchain')
32 TEST_MODULES = [
33 'build_version_test',
34 'create_html_test',
35 'create_nmf_test',
36 'easy_template_test',
37 'elf_test',
38 'fix_deps_test',
39 'getos_test',
40 'get_shared_deps_test',
41 'httpd_test',
42 'nacl_config_test',
43 'oshelpers_test',
44 'parse_dsc_test',
45 'quote_test',
46 'sdktools_commands_test',
47 'sdktools_config_test',
48 'sdktools_test',
49 'sel_ldr_test',
50 'update_nacl_manifest_test',
51 'verify_filelist_test',
52 'verify_ppapi_test',
55 def ExtractToolchains():
56 subprocess.check_output([sys.executable, PKG_VER,
57 '--packages', ','.join(EXTRACT_PACKAGES),
58 '--tar-dir', TAR_DIR,
59 '--dest-dir', TOOLCHAIN_OUT,
60 'extract'])
62 def main():
63 # Some of the unit tests use parts of toolchains. Extract to TOOLCHAIN_OUT.
64 ExtractToolchains()
66 suite = unittest.TestSuite()
67 for module_name in TEST_MODULES:
68 module = __import__(module_name)
69 suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module))
71 result = unittest.TextTestRunner(verbosity=2).run(suite)
72 return int(not result.wasSuccessful())
74 if __name__ == '__main__':
75 sys.exit(main())