mbligh | 1ee9ad7 | 2008-08-01 16:15:08 +0000 | [diff] [blame] | 1 | #!/usr/bin/python -u |
mbligh | f975133 | 2008-04-08 18:25:33 +0000 | [diff] [blame] | 2 | |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 3 | import os, sys, unittest, optparse |
mbligh | dc90601 | 2008-06-27 19:29:11 +0000 | [diff] [blame] | 4 | import common |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 5 | from autotest_lib.utils import parallel |
mbligh | 5f55484 | 2009-12-21 21:50:18 +0000 | [diff] [blame] | 6 | from autotest_lib.client.common_lib.test_utils import unittest as custom_unittest |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 7 | |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 8 | parser = optparse.OptionParser() |
| 9 | parser.add_option("-r", action="store", type="string", dest="start", |
| 10 | default='', |
| 11 | help="root directory to start running unittests") |
| 12 | parser.add_option("--full", action="store_true", dest="full", default=False, |
| 13 | help="whether to run the shortened version of the test") |
mbligh | 43758df | 2008-09-04 19:54:45 +0000 | [diff] [blame] | 14 | parser.add_option("--debug", action="store_true", dest="debug", default=False, |
| 15 | help="run in debug mode") |
jamesren | 74e77fc | 2010-02-19 21:56:39 +0000 | [diff] [blame] | 16 | parser.add_option("--skip-tests", dest="skip_tests", default=[], |
| 17 | help="A space separated list of tests to skip") |
| 18 | |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 19 | parser.set_defaults(module_list=None) |
| 20 | |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 21 | # Following sets are used to define a collection of modules that are optional |
| 22 | # tests and do not need to be executed in unittest suite for various reasons. |
| 23 | # Each entry can be file name or relative path that's relative to the parent |
| 24 | # folder of the folder containing this file (unittest_suite.py). The list |
| 25 | # will be used to filter any test file with matching name or matching full |
| 26 | # path. If a file's name is too general and has a chance to collide with files |
| 27 | # in other folder, it is recommended to specify its relative path here, e.g., |
| 28 | # using 'mirror/trigger_unittest.py', instead of 'trigger_unittest.py' only. |
mbligh | f975133 | 2008-04-08 18:25:33 +0000 | [diff] [blame] | 29 | |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 30 | REQUIRES_DJANGO = set(( |
| 31 | 'monitor_db_unittest.py', |
| 32 | 'monitor_db_functional_test.py', |
| 33 | 'monitor_db_cleanup_test.py', |
| 34 | 'frontend_unittest.py', |
| 35 | 'csv_encoder_unittest.py', |
| 36 | 'rpc_interface_unittest.py', |
| 37 | 'models_test.py', |
| 38 | 'scheduler_models_unittest.py', |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 39 | 'rpc_utils_unittest.py', |
jamesren | 37dfa9d | 2010-04-12 18:24:31 +0000 | [diff] [blame] | 40 | 'site_rpc_utils_unittest.py', |
jamesren | 1468135 | 2010-04-09 20:46:09 +0000 | [diff] [blame] | 41 | 'execution_engine_unittest.py', |
jamesren | cd7a81a | 2010-04-21 20:39:08 +0000 | [diff] [blame] | 42 | 'service_proxy_lib_test.py', |
Prashanth B | 489b91d | 2014-03-15 12:17:16 -0700 | [diff] [blame] | 43 | 'rdb_integration_tests.py', |
Prashanth B | b474fdf | 2014-04-03 16:05:38 -0700 | [diff] [blame] | 44 | 'rdb_unittest.py', |
| 45 | 'rdb_hosts_unittest.py', |
Prashanth B | 86934c8 | 2014-05-09 11:17:20 -0700 | [diff] [blame] | 46 | 'rdb_cache_unittests.py', |
Prashanth B | 0e96028 | 2014-05-13 19:38:28 -0700 | [diff] [blame] | 47 | 'scheduler_lib_unittest.py', |
Prashanth B | f66d51b | 2014-05-06 12:42:25 -0700 | [diff] [blame] | 48 | 'host_scheduler_unittests.py', |
Jakob Juelich | 8a764d1 | 2014-10-14 19:24:21 -0700 | [diff] [blame] | 49 | 'site_parse_unittest.py', |
Prashanth Balasubramanian | 22dd226 | 2014-11-28 18:19:18 -0800 | [diff] [blame] | 50 | 'shard_client_integration_tests.py', |
Dan Shi | 784df0c | 2014-11-26 10:11:15 -0800 | [diff] [blame] | 51 | 'server_manager_unittest.py', |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 52 | )) |
| 53 | |
| 54 | REQUIRES_MYSQLDB = set(( |
| 55 | 'migrate_unittest.py', |
| 56 | 'db_utils_unittest.py', |
| 57 | )) |
| 58 | |
| 59 | REQUIRES_GWT = set(( |
jamesren | 12c9fdd | 2010-03-02 00:00:39 +0000 | [diff] [blame] | 60 | 'client_compilation_unittest.py', |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 61 | )) |
| 62 | |
| 63 | REQUIRES_SIMPLEJSON = set(( |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 64 | 'serviceHandler_unittest.py', |
| 65 | )) |
| 66 | |
jamesren | 6461fff | 2010-04-06 23:33:05 +0000 | [diff] [blame] | 67 | REQUIRES_AUTH = set (( |
| 68 | 'trigger_unittest.py', |
| 69 | )) |
| 70 | |
jamesren | 37dfa9d | 2010-04-12 18:24:31 +0000 | [diff] [blame] | 71 | REQUIRES_HTTPLIB2 = set(( |
| 72 | )) |
| 73 | |
jamesren | 34a0f3b | 2010-06-08 20:38:27 +0000 | [diff] [blame] | 74 | REQUIRES_PROTOBUFS = set(( |
| 75 | 'job_serializer_unittest.py', |
| 76 | )) |
| 77 | |
Aviv Keshet | 78f446d | 2013-06-18 10:28:57 -0700 | [diff] [blame] | 78 | REQUIRES_SELENIUM = set(( |
| 79 | 'ap_configurator_factory_unittest.py', |
Aviv Keshet | 78f446d | 2013-06-18 10:28:57 -0700 | [diff] [blame] | 80 | 'ap_batch_locker_unittest.py' |
| 81 | )) |
| 82 | |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 83 | LONG_RUNTIME = set(( |
mbligh | 999fb13 | 2010-04-23 17:22:03 +0000 | [diff] [blame] | 84 | 'base_barrier_unittest.py', |
showard | ef1edaf | 2009-07-01 22:21:30 +0000 | [diff] [blame] | 85 | 'logging_manager_test.py', |
Prathmesh Prabhu | af04857 | 2013-06-25 12:06:00 -0700 | [diff] [blame] | 86 | 'task_loop_unittest.py' # crbug.com/254030 |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 87 | )) |
| 88 | |
Dan Shi | 8e9f9f1 | 2015-02-17 10:51:34 -0800 | [diff] [blame] | 89 | # Unitests that only work in chroot. The names are for module name, thus no |
| 90 | # file extension of ".py". |
| 91 | REQUIRES_CHROOT = set(( |
| 92 | 'mbim_channel_unittest', |
| 93 | )) |
Aviv Keshet | 78b0595 | 2013-02-13 14:37:37 -0800 | [diff] [blame] | 94 | |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 95 | SKIP = set(( |
Aviv Keshet | 78b0595 | 2013-02-13 14:37:37 -0800 | [diff] [blame] | 96 | # This particular KVM autotest test is not a unittest |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 97 | 'guest_test.py', |
Aviv Keshet | 3c5a1f8 | 2013-05-10 13:42:18 -0700 | [diff] [blame] | 98 | 'ap_configurator_test.py', |
| 99 | 'chaos_base_test.py', |
Aviv Keshet | 1f23b69 | 2013-05-14 11:13:55 -0700 | [diff] [blame] | 100 | 'chaos_interop_test.py', |
beeps | 7d8273b | 2013-11-06 09:44:34 -0800 | [diff] [blame] | 101 | 'atomic_group_unittests.py', |
Aviv Keshet | c0fdfc5 | 2013-06-18 14:24:05 -0700 | [diff] [blame] | 102 | # crbug.com/251395 |
| 103 | 'dev_server_test.py', |
Aviv Keshet | 6e161a7 | 2013-06-26 17:24:48 -0700 | [diff] [blame] | 104 | 'full_release_test.py', |
Prashanth B | 0e96028 | 2014-05-13 19:38:28 -0700 | [diff] [blame] | 105 | 'scheduler_lib_unittest.py', |
Nathan Stoddard | ab58304 | 2014-08-11 10:41:47 -0700 | [diff] [blame] | 106 | 'webstore_test.py', |
Prathmesh Prabhu | d456bf0 | 2014-11-14 17:28:42 -0800 | [diff] [blame] | 107 | # crbug.com/432621 These files are not tests, and will disappear soon. |
| 108 | 'des_01_test.py', |
| 109 | 'des_02_test.py', |
Dan Shi | 767dced | 2015-02-01 00:21:07 -0800 | [diff] [blame] | 110 | # Rquire lxc to be installed |
| 111 | 'lxc_functional_test.py', |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 112 | )) |
| 113 | |
Aviv Keshet | 1f23b69 | 2013-05-14 11:13:55 -0700 | [diff] [blame] | 114 | LONG_TESTS = (REQUIRES_MYSQLDB | |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 115 | REQUIRES_GWT | |
jamesren | 37dfa9d | 2010-04-12 18:24:31 +0000 | [diff] [blame] | 116 | REQUIRES_HTTPLIB2 | |
jamesren | 6461fff | 2010-04-06 23:33:05 +0000 | [diff] [blame] | 117 | REQUIRES_AUTH | |
jamesren | 34a0f3b | 2010-06-08 20:38:27 +0000 | [diff] [blame] | 118 | REQUIRES_PROTOBUFS | |
Aviv Keshet | 78f446d | 2013-06-18 10:28:57 -0700 | [diff] [blame] | 119 | REQUIRES_SELENIUM | |
Prathmesh Prabhu | 0ddb541 | 2013-11-19 16:47:16 +0000 | [diff] [blame] | 120 | LONG_RUNTIME) |
jamesren | 92c1859 | 2010-02-25 19:10:32 +0000 | [diff] [blame] | 121 | |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 122 | ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 123 | |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 124 | # The set of files in LONG_TESTS with its full path |
| 125 | LONG_TESTS_FULL_PATH = {os.path.join(ROOT, t) for t in LONG_TESTS} |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 126 | |
Aviv Keshet | 78b0595 | 2013-02-13 14:37:37 -0800 | [diff] [blame] | 127 | class TestFailure(Exception): |
| 128 | """Exception type for any test failure.""" |
| 129 | pass |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 130 | |
| 131 | |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 132 | def run_test(mod_names, options): |
| 133 | """ |
| 134 | @param mod_names: A list of individual parts of the module name to import |
| 135 | and run as a test suite. |
| 136 | @param options: optparse options. |
| 137 | """ |
mbligh | 43758df | 2008-09-04 19:54:45 +0000 | [diff] [blame] | 138 | if not options.debug: |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 139 | parallel.redirect_io() |
| 140 | |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 141 | print "Running %s" % '.'.join(mod_names) |
| 142 | mod = common.setup_modules.import_module(mod_names[-1], |
| 143 | '.'.join(mod_names[:-1])) |
mbligh | 5f55484 | 2009-12-21 21:50:18 +0000 | [diff] [blame] | 144 | for ut_module in [unittest, custom_unittest]: |
| 145 | test = ut_module.defaultTestLoader.loadTestsFromModule(mod) |
| 146 | suite = ut_module.TestSuite(test) |
| 147 | runner = ut_module.TextTestRunner(verbosity=2) |
| 148 | result = runner.run(suite) |
| 149 | if result.errors or result.failures: |
| 150 | msg = '%s had %d failures and %d errors.' |
| 151 | msg %= '.'.join(mod_names), len(result.failures), len(result.errors) |
| 152 | raise TestFailure(msg) |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 153 | |
| 154 | |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 155 | def scan_for_modules(start, options): |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 156 | """Scan folders and find all test modules that are not included in the |
| 157 | blacklist (defined in LONG_TESTS). |
| 158 | |
Aviv Keshet | 78b0595 | 2013-02-13 14:37:37 -0800 | [diff] [blame] | 159 | @param start: The absolute directory to look for tests under. |
| 160 | @param options: optparse options. |
| 161 | @return a list of modules to be executed. |
| 162 | """ |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 163 | modules = [] |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 164 | |
| 165 | skip_tests = SKIP |
jamesren | 74e77fc | 2010-02-19 21:56:39 +0000 | [diff] [blame] | 166 | if options.skip_tests: |
| 167 | skip_tests.update(options.skip_tests.split()) |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 168 | skip_tests_full_path = {os.path.join(ROOT, t) for t in skip_tests} |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 169 | |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 170 | for dir_path, sub_dirs, file_names in os.walk(start): |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 171 | # Only look in and below subdirectories that are python modules. |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 172 | if '__init__.py' not in file_names: |
mbligh | a64df1a | 2009-09-18 16:54:39 +0000 | [diff] [blame] | 173 | if options.full: |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 174 | for file_name in file_names: |
| 175 | if file_name.endswith('.pyc'): |
| 176 | os.unlink(os.path.join(dir_path, file_name)) |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 177 | # Skip all subdirectories below this one, it is not a module. |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 178 | del sub_dirs[:] |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 179 | if options.debug: |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 180 | print 'Skipping', dir_path |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 181 | continue # Skip this directory. |
| 182 | |
| 183 | # Look for unittest files. |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 184 | for file_name in file_names: |
| 185 | if (file_name.endswith('_unittest.py') or |
| 186 | file_name.endswith('_test.py')): |
| 187 | file_path = os.path.join(dir_path, file_name) |
| 188 | if (not options.full and |
| 189 | (file_name in LONG_TESTS or |
| 190 | file_path in LONG_TESTS_FULL_PATH)): |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 191 | continue |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 192 | if (file_name in skip_tests or |
| 193 | file_path in skip_tests_full_path): |
jamesren | 74e77fc | 2010-02-19 21:56:39 +0000 | [diff] [blame] | 194 | continue |
Dan Shi | 8af6fbe | 2013-02-13 14:20:16 -0800 | [diff] [blame] | 195 | path_no_py = os.path.join(dir_path, file_name).rstrip('.py') |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 196 | assert path_no_py.startswith(ROOT) |
| 197 | names = path_no_py[len(ROOT)+1:].split('/') |
| 198 | modules.append(['autotest_lib'] + names) |
| 199 | if options.debug: |
| 200 | print 'testing', path_no_py |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 201 | return modules |
| 202 | |
Dan Shi | 8e9f9f1 | 2015-02-17 10:51:34 -0800 | [diff] [blame] | 203 | |
| 204 | def is_inside_chroot(): |
| 205 | """Check if the process is running inside the chroot. |
| 206 | |
| 207 | @return: True if the process is running inside the chroot, False otherwise. |
| 208 | """ |
| 209 | try: |
| 210 | # chromite may not be setup, e.g., in vm, therefore the ImportError |
| 211 | # needs to be handled. |
| 212 | from chromite.lib import cros_build_lib |
| 213 | return cros_build_lib.IsInsideChroot() |
| 214 | except ImportError: |
| 215 | return False |
| 216 | |
| 217 | |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 218 | def find_and_run_tests(start, options): |
| 219 | """ |
| 220 | Find and run Python unittest suites below the given directory. Only look |
| 221 | in subdirectories of start that are actual importable Python modules. |
| 222 | |
| 223 | @param start: The absolute directory to look for tests under. |
| 224 | @param options: optparse options. |
| 225 | """ |
| 226 | if options.module_list: |
| 227 | modules = [] |
| 228 | for m in options.module_list: |
| 229 | modules.append(m.split('.')) |
| 230 | else: |
| 231 | modules = scan_for_modules(start, options) |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 232 | |
| 233 | if options.debug: |
| 234 | print 'Number of test modules found:', len(modules) |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 235 | |
Dan Shi | 8e9f9f1 | 2015-02-17 10:51:34 -0800 | [diff] [blame] | 236 | chroot = is_inside_chroot() |
showard | cc85e81 | 2008-08-08 20:33:30 +0000 | [diff] [blame] | 237 | functions = {} |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 238 | for module_names in modules: |
Dan Shi | 8e9f9f1 | 2015-02-17 10:51:34 -0800 | [diff] [blame] | 239 | if not chroot and module_names[-1] in REQUIRES_CHROOT: |
| 240 | if options.debug: |
| 241 | print ('Test %s requires to run in chroot, skipped.' % |
| 242 | module_names[-1]) |
| 243 | continue |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 244 | # Create a function that'll test a particular module. module=module |
| 245 | # is a hack to force python to evaluate the params now. We then |
| 246 | # rename the function to make error reporting nicer. |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 247 | run_module = lambda module=module_names: run_test(module, options) |
| 248 | name = '.'.join(module_names) |
showard | cc85e81 | 2008-08-08 20:33:30 +0000 | [diff] [blame] | 249 | run_module.__name__ = name |
showard | cc85e81 | 2008-08-08 20:33:30 +0000 | [diff] [blame] | 250 | functions[run_module] = set() |
| 251 | |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 252 | try: |
| 253 | dargs = {} |
mbligh | 43758df | 2008-09-04 19:54:45 +0000 | [diff] [blame] | 254 | if options.debug: |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 255 | dargs['max_simultaneous_procs'] = 1 |
| 256 | pe = parallel.ParallelExecute(functions, **dargs) |
| 257 | pe.run_until_completion() |
| 258 | except parallel.ParallelError, err: |
| 259 | return err.errors |
| 260 | return [] |
mbligh | f975133 | 2008-04-08 18:25:33 +0000 | [diff] [blame] | 261 | |
| 262 | |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 263 | def main(): |
Aviv Keshet | 78b0595 | 2013-02-13 14:37:37 -0800 | [diff] [blame] | 264 | """Entry point for unittest_suite.py""" |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 265 | options, args = parser.parse_args() |
| 266 | if args: |
Eric Li | 861b2d5 | 2011-02-04 14:50:35 -0800 | [diff] [blame] | 267 | options.module_list = args |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 268 | |
showard | cc85e81 | 2008-08-08 20:33:30 +0000 | [diff] [blame] | 269 | # Strip the arguments off the command line, so that the unit tests do not |
| 270 | # see them. |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 271 | del sys.argv[1:] |
showard | cc85e81 | 2008-08-08 20:33:30 +0000 | [diff] [blame] | 272 | |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 273 | absolute_start = os.path.join(ROOT, options.start) |
| 274 | errors = find_and_run_tests(absolute_start, options) |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 275 | if errors: |
| 276 | print "%d tests resulted in an error/failure:" % len(errors) |
| 277 | for error in errors: |
| 278 | print "\t%s" % error |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 279 | print "Rerun", sys.argv[0], "--debug to see the failure details." |
mbligh | 671c592 | 2008-07-28 19:34:38 +0000 | [diff] [blame] | 280 | sys.exit(1) |
| 281 | else: |
| 282 | print "All passed!" |
| 283 | sys.exit(0) |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 284 | |
mbligh | 780fa7f | 2009-07-02 19:01:53 +0000 | [diff] [blame] | 285 | |
mbligh | eeb1357 | 2008-07-30 00:04:01 +0000 | [diff] [blame] | 286 | if __name__ == "__main__": |
| 287 | main() |