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