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