|
|
|
@ -149,58 +149,60 @@ class CLanguage(object): |
|
|
|
|
def test_specs(self): |
|
|
|
|
out = [] |
|
|
|
|
binaries = get_c_tests(self.args.travis, self.test_lang) |
|
|
|
|
for target in binaries: |
|
|
|
|
if self.config.build_config in target['exclude_configs']: |
|
|
|
|
continue |
|
|
|
|
if self.platform == 'windows': |
|
|
|
|
binary = 'vsprojects/%s%s/%s.exe' % ( |
|
|
|
|
'x64/' if self.args.arch == 'x64' else '', |
|
|
|
|
_MSBUILD_CONFIG[self.config.build_config], |
|
|
|
|
target['name']) |
|
|
|
|
else: |
|
|
|
|
binary = 'bins/%s/%s' % (self.config.build_config, target['name']) |
|
|
|
|
env = {} |
|
|
|
|
shortname_ext = '' |
|
|
|
|
if 'env' in target: |
|
|
|
|
tenv = target['env'] |
|
|
|
|
env.update(tenv) |
|
|
|
|
shortname_ext += ' ' |
|
|
|
|
shortname_ext += ' '.join('%s=%s' % (key, tenv[key]) for key in sorted(tenv.keys())) |
|
|
|
|
env['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ( |
|
|
|
|
_ROOT + '/src/core/tsi/test_creds/ca.pem') |
|
|
|
|
if os.path.isfile(binary): |
|
|
|
|
if 'gtest' in target and target['gtest']: |
|
|
|
|
# here we parse the output of --gtest_list_tests to build up a |
|
|
|
|
# complete list of the tests contained in a binary |
|
|
|
|
# for each test, we then add a job to run, filtering for just that |
|
|
|
|
# test |
|
|
|
|
with open(os.devnull, 'w') as fnull: |
|
|
|
|
tests = subprocess.check_output([binary, '--gtest_list_tests'], |
|
|
|
|
stderr=fnull) |
|
|
|
|
base = None |
|
|
|
|
for line in tests.split('\n'): |
|
|
|
|
i = line.find('#') |
|
|
|
|
if i >= 0: line = line[:i] |
|
|
|
|
if not line: continue |
|
|
|
|
if line[0] != ' ': |
|
|
|
|
base = line.strip() |
|
|
|
|
else: |
|
|
|
|
assert base is not None |
|
|
|
|
assert line[1] == ' ' |
|
|
|
|
test = base + line.strip() |
|
|
|
|
cmdline = [binary] + ['--gtest_filter=%s' % test] |
|
|
|
|
out.append(self.config.job_spec(cmdline, [binary], |
|
|
|
|
shortname='%s:%s %s' % (binary, test, shortname_ext), |
|
|
|
|
cpu_cost=target['cpu_cost'], |
|
|
|
|
environ=env)) |
|
|
|
|
POLLING_STRATEGIES = { |
|
|
|
|
'windows': ['all'], |
|
|
|
|
'mac': ['all'], |
|
|
|
|
'posix': ['all'], |
|
|
|
|
'linux': ['poll', 'legacy'] |
|
|
|
|
} |
|
|
|
|
for polling_strategy in POLLING_STRATEGIES[self.platform]: |
|
|
|
|
env={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH': |
|
|
|
|
_ROOT + '/src/core/tsi/test_creds/ca.pem', |
|
|
|
|
'GRPC_POLLING_STRATEGY': polling_strategy} |
|
|
|
|
shortname_ext = '' if polling_strategy=='all' else ' polling=%s' % polling_strategy |
|
|
|
|
for target in binaries: |
|
|
|
|
if self.config.build_config in target['exclude_configs']: |
|
|
|
|
continue |
|
|
|
|
if self.platform == 'windows': |
|
|
|
|
binary = 'vsprojects/%s%s/%s.exe' % ( |
|
|
|
|
'x64/' if self.args.arch == 'x64' else '', |
|
|
|
|
_MSBUILD_CONFIG[self.config.build_config], |
|
|
|
|
target['name']) |
|
|
|
|
else: |
|
|
|
|
cmdline = [binary] + target['args'] |
|
|
|
|
out.append(self.config.job_spec(cmdline, [binary], |
|
|
|
|
shortname=' '.join(cmdline) + shortname_ext, |
|
|
|
|
cpu_cost=target['cpu_cost'], |
|
|
|
|
environ=env)) |
|
|
|
|
elif self.args.regex == '.*' or self.platform == 'windows': |
|
|
|
|
print '\nWARNING: binary not found, skipping', binary |
|
|
|
|
binary = 'bins/%s/%s' % (self.config.build_config, target['name']) |
|
|
|
|
if os.path.isfile(binary): |
|
|
|
|
if 'gtest' in target and target['gtest']: |
|
|
|
|
# here we parse the output of --gtest_list_tests to build up a |
|
|
|
|
# complete list of the tests contained in a binary |
|
|
|
|
# for each test, we then add a job to run, filtering for just that |
|
|
|
|
# test |
|
|
|
|
with open(os.devnull, 'w') as fnull: |
|
|
|
|
tests = subprocess.check_output([binary, '--gtest_list_tests'], |
|
|
|
|
stderr=fnull) |
|
|
|
|
base = None |
|
|
|
|
for line in tests.split('\n'): |
|
|
|
|
i = line.find('#') |
|
|
|
|
if i >= 0: line = line[:i] |
|
|
|
|
if not line: continue |
|
|
|
|
if line[0] != ' ': |
|
|
|
|
base = line.strip() |
|
|
|
|
else: |
|
|
|
|
assert base is not None |
|
|
|
|
assert line[1] == ' ' |
|
|
|
|
test = base + line.strip() |
|
|
|
|
cmdline = [binary] + ['--gtest_filter=%s' % test] |
|
|
|
|
out.append(self.config.job_spec(cmdline, [binary], |
|
|
|
|
shortname='%s:%s' % (binary, test, shortname_ext), |
|
|
|
|
cpu_cost=target['cpu_cost'], |
|
|
|
|
environ=env)) |
|
|
|
|
else: |
|
|
|
|
cmdline = [binary] + target['args'] |
|
|
|
|
out.append(self.config.job_spec(cmdline, [binary], |
|
|
|
|
shortname=' '.join(cmdline) + shortname_ext, |
|
|
|
|
cpu_cost=target['cpu_cost'], |
|
|
|
|
environ=env)) |
|
|
|
|
elif self.args.regex == '.*' or self.platform == 'windows': |
|
|
|
|
print '\nWARNING: binary not found, skipping', binary |
|
|
|
|
return sorted(out) |
|
|
|
|
|
|
|
|
|
def make_targets(self): |
|
|
|
|