[LyX/master] Cmake export tests: Omit next group of possible conflicts while runnig test in parallel

Kornel Benko kornel at lyx.org
Wed Aug 19 20:09:36 UTC 2020


commit 4bb00e99fbc4e23075088dfdd8e3d566fbd9d187
Author: Kornel Benko <kornel at lyx.org>
Date:   Wed Aug 19 22:28:50 2020 +0200

    Cmake export tests: Omit next group of possible conflicts while runnig test in parallel
    
    Disable conversion cache because all lyx instances use the same cache without
    any locking between read and write to the cache.
    
    Thanks to Scott catching this case.
---
 lib/scripts/prefTest.pl.in |   12 ++++++++++--
 lib/scripts/prefTest.pm    |   22 ++++++++++++++++------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/lib/scripts/prefTest.pl.in b/lib/scripts/prefTest.pl.in
index 4e0aab7..d999b6a 100755
--- a/lib/scripts/prefTest.pl.in
+++ b/lib/scripts/prefTest.pl.in
@@ -30,6 +30,8 @@ my %allowedKeys = (
   "use_converter_needauth_forbidden" => ["true", "false"],
   "use_converter_needauth" => ["true", "false"],
   "allow_geometry_session" => ["false"],
+  "use_converter_cache" => ["true", "false"],
+  "converter_cache_maxage" => "integer",
     );
 
 my %Converter = ();
@@ -53,14 +55,20 @@ if ($handle_argv eq "test") {
   @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
 			       "allow_geometry_session=false",
 			       "use_converter_needauth_forbidden=false",
-			       "use_converter_needauth=false", @ARGV);
+			       "use_converter_needauth=false",
+			       "use_converter_cache=false",
+			       "converter_cache_maxage=" . 180*24*60*60,
+			       @ARGV);
 }
 elsif ($handle_argv eq "default") {
   $shell_escapes = 0;
   @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
 			       "allow_geometry_session=false",
 			       "use_converter_needauth_forbidden=true",
-			       "use_converter_needauth=true", @ARGV);
+			       "use_converter_needauth=true",
+			       "use_converter_cache=true",
+			       "converter_cache_maxage=" . 61*24*60*60,
+			       @ARGV);
 }
 else {
   @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
diff --git a/lib/scripts/prefTest.pm b/lib/scripts/prefTest.pm
index 814304f..8f88769 100644
--- a/lib/scripts/prefTest.pm
+++ b/lib/scripts/prefTest.pm
@@ -31,12 +31,22 @@ sub getSubstitutes($$@)
 	my $value = $2;
 	my $valid = 0;
 	if (defined($rAllowedKeys->{$key})) {
-	  for my $val (@{$rAllowedKeys->{$key}}) {
-	    if ($val eq $value) {
+	  if (ref($rAllowedKeys->{$key}) eq "ARRAY") {
+	    for my $val (@{$rAllowedKeys->{$key}}) {
+	      if ($val eq $value) {
+		$valid = 1;
+		last;
+	      }
+	    }
+	  }
+	  elsif ($rAllowedKeys->{$key} eq "integer") {
+	    if ($value =~ /^\d+$/) {
 	      $valid = 1;
-	      last;
 	    }
 	  }
+	  elsif ($rAllowedKeys->{$key} eq "string") {
+	    $valid = 1;
+	  }
 	}
 	if ($valid) {
 	  $rSubst->{$key} = [$value, 0];
@@ -82,15 +92,15 @@ sub getConverter($$)
   return undef if ($to !~ /^((dvi3?|pdf[23456]?)(log)?)$/);
   ($l, $cmd) = getNext($l);
   if ($add) {
-    if ($cmd !~ /\-shell-escape/) {
+    if ($cmd !~ /\-shell-(escape|restricted)/) {
       if ($cmd =~ /^(\S+)\s*(.*)$/) {
-	$cmd = "$1 -shell-escape $2";
+	$cmd = "$1 -shell-restricted $2";
 	$cmd =~ s/\s+$//;
       }
     }
   }
   else {
-    $cmd =~ s/\s+\-shell\-escape//;
+    $cmd =~ s/\s+\-shell\-(escape|restricted)//;
   }
   ($l, $par) = getNext($l);
   return undef if ($par !~ /^latex/);


More information about the lyx-cvs mailing list