From 51d04776a3158ec8a50ea21fde2f19a8d6cdf4ee Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Tue, 20 Jun 2023 15:45:18 -0700 Subject: tests: add support for c++23/c++26 detection Signed-off-by: Steven Noonan Signed-off-by: Patrick Williams --- unittests/linuxliketests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'unittests') diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index f322b02..7c4c6ca 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -517,6 +517,15 @@ class LinuxlikeTests(BasePlatformTests): has_cpp20 = (compiler.get_id() not in {'clang', 'gcc'} or compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=10.0.0', None) or compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=10.0.0')) + has_cpp2b = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=12.0.0', None) or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=12.2.0')) + has_cpp23 = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=17.0.0', None) or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=12.2.0')) + has_cpp26 = (compiler.get_id() not in {'clang', 'gcc'} or + compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=17.0.0', None) or + compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=14.0.0')) has_c18 = (compiler.get_id() not in {'clang', 'gcc'} or compiler.get_id() == 'clang' and _clang_at_least(compiler, '>=8.0.0', '>=11.0') or compiler.get_id() == 'gcc' and version_compare(compiler.version, '>=8.0.0')) @@ -533,6 +542,12 @@ class LinuxlikeTests(BasePlatformTests): continue elif '++20' in v and not has_cpp20: continue + elif '++2b' in v and not has_cpp2b: + continue + elif '++23' in v and not has_cpp23: + continue + elif ('++26' in v or '++2c' in v) and not has_cpp26: + continue # now C elif '17' in v and not has_cpp2a_c17: continue -- cgit v1.1