diff options
Diffstat (limited to 'tools/run_tests/run_tests.py')
-rwxr-xr-x | tools/run_tests/run_tests.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index b93f584095..482ffcc435 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -54,6 +54,17 @@ os.chdir(ROOT) _FORCE_ENVIRON_FOR_WRAPPERS = {} +def platform_string(): + if platform.system() == 'Windows': + return 'windows' + elif platform.system() == 'Darwin': + return 'mac' + elif platform.system() == 'Linux': + return 'linux' + else: + return 'posix' + + # SimpleConfig: just compile with CONFIG=config, and run the binary to test class SimpleConfig(object): @@ -109,17 +120,13 @@ class CLanguage(object): def __init__(self, make_target, test_lang): self.make_target = make_target - if platform.system() == 'Windows': - plat = 'windows' - else: - plat = 'posix' - self.platform = plat + self.platform = platform_string() 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 and - plat in tgt['platforms']] + platform_string() in tgt['platforms']] def test_specs(self, config, travis): out = [] @@ -245,11 +252,7 @@ class RubyLanguage(object): class CSharpLanguage(object): def __init__(self): - if platform.system() == 'Windows': - plat = 'windows' - else: - plat = 'posix' - self.platform = plat + self.platform = platform_string() def test_specs(self, config, travis): assemblies = ['Grpc.Core.Tests', @@ -263,7 +266,7 @@ class CSharpLanguage(object): return [config.job_spec([cmd, assembly], None, shortname=assembly, environ=_FORCE_ENVIRON_FOR_WRAPPERS) - for assembly in assemblies ] + for assembly in assemblies] def make_targets(self): # For Windows, this target doesn't really build anything, |