diff options
author | 2017-06-26 15:16:48 +0200 | |
---|---|---|
committer | 2017-08-23 07:53:18 +0200 | |
commit | 6521c5078c9d4c817cc61665a68a471c877571ea (patch) | |
tree | 21f621b0530250fc26459d11af7ae25bc1567d62 /tools/run_tests/run_tests.py | |
parent | 14e593c0298debc446c25911f5eb74d0abd14705 (diff) |
build C tests and protoc artifacts on windows with cmake
Diffstat (limited to 'tools/run_tests/run_tests.py')
-rwxr-xr-x | tools/run_tests/run_tests.py | 59 |
1 files changed, 13 insertions, 46 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index e8a4be3343..d874b2a320 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -234,15 +234,17 @@ class CLanguage(object): def configure(self, config, args): self.config = config self.args = args - if self.args.compiler == 'cmake': + if self.platform == 'windows': + _check_compiler(self.args.compiler, ['default', 'cmake']) + _check_arch(self.args.arch, ['default', 'x64', 'x86']) + self._cmake_arch_option = 'x64' if self.args.arch == 'x64' else 'Win32' + self._use_cmake = True + self._make_options = [] + elif self.args.compiler == 'cmake': _check_arch(self.args.arch, ['default']) self._use_cmake = True self._docker_distro = 'jessie' self._make_options = [] - elif self.platform == 'windows': - self._use_cmake = False - self._make_options = [_windows_toolset_option(self.args.compiler), - _windows_arch_option(self.args.arch)] else: self._use_cmake = False self._docker_distro, self._make_options = self._compiler_options(self.args.use_docker, @@ -303,13 +305,7 @@ class CLanguage(object): if self.args.iomgr_platform in target.get('exclude_iomgrs', []): continue if self.platform == 'windows': - if self._use_cmake: - binary = 'cmake/build/%s/%s.exe' % (_MSBUILD_CONFIG[self.config.build_config], target['name']) - else: - binary = 'vsprojects/%s%s/%s.exe' % ( - 'x64/' if self.args.arch == 'x64' else '', - _MSBUILD_CONFIG[self.config.build_config], - target['name']) + binary = 'cmake/build/%s/%s.exe' % (_MSBUILD_CONFIG[self.config.build_config], target['name']) else: if self._use_cmake: binary = 'cmake/build/%s' % target['name'] @@ -370,16 +366,12 @@ class CLanguage(object): return self._make_options; def pre_build_steps(self): - if self._use_cmake: - if self.platform == 'windows': - return [['tools\\run_tests\\helper_scripts\\pre_build_cmake.bat']] - else: - return [['tools/run_tests/helper_scripts/pre_build_cmake.sh']] + if self.platform == 'windows': + return [['tools\\run_tests\\helper_scripts\\pre_build_cmake.bat', self._cmake_arch_option]] + elif self._use_cmake: + return [['tools/run_tests/helper_scripts/pre_build_cmake.sh']] else: - if self.platform == 'windows': - return [['tools\\run_tests\\helper_scripts\\pre_build_c.bat']] - else: - return [] + return [] def build_steps(self): return [] @@ -1111,30 +1103,6 @@ def _check_arch_option(arch): sys.exit(1) -def _windows_build_bat(compiler): - """Returns name of build.bat for selected compiler.""" - # For CoreCLR, fall back to the default compiler for C core - if compiler == 'default' or compiler == 'vs2013': - return 'vsprojects\\build_vs2013.bat' - elif compiler == 'vs2015': - return 'vsprojects\\build_vs2015.bat' - else: - print('Compiler %s not supported.' % compiler) - sys.exit(1) - - -def _windows_toolset_option(compiler): - """Returns msbuild PlatformToolset for selected compiler.""" - # For CoreCLR, fall back to the default compiler for C core - if compiler == 'default' or compiler == 'vs2013' or compiler == 'coreclr': - return '/p:PlatformToolset=v120' - elif compiler == 'vs2015': - return '/p:PlatformToolset=v140' - else: - print('Compiler %s not supported.' % compiler) - sys.exit(1) - - def _docker_arch_suffix(arch): """Returns suffix to dockerfile dir to use.""" if arch == 'default' or arch == 'x64': @@ -1233,7 +1201,6 @@ argp.add_argument('--compiler', choices=['default', 'gcc4.4', 'gcc4.6', 'gcc4.8', 'gcc4.9', 'gcc5.3', 'gcc_musl', 'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7', - 'vs2013', 'vs2015', 'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine', 'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8', 'electron1.3', 'electron1.6', |