Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1062)

Side by Side Diff: native_client_sdk/src/test_all.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 os 6 import os
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 'sdktools_commands_test', 47 'sdktools_commands_test',
48 'sdktools_config_test', 48 'sdktools_config_test',
49 'sdktools_test', 49 'sdktools_test',
50 'sel_ldr_test', 50 'sel_ldr_test',
51 'update_nacl_manifest_test', 51 'update_nacl_manifest_test',
52 'verify_filelist_test', 52 'verify_filelist_test',
53 'verify_ppapi_test', 53 'verify_ppapi_test',
54 ] 54 ]
55 55
56 def ExtractToolchains(): 56 def ExtractToolchains():
57 subprocess.check_output([sys.executable, PKG_VER, 57 cmd = [sys.executable, PKG_VER, '--verbose',
58 '--packages', ','.join(EXTRACT_PACKAGES), 58 '--packages', ','.join(EXTRACT_PACKAGES),
59 '--tar-dir', TAR_DIR, 59 '--tar-dir', TAR_DIR,
60 '--dest-dir', TOOLCHAIN_OUT, 60 '--dest-dir', TOOLCHAIN_OUT,
61 'extract']) 61 'extract']
62 print(cmd)
binji 2014/11/13 23:57:02 why?
Sam Clegg 2014/11/30 17:55:12 Dropped.
63 subprocess.check_output(cmd)
62 64
63 def main(): 65 def main():
64 # Some of the unit tests use parts of toolchains. Extract to TOOLCHAIN_OUT. 66 # Some of the unit tests use parts of toolchains. Extract to TOOLCHAIN_OUT.
65 ExtractToolchains() 67 ExtractToolchains()
66 68
67 suite = unittest.TestSuite() 69 suite = unittest.TestSuite()
68 for module_name in TEST_MODULES: 70 for module_name in TEST_MODULES:
69 module = __import__(module_name) 71 module = __import__(module_name)
70 suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) 72 suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module))
71 73
72 result = unittest.TextTestRunner(verbosity=2).run(suite) 74 result = unittest.TextTestRunner(verbosity=2).run(suite)
73 return int(not result.wasSuccessful()) 75 return int(not result.wasSuccessful())
74 76
75 if __name__ == '__main__': 77 if __name__ == '__main__':
76 sys.exit(main()) 78 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698