7 # Syntax: prefTest.pl [test|default] [<var1>=<Subst1> [<var2>=<Subst> ...]] [[ctest parameters]]
8 # If the first parameter is "test"
9 # allow use of -shell-escape in converters and
10 # allow use of external programs
11 # If the first parameter is "default"
12 # remove "-shell-escape" from converters and
13 # forbid use of external programs
15 # allow use of -shell-escape in converters and
16 # do not change handling the use of external programs
17 ############################################################
20 unshift(@INC, "@CMAKE_CURRENT_SOURCE_DIR@");
25 my $bindir = "@CMAKE_BINARY_DIR@";
27 my $userdir = "$bindir/Testing/.lyx";
30 "use_converter_needauth_forbidden" => ["true", "false"],
31 "use_converter_needauth" => ["true", "false"],
32 "allow_geometry_session" => ["false"],
33 "use_converter_cache" => ["true", "false"],
34 "converter_cache_maxage" => "integer",
41 # Parse Arguments for strings to substitute
47 my $shell_escapes = 1;
49 if (defined($ARGV[0]) && ($ARGV[0] =~ /^(test|default)$/)) {
54 if ($handle_argv eq "test") {
55 @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
56 "allow_geometry_session=false",
57 "use_converter_needauth_forbidden=false",
58 "use_converter_needauth=false",
59 "use_converter_cache=false",
60 "converter_cache_maxage=" . 180*24*60*60,
63 elsif ($handle_argv eq "default") {
65 @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
66 "allow_geometry_session=false",
67 "use_converter_needauth_forbidden=true",
68 "use_converter_needauth=true",
69 "use_converter_cache=true",
70 "converter_cache_maxage=" . 61*24*60*60,
74 @ctestpars = &getSubstitutes(\%allowedKeys, \%Subst,
75 "allow_geometry_session=false", @ARGV);
78 &getConverters($userdir, \%Converter, $shell_escapes);
80 &applyChanges($userdir, \%Subst, \%Converter, $shell_escapes);
84 $res = system("ctest", @ctestpars);