Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed to the Apache Software Foundation (ASF) under one |
| 5 | # or more contributor license agreements. See the NOTICE file |
| 6 | # distributed with this work for additional information |
| 7 | # regarding copyright ownership. The ASF licenses this file |
| 8 | # to you under the Apache License, Version 2.0 (the |
| 9 | # "License"); you may not use this file except in compliance |
| 10 | # with the License. You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, |
| 15 | # software distributed under the License is distributed on an |
| 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 17 | # KIND, either express or implied. See the License for the |
| 18 | # specific language governing permissions and limitations |
| 19 | # under the License. |
| 20 | # |
| 21 | |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 22 | from __future__ import division |
Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 23 | from __future__ import print_function |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 24 | import platform |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 25 | import copy |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 26 | import os |
| 27 | import signal |
Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 28 | import socket |
Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 29 | import subprocess |
| 30 | import sys |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 31 | import time |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 32 | from optparse import OptionParser |
| 33 | |
Nobuaki Sukegawa | 7af189a | 2016-02-11 16:21:01 +0900 | [diff] [blame] | 34 | from util import local_libpath |
| 35 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 36 | SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 37 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 38 | SCRIPTS = [ |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 39 | 'FastbinaryTest.py', |
| 40 | 'TestFrozen.py', |
| 41 | 'TSimpleJSONProtocolTest.py', |
| 42 | 'SerializationTest.py', |
| 43 | 'TestEof.py', |
| 44 | 'TestSyntax.py', |
| 45 | 'TestSocket.py', |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 46 | ] |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 47 | FRAMED = ["TNonblockingServer"] |
Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 48 | SKIP_ZLIB = ['TNonblockingServer', 'THttpServer'] |
Nobuaki Sukegawa | 4626fd8 | 2017-02-12 21:11:36 +0900 | [diff] [blame^] | 49 | SKIP_SSL = ['THttpServer'] |
Roger Meier | 6857b7f | 2015-09-16 19:53:07 +0200 | [diff] [blame] | 50 | EXTRA_DELAY = dict(TProcessPoolServer=5.5) |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 51 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 52 | PROTOS = [ |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 53 | 'accel', |
Nobuaki Sukegawa | 6525f6a | 2016-02-11 13:58:39 +0900 | [diff] [blame] | 54 | 'accelc', |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 55 | 'binary', |
| 56 | 'compact', |
| 57 | 'json', |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 58 | ] |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 59 | |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 60 | |
| 61 | def default_servers(): |
| 62 | servers = [ |
| 63 | 'TSimpleServer', |
| 64 | 'TThreadedServer', |
| 65 | 'TThreadPoolServer', |
| 66 | 'TNonblockingServer', |
| 67 | 'THttpServer', |
| 68 | ] |
| 69 | if platform.system() != 'Windows': |
| 70 | servers.append('TProcessPoolServer') |
| 71 | servers.append('TForkingServer') |
| 72 | return servers |
Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 73 | |
Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 74 | |
David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 75 | def relfile(fname): |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 76 | return os.path.join(SCRIPT_DIR, fname) |
David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 77 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 78 | |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 79 | def setup_pypath(libdir, gendir): |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 80 | dirs = [libdir, gendir] |
| 81 | env = copy.deepcopy(os.environ) |
| 82 | pypath = env.get('PYTHONPATH', None) |
| 83 | if pypath: |
| 84 | dirs.append(pypath) |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 85 | env['PYTHONPATH'] = os.pathsep.join(dirs) |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 86 | if gendir.endswith('gen-py-no_utf8strings'): |
| 87 | env['THRIFT_TEST_PY_NO_UTF8STRINGS'] = '1' |
| 88 | return env |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 89 | |
| 90 | |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 91 | def runScriptTest(libdir, genbase, genpydir, script): |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 92 | env = setup_pypath(libdir, os.path.join(genbase, genpydir)) |
| 93 | script_args = [sys.executable, relfile(script)] |
| 94 | print('\nTesting script: %s\n----' % (' '.join(script_args))) |
| 95 | ret = subprocess.call(script_args, env=env) |
| 96 | if ret != 0: |
| 97 | print('*** FAILED ***', file=sys.stderr) |
| 98 | print('LIBDIR: %s' % libdir, file=sys.stderr) |
| 99 | print('PY_GEN: %s' % genpydir, file=sys.stderr) |
| 100 | print('SCRIPT: %s' % script, file=sys.stderr) |
| 101 | raise Exception("Script subprocess failed, retcode=%d, args: %s" % (ret, ' '.join(script_args))) |
Roger Meier | 7615072 | 2014-05-31 22:22:07 +0200 | [diff] [blame] | 102 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 103 | |
Nobuaki Sukegawa | a3b88a0 | 2016-01-06 20:44:17 +0900 | [diff] [blame] | 104 | def runServiceTest(libdir, genbase, genpydir, server_class, proto, port, use_zlib, use_ssl, verbose): |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 105 | env = setup_pypath(libdir, os.path.join(genbase, genpydir)) |
| 106 | # Build command line arguments |
| 107 | server_args = [sys.executable, relfile('TestServer.py')] |
| 108 | cli_args = [sys.executable, relfile('TestClient.py')] |
| 109 | for which in (server_args, cli_args): |
| 110 | which.append('--protocol=%s' % proto) # accel, binary, compact or json |
| 111 | which.append('--port=%d' % port) # default to 9090 |
| 112 | if use_zlib: |
| 113 | which.append('--zlib') |
| 114 | if use_ssl: |
| 115 | which.append('--ssl') |
| 116 | if verbose == 0: |
| 117 | which.append('-q') |
| 118 | if verbose == 2: |
| 119 | which.append('-v') |
| 120 | # server-specific option to select server class |
| 121 | server_args.append(server_class) |
| 122 | # client-specific cmdline options |
| 123 | if server_class in FRAMED: |
| 124 | cli_args.append('--transport=framed') |
| 125 | else: |
| 126 | cli_args.append('--transport=buffered') |
| 127 | if server_class == 'THttpServer': |
| 128 | cli_args.append('--http=/') |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 129 | if verbose > 0: |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 130 | print('Testing server %s: %s' % (server_class, ' '.join(server_args))) |
| 131 | serverproc = subprocess.Popen(server_args, env=env) |
| 132 | |
| 133 | def ensureServerAlive(): |
| 134 | if serverproc.poll() is not None: |
| 135 | print(('FAIL: Server process (%s) failed with retcode %d') |
| 136 | % (' '.join(server_args), serverproc.returncode)) |
| 137 | raise Exception('Server subprocess %s died, args: %s' |
| 138 | % (server_class, ' '.join(server_args))) |
| 139 | |
| 140 | # Wait for the server to start accepting connections on the given port. |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 141 | sleep_time = 0.1 # Seconds |
| 142 | max_attempts = 100 |
Nobuaki Sukegawa | e9b3234 | 2016-02-27 03:44:02 +0900 | [diff] [blame] | 143 | attempt = 0 |
| 144 | while True: |
| 145 | sock4 = socket.socket() |
| 146 | sock6 = socket.socket(socket.AF_INET6) |
| 147 | try: |
| 148 | if sock4.connect_ex(('127.0.0.1', port)) == 0 \ |
| 149 | or sock6.connect_ex(('::1', port)) == 0: |
| 150 | break |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 151 | attempt += 1 |
| 152 | if attempt >= max_attempts: |
| 153 | raise Exception("TestServer not ready on port %d after %.2f seconds" |
| 154 | % (port, sleep_time * attempt)) |
| 155 | ensureServerAlive() |
| 156 | time.sleep(sleep_time) |
Nobuaki Sukegawa | e9b3234 | 2016-02-27 03:44:02 +0900 | [diff] [blame] | 157 | finally: |
| 158 | sock4.close() |
| 159 | sock6.close() |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 160 | |
| 161 | try: |
| 162 | if verbose > 0: |
| 163 | print('Testing client: %s' % (' '.join(cli_args))) |
| 164 | ret = subprocess.call(cli_args, env=env) |
| 165 | if ret != 0: |
| 166 | print('*** FAILED ***', file=sys.stderr) |
| 167 | print('LIBDIR: %s' % libdir, file=sys.stderr) |
| 168 | print('PY_GEN: %s' % genpydir, file=sys.stderr) |
| 169 | raise Exception("Client subprocess failed, retcode=%d, args: %s" % (ret, ' '.join(cli_args))) |
| 170 | finally: |
| 171 | # check that server didn't die |
| 172 | ensureServerAlive() |
| 173 | extra_sleep = EXTRA_DELAY.get(server_class, 0) |
| 174 | if extra_sleep > 0 and verbose > 0: |
| 175 | print('Giving %s (proto=%s,zlib=%s,ssl=%s) an extra %d seconds for child' |
| 176 | 'processes to terminate via alarm' |
| 177 | % (server_class, proto, use_zlib, use_ssl, extra_sleep)) |
| 178 | time.sleep(extra_sleep) |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 179 | sig = signal.SIGKILL if platform.system() != 'Windows' else signal.SIGABRT |
| 180 | os.kill(serverproc.pid, sig) |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 181 | serverproc.wait() |
David Reiss | bcaa2ad | 2008-06-10 22:55:26 +0000 | [diff] [blame] | 182 | |
Roger Meier | 7615072 | 2014-05-31 22:22:07 +0200 | [diff] [blame] | 183 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 184 | class TestCases(object): |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 185 | def __init__(self, genbase, libdir, port, gendirs, servers, verbose): |
| 186 | self.genbase = genbase |
| 187 | self.libdir = libdir |
| 188 | self.port = port |
| 189 | self.verbose = verbose |
| 190 | self.gendirs = gendirs |
| 191 | self.servers = servers |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 192 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 193 | def default_conf(self): |
| 194 | return { |
| 195 | 'gendir': self.gendirs[0], |
| 196 | 'server': self.servers[0], |
| 197 | 'proto': PROTOS[0], |
| 198 | 'zlib': False, |
| 199 | 'ssl': False, |
| 200 | } |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 201 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 202 | def run(self, conf, test_count): |
| 203 | with_zlib = conf['zlib'] |
| 204 | with_ssl = conf['ssl'] |
| 205 | try_server = conf['server'] |
| 206 | try_proto = conf['proto'] |
| 207 | genpydir = conf['gendir'] |
| 208 | # skip any servers that don't work with the Zlib transport |
| 209 | if with_zlib and try_server in SKIP_ZLIB: |
| 210 | return False |
| 211 | # skip any servers that don't work with SSL |
| 212 | if with_ssl and try_server in SKIP_SSL: |
| 213 | return False |
| 214 | if self.verbose > 0: |
| 215 | print('\nTest run #%d: (includes %s) Server=%s, Proto=%s, zlib=%s, SSL=%s' |
| 216 | % (test_count, genpydir, try_server, try_proto, with_zlib, with_ssl)) |
| 217 | runServiceTest(self.libdir, self.genbase, genpydir, try_server, try_proto, self.port, with_zlib, with_ssl, self.verbose) |
| 218 | if self.verbose > 0: |
| 219 | print('OK: Finished (includes %s) %s / %s proto / zlib=%s / SSL=%s. %d combinations tested.' |
| 220 | % (genpydir, try_server, try_proto, with_zlib, with_ssl, test_count)) |
| 221 | return True |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 222 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 223 | def test_feature(self, name, values): |
| 224 | test_count = 0 |
| 225 | conf = self.default_conf() |
| 226 | for try_server in values: |
| 227 | conf[name] = try_server |
| 228 | if self.run(conf, test_count): |
| 229 | test_count += 1 |
| 230 | return test_count |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 231 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 232 | def run_all_tests(self): |
| 233 | test_count = 0 |
| 234 | for try_server in self.servers: |
| 235 | for genpydir in self.gendirs: |
| 236 | for try_proto in PROTOS: |
| 237 | for with_zlib in (False, True): |
| 238 | # skip any servers that don't work with the Zlib transport |
| 239 | if with_zlib and try_server in SKIP_ZLIB: |
| 240 | continue |
| 241 | for with_ssl in (False, True): |
| 242 | # skip any servers that don't work with SSL |
| 243 | if with_ssl and try_server in SKIP_SSL: |
| 244 | continue |
| 245 | test_count += 1 |
| 246 | if self.verbose > 0: |
| 247 | print('\nTest run #%d: (includes %s) Server=%s, Proto=%s, zlib=%s, SSL=%s' |
| 248 | % (test_count, genpydir, try_server, try_proto, with_zlib, with_ssl)) |
| 249 | runServiceTest(self.libdir, self.genbase, genpydir, try_server, try_proto, self.port, with_zlib, with_ssl) |
| 250 | if self.verbose > 0: |
| 251 | print('OK: Finished (includes %s) %s / %s proto / zlib=%s / SSL=%s. %d combinations tested.' |
| 252 | % (genpydir, try_server, try_proto, with_zlib, with_ssl, test_count)) |
| 253 | return test_count |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 254 | |
| 255 | |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 256 | def main(): |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 257 | parser = OptionParser() |
| 258 | parser.add_option('--all', action="store_true", dest='all') |
| 259 | parser.add_option('--genpydirs', type='string', dest='genpydirs', |
| 260 | default='default,slots,oldstyle,no_utf8strings,dynamic,dynamicslots', |
| 261 | help='directory extensions for generated code, used as suffixes for \"gen-py-*\" added sys.path for individual tests') |
| 262 | parser.add_option("--port", type="int", dest="port", default=9090, |
| 263 | help="port number for server to listen on") |
| 264 | parser.add_option('-v', '--verbose', action="store_const", |
| 265 | dest="verbose", const=2, |
| 266 | help="verbose output") |
| 267 | parser.add_option('-q', '--quiet', action="store_const", |
| 268 | dest="verbose", const=0, |
| 269 | help="minimal output") |
Nobuaki Sukegawa | 7af189a | 2016-02-11 16:21:01 +0900 | [diff] [blame] | 270 | parser.add_option('-L', '--libdir', dest="libdir", default=local_libpath(), |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 271 | help="directory path that contains Thrift Python library") |
| 272 | parser.add_option('--gen-base', dest="gen_base", default=SCRIPT_DIR, |
| 273 | help="directory path that contains Thrift Python library") |
| 274 | parser.set_defaults(verbose=1) |
| 275 | options, args = parser.parse_args() |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 276 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 277 | generated_dirs = [] |
| 278 | for gp_dir in options.genpydirs.split(','): |
| 279 | generated_dirs.append('gen-py-%s' % (gp_dir)) |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 280 | |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 281 | # commandline permits a single class name to be specified to override SERVERS=[...] |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 282 | servers = default_servers() |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 283 | if len(args) == 1: |
Nobuaki Sukegawa | 06e8fd4 | 2016-02-28 12:50:03 +0900 | [diff] [blame] | 284 | if args[0] in servers: |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 285 | servers = args |
| 286 | else: |
| 287 | print('Unavailable server type "%s", please choose one of: %s' % (args[0], servers)) |
| 288 | sys.exit(0) |
| 289 | |
| 290 | tests = TestCases(options.gen_base, options.libdir, options.port, generated_dirs, servers, options.verbose) |
| 291 | |
| 292 | # run tests without a client/server first |
| 293 | print('----------------') |
| 294 | print(' Executing individual test scripts with various generated code directories') |
| 295 | print(' Directories to be tested: ' + ', '.join(generated_dirs)) |
| 296 | print(' Scripts to be tested: ' + ', '.join(SCRIPTS)) |
| 297 | print('----------------') |
| 298 | for genpydir in generated_dirs: |
| 299 | for script in SCRIPTS: |
| 300 | runScriptTest(options.libdir, options.gen_base, genpydir, script) |
| 301 | |
| 302 | print('----------------') |
| 303 | print(' Executing Client/Server tests with various generated code directories') |
| 304 | print(' Servers to be tested: ' + ', '.join(servers)) |
| 305 | print(' Directories to be tested: ' + ', '.join(generated_dirs)) |
| 306 | print(' Protocols to be tested: ' + ', '.join(PROTOS)) |
| 307 | print(' Options to be tested: ZLIB(yes/no), SSL(yes/no)') |
| 308 | print('----------------') |
| 309 | |
| 310 | if options.all: |
| 311 | tests.run_all_tests() |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 312 | else: |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 313 | tests.test_feature('gendir', generated_dirs) |
| 314 | tests.test_feature('server', servers) |
| 315 | tests.test_feature('proto', PROTOS) |
| 316 | tests.test_feature('zlib', [False, True]) |
| 317 | tests.test_feature('ssl', [False, True]) |
Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 318 | |
| 319 | |
| 320 | if __name__ == '__main__': |
Nobuaki Sukegawa | 10308cb | 2016-02-03 01:57:03 +0900 | [diff] [blame] | 321 | sys.exit(main()) |