mirror of https://github.com/grpc/grpc.git
commit
0c5cf25d4e
37 changed files with 11394 additions and 177 deletions
@ -0,0 +1,54 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <grpc++/channel_arguments.h> |
||||
#include <grpc/grpc_security.h> |
||||
|
||||
#include "src/core/channel/channel_args.h" |
||||
|
||||
namespace grpc { |
||||
|
||||
void ChannelArguments::SetSslTargetNameOverride(const grpc::string& name) { |
||||
SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name); |
||||
} |
||||
|
||||
grpc::string ChannelArguments::GetSslTargetNameOverride() const { |
||||
for (unsigned int i = 0; i < args_.size(); i++) { |
||||
if (grpc::string(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == args_[i].key) { |
||||
return args_[i].value.string; |
||||
} |
||||
} |
||||
return ""; |
||||
} |
||||
|
||||
} // namespace grpc
|
@ -0,0 +1,33 @@ |
||||
<%! |
||||
import json |
||||
import os |
||||
|
||||
def proto_headers(src): |
||||
out = [] |
||||
for f in src: |
||||
name, ext = os.path.splitext(f) |
||||
if ext == '.proto': |
||||
out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) |
||||
return out |
||||
|
||||
def no_protos(src): |
||||
out = [] |
||||
for f in src: |
||||
if os.path.splitext(f)[1] != '.proto': |
||||
out.append(f) |
||||
return out |
||||
%> |
||||
|
||||
${json.dumps([{"name": tgt.name, |
||||
"language": tgt.language, |
||||
"src": sorted( |
||||
no_protos(tgt.src) + |
||||
tgt.get('public_headers', []) + |
||||
tgt.get('headers', [])), |
||||
"headers": sorted( |
||||
tgt.get('public_headers', []) + |
||||
tgt.get('headers', []) + |
||||
proto_headers(tgt.src)), |
||||
"deps": sorted(tgt.get('deps', []))} |
||||
for tgt in (targets + libs)], |
||||
sort_keys=True, indent=2)} |
@ -0,0 +1,45 @@ |
||||
#!/bin/bash |
||||
# Copyright 2015, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
# |
||||
# This script is invoked by run_jekins.sh when piggy-backing into docker. |
||||
set -e |
||||
|
||||
export CONFIG=$config |
||||
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.5 |
||||
export CPPFLAGS=-I/tmp/prebuilt/include |
||||
|
||||
mkdir -p /var/local/git |
||||
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc |
||||
|
||||
cd /var/local/git/grpc |
||||
nvm use 0.12 |
||||
rvm use ruby-2.1 |
||||
tools/run_tests/prepare_travis.sh |
||||
tools/run_tests/run_tests.py -t -c $config -l $language -x report.xml |
@ -0,0 +1,55 @@ |
||||
#!/usr/bin/env python2.7 |
||||
|
||||
import json |
||||
import os |
||||
import re |
||||
import sys |
||||
|
||||
root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) |
||||
with open(os.path.join(root, 'tools', 'run_tests', 'sources_and_headers.json')) as f: |
||||
js = json.loads(f.read()) |
||||
|
||||
re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"') |
||||
assert re_inc1.match('#include "foo"').group(1) == 'foo' |
||||
re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>') |
||||
assert re_inc2.match('#include <grpc++/foo>').group(1) == 'grpc++/foo' |
||||
|
||||
def get_target(name): |
||||
for target in js: |
||||
if target['name'] == name: |
||||
return target |
||||
assert False, 'no target %s' % name |
||||
|
||||
def target_has_header(target, name): |
||||
# print target['name'], name |
||||
if name in target['headers']: |
||||
return True |
||||
for dep in target['deps']: |
||||
if target_has_header(get_target(dep), name): |
||||
return True |
||||
if name == 'src/core/profiling/stap_probes.h': |
||||
return True |
||||
return False |
||||
|
||||
errors = 0 |
||||
for target in js: |
||||
for fn in target['src']: |
||||
with open(os.path.join(root, fn)) as f: |
||||
src = f.read().splitlines() |
||||
for line in src: |
||||
m = re_inc1.match(line) |
||||
if m: |
||||
if not target_has_header(target, m.group(1)): |
||||
print ( |
||||
'target %s (%s) does not name header %s as a dependency' % ( |
||||
target['name'], fn, m.group(1))) |
||||
errors += 1 |
||||
m = re_inc2.match(line) |
||||
if m: |
||||
if not target_has_header(target, 'include/' + m.group(1)): |
||||
print ( |
||||
'target %s (%s) does not name header %s as a dependency' % ( |
||||
target['name'], fn, m.group(1))) |
||||
errors += 1 |
||||
|
||||
assert errors == 0 |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue