Commit 28dd47d4 authored by Steve Holme's avatar Steve Holme
Browse files

runtests.pl: Optimised feature present checking code

...to exclude not present features.
parent 147b2a54
Loading
Loading
Loading
Loading
+95 −92
Original line number Diff line number Diff line
@@ -2751,124 +2751,127 @@ sub singletest {
        my $f = $_;
        $f =~ s/\s//g;

        $feature{$f} = $f;
        if($f =~ /^[^!](.*)$/) {
            # Store the feature for later
            $feature{$1} = $1;

        if($f eq "SSL") {
            if($1 eq "SSL") {
                if($ssl_version) {
                    next;
                }
            }
        elsif($f eq "OpenSSL") {
            elsif($1 eq "OpenSSL") {
                if($has_openssl) {
                    next;
                }
            }
        elsif($f eq "GnuTLS") {
            elsif($1 eq "GnuTLS") {
                if($has_gnutls) {
                    next;
                }
            }
        elsif($f eq "NSS") {
            elsif($1 eq "NSS") {
                if($has_nss) {
                    next;
                }
            }
        elsif($f eq "axTLS") {
            elsif($1 eq "axTLS") {
                if($has_axtls) {
                    next;
                }
            }
        elsif($f eq "WinSSL") {
            elsif($1 eq "WinSSL") {
                if($has_winssl) {
                    next;
                }
            }
        elsif($f eq "DarwinSSL") {
            elsif($1 eq "DarwinSSL") {
                if($has_darwinssl) {
                    next;
                }
            }
        elsif($f eq "unittest") {
            elsif($1 eq "unittest") {
                if($debug_build) {
                    next;
                }
            }
        elsif($f eq "debug") {
            elsif($1 eq "debug") {
                if($debug_build) {
                    next;
                }
            }
        elsif($f eq "TrackMemory") {
            elsif($1 eq "TrackMemory") {
                if($has_memory_tracking) {
                    next;
                }
            }
        elsif($f eq "large_file") {
            elsif($1 eq "large_file") {
                if($large_file) {
                    next;
                }
            }
        elsif($f eq "idn") {
            elsif($1 eq "idn") {
                if($has_idn) {
                    next;
                }
            }
        elsif($f eq "ipv6") {
            elsif($1 eq "ipv6") {
                if($has_ipv6) {
                    next;
                }
            }
        elsif($f eq "libz") {
            elsif($1 eq "libz") {
                if($has_libz) {
                    next;
                }
            }
        elsif($f eq "NTLM") {
            elsif($1 eq "NTLM") {
                if($has_ntlm) {
                    next;
                }
            }
        elsif($f eq "NTLM_WB") {
            elsif($1 eq "NTLM_WB") {
                if($has_ntlm_wb) {
                    next;
                }
            }
        elsif($f eq "SSPI") {
            elsif($1 eq "SSPI") {
                if($has_sspi) {
                    next;
                }
            }
        elsif($f eq "getrlimit") {
            elsif($1 eq "getrlimit") {
                if($has_getrlimit) {
                    next;
                }
            }
        elsif($f eq "crypto") {
            elsif($1 eq "crypto") {
                if($has_crypto) {
                    next;
                }
            }
        elsif($f eq "TLS-SRP") {
            elsif($1 eq "TLS-SRP") {
                if($has_tls_srp) {
                    next;
                }
            }
        elsif($f eq "Metalink") {
            elsif($1 eq "Metalink") {
                if($has_metalink) {
                    next;
                }
            }
        elsif($f eq "socks") {
            elsif($1 eq "socks") {
                next;
            }
            # See if this "feature" is in the list of supported protocols
        elsif (grep /^\Q$f\E$/i, @protocols) {
            elsif (grep /^\Q$1\E$/i, @protocols) {
                next;
            }

        $why = "curl lacks $f support";
            $why = "curl lacks $1 support";
            last;
        }
    }

    # We require a feature to not be present
    if(!$why) {