diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-25 03:13:11 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-25 12:15:59 +0200 |
commit | 67f3f803620cdf5cbabd2757211cb4c969ccf41f (patch) | |
tree | c031ddc03e77ee1293bb94fcf4171c5d83fdd14a | |
parent | dd74f3fb55e14e766ce465d6b98d06628b7f5d00 (diff) | |
download | meson-67f3f803620cdf5cbabd2757211cb4c969ccf41f.zip meson-67f3f803620cdf5cbabd2757211cb4c969ccf41f.tar.gz meson-67f3f803620cdf5cbabd2757211cb4c969ccf41f.tar.bz2 |
Determining whether to run C# tests is so difficult it deserves its own function.
-rwxr-xr-x | run_project_tests.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 6e03f6c..f9d4dbd 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -465,6 +465,28 @@ def skippable(suite, test): # Other framework tests are allowed to be skipped on other platforms return True +def skip_csharp(backend): + if backend is not Backend.ninja: + return True + if not shutil.which('resgen'): + return True + if shutil.which('mcs'): + return False + if shutil.which('csc'): + # Only support VS2017 for now. Earlier versions fail + # under CI in mysterious ways. + try: + stdo = subprocess.check_output(['csc', '/version']) + except subprocess.CalledProcessError: + return True + # Having incrementing version numbers would be too easy. + # Microsoft reset the versioning back to 1.0 (from 4.x) + # when they got the Roslyn based compiler. Thus there + # is NO WAY to reliably do version number comparisons. + # Only support the version that ships with VS2017. + return not stdo.startswith(b'2.') + return True + def detect_tests_to_run(): # Name, subdirectory, skip condition. all_tests = [ @@ -478,7 +500,7 @@ def detect_tests_to_run(): ('platform-linux', 'linuxlike', mesonlib.is_osx() or mesonlib.is_windows()), ('java', 'java', backend is not Backend.ninja or mesonlib.is_osx() or not have_java()), - ('C#', 'csharp', backend is not Backend.ninja or not (shutil.which('mcs') or shutil.which('csc')) or not shutil.which('resgen')), + ('C#', 'csharp', skip_csharp(backend)), ('vala', 'vala', backend is not Backend.ninja or not shutil.which('valac')), ('rust', 'rust', backend is not Backend.ninja or not shutil.which('rustc')), ('d', 'd', backend is not Backend.ninja or not have_d_compiler()), |