diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index efe040aeb6525039c6ea58b4b240bf1c3122e131..b8b4cf0001a8883cd305d08f949c013f3693d1ef 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -144,7 +144,7 @@ def which(filename): class JobSpec(object): """Specifies what to run for a job.""" - def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None, cwd=None): + def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None, cwd=None, shell=False): """ Arguments: cmdline: a list of arguments to pass as the command line @@ -161,6 +161,7 @@ class JobSpec(object): self.shortname = cmdline[0] if shortname is None else shortname self.hash_targets = hash_targets or [] self.cwd = cwd + self.shell = shell def identity(self): return '%r %r %r' % (self.cmdline, self.environ, self.hash_targets) @@ -187,6 +188,7 @@ class Job(object): stderr=subprocess.STDOUT, stdout=self._tempfile, cwd=spec.cwd, + shell=spec.shell, env=env) self._state = _RUNNING self._newline_on_success = newline_on_success diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 8c8e78d8597461e2d08316dc3d00bb6ba274247c..4e24f4b5104f2f4e4366414046a2fa572df54e8c 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -346,8 +346,8 @@ if len(build_configs) > 1: if platform.system() == 'Windows': def make_jobspec(cfg, targets): - return jobset.JobSpec(['nmake', '/f', 'Grpc.mak', 'CONFIG=%s' % cfg] + targets, - cwd='vsprojects\\vs2013') + return jobset.JobSpec(['make.bat', 'CONFIG=%s' % cfg] + targets, + cwd='vsprojects', shell=True) else: def make_jobspec(cfg, targets): return jobset.JobSpec(['make', diff --git a/vsprojects/README.md b/vsprojects/README.md index 7026bf77044e06f48c87175e3e37306ba64fa231..e30b99c7b8a5e5e8ab722151ab35967e30ea2862 100644 --- a/vsprojects/README.md +++ b/vsprojects/README.md @@ -19,9 +19,14 @@ After that, open `grpc.sln` with Visual Studio and hit "Build". #Testing -Use `make.bat` to build gRPC tests. +Use `run_tests.py`, that also supports Windows (with a bit limited experience). ``` -make.bat test +REM Run from repository root. +python tools\run_tests\run_tests.py -l c ``` - +Also, you can `make.bat` directly to build and run gRPC tests. +``` +REM Run from this directory. +make.bat alarm_test +``` \ No newline at end of file diff --git a/vsprojects/make.bat b/vsprojects/make.bat index 4e17b40fcfebb42d77f373188675d1523264308c..782952f9448dc1f7af07dd51dedb9505d3d02c30 100644 --- a/vsprojects/make.bat +++ b/vsprojects/make.bat @@ -2,8 +2,11 @@ @rem Usage: make.bat TARGET_NAME setlocal -@rem Set VS variables +@rem Set VS variables (uses Visual Studio 2013) @call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" x86 -nmake.exe /f Grpc.mak %1 +echo %* + +nmake /f Grpc.mak %* +exit /b %ERRORLEVEL% endlocal \ No newline at end of file