mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Minor cleanups in test-ref-configs.pl
This commit is contained in:
		
							parent
							
								
									0bc1f23dfd
								
							
						
					
					
						commit
						827b6cee7f
					
				@ -4,29 +4,34 @@
 | 
			
		||||
# - build
 | 
			
		||||
# - run test suite
 | 
			
		||||
# - run compat.sh
 | 
			
		||||
#
 | 
			
		||||
# Usage: tests/scripts/test-ref-configs.pl [config-name [...]]
 | 
			
		||||
 | 
			
		||||
use warnings;
 | 
			
		||||
use strict;
 | 
			
		||||
 | 
			
		||||
my %configs = (
 | 
			
		||||
    'config-psk-rc4-tls1_0.h'   => '-m tls1   -f \'^PSK.*RC4\|TLS-PSK.*RC4\'',
 | 
			
		||||
    'config-psk-rc4-tls1_0.h'
 | 
			
		||||
        => '-m tls1   -f \'^PSK.*RC4\|TLS-PSK.*RC4\'',
 | 
			
		||||
    'config-mini-tls1_1.h'
 | 
			
		||||
    => '-m tls1_1 -f \'^DES-CBC3-SHA$\|^TLS-RSA-WITH-3DES-EDE-CBC-SHA$\'',
 | 
			
		||||
    'config-suite-b.h'          => "-m tls1_2 -f 'ECDHE-ECDSA.*AES.*GCM'",
 | 
			
		||||
        => '-m tls1_1 -f \'^DES-CBC3-SHA$\|^TLS-RSA-WITH-3DES-EDE-CBC-SHA$\'',
 | 
			
		||||
    'config-suite-b.h'
 | 
			
		||||
        => "-m tls1_2 -f 'ECDHE-ECDSA.*AES.*GCM'",
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
# If no config-name is provided, use all known configs.
 | 
			
		||||
# Otherwise, use the provided names only.
 | 
			
		||||
if ($#ARGV >= 0) {
 | 
			
		||||
    # filter configs
 | 
			
		||||
    my @filtered_keys;
 | 
			
		||||
    my %filtered_configs;
 | 
			
		||||
    my %configs_ori = ( %configs );
 | 
			
		||||
    %configs = ();
 | 
			
		||||
 | 
			
		||||
    foreach my $filter (@ARGV) {
 | 
			
		||||
        push (@filtered_keys, $filter);
 | 
			
		||||
    foreach my $conf_name (@ARGV) {
 | 
			
		||||
        if( ! exists $configs_ori{$conf_name} ) {
 | 
			
		||||
            die "Unknown configuration: $conf_name\n";
 | 
			
		||||
        } else {
 | 
			
		||||
            $configs{$conf_name} = $configs_ori{$conf_name};
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    @filtered_keys = grep { exists $configs{$ARGV[0]} } @filtered_keys;
 | 
			
		||||
    @filtered_configs{@filtered_keys} = @configs{@filtered_keys};
 | 
			
		||||
 | 
			
		||||
    %configs = %filtered_configs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-d 'library' && -d 'include' && -d 'tests' or die "Must be run from root\n";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user