Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / pnacl / driver / tests / driver_tests.py
1 #!/usr/bin/python
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
4 # found in the LICENSE file.
5
6 """Run all python tests in this directory."""
7
8 import os
9 import sys
10 import unittest
11
12 MODULES = [
13     'default_output_filename_test',
14     'diagnostic_flags_test',
15     'driver_env_test',
16     'driver_tools_test',
17     'expand_response_file_test',
18     'filetype_test',
19     'fix_private_libs_test',
20     'force_file_type_test',
21     'help_message_test',
22     'native_objects_test',
23     'path_length_test',
24     'pnacl_compress_test',
25     'strip_test',
26     'translate_options_test',
27 ]
28
29 # The tested modules live in the parent directory. Set up the import path
30 # accordingly.
31 my_dir = os.path.dirname(sys.argv[0])
32 sys.path.append(os.path.join(my_dir, '..'))
33
34 suite = unittest.TestLoader().loadTestsFromNames(MODULES)
35 result = unittest.TextTestRunner(verbosity=2).run(suite)
36 if result.wasSuccessful():
37   sys.exit(0)
38 else:
39   sys.exit(1)