Merge branch 'master' of github.com:grpc/grpc into sanity
Conflicts:
tools/run_tests/run_tests.py
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 1e35165..a443b17 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.7
+#!/usr/bin/env python
# Copyright 2015, Google Inc.
# All rights reserved.
#
@@ -39,6 +39,7 @@
import re
import sys
import time
+import platform
import jobset
import watch_dirs
@@ -101,9 +102,16 @@
def __init__(self, make_target, test_lang):
self.make_target = make_target
+ if platform.system() == 'Windows':
+ plat = 'windows'
+ else:
+ plat = 'posix'
with open('tools/run_tests/tests.json') as f:
js = json.load(f)
- self.binaries = [tgt for tgt in js if tgt['language'] == test_lang]
+ self.binaries = [tgt
+ for tgt in js
+ if tgt['language'] == test_lang and
+ plat in tgt['platforms']]
def test_specs(self, config, travis):
out = []
@@ -190,6 +198,7 @@
def __str__(self):
return 'python'
+
class RubyLanguage(object):
def test_specs(self, config, travis):
@@ -207,6 +216,7 @@
def __str__(self):
return 'ruby'
+
class CSharpLanguage(object):
def test_specs(self, config, travis):
@@ -224,6 +234,7 @@
def __str__(self):
return 'csharp'
+
class Sanity(object):
def test_specs(self, config, travis):
@@ -241,6 +252,7 @@
def __str__(self):
return 'sanity'
+
class Build(object):
def test_specs(self, config, travis):
@@ -332,17 +344,27 @@
print language, 'does not support multiple build configurations'
sys.exit(1)
-build_steps = [jobset.JobSpec(['make',
- '-j', '%d' % (multiprocessing.cpu_count() + 1),
- 'EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f' % args.slowdown,
- 'CONFIG=%s' % cfg] + list(set(
- itertools.chain.from_iterable(
- l.make_targets() for l in languages))))
- for cfg in build_configs] + list(set(
+if platform.system() == 'Windows':
+ def make_jobspec(cfg, targets):
+ return jobset.JobSpec(['nmake', '/f', 'Grpc.mak', 'CONFIG=%s' % cfg] + targets,
+ cwd='vsprojects\\vs2013')
+else:
+ def make_jobspec(cfg, targets):
+ return jobset.JobSpec(['make',
+ '-j', '%d' % (multiprocessing.cpu_count() + 1),
+ 'EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f' %
+ args.slowdown,
+ 'CONFIG=%s' % cfg] + targets)
+
+build_steps = [make_jobspec(cfg,
+ list(set(itertools.chain.from_iterable(
+ l.make_targets() for l in languages))))
+ for cfg in build_configs]
+build_steps.extend(set(
jobset.JobSpec(cmdline, environ={'CONFIG': cfg})
for cfg in build_configs
for l in languages
- for cmdline in l.build_steps()))
+ for cmdline in l.build_steps()))
one_run = set(
spec
for config in run_configs