From: Viktor Szakats Date: Tue, 29 Oct 2024 23:24:45 +0000 (+0100) Subject: pytest: show curl features and protocols X-Git-Tag: curl-8_11_0~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc6212004a19eb0de19e2d0f20e035e277febddc;p=thirdparty%2Fcurl.git pytest: show curl features and protocols For the Test Clutch matrix. https://testclutch.curl.se/static/reports/feature-matrix.html Closes #15452 --- diff --git a/tests/http/conftest.py b/tests/http/conftest.py index 563a8c92d9..a4a4a172c8 100644 --- a/tests/http/conftest.py +++ b/tests/http/conftest.py @@ -38,6 +38,8 @@ def pytest_report_header(config): env = Env() report = [ f'Testing curl {env.curl_version()}', + f' curl: Features: {env.curl_features_string()}', + f' curl: Protocols: {env.curl_protocols_string()}', f' httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}', f' httpd-proxy: {env.httpd_version()}, http:{env.proxy_port} https:{env.proxys_port}' ] diff --git a/tests/http/testenv/env.py b/tests/http/testenv/env.py index 988b90a2f1..aa40180046 100644 --- a/tests/http/testenv/env.py +++ b/tests/http/testenv/env.py @@ -71,7 +71,9 @@ class EnvConfig: 'version': '', 'os': '', 'fullname': '', + 'features_string': '', 'features': [], + 'protocols_string': '', 'protocols': [], 'libs': [], 'lib_versions': [], @@ -98,10 +100,12 @@ class EnvConfig: re.sub(r'/[a-z0-9.-]*', '', lib) for lib in self.curl_props['lib_versions'] ] if line.startswith('Features: '): + self.curl_props['features_string'] = line[10:] self.curl_props['features'] = [ feat.lower() for feat in line[10:].split(' ') ] if line.startswith('Protocols: '): + self.curl_props['protocols_string'] = line[11:] self.curl_props['protocols'] = [ prot.lower() for prot in line[11:].split(' ') ] @@ -323,10 +327,18 @@ class Env: return not Env.curl_uses_lib('ngtcp2') and Env.curl_uses_lib('nghttp3') return False + @staticmethod + def curl_features_string() -> str: + return Env.CONFIG.curl_props['features_string'] + @staticmethod def curl_has_feature(feature: str) -> bool: return feature.lower() in Env.CONFIG.curl_props['features'] + @staticmethod + def curl_protocols_string() -> str: + return Env.CONFIG.curl_props['protocols_string'] + @staticmethod def curl_has_protocol(protocol: str) -> bool: return protocol.lower() in Env.CONFIG.curl_props['protocols']