Upstream version 10.39.225.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     'pnacl_ld_options_test',
26     'strip_test',
27     'translate_options_test',
28 ]
29
30 # The tested modules live in the parent directory. Set up the import path
31 # accordingly.
32 my_dir = os.path.dirname(sys.argv[0])
33 sys.path.append(os.path.join(my_dir, '..'))
34
35 suite = unittest.TestLoader().loadTestsFromNames(MODULES)
36 result = unittest.TextTestRunner(verbosity=2).run(suite)
37 if result.wasSuccessful():
38   sys.exit(0)
39 else:
40   sys.exit(1)