Changeset 14871 in josm for trunk/scripts


Ignore:
Timestamp:
2019-03-10T14:41:48+01:00 (6 years ago)
Author:
stoecker
Message:

See #16123 - move TestHTTPS ignores from script to IntegrationTestIgnores page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/TestHTTPS.pl

    r14626 r14871  
    88
    99my %urls;
     10my %known;
    1011
    11 my %known = map {$_ => 1} qw(
    12   siglon.londrina.pr.gov.br
    13   tiles.itoworld.com
    14   tms.cadastre.openstreetmap.fr
    15   www.jgoodies.com
    16   zibi.openstreetmap.org.pl
    17 );
     12sub getignores
     13{
     14  open FILE,"<:encoding(utf-8)","josm_httpsignores.txt" or die;
     15  for my $line (<FILE>)
     16  {
     17    if($line =~ /\|\| TestHTTPS \|\| \{\{\{(.*)\}\}\} \|\|/)
     18    {
     19      $known{$1}++;
     20    }
     21  }
     22  close FILE;
     23}
    1824
    1925sub getmaps
     
    8490}
    8591
    86 print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n ALL GETALL\n" if !@ARGV;
     92print "Options: \n PLUGIN STYLE RULE PRESET MAP DUMP\n GETPLUGIN GETSTYLE GETRULE GETPRESET GETMAP GETDUMP\n LOCAL\n IGNORES GETIGNORES\n ALL GETALL\n" if !@ARGV;
    8793
    8894open OUTFILE,">","josm_https.txt" or die "Could not open output file";
     
    9096sub doprint($)
    9197{
    92   print OUTFILE $_[0];
    93   print $_[0];
     98  my $t = $_[0];
     99  for my $k (sort keys %known)
     100  {
     101    $t =~ s/(\Q$k\E)/~~$1~~/g;
     102  }
     103  print OUTFILE $t;
     104  print $t;
    94105}
    95106
     
    97108for my $ARG (@ARGV)
    98109{
    99   if($ARG eq "ALL") {push(@ARGV, "PLUGIN", "STYLE", "RULE", "PRESET", "MAP", "DUMP");}
    100   if($ARG eq "GETALL") {push(@ARGV, "GETPLUGIN", "GETSTYLE", "GETRULE", "GETPRESET", "GETMAP", "GETDUMP");}
     110  if($ARG eq "ALL") {push(@ARGV, "PLUGIN", "STYLE", "RULE", "PRESET", "MAP", "DUMP", "IGNORES");}
     111  if($ARG eq "GETALL") {push(@ARGV, "GETPLUGIN", "GETSTYLE", "GETRULE", "GETPRESET", "GETMAP", "GETDUMP", "GETIGNORES");}
    101112}
    102113my %ARGS = map {$_ => 1} @ARGV; # prevent double arguments by passing through a hash
    103114for my $ARG (sort keys %ARGS)
    104115{
     116  if($ARG eq "GETIGNORES") { system "curl https://josm.openstreetmap.de/wiki/IntegrationTestIgnores?format=txt -o josm_httpsignores.txt"; getignores();}
     117  if($ARG eq "IGNORES") { getignores(); }
    105118  if($ARG eq "LOCAL") {$local = 1; }
    106119  if($ARG eq "GETDUMP") { system "scp josm\@josm.openstreetmap.de:auto/httpinfo.dump josm_dump.txt"; getdump();}
     
    123136  if($local) # skip test
    124137  {
    125     doprint "* ".($known{$url} ? "~~" : "")."$url:$i\n";
     138    doprint "* $url:$i\n";
    126139    next;
    127140  }
     
    135148    my($code, $mess, %h) = $s->read_response_headers;
    136149    alarm(0);
    137     doprint "* ".($known{$url} ? "~~" : "")."$url [$code $mess]: $i\n";
     150    doprint "* $url [$code $mess]: $i\n";
    138151  };
    139152  if($@ && $@ !~ "(--Alarm--|Connection refused)")
     
    142155    $e =~ s/[\r\n]//g;
    143156    $e =~ s/ at scripts\/TestHTTPS.pl .*//;
    144     doprint "* ".($known{$url} ? "~~" : "")."$url [Error $e] :$i\n";
     157    doprint "* $url [Error $e] :$i\n";
    145158  }
    146159}
Note: See TracChangeset for help on using the changeset viewer.