aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2015-04-27 10:10:58 -0700
committerGravatar Michael Lumish <mlumish@google.com>2015-04-27 10:10:58 -0700
commit50a4324830f9dea3460c58f3ca94edea780cf2dc (patch)
tree601e7f0f0cfbc592dc4acf07fe72c433ed5ee4b7 /tools/run_tests
parent924ef9a09b1531e646a4134d5e0688e169172d0c (diff)
parente79e2f54e82a4a59ae858c9a04690dea69c90060 (diff)
Merge pull request #1361 from jtattermusch/run_tests_fixes
Improve C# support in run_tests.py and run C# on Travis.
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-xtools/run_tests/build_csharp.sh14
-rwxr-xr-xtools/run_tests/run_csharp.sh17
-rwxr-xr-xtools/run_tests/run_tests.py11
3 files changed, 32 insertions, 10 deletions
diff --git a/tools/run_tests/build_csharp.sh b/tools/run_tests/build_csharp.sh
index 8227ad37bc..eae7bd5040 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 d10a41ae9f..752e83ef70 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 5165983d97..50fdec7f5f 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']