Skip to content
Snippets Groups Projects
Commit ca62ff01 authored by Craig Tiller's avatar Craig Tiller
Browse files

Expand gtest suites into individual run_tests tests

parent c333cc93
No related branches found
No related tags found
No related merge requests found
......@@ -1954,6 +1954,7 @@ targets:
- linux
- posix
- name: alarm_cpp_test
gtest: true
build: test
language: c++
src:
......@@ -1966,6 +1967,7 @@ targets:
- gpr_test_util
- gpr
- name: async_end2end_test
gtest: true
build: test
language: c++
src:
......@@ -2012,6 +2014,7 @@ targets:
- linux
- posix
- name: auth_property_iterator_test
gtest: true
build: test
language: c++
src:
......@@ -2024,6 +2027,7 @@ targets:
- gpr_test_util
- gpr
- name: channel_arguments_test
gtest: true
build: test
language: c++
src:
......@@ -2033,6 +2037,7 @@ targets:
- grpc
- gpr
- name: cli_call_test
gtest: true
build: test
language: c++
src:
......@@ -2045,6 +2050,7 @@ targets:
- gpr_test_util
- gpr
- name: client_crash_test
gtest: true
cpu_cost: 0.1
build: test
language: c++
......@@ -2075,6 +2081,7 @@ targets:
- gpr_test_util
- gpr
- name: credentials_test
gtest: true
build: test
language: c++
src:
......@@ -2084,6 +2091,7 @@ targets:
- grpc
- gpr
- name: cxx_byte_buffer_test
gtest: true
build: test
language: c++
src:
......@@ -2095,6 +2103,7 @@ targets:
- gpr_test_util
- gpr
- name: cxx_slice_test
gtest: true
build: test
language: c++
src:
......@@ -2106,6 +2115,7 @@ targets:
- gpr_test_util
- gpr
- name: cxx_string_ref_test
gtest: true
build: test
language: c++
src:
......@@ -2113,6 +2123,7 @@ targets:
deps:
- grpc++
- name: cxx_time_test
gtest: true
build: test
language: c++
src:
......@@ -2124,6 +2135,7 @@ targets:
- gpr_test_util
- gpr
- name: end2end_test
gtest: true
cpu_cost: 0.5
build: test
language: c++
......@@ -2154,6 +2166,7 @@ targets:
- linux
- posix
- name: generic_end2end_test
gtest: true
build: test
language: c++
src:
......@@ -2230,6 +2243,7 @@ targets:
vs_config_type: Application
vs_project_guid: '{069E9D05-B78B-4751-9252-D21EBAE7DE8E}'
- name: grpclb_api_test
gtest: true
build: test
language: c++
src:
......@@ -2241,6 +2255,7 @@ targets:
- grpc++
- grpc
- name: hybrid_end2end_test
gtest: true
build: test
language: c++
src:
......@@ -2320,6 +2335,7 @@ targets:
- gpr
- grpc++_test_config
- name: mock_test
gtest: true
build: test
language: c++
src:
......@@ -2455,6 +2471,7 @@ targets:
- gpr
- grpc++_test_config
- name: secure_auth_context_test
gtest: true
build: test
language: c++
src:
......@@ -2484,6 +2501,7 @@ targets:
- linux
- posix
- name: server_crash_test
gtest: true
cpu_cost: 0.1
build: test
language: c++
......@@ -2514,6 +2532,7 @@ targets:
- gpr_test_util
- gpr
- name: shutdown_test
gtest: true
build: test
language: c++
src:
......@@ -2537,6 +2556,7 @@ targets:
- gpr_test_util
- gpr
- name: streaming_throughput_test
gtest: true
build: test
language: c++
src:
......@@ -2613,6 +2633,7 @@ targets:
- linux
- posix
- name: thread_stress_test
gtest: true
cpu_cost: 100
build: test
language: c++
......@@ -2626,6 +2647,7 @@ targets:
- gpr_test_util
- gpr
- name: zookeeper_test
gtest: true
build: test
run: false
language: c++
......
......@@ -3,11 +3,12 @@
<%!
import json
%>
${json.dumps([{"name": tgt.name,
"language": tgt.language,
"platforms": tgt.platforms,
"ci_platforms": tgt.ci_platforms,
"gtest": tgt.gtest,
"exclude_configs": tgt.get("exclude_configs", []),
"args": [],
"flaky": tgt.flaky,
......
......@@ -40,6 +40,7 @@ TEST = (os.environ.get('TEST', 'false') == 'true')
_TOP_LEVEL_KEYS = ['settings', 'proto_deps', 'filegroups', 'libs', 'targets', 'vspackages']
_ELEM_KEYS = [
'name',
'gtest',
'cpu_cost',
'flaky',
'build',
......@@ -98,4 +99,3 @@ for filename in sys.argv[1:]:
else:
with open(filename, 'w') as f:
f.write(output)
......@@ -52,6 +52,7 @@ def mako_plugin(dictionary):
tgt['ci_platforms'] = sorted(tgt.get('ci_platforms', tgt['platforms']))
tgt['boringssl'] = tgt.get('boringssl', False)
tgt['zlib'] = tgt.get('zlib', False)
tgt['gtest'] = tgt.get('gtest', False)
libs = dictionary.get('libs')
for lib in libs:
......
......@@ -160,12 +160,34 @@ class CLanguage(object):
else:
binary = 'bins/%s/%s' % (self.config.build_config, target['name'])
if os.path.isfile(binary):
cmdline = [binary] + target['args']
out.append(self.config.job_spec(cmdline, [binary],
shortname=' '.join(cmdline),
cpu_cost=target['cpu_cost'],
environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH':
_ROOT + '/src/core/tsi/test_creds/ca.pem'}))
if 'gtest' in target and target['gtest']:
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
else:
assert base is not None
assert line[1] == ' '
test = base + line[2:]
cmdline = [binary] + ['--gtest_filter=%s' % test]
out.append(self.config.job_spec(cmdline, [binary],
shortname='%s:%s' % (binary, test),
cpu_cost=target['cpu_cost'],
environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH':
_ROOT + '/src/core/tsi/test_creds/ca.pem'}))
else:
cmdline = [binary] + target['args']
out.append(self.config.job_spec(cmdline, [binary],
shortname=' '.join(cmdline),
cpu_cost=target['cpu_cost'],
environ={'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH':
_ROOT + '/src/core/tsi/test_creds/ca.pem'}))
elif self.args.regex == '.*' or self.platform == 'windows':
print '\nWARNING: binary not found, skipping', binary
return sorted(out)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment