fix run_tests scripts

pull/6134/head
Jan Tattermusch 9 years ago
parent b323608b27
commit f6824c2685
  1. 7
      tools/run_tests/run_csharp.bat
  2. 5
      tools/run_tests/run_csharp.sh
  3. 15
      tools/run_tests/run_tests.py

@ -5,12 +5,15 @@ setlocal
@rem enter src/csharp directory
cd /d %~dp0\..\..\src\csharp
rem nunit3-console fails if nunit.framework.dll is not found.
copy packages\NUnit.3.2.0\lib\net45\nunit.framework.dll packages\NUnit.ConsoleRunner.3.2.0\tools\nunit.framework.dll
if not "%CONFIG%" == "gcov" (
packages\NUnit.Runners.2.6.4\tools\nunit-console-x86.exe %* || goto :error
packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe %* || goto :error
) else (
@rem Run all tests with code coverage
packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"packages\NUnit.Runners.2.6.4\tools\nunit-console-x86.exe" -targetdir:"." -targetargs:"%*" -filter:"+[Grpc.Core]*" -register:user -output:coverage_results.xml || goto :error
packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe" -targetdir:"." -targetargs:"%*" -filter:"+[Grpc.Core]*" -register:user -output:coverage_results.xml || goto :error
packages\ReportGenerator.2.4.4.0\tools\ReportGenerator.exe -reports:"coverage_results.xml" -targetdir:"..\..\reports\csharp_coverage" -reporttypes:"Html;TextSummary" || goto :error

@ -31,7 +31,10 @@
set -ex
CONFIG=${CONFIG:-opt}
NUNIT_CONSOLE="mono packages/NUnit.Runners.2.6.4/tools/nunit-console.exe"
NUNIT_CONSOLE="mono packages/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe"
# nunit3-console fails if nunit.framework.dll is not found.
cp -u src/csharp/packages/NUnit.3.2.0/lib/net45/nunit.framework.dll src/csharp/packages/NUnit.ConsoleRunner.3.2.0/tools/
# change to gRPC repo root
cd $(dirname $0)/../..

@ -494,11 +494,16 @@ class CSharpLanguage(object):
assembly_files = ['%s/bin/%s/%s.dll' % (a, msbuild_config, a)
for a in assemblies]
extra_args = ['-labels'] + assembly_files
# TODO(jtattermusch): use --x86 when needed
extra_args = ['--labels=All',
'--noresult',
'--workers=1',
'--inprocess'] + assembly_files
if self.platform == 'windows':
script_name = 'tools\\run_tests\\run_csharp.bat'
extra_args += ['-domain=None']
extra_args += ['--domain=None']
else:
script_name = 'tools/run_tests/run_csharp.sh'
@ -512,11 +517,7 @@ class CSharpLanguage(object):
else:
specs = []
for test in tests:
cmdline = [script_name, '-run=%s' % test] + extra_args
if self.platform == 'windows':
# use different output directory for each test to prevent
# TestResult.xml clash between parallel test runs.
cmdline += ['-work=test-result/%s' % uuid.uuid4()]
cmdline = [script_name, '--test=%s' % test] + extra_args
specs.append(self.config.job_spec(cmdline, None,
shortname='csharp.%s' % test,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))

Loading…
Cancel
Save