mirror of https://github.com/grpc/grpc.git
commit
b7a597771f
59 changed files with 1752 additions and 698 deletions
@ -0,0 +1,6 @@ |
||||
reporting: |
||||
watermarks: |
||||
statements: [80, 95] |
||||
lines: [80, 95] |
||||
functions: [80, 95] |
||||
branches: [80, 95] |
@ -0,0 +1,60 @@ |
||||
import types |
||||
import unittest |
||||
|
||||
import pytest |
||||
|
||||
|
||||
class LoadTestsSuiteCollector(pytest.Collector): |
||||
|
||||
def __init__(self, name, parent, suite): |
||||
super(LoadTestsSuiteCollector, self).__init__(name, parent=parent) |
||||
self.suite = suite |
||||
self.obj = suite |
||||
|
||||
def collect(self): |
||||
collected = [] |
||||
for case in self.suite: |
||||
if isinstance(case, unittest.TestCase): |
||||
collected.append(LoadTestsCase(case.id(), self, case)) |
||||
elif isinstance(case, unittest.TestSuite): |
||||
collected.append( |
||||
LoadTestsSuiteCollector('suite_child_of_mine', self, case)) |
||||
return collected |
||||
|
||||
def reportinfo(self): |
||||
return str(self.suite) |
||||
|
||||
|
||||
class LoadTestsCase(pytest.Function): |
||||
|
||||
def __init__(self, name, parent, item): |
||||
super(LoadTestsCase, self).__init__(name, parent, callobj=self._item_run) |
||||
self.item = item |
||||
|
||||
def _item_run(self): |
||||
result = unittest.TestResult() |
||||
self.item(result) |
||||
if result.failures: |
||||
test_method, trace = result.failures[0] |
||||
pytest.fail(trace, False) |
||||
elif result.errors: |
||||
test_method, trace = result.errors[0] |
||||
pytest.fail(trace, False) |
||||
elif result.skipped: |
||||
test_method, reason = result.skipped[0] |
||||
pytest.skip(reason) |
||||
|
||||
|
||||
def pytest_pycollect_makeitem(collector, name, obj): |
||||
if name == 'load_tests' and isinstance(obj, types.FunctionType): |
||||
suite = unittest.TestSuite() |
||||
loader = unittest.TestLoader() |
||||
pattern = '*' |
||||
try: |
||||
# Check that the 'load_tests' object is actually a callable that actually |
||||
# accepts the arguments expected for the load_tests protocol. |
||||
suite = obj(loader, suite, pattern) |
||||
except Exception as e: |
||||
return None |
||||
else: |
||||
return LoadTestsSuiteCollector(name, collector, suite) |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,111 @@ |
||||
#!/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_interop_tests.py to accommodate |
||||
# "interop tests under docker" scenario. You should never need to call this |
||||
# script on your own. |
||||
|
||||
set -ex |
||||
|
||||
cd `dirname $0`/../.. |
||||
git_root=`pwd` |
||||
cd - |
||||
|
||||
mkdir -p /tmp/ccache |
||||
|
||||
# Use image name based on Dockerfile checksum |
||||
DOCKER_IMAGE_NAME=grpc_jenkins_slave${docker_suffix}_`sha1sum tools/jenkins/grpc_jenkins_slave/Dockerfile | cut -f1 -d\ ` |
||||
|
||||
# Make sure docker image has been built. Should be instantaneous if so. |
||||
docker build -t $DOCKER_IMAGE_NAME tools/jenkins/grpc_jenkins_slave$docker_suffix |
||||
|
||||
# Create a local branch so the child Docker script won't complain |
||||
git branch -f jenkins-docker |
||||
|
||||
# Make sure the CID files are gone. |
||||
rm -f prepare.cid server.cid client.cid |
||||
|
||||
# Prepare image for interop tests |
||||
docker run \ |
||||
-e CCACHE_DIR=/tmp/ccache \ |
||||
-i $TTY_FLAG \ |
||||
-v "$git_root:/var/local/jenkins/grpc" \ |
||||
-v /tmp/ccache:/tmp/ccache \ |
||||
--cidfile=prepare.cid \ |
||||
$DOCKER_IMAGE_NAME \ |
||||
bash -l /var/local/jenkins/grpc/tools/jenkins/docker_prepare_interop_tests.sh || DOCKER_FAILED="true" |
||||
|
||||
PREPARE_CID=`cat prepare.cid` |
||||
|
||||
# Create image from the container, we will spawn one docker for clients |
||||
# and one for servers. |
||||
INTEROP_IMAGE=interop_`uuidgen` |
||||
docker commit $PREPARE_CID $INTEROP_IMAGE |
||||
# remove container, possibly killing it first |
||||
docker rm -f $PREPARE_CID || true |
||||
echo "Successfully built image $INTEROP_IMAGE" |
||||
|
||||
# run interop servers under docker in the background |
||||
docker run \ |
||||
-d -i \ |
||||
$SERVERS_DOCKER_EXTRA_ARGS \ |
||||
--cidfile=server.cid \ |
||||
$INTEROP_IMAGE bash -l /var/local/git/grpc/tools/jenkins/docker_run_interop_servers.sh |
||||
|
||||
SERVER_CID=`cat server.cid` |
||||
|
||||
SERVER_PORTS="" |
||||
for tuple in $SERVER_PORT_TUPLES |
||||
do |
||||
# lookup under which port docker exposes given internal port |
||||
exposed_port=`docker port $SERVER_CID ${tuple#*:} | awk -F ":" '{print $NF}'` |
||||
|
||||
# override the port for corresponding cloud_to_cloud server |
||||
SERVER_PORTS+=" --override_server ${tuple%:*}=localhost:$exposed_port" |
||||
echo "${tuple%:*} server is exposed under port $exposed_port" |
||||
done |
||||
|
||||
# run interop clients |
||||
docker run \ |
||||
-e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND $SERVER_PORTS" \ |
||||
-w /var/local/git/grpc \ |
||||
-i $TTY_FLAG \ |
||||
--net=host \ |
||||
--cidfile=client.cid \ |
||||
$INTEROP_IMAGE bash -l /var/local/git/grpc/tools/jenkins/docker_run_interop_tests.sh || DOCKER_FAILED="true" |
||||
|
||||
CLIENT_CID=`cat client.cid` |
||||
|
||||
echo "killing and removing server container $SERVER_CID" |
||||
docker rm -f $SERVER_CID || true |
||||
|
||||
docker cp $CLIENT_CID:/var/local/git/grpc/report.xml $git_root |
||||
docker rm -f $CLIENT_CID || true |
||||
docker rmi -f $DOCKER_IMAGE_NAME || true |
@ -0,0 +1,79 @@ |
||||
#!/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. It contains the test logic |
||||
# that should run inside a docker container. |
||||
set -e |
||||
|
||||
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 |
||||
|
||||
# TODO(jtattermusch): use cleaner way to install root certs |
||||
mkdir -p /usr/local/share/grpc |
||||
cp etc/roots.pem /usr/local/share/grpc/ |
||||
|
||||
# build C++ interop client & server |
||||
make interop_client interop_server |
||||
|
||||
# build C# interop client & server |
||||
make install_grpc_csharp_ext |
||||
(cd src/csharp && mono /var/local/NuGet.exe restore Grpc.sln) |
||||
(cd src/csharp && xbuild Grpc.sln) |
||||
|
||||
# build Node interop client & server |
||||
npm install -g node-gyp |
||||
make install_c -C /var/local/git/grpc |
||||
(cd src/node && npm install && node-gyp rebuild) |
||||
|
||||
# build Ruby interop client and server |
||||
(cd src/ruby && gem update bundler && bundle && rake compile:grpc) |
||||
|
||||
# TODO(jtattermusch): add python |
||||
|
||||
# build PHP interop client |
||||
# TODO(jtattermusch): prerequisites for PHP should be installed sooner than here. |
||||
# Install composer |
||||
curl -sS https://getcomposer.org/installer | php |
||||
mv composer.phar /usr/local/bin/composer |
||||
# Download the patched PHP protobuf so that PHP gRPC clients can be generated |
||||
# from proto3 schemas. |
||||
git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php |
||||
(cd src/php/ext/grpc && phpize && ./configure && make) |
||||
rvm all do gem install ronn rake |
||||
(cd third_party/protobuf && make install) |
||||
(cd /var/local/git/protobuf-php \ |
||||
&& rvm all do rake pear:package version=1.0 \ |
||||
&& pear install Protobuf-1.0.tgz) |
||||
(cd src/php && composer install) |
||||
(cd src/php && protoc-gen-php -i tests/interop/ -o tests/interop/ tests/interop/test.proto) |
@ -0,0 +1,39 @@ |
||||
#!/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 build_docker_and_run_interop_tests.sh inside |
||||
# a docker container. You should never need to call this script on your own. |
||||
set -e |
||||
|
||||
nvm use 0.12 |
||||
rvm use ruby-2.1 |
||||
|
||||
# run the cloud-to-prod interop tests |
||||
$RUN_TESTS_COMMAND |
@ -0,0 +1,330 @@ |
||||
#!/usr/bin/env python |
||||
# 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. |
||||
|
||||
"""Run interop (cross-language) tests in parallel.""" |
||||
|
||||
import argparse |
||||
import itertools |
||||
import xml.etree.cElementTree as ET |
||||
import jobset |
||||
import os |
||||
import subprocess |
||||
import sys |
||||
import time |
||||
|
||||
|
||||
_CLOUD_TO_PROD_BASE_ARGS = [ |
||||
'--server_host_override=grpc-test.sandbox.google.com', |
||||
'--server_host=grpc-test.sandbox.google.com', |
||||
'--server_port=443'] |
||||
|
||||
_CLOUD_TO_CLOUD_BASE_ARGS = [ |
||||
'--server_host_override=foo.test.google.fr'] |
||||
|
||||
# TOOD(jtattermusch) wrapped languages use this variable for location |
||||
# of roots.pem. We might want to use GRPC_DEFAULT_SSL_ROOTS_FILE_PATH |
||||
# supported by C core SslCredentials instead. |
||||
_SSL_CERT_ENV = { 'SSL_CERT_FILE':'/usr/local/share/grpc/roots.pem' } |
||||
|
||||
# TODO(jtatttermusch) unify usage of --enable_ssl, --use_tls and --use_tls=true |
||||
|
||||
|
||||
class CXXLanguage: |
||||
|
||||
def __init__(self): |
||||
self.client_cmdline_base = ['bins/opt/interop_client'] |
||||
self.client_cwd = None |
||||
|
||||
def cloud_to_prod_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + |
||||
['--enable_ssl','--use_prod_roots']) |
||||
|
||||
def cloud_to_cloud_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + |
||||
['--enable_ssl']) |
||||
|
||||
def cloud_to_prod_env(self): |
||||
return None |
||||
|
||||
def __str__(self): |
||||
return 'c++' |
||||
|
||||
|
||||
class CSharpLanguage: |
||||
|
||||
def __init__(self): |
||||
self.client_cmdline_base = ['mono', 'Grpc.IntegrationTesting.Client.exe'] |
||||
self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug' |
||||
|
||||
def cloud_to_prod_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + |
||||
['--use_tls']) |
||||
|
||||
def cloud_to_cloud_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + |
||||
['--use_tls', '--use_test_ca']) |
||||
|
||||
def cloud_to_prod_env(self): |
||||
return _SSL_CERT_ENV |
||||
|
||||
def __str__(self): |
||||
return 'csharp' |
||||
|
||||
|
||||
class NodeLanguage: |
||||
|
||||
def __init__(self): |
||||
self.client_cmdline_base = ['node', 'src/node/interop/interop_client.js'] |
||||
self.client_cwd = None |
||||
|
||||
def cloud_to_prod_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + |
||||
['--use_tls=true']) |
||||
|
||||
def cloud_to_cloud_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + |
||||
['--use_tls=true', '--use_test_ca=true']) |
||||
|
||||
def cloud_to_prod_env(self): |
||||
return _SSL_CERT_ENV |
||||
|
||||
def __str__(self): |
||||
return 'node' |
||||
|
||||
|
||||
class PHPLanguage: |
||||
|
||||
def __init__(self): |
||||
self.client_cmdline_base = ['src/php/bin/interop_client.sh'] |
||||
self.client_cwd = None |
||||
|
||||
def cloud_to_prod_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + |
||||
['--use_tls']) |
||||
|
||||
def cloud_to_cloud_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + |
||||
['--use_tls', '--use_test_ca']) |
||||
|
||||
def cloud_to_prod_env(self): |
||||
return _SSL_CERT_ENV |
||||
|
||||
def __str__(self): |
||||
return 'php' |
||||
|
||||
|
||||
class RubyLanguage: |
||||
|
||||
def __init__(self): |
||||
self.client_cmdline_base = ['ruby', 'src/ruby/bin/interop/interop_client.rb'] |
||||
self.client_cwd = None |
||||
|
||||
def cloud_to_prod_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + |
||||
['--use_tls']) |
||||
|
||||
def cloud_to_cloud_args(self): |
||||
return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + |
||||
['--use_tls', '--use_test_ca']) |
||||
|
||||
def cloud_to_prod_env(self): |
||||
return _SSL_CERT_ENV |
||||
|
||||
def __str__(self): |
||||
return 'ruby' |
||||
|
||||
|
||||
# TODO(jtattermusch): add php and python once we get them working |
||||
_LANGUAGES = { |
||||
'c++' : CXXLanguage(), |
||||
'csharp' : CSharpLanguage(), |
||||
'node' : NodeLanguage(), |
||||
'php' : PHPLanguage(), |
||||
'ruby' : RubyLanguage(), |
||||
} |
||||
|
||||
# languages supported as cloud_to_cloud servers |
||||
# TODO(jtattermusch): enable other languages as servers as well |
||||
_SERVERS = { 'c++' : 8010, 'node' : 8040, 'csharp': 8070 } |
||||
|
||||
# TODO(jtattermusch): add empty_stream once C++ start supporting it. |
||||
# TODO(jtattermusch): add support for auth tests. |
||||
_TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong', |
||||
'client_streaming', 'server_streaming', |
||||
'cancel_after_begin', 'cancel_after_first_response', |
||||
'timeout_on_sleeping_server'] |
||||
|
||||
|
||||
def cloud_to_prod_jobspec(language, test_case): |
||||
"""Creates jobspec for cloud-to-prod interop test""" |
||||
cmdline = language.cloud_to_prod_args() + ['--test_case=%s' % test_case] |
||||
test_job = jobset.JobSpec( |
||||
cmdline=cmdline, |
||||
cwd=language.client_cwd, |
||||
shortname="cloud_to_prod:%s:%s" % (language, test_case), |
||||
environ=language.cloud_to_prod_env(), |
||||
timeout_seconds=60) |
||||
return test_job |
||||
|
||||
|
||||
def cloud_to_cloud_jobspec(language, test_case, server_name, server_host, |
||||
server_port): |
||||
"""Creates jobspec for cloud-to-cloud interop test""" |
||||
cmdline = language.cloud_to_cloud_args() + ['--test_case=%s' % test_case, |
||||
'--server_host=%s' % server_host, |
||||
'--server_port=%s' % server_port ] |
||||
test_job = jobset.JobSpec( |
||||
cmdline=cmdline, |
||||
cwd=language.client_cwd, |
||||
shortname="cloud_to_cloud:%s:%s_server:%s" % (language, server_name, |
||||
test_case), |
||||
timeout_seconds=60) |
||||
return test_job |
||||
|
||||
argp = argparse.ArgumentParser(description='Run interop tests.') |
||||
argp.add_argument('-l', '--language', |
||||
choices=['all'] + sorted(_LANGUAGES), |
||||
nargs='+', |
||||
default=['all'], |
||||
help='Clients to run.') |
||||
argp.add_argument('-j', '--jobs', default=24, type=int) |
||||
argp.add_argument('--cloud_to_prod', |
||||
default=False, |
||||
action='store_const', |
||||
const=True, |
||||
help='Run cloud_to_prod tests.') |
||||
argp.add_argument('-s', '--server', |
||||
choices=['all'] + sorted(_SERVERS), |
||||
action='append', |
||||
help='Run cloud_to_cloud servers in a separate docker ' + |
||||
'image. Servers can only be started automatically if ' + |
||||
'--use_docker option is enabled.', |
||||
default=[]) |
||||
argp.add_argument('--override_server', |
||||
action='append', |
||||
type=lambda kv: kv.split("="), |
||||
help='Use servername=HOST:PORT to explicitly specify a server. E.g. csharp=localhost:50000', |
||||
default=[]) |
||||
argp.add_argument('-t', '--travis', |
||||
default=False, |
||||
action='store_const', |
||||
const=True) |
||||
argp.add_argument('--use_docker', |
||||
default=False, |
||||
action='store_const', |
||||
const=True, |
||||
help='Run all the interop tests under docker. That provides ' + |
||||
'additional isolation and prevents the need to install ' + |
||||
'language specific prerequisites. Only available on Linux.') |
||||
args = argp.parse_args() |
||||
|
||||
servers = set(s for s in itertools.chain.from_iterable(_SERVERS.iterkeys() |
||||
if x == 'all' else [x] |
||||
for x in args.server)) |
||||
|
||||
if args.use_docker: |
||||
if not args.travis: |
||||
print 'Seen --use_docker flag, will run interop tests under docker.' |
||||
print |
||||
print 'IMPORTANT: The changes you are testing need to be locally committed' |
||||
print 'because only the committed changes in the current branch will be' |
||||
print 'copied to the docker environment.' |
||||
time.sleep(5) |
||||
|
||||
child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ] |
||||
run_tests_cmd = ('tools/run_tests/run_interop_tests.py %s' % |
||||
" ".join(child_argv[1:])) |
||||
|
||||
# cmdline args to pass to the container running servers. |
||||
servers_extra_docker_args = '' |
||||
server_port_tuples = '' |
||||
for server in servers: |
||||
port = _SERVERS[server] |
||||
servers_extra_docker_args += ' -p %s' % port |
||||
servers_extra_docker_args += ' -e SERVER_PORT_%s=%s' % (server.replace("+", "x"), port) |
||||
server_port_tuples += ' %s:%s' % (server, port) |
||||
|
||||
env = os.environ.copy() |
||||
env['RUN_TESTS_COMMAND'] = run_tests_cmd |
||||
env['SERVERS_DOCKER_EXTRA_ARGS'] = servers_extra_docker_args |
||||
env['SERVER_PORT_TUPLES'] = server_port_tuples |
||||
if not args.travis: |
||||
env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins. |
||||
|
||||
subprocess.check_call(['tools/jenkins/build_docker_and_run_interop_tests.sh'], |
||||
shell=True, |
||||
env=env) |
||||
sys.exit(0) |
||||
|
||||
languages = set(_LANGUAGES[l] |
||||
for l in itertools.chain.from_iterable( |
||||
_LANGUAGES.iterkeys() if x == 'all' else [x] |
||||
for x in args.language)) |
||||
|
||||
jobs = [] |
||||
if args.cloud_to_prod: |
||||
for language in languages: |
||||
for test_case in _TEST_CASES: |
||||
test_job = cloud_to_prod_jobspec(language, test_case) |
||||
jobs.append(test_job) |
||||
|
||||
# default servers to "localhost" and the default port |
||||
server_addresses = dict((s, ("localhost", _SERVERS[s])) for s in servers) |
||||
|
||||
for server in args.override_server: |
||||
server_name = server[0] |
||||
(server_host, server_port) = server[1].split(":") |
||||
server_addresses[server_name] = (server_host, server_port) |
||||
|
||||
for server_name, server_address in server_addresses.iteritems(): |
||||
(server_host, server_port) = server_address |
||||
for language in languages: |
||||
for test_case in _TEST_CASES: |
||||
test_job = cloud_to_cloud_jobspec(language, |
||||
test_case, |
||||
server_name, |
||||
server_host, |
||||
server_port) |
||||
jobs.append(test_job) |
||||
|
||||
if not jobs: |
||||
print "No jobs to run." |
||||
sys.exit(1) |
||||
|
||||
root = ET.Element('testsuites') |
||||
testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') |
||||
|
||||
if jobset.run(jobs, newline_on_success=True, maxjobs=args.jobs, xml_report=testsuite): |
||||
jobset.message('SUCCESS', 'All tests passed', do_newline=True) |
||||
else: |
||||
jobset.message('FAILED', 'Some tests failed', do_newline=True) |
||||
|
||||
tree = ET.ElementTree(root) |
||||
tree.write('report.xml', encoding='UTF-8') |
@ -1,37 +0,0 @@ |
||||
import argparse |
||||
import xml.etree.cElementTree as ET |
||||
import jobset |
||||
|
||||
argp = argparse.ArgumentParser(description='Run interop tests.') |
||||
argp.add_argument('-l', '--language', |
||||
default='c++') |
||||
args = argp.parse_args() |
||||
|
||||
# build job |
||||
build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%s' % args.language], |
||||
shortname='build', |
||||
timeout_seconds=30*60) |
||||
|
||||
# test jobs, each test is a separate job to run in parallel |
||||
_TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming'] |
||||
jobs = [] |
||||
jobNumber = 0 |
||||
for test in _TESTS: |
||||
test_job = jobset.JobSpec( |
||||
cmdline=['tools/run_tests/run_interops_test.sh', '%s' % args.language, '%s' % test], |
||||
shortname=test, |
||||
timeout_seconds=15*60) |
||||
jobs.append(test_job) |
||||
jobNumber+=1 |
||||
|
||||
root = ET.Element('testsuites') |
||||
testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') |
||||
|
||||
# always do the build of docker first, and then all the tests can run in parallel |
||||
jobset.run([build_job], maxjobs=1, xml_report=testsuite) |
||||
jobset.run(jobs, maxjobs=jobNumber, xml_report=testsuite) |
||||
|
||||
tree = ET.ElementTree(root) |
||||
tree.write('report.xml', encoding='UTF-8') |
||||
|
||||
|
@ -1,75 +0,0 @@ |
||||
#!/bin/sh |
||||
|
||||
# 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. |
||||
|
||||
language=$1 |
||||
|
||||
set -e |
||||
|
||||
#clean up any old docker files and start mirroring repository if not started already |
||||
sudo docker rmi -f grpc/cxx || true |
||||
sudo docker rmi -f grpc/base || true |
||||
sudo docker rmi -f 0.0.0.0:5000/grpc/base || true |
||||
sudo docker run -d -e GCS_BUCKET=docker-interop-images -e STORAGE_PATH=/admin/docker_images -p 5000:5000 google/docker-registry || true |
||||
|
||||
#prepare building by pulling down base images and necessary files |
||||
sudo docker pull 0.0.0.0:5000/grpc/base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/base grpc/base |
||||
|
||||
if [ "$language" = "c++" ] |
||||
then |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx |
||||
sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx |
||||
elif [ "$language" = "node" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/node_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/node_base grpc/node_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_node |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_node |
||||
sudo docker build --no-cache -t grpc/node tools/dockerfile/grpc_node |
||||
elif [ "$language" = "ruby" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/ruby_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/ruby_base grpc/ruby_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_ruby |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_ruby |
||||
sudo docker build --no-cache -t grpc/ruby tools/dockerfile/grpc_ruby |
||||
elif [ "$language" = "php" ] |
||||
then |
||||
sudo docker pull 0.0.0.0:5000/grpc/php_base |
||||
sudo docker tag -f 0.0.0.0:5000/grpc/php_base grpc/php_base |
||||
gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_php |
||||
gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_php |
||||
sudo docker build --no-cache -t grpc/php tools/dockerfile/grpc_php |
||||
else |
||||
echo "interop testss not added for $language" |
||||
exit 1 |
||||
fi |
@ -0,0 +1,35 @@ |
||||
Zlib Native Nuget package |
||||
------------------------- |
||||
|
||||
Uses [CoApp](http://coapp.org/) project to build the zlib package. |
||||
|
||||
Prerequisites |
||||
------------- |
||||
Multiple versions of VS installed to be able to build all the targets: |
||||
* Visual Studio 2013 |
||||
* Visual Studio 2010 (you might need SP1 to prevent LNK1123 error) |
||||
|
||||
CoApp toolkit: http://downloads.coapp.org/files/CoApp.Tools.Powershell.msi |
||||
|
||||
More details on installation: http://coapp.org/tutorials/installation.html |
||||
|
||||
Building |
||||
-------- |
||||
|
||||
Build all flavors of zlib library using the provided batch file. |
||||
``` |
||||
buildall.bat |
||||
``` |
||||
|
||||
Then, create NuGet package using powershell (you'll need the CoApp toolkit installed): |
||||
``` |
||||
[THIS_DIRECTORY]> Write-NuGetPackage grpc.dependencies.zlib.autopkg |
||||
``` |
||||
|
||||
This will create three NuGet packages: |
||||
* the main dev package |
||||
* the redistributable package that contains just the binaries and no headers |
||||
* the symbols package (debug symbols) |
||||
|
||||
Later, you can push the package to NuGet.org repo. |
||||
Attention: before pusing the resulting nuget package to public nuget repo, you have to be 100% sure it works correctly - there’s no way how to delete or update an already existing package. |
@ -0,0 +1,51 @@ |
||||
@echo off |
||||
setlocal |
||||
|
||||
setlocal |
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 |
||||
call :build x64 Release v120 || goto :eof |
||||
call :build x64 Debug v120 || goto :eof |
||||
endlocal |
||||
|
||||
setlocal |
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 |
||||
call :build Win32 Release v120 || goto :eof |
||||
call :build Win32 Debug v120 || goto :eof |
||||
endlocal |
||||
|
||||
REM setlocal |
||||
REM call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64 |
||||
REM call :build x64 Release v110 || goto :eof |
||||
REM call :build x64 Debug v110 || goto :eof |
||||
REM endlocal |
||||
|
||||
REM setlocal |
||||
REM call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 |
||||
REM call :build Win32 Release v110 || goto :eof |
||||
REM call :build Win32 Debug v110 || goto :eof |
||||
REM endlocal |
||||
|
||||
REM setlocal |
||||
REM call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 |
||||
REM call :build x64 Release v100 || goto :eof |
||||
REM call :build x64 Debug v100 || goto :eof |
||||
REM endlocal |
||||
|
||||
setlocal |
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 |
||||
call :build Win32 Release v100 || goto :eof |
||||
call :build Win32 Debug v100 || goto :eof |
||||
endlocal |
||||
|
||||
goto :eof |
||||
|
||||
:build |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=Dynamic /P:CallingConvention=cdecl .\zlib.sln || goto :eof |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=Dynamic /P:CallingConvention=stdcall .\zlib.sln || goto :eof |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=Static /P:CallingConvention=cdecl .\zlib.sln || goto :eof |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=Static /P:CallingConvention=stdcall .\zlib.sln || goto :eof |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=ltcg /P:CallingConvention=cdecl .\zlib.sln || goto :eof |
||||
msbuild /P:Platform=%1 /P:Configuration=%2 /P:PlatformToolset=%3 /P:UsesConfigurationType=ltcg /P:CallingConvention=stdcall .\zlib.sln || goto :eof |
||||
goto :eof |
||||
|
||||
|
@ -0,0 +1,102 @@ |
||||
@import @"version.inc"; |
||||
|
||||
configurations { |
||||
}; |
||||
|
||||
#define { |
||||
package-id = "grpc.dependencies.zlib"; |
||||
} |
||||
|
||||
nuget { |
||||
// the nuspec file metadata. Gets created/updated on build |
||||
nuspec { |
||||
id = ${package-id}; |
||||
version : ${package-version}; |
||||
title: gRPC Native Dependency: ZLib compression library; |
||||
authors: {Jean-loup Gailly, Mark Adler, Garrett Serack, Tim Rogers}; |
||||
owners: {Jan Tattermusch}; |
||||
licenseUrl: "http://zlib.net/zlib-license.html"; |
||||
projectUrl: "http://github.com/jtattermusch/zlib"; |
||||
iconUrl: "http://zlib.net/images/zlib3d-b1.png"; |
||||
requireLicenseAcceptance:false; |
||||
summary:A zlib library; |
||||
description: @"A native zlib library. |
||||
zlib homepage: http://zlib.net"; |
||||
releaseNotes: "Release of zlib 1.2.8 libraries."; |
||||
copyright: Copyright 2013; |
||||
tags: { zlib, native, CoApp }; |
||||
|
||||
}; |
||||
|
||||
// the files that go into the content folders |
||||
// (inserted into the nuspec file) |
||||
files { |
||||
// .targets file that are applied when redist package is installed from a managed project. |
||||
managed_build: { |
||||
#output { |
||||
package = redist; |
||||
}; |
||||
#destination = "\build\portable-net45"; |
||||
"managed_targets\${package-id}.redist.props"; |
||||
"managed_targets\${package-id}.redist.targets"; |
||||
}; |
||||
|
||||
include: { ..\..\..\third_party\zlib\zlib.h, ..\..\..\third_party\zlib\zconf.h }; |
||||
|
||||
docs: { ..\..\..\third_party\zlib\doc\**\* }; |
||||
|
||||
source += { |
||||
"..\..\..\third_party\zlib\adler32.c", |
||||
"..\..\..\third_party\zlib\compress.c", |
||||
"..\..\..\third_party\zlib\crc32.c", |
||||
"..\..\..\third_party\zlib\deflate.c", |
||||
"..\..\..\third_party\zlib\gzclose.c", |
||||
"..\..\..\third_party\zlib\gzlib.c", |
||||
"..\..\..\third_party\zlib\gzread.c", |
||||
"..\..\..\third_party\zlib\gzwrite.c", |
||||
"..\..\..\third_party\zlib\infback.c", |
||||
"..\..\..\third_party\zlib\inffast.c", |
||||
"..\..\..\third_party\zlib\inflate.c", |
||||
"..\..\..\third_party\zlib\inftrees.c", |
||||
"..\..\..\third_party\zlib\trees.c", |
||||
"..\..\..\third_party\zlib\uncompr.c", |
||||
"..\..\..\third_party\zlib\zutil.c", |
||||
"..\..\..\third_party\zlib\crc32.h", |
||||
"..\..\..\third_party\zlib\deflate.h", |
||||
"..\..\..\third_party\zlib\gzguts.h", |
||||
"..\..\..\third_party\zlib\inffast.h", |
||||
"..\..\..\third_party\zlib\inffixed.h", |
||||
"..\..\..\third_party\zlib\inflate.h", |
||||
"..\..\..\third_party\zlib\inftrees.h", |
||||
"..\..\..\third_party\zlib\trees.h", |
||||
"..\..\..\third_party\zlib\zconf.h", |
||||
"..\..\..\third_party\zlib\zlib.h", |
||||
"..\..\..\third_party\zlib\zutil.h", |
||||
"..\..\..\third_party\zlib\contrib\masmx64\inffas8664.c", |
||||
}; |
||||
("v100,v120", "Win32,x64", "Release,Debug", "Dynamic", "cdecl,stdcall", "MultiByte") => { |
||||
[${0},${1},${2},${3},${4}] { |
||||
lib: { .\output\${0}\${1}\${2}\${3}\${4}\${5}\*.lib }; |
||||
bin: { .\output\${0}\${1}\${2}\${3}\${4}\${5}\*.dll }; |
||||
symbols: { .\output\${0}\${1}\${2}\${3}\${4}\${5}\*.pdb }; |
||||
}; |
||||
}; |
||||
("v100,v120", "Win32,x64", "Release,Debug", "Static,ltcg", "cdecl,stdcall", "MultiByte") => { |
||||
[${0},${1},${2},${3},${4}] { |
||||
lib: { .\output\${0}\${1}\${2}\${3}\${4}\${5}\*.lib }; |
||||
}; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
// the VC++ .targets file that gets generated and inserted into the ${d_content} folder |
||||
targets { |
||||
Defines += HAS_ZLIB; |
||||
[dynamic] |
||||
Defines += ZLIB_DLL; |
||||
[stdcall] |
||||
Defines += ZLIB_WINAPI; |
||||
|
||||
}; |
||||
} |
||||
|
@ -0,0 +1 @@ |
||||
#define { package-version : 1.2.8.9; } |
@ -0,0 +1,147 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="PreBuildCmds;PreBuildTargets;Build;PostBuildCmds;PostBuildTargets" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup Label="CoApp" > |
||||
<CoAppEtcDirectory>$(registry:HKEY_LOCAL_MACHINE\Software\Outercurve\CoApp.Powershell\etc)</CoAppEtcDirectory> |
||||
|
||||
<!-- Set to true to make visual studio use PTK when building.--> |
||||
<UsePTKFromVisualStudio>false</UsePTKFromVisualStudio> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup Label="Configuration" > |
||||
<!-- This lets Visual Studio see this as a VC12 project by default --> |
||||
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v120</PlatformToolset> |
||||
</PropertyGroup> |
||||
|
||||
<Import Condition="Exists('$(CoAppEtcDirectory)\common-variables.vcxproj')" Project="$(CoAppEtcDirectory)\common-variables.vcxproj" /> |
||||
|
||||
<PropertyGroup Label="CustomSettings" /> |
||||
|
||||
<PropertyGroup Label="Globals"> |
||||
<ProjectGuid>{63BED288-E8C3-4345-B84D-2E64598DCF3A}</ProjectGuid> |
||||
<RootNamespace>$(MSBuildProjectName)</RootNamespace> |
||||
|
||||
<OutNameSuffix Condition="$(IS_CDECL) AND $(IS_DYNAMIC)">1</OutNameSuffix> |
||||
|
||||
<!-- set to Application or DynamicLibrary (DynamicLibrary can get altered to StaticLibrary by PTK --> |
||||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
||||
|
||||
<!-- Common Compiler Defines (semicolon delimited) --> |
||||
<Defines>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;</Defines> |
||||
<Defines Condition="$(IS_STDCALL)">$(Defines);ZLIB_WINAPI;</Defines> |
||||
<Defines Condition="$(IS_DYNAMIC)">$(Defines);ZLIB_DLL;</Defines> |
||||
<Defines Condition="'$(AppContainer)' == 'App'">$(Defines);IOWIN32_USING_WINRT_API=1;</Defines> |
||||
<Defines Condition="'$(AppContainer)' != 'App'">$(Defines);IOWIN32_USING_WINRT_API=0;</Defines> |
||||
<Defines Condition="'$(UseASM)' == 'ASM'">$(Defines);ASMV;ASMINF;</Defines> |
||||
<Defines Condition="$(IS_X64)">$(Defines);WIN64;</Defines> |
||||
|
||||
<!-- Additional Include folders (semicolon delimited) --> |
||||
<IncludeDirectories>..\..\..\third_party\zlib;</IncludeDirectories> |
||||
|
||||
<!-- Additional Library folders (semicolon delimited) --> |
||||
<LibraryDirectories></LibraryDirectories> |
||||
|
||||
<!-- Libraries to Link with --> |
||||
<Libraries></Libraries> |
||||
|
||||
<!-- Batch script to run before Build--> |
||||
<PreBuild></PreBuild> |
||||
|
||||
<!-- Batch script to run after Build--> |
||||
<PostBuild></PostBuild> |
||||
|
||||
<!-- Batch script to run before Link step--> |
||||
<PreLink></PreLink> |
||||
|
||||
<!-- Batch script to run after Link--> |
||||
<PostLink></PostLink> |
||||
|
||||
<!-- Batch script to run before Lib step--> |
||||
<PreLib></PreLib> |
||||
|
||||
<!-- Batch script to run after Lib--> |
||||
<PostLib></PostLib> |
||||
|
||||
<!-- Targets to run before Build (semcolon delimited)--> |
||||
<PreBuildTargets></PreBuildTargets> |
||||
|
||||
<!-- Targets to run before Build (semcolon delimited)--> |
||||
<PostBuildTargets></PostBuildTargets> |
||||
|
||||
<!-- for Dynamic libs, you can specify the Module .DEF file path --> |
||||
<ModuleDefinitionFile></ModuleDefinitionFile> |
||||
</PropertyGroup> |
||||
|
||||
<Import Condition="Exists('$(CoAppEtcDirectory)\common-header.vcxproj')" Project="$(CoAppEtcDirectory)\common-header.vcxproj" /> |
||||
<Import Condition="'$(UseASM)' == 'ASM'" Project="$(VCTargetsPath)\BuildCustomizations\masm.props" /> |
||||
|
||||
<PropertyGroup> |
||||
<OutDir>$(ProjectRootDir)Output/$(PlatformToolset)/$(Platform)/$(Configuration)/$(UsesConfigurationType)/$(CallingConvention)/$(CharacterSet)/$(AppContainer)/$(UseASM)/</OutDir> |
||||
<IntDir>$(ProjectRootDir)Intermediate/$(TargetName)/$(PlatformToolset)/$(Platform)/$(Configuration)/$(UsesConfigurationType)/$(CallingConvention)/$(CharacterSet)/$(AppContainer)/$(UseASM)/</IntDir> |
||||
</PropertyGroup> |
||||
|
||||
<ItemDefinitionGroup> |
||||
<ClCompile> |
||||
<SDLCheck>true</SDLCheck> |
||||
</ClCompile> |
||||
<Link> |
||||
<BaseAddress>0x5A4C0000</BaseAddress> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemGroup Condition="'$(UseASM)' == 'ASM'"> |
||||
<MASM Include="..\..\..\third_party\zlib\contrib\masmx64\gvmat64.asm" Condition="$(IS_X64)"> |
||||
<AssembledCodeListingFile>$(IntDir)gvmat64.lst</AssembledCodeListingFile> |
||||
<MASMBeforeTargets>Build</MASMBeforeTargets> |
||||
<ObjectFileName>$(IntDir)gvmat64.obj</ObjectFileName> |
||||
</MASM> |
||||
<MASM Include="..\..\..\third_party\zlib\contrib\masmx64\inffasx64.asm" Condition="$(IS_X64)"> |
||||
<AssembledCodeListingFile>$(IntDir)inffasx64.lst</AssembledCodeListingFile> |
||||
<MASMBeforeTargets>Build</MASMBeforeTargets> |
||||
<ObjectFileName>$(IntDir)inffasx64.obj</ObjectFileName> |
||||
</MASM> |
||||
<MASM Include="..\..\..\third_party\zlib\contrib\masmx86\inffas32.asm" Condition="$(IS_X86) AND $(IS_STDCALL)"> |
||||
<AssembledCodeListingFile>$(IntDir)inffas32.lst</AssembledCodeListingFile> |
||||
<MASMBeforeTargets>Build</MASMBeforeTargets> |
||||
<UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> |
||||
<AdditionalOptions>/coff %(AdditionalOptions)</AdditionalOptions> |
||||
<ObjectFileName>$(IntDir)inffas32.obj</ObjectFileName> |
||||
</MASM> |
||||
<MASM Include="..\..\..\third_party\zlib\contrib\masmx86\match686.asm" Condition="$(IS_X86) AND $(IS_STDCALL)"> |
||||
<AssembledCodeListingFile>$(IntDir)match686.lst</AssembledCodeListingFile> |
||||
<MASMBeforeTargets>Build</MASMBeforeTargets> |
||||
<UseSafeExceptionHandlers>true</UseSafeExceptionHandlers> |
||||
<AdditionalOptions>/coff %(AdditionalOptions)</AdditionalOptions> |
||||
<ObjectFileName>$(IntDir)match686.obj</ObjectFileName> |
||||
</MASM> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup Label="C Source Files"> |
||||
<!-- Include the source files to compile here --> |
||||
<!-- <ClCompile Include="..\src\foo.c" /> --> |
||||
<ClCompile Include="..\..\..\third_party\zlib\adler32.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\compress.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\crc32.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\deflate.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\gzclose.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\gzlib.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\gzread.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\gzwrite.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\infback.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\contrib\masmx64\inffas8664.c" Condition="$(IS_X64)" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\inffast.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\inflate.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\inftrees.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\trees.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\uncompr.c" /> |
||||
<ClCompile Include="..\..\..\third_party\zlib\zutil.c" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup Label="Resource Files"> |
||||
<!-- Include the source files to compile here --> |
||||
<!-- <ResourceCompile Include="..\src\foo.rc" /> --> |
||||
<ResourceCompile Include="..\..\..\third_party\zlib\win32\zlib1.rc" /> |
||||
</ItemGroup> |
||||
|
||||
<Import Condition="'$(UseASM)' == 'ASM'" Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" /> |
||||
<Import Condition="Exists('$(CoAppEtcDirectory)\common-footer.vcxproj')" Project="$(CoAppEtcDirectory)\common-footer.vcxproj" /> |
||||
</Project> |
Loading…
Reference in new issue