diff --git a/.travis.yml b/.travis.yml index 7d8634506c344d23c8c64a6a3e0e7f4dcc64477d..f1839ac174ae552179a3bf3cc20f992de56c1c1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,19 @@ language: cpp before_install: - sudo add-apt-repository ppa:yjwong/gflags -y - sudo add-apt-repository ppa:h-rayflood/llvm -y + - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF + - echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list + - echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv clang-3.5 - sudo pip install cpp-coveralls mako simplejson + - sudo apt-get install -qq mono-devel nunit + - wget www.nuget.org/NuGet.exe -O nuget.exe env: global: - RUBY_VERSION=2.1 - COVERALLS_PARALLEL=true + - NUGET="mono nuget.exe" matrix: - CONFIG=opt TEST=sanity - CONFIG=dbg TEST=c @@ -18,6 +24,7 @@ env: - CONFIG=opt TEST=node - CONFIG=opt TEST=ruby - CONFIG=opt TEST=python + - CONFIG=opt TEST=csharp - CONFIG=gcov TEST=c - CONFIG=gcov TEST=c++ - USE_GCC=4.4 CONFIG=opt TEST=build diff --git a/tools/run_tests/build_csharp.sh b/tools/run_tests/build_csharp.sh index 8227ad37bca5cd5f4ce06c32876106d4292f5df8..eae7bd50405aa37fbacbda8bfe62a4efdc87d931 100755 --- a/tools/run_tests/build_csharp.sh +++ b/tools/run_tests/build_csharp.sh @@ -30,9 +30,21 @@ set -ex +if [ "$CONFIG" = "dbg" ] +then + MSBUILD_CONFIG="Debug" +else + MSBUILD_CONFIG="Release" +fi + # change to gRPC repo root cd $(dirname $0)/../.. root=`pwd` -xbuild src/csharp/Grpc.sln +if [ -n "$NUGET" ] +then + $NUGET restore src/csharp/Grpc.sln +fi + +xbuild /p:Configuration=$MSBUILD_CONFIG src/csharp/Grpc.sln diff --git a/tools/run_tests/run_csharp.sh b/tools/run_tests/run_csharp.sh index d10a41ae9f4858bd5d2bcd410cf79b2d1e8a2d4c..752e83ef70547a7bce5e6dc258eacaf2a0accb4d 100755 --- a/tools/run_tests/run_csharp.sh +++ b/tools/run_tests/run_csharp.sh @@ -30,17 +30,22 @@ set -ex +CONFIG=${CONFIG:-opt} + +if [ "$CONFIG" = "dbg" ] +then + MSBUILD_CONFIG="Debug" +else + MSBUILD_CONFIG="Release" +fi + # change to gRPC repo root cd $(dirname $0)/../.. root=`pwd` cd src/csharp -# TODO: All the tests run pretty fast. In the future, we might need to teach -# run_tests.py about separate tests to make them run in parallel. -for assembly_name in Grpc.Core.Tests Grpc.Examples.Tests Grpc.IntegrationTesting -do - LD_LIBRARY_PATH=$root/libs/dbg nunit-console -labels $assembly_name/bin/Debug/$assembly_name.dll -done +export LD_LIBRARY_PATH=$root/libs/$CONFIG +nunit-console -labels "$1/bin/$MSBUILD_CONFIG/$1.dll" diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 5165983d970589492fc85c3af6779c29171897de..50fdec7f5f2a8e659a14245ee2c7a5fb7f4db445 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -61,7 +61,7 @@ class SimpleConfig(object): self.environ = environ self.environ['CONFIG'] = config - def job_spec(self, cmdline, hash_targets): + def job_spec(self, cmdline, hash_targets, shortname=None): """Construct a jobset.JobSpec for a test under this config Args: @@ -74,6 +74,7 @@ class SimpleConfig(object): be listed """ return jobset.JobSpec(cmdline=cmdline, + shortname=shortname, environ=self.environ, hash_targets=hash_targets if self.allow_hashing else None) @@ -218,9 +219,13 @@ class RubyLanguage(object): class CSharpLanguage(object): - def test_specs(self, config, travis): - return [config.job_spec('tools/run_tests/run_csharp.sh', None)] + assemblies = ['Grpc.Core.Tests', + 'Grpc.Examples.Tests', + 'Grpc.IntegrationTesting'] + return [config.job_spec(['tools/run_tests/run_csharp.sh', assembly], + None, shortname=assembly) + for assembly in assemblies ] def make_targets(self): return ['grpc_csharp_ext']