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