diff options
author | Craig Tiller <ctiller@google.com> | 2016-11-01 14:27:25 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-11-01 14:27:25 -0700 |
commit | ac119ba887e37c8b4c7fc0e6f43477869796db06 (patch) | |
tree | 51afcc18b19a1688b6cbd40984740bbd0d8200c2 /tools/run_tests/run_tests.py | |
parent | 5282cdb025d222c5bdf6069ae06ea8b568c4baf6 (diff) | |
parent | 9dd2c7da2f82eb27dfbef01a9c133e403dcffc45 (diff) |
Merge github.com:grpc/grpc into microbench
Diffstat (limited to 'tools/run_tests/run_tests.py')
-rwxr-xr-x | tools/run_tests/run_tests.py | 75 |
1 files changed, 73 insertions, 2 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index e9ee5f538d..911843e9f3 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -83,7 +83,7 @@ _DEFAULT_TIMEOUT_SECONDS = 5 * 60 # SimpleConfig: just compile with CONFIG=config, and run the binary to test class Config(object): - def __init__(self, config, environ=None, timeout_multiplier=1, tool_prefix=[]): + def __init__(self, config, environ=None, timeout_multiplier=1, tool_prefix=[], iomgr_platform='native'): if environ is None: environ = {} self.build_config = config @@ -91,6 +91,7 @@ class Config(object): self.environ['CONFIG'] = config self.tool_prefix = tool_prefix self.timeout_multiplier = timeout_multiplier + self.iomgr_platform = iomgr_platform def job_spec(self, cmdline, timeout_seconds=_DEFAULT_TIMEOUT_SECONDS, shortname=None, environ={}, cpu_cost=1.0, flaky=False): @@ -202,6 +203,18 @@ class CLanguage(object): else: self._docker_distro, self._make_options = self._compiler_options(self.args.use_docker, self.args.compiler) + if args.iomgr_platform == "uv": + cflags = '-DGRPC_UV ' + try: + cflags += subprocess.check_output(['pkg-config', '--cflags', 'libuv']).strip() + ' ' + except (subprocess.CalledProcessError, OSError): + pass + try: + ldflags = subprocess.check_output(['pkg-config', '--libs', 'libuv']).strip() + ' ' + except (subprocess.CalledProcessError, OSError): + ldflags = '-luv ' + self._make_options += ['EXTRA_CPPFLAGS={}'.format(cflags), + 'EXTRA_LDLIBS={}'.format(ldflags)] def test_specs(self): out = [] @@ -210,6 +223,8 @@ class CLanguage(object): polling_strategies = (_POLLING_STRATEGIES.get(self.platform, ['all']) if target.get('uses_polling', True) else ['all']) + if self.args.iomgr_platform == 'uv': + polling_strategies = ['all'] for polling_strategy in polling_strategies: env={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH': _ROOT + '/src/core/lib/tsi/test_creds/ca.pem', @@ -218,6 +233,8 @@ class CLanguage(object): shortname_ext = '' if polling_strategy=='all' else ' GRPC_POLL_STRATEGY=%s' % polling_strategy if self.config.build_config in target['exclude_configs']: continue + if self.args.iomgr_platform in target.get('exclude_iomgrs', []): + continue if self.platform == 'windows': binary = 'vsprojects/%s%s/%s.exe' % ( 'x64/' if self.args.arch == 'x64' else '', @@ -346,7 +363,8 @@ class NodeLanguage(object): self.config = config self.args = args _check_compiler(self.args.compiler, ['default', 'node0.12', - 'node4', 'node5', 'node6']) + 'node4', 'node5', 'node6', + 'node7']) if self.args.compiler == 'default': self.node_version = '4' else: @@ -825,6 +843,53 @@ class Sanity(object): def __str__(self): return 'sanity' +class NodeExpressLanguage(object): + """Dummy Node express test target to enable running express performance + benchmarks""" + + def __init__(self): + self.platform = platform_string() + + def configure(self, config, args): + self.config = config + self.args = args + _check_compiler(self.args.compiler, ['default', 'node0.12', + 'node4', 'node5', 'node6']) + if self.args.compiler == 'default': + self.node_version = '4' + else: + # Take off the word "node" + self.node_version = self.args.compiler[4:] + + def test_specs(self): + return [] + + def pre_build_steps(self): + if self.platform == 'windows': + return [['tools\\run_tests\\pre_build_node.bat']] + else: + return [['tools/run_tests/pre_build_node.sh', self.node_version]] + + def make_targets(self): + return [] + + def make_options(self): + return [] + + def build_steps(self): + return [] + + def post_tests_steps(self): + return [] + + def makefile_name(self): + return 'Makefile' + + def dockerfile_dir(self): + return 'tools/dockerfile/test/node_jessie_%s' % _docker_arch_suffix(self.args.arch) + + def __str__(self): + return 'node_express' # different configurations we can run under with open('tools/run_tests/configs.json') as f: @@ -835,6 +900,7 @@ _LANGUAGES = { 'c++': CLanguage('cxx', 'c++'), 'c': CLanguage('c', 'c'), 'node': NodeLanguage(), + 'node_express': NodeExpressLanguage(), 'php': PhpLanguage(), 'php7': Php7Language(), 'python': PythonLanguage(), @@ -999,9 +1065,14 @@ argp.add_argument('--compiler', 'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7', 'vs2010', 'vs2013', 'vs2015', 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', + 'node0.12', 'node4', 'node5', 'node6', 'node7', 'coreclr'], default='default', help='Selects compiler to use. Allowed values depend on the platform and language.') +argp.add_argument('--iomgr_platform', + choices=['native', 'uv'], + default='native', + help='Selects iomgr platform to build on') argp.add_argument('--build_only', default=False, action='store_const', |