diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-06-25 21:00:58 -0400 |
---|---|---|
committer | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-07-08 22:27:35 -0400 |
commit | c756d06fbb54651c2ba19f7801885018c1c389df (patch) | |
tree | 8b211268b057550a2b2d78f000c161700af53e22 /run_unittests.py | |
parent | fb4c95a32207e3ec0f7f18a3956da34d45b029a4 (diff) | |
download | meson-c756d06fbb54651c2ba19f7801885018c1c389df.zip meson-c756d06fbb54651c2ba19f7801885018c1c389df.tar.gz meson-c756d06fbb54651c2ba19f7801885018c1c389df.tar.bz2 |
add clang c_std=c18 alias
fix unit test skips for clang c18
correct unittests clang minimum version
cleanup unittest clang skip c_std
finesse unittest vs. clang version
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/run_unittests.py b/run_unittests.py index 214def1..3357ed3 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -4545,19 +4545,43 @@ class LinuxlikeTests(BasePlatformTests): def _test_stds_impl(self, testdir, compiler, p): lang_std = p + '_std' - # Check that all the listed -std=xxx options for this compiler work - # just fine when used + clangLT5 = (compiler.get_id() == 'clang' and + (version_compare(compiler.version, '<5.0.0') or + (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<9.1')))) + clangLT6 = (compiler.get_id() == 'clang' and + (version_compare(compiler.version, '<6.0.0') or + (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<10.0')))) + clangLT8 = (compiler.get_id() == 'clang' and + (version_compare(compiler.version, '<8.0.0') or + (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<11.0')))) + # Check that all the listed -std=xxx options for this compiler work just fine when used + # https://en.wikipedia.org/wiki/Xcode#Latest_versions + # https://www.gnu.org/software/gcc/projects/cxx-status.html for v in compiler.get_options()[lang_std].choices: - if (compiler.get_id() == 'clang' and '17' in v and - (version_compare(compiler.version, '<5.0.0') or - (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<9.1')))): - continue - if (compiler.get_id() == 'clang' and '2a' in v and - (version_compare(compiler.version, '<6.0.0') or - (compiler.compiler_type == mesonbuild.compilers.CompilerType.CLANG_OSX and version_compare(compiler.version, '<9.1')))): - continue - if (compiler.get_id() == 'gcc' and '2a' in v and version_compare(compiler.version, '<8.0.0')): - continue + # we do it like this to handle gnu++17,c++17 and gnu17,c17 cleanly + # thus, C++ first + if '++17' in v: + if clangLT5: + continue + if compiler.get_id() == 'gcc' and version_compare(compiler.version, '<5.0.0'): + continue + elif '++2a' in v: + # https://en.cppreference.com/w/cpp/compiler_support + if clangLT6: + continue + if compiler.get_id() == 'gcc' and version_compare(compiler.version, '<8.0.0'): + continue + # now C + elif '17' in v: + if clangLT6: + continue + if compiler.get_id() == 'gcc' and version_compare(compiler.version, '<8.0.0'): + continue + elif '18' in v: + if clangLT8: + continue + if compiler.get_id() == 'gcc' and version_compare(compiler.version, '<8.0.0'): + continue std_opt = '{}={}'.format(lang_std, v) self.init(testdir, extra_args=['-D' + std_opt]) cmd = self.get_compdb()[0]['command'] |