diff h2_ssl.t @ 1860:58951cf933e1

Tests: added has_feature() test for SSL libraries. This makes it possible to further simplify various SSL tests. It also avoids direct testing of the $t->{_configure_args} internal field, and implements proper comparison of version numbers.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 18 May 2023 18:07:06 +0300
parents cdcd75657e52
children f9bb84e4c8e2
line wrap: on
line diff
--- a/h2_ssl.t
+++ b/h2_ssl.t
@@ -87,10 +87,12 @@ plan(skip_all => 'no ALPN negotiation') 
 ###############################################################################
 
 SKIP: {
-$t->{_configure_args} =~ /LibreSSL ([\d\.]+)/;
-skip 'LibreSSL too old', 1 if defined $1 and $1 lt '3.4.0';
-$t->{_configure_args} =~ /OpenSSL ([\d\.]+)/;
-skip 'OpenSSL too old', 1 if defined $1 and $1 lt '1.1.0';
+skip 'LibreSSL too old', 1
+	if $t->has_module('LibreSSL')
+	and not $t->has_feature('libressl:3.4.0');
+skip 'OpenSSL too old', 1
+	if $t->has_module('OpenSSL')
+	and not $t->has_feature('openssl:1.1.0');
 
 TODO: {
 local $TODO = 'not yet' unless $t->has_version('1.21.4');