Index: native_client_sdk/src/test_all.py |
diff --git a/native_client_sdk/src/test_all.py b/native_client_sdk/src/test_all.py |
index 6e9b3dd3af30d3d3daa33c0864461773ec962add..7db879ac9a763e9668f137bfce2e7cfe9474f673 100755 |
--- a/native_client_sdk/src/test_all.py |
+++ b/native_client_sdk/src/test_all.py |
@@ -3,7 +3,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-"""Top level script for running all python unittests in the NaCl SDK |
+"""Top level script for running all python unittests in the NaCl SDK. |
""" |
from __future__ import print_function |
@@ -50,25 +50,35 @@ TEST_MODULES = [ |
'oshelpers_test', |
'parse_dsc_test', |
'quote_test', |
- 'sdktools_commands_test', |
'sdktools_config_test', |
- 'sdktools_test', |
'sel_ldr_test', |
+ 'test_projects_test', |
'update_nacl_manifest_test', |
'verify_filelist_test', |
'verify_ppapi_test', |
] |
+# These tests for 'sdktools' are more like system tests and take a lot |
+# longer to run. If --quick is passed then we don't run these. |
+TEST_MODULES_BIG = [ |
+ 'sdktools_commands_test', |
+ 'sdktools_test', |
+] |
+ |
+ |
def ExtractToolchains(): |
- subprocess.check_output([sys.executable, PKG_VER, |
- '--packages', ','.join(EXTRACT_PACKAGES), |
- '--tar-dir', TAR_DIR, |
- '--dest-dir', TOOLCHAIN_OUT, |
- 'extract']) |
+ cmd = [sys.executable, PKG_VER, |
+ '--packages', ','.join(EXTRACT_PACKAGES), |
+ '--tar-dir', TAR_DIR, |
+ '--dest-dir', TOOLCHAIN_OUT, |
+ 'extract'] |
+ subprocess.check_call(cmd) |
+ |
def main(args): |
parser = argparse.ArgumentParser(description=__doc__) |
parser.add_argument('-v', '--verbose', action='store_true') |
+ parser.add_argument('--quick', action='store_true') |
options = parser.parse_args(args) |
# Some of the unit tests use parts of toolchains. Extract to TOOLCHAIN_OUT. |
@@ -76,7 +86,11 @@ def main(args): |
ExtractToolchains() |
suite = unittest.TestSuite() |
- for module_name in TEST_MODULES: |
+ modules = TEST_MODULES |
+ if not options.quick: |
+ modules += TEST_MODULES_BIG |
+ |
+ for module_name in modules: |
module = __import__(module_name) |
suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) |
@@ -89,5 +103,6 @@ def main(args): |
result = unittest.TextTestRunner(verbosity=verbosity).run(suite) |
return int(not result.wasSuccessful()) |
+ |
if __name__ == '__main__': |
sys.exit(main(sys.argv[1:])) |