quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

globalconfig.pm (5014B)


      1 #***************************************************************************
      2 #                                  _   _ ____  _
      3 #  Project                     ___| | | |  _ \| |
      4 #                             / __| | | | |_) | |
      5 #                            | (__| |_| |  _ <| |___
      6 #                             \___|\___/|_| \_\_____|
      7 #
      8 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      9 #
     10 # This software is licensed as described in the file COPYING, which
     11 # you should have received as part of this distribution. The terms
     12 # are also available at https://curl.se/docs/copyright.html.
     13 #
     14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
     15 # copies of the Software, and permit persons to whom the Software is
     16 # furnished to do so, under the terms of the COPYING file.
     17 #
     18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
     19 # KIND, either express or implied.
     20 #
     21 # SPDX-License-Identifier: curl
     22 #
     23 ###########################################################################
     24 
     25 # This module contains global variables used in multiple modules in the test
     26 # harness but not really "owned" by any one.
     27 
     28 package globalconfig;
     29 
     30 use strict;
     31 use warnings;
     32 
     33 BEGIN {
     34     use base qw(Exporter);
     35 
     36     our @EXPORT = qw(
     37         $anyway
     38         $automakestyle
     39         $CURL
     40         $CURLINFO
     41         $CURLVERSION
     42         $CURLVERNUM
     43         $DATE
     44         $LIBDIR
     45         $UNITDIR
     46         $TUNITDIR
     47         $SRVDIR
     48         $listonly
     49         $LOCKDIR
     50         $LOGDIR
     51         $memanalyze
     52         $MEMDUMP
     53         $perlcmd
     54         $perl
     55         $PIDDIR
     56         $proxy_address
     57         $PROXYIN
     58         $pwd
     59         $randseed
     60         $run_duphandle
     61         $run_event_based
     62         $SERVERCMD
     63         $DNSCMD
     64         $SERVERIN
     65         $srcdir
     66         $TESTDIR
     67         $torture
     68         $valgrind
     69         $VCURL
     70         $verbose
     71         %feature
     72         %keywords
     73         @protocols
     74         $dev_null
     75     );
     76 }
     77 use pathhelp qw(
     78     exe_ext
     79     dirsepadd
     80 );
     81 use Cwd qw(getcwd);
     82 use testutil qw(
     83     shell_quote
     84 );
     85 use File::Spec;
     86 
     87 
     88 #######################################################################
     89 # global configuration variables
     90 #
     91 
     92 # config variables overridden by command-line options
     93 our $verbose;         # 1 to show verbose test output
     94 our $torture;         # 1 to enable torture testing
     95 our $proxy_address;   # external HTTP proxy address
     96 our $listonly;        # only list the tests
     97 our $run_duphandle;   # run curl with --test-duphandle to verify handle duplication
     98 our $run_event_based; # run curl with --test-event to test the event API
     99 our $automakestyle;   # use automake-like test status output format
    100 our $anyway;          # continue anyway, even if a test fail
    101 our $CURLVERSION="";  # curl's reported version number
    102 our $CURLVERNUM="";   # curl's reported version number (without -DEV)
    103 our $randseed = 0;    # random number seed
    104 
    105 # paths
    106 our $pwd = getcwd();  # current working directory
    107 our $srcdir = $ENV{'srcdir'} || '.';  # root of the test source code
    108 our $perlcmd=shell_quote($^X);
    109 our $perl="$perlcmd -I. " . shell_quote("-I$srcdir"); # invoke perl like this
    110 our $LOGDIR="log";  # root of the log directory; this will be different for
    111                     # each runner in multiprocess mode
    112 our $LIBDIR=dirsepadd("./libtest/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
    113 our $UNITDIR=dirsepadd("./unit/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
    114 our $TUNITDIR=dirsepadd("./tunit/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
    115 our $SRVDIR=dirsepadd("./server/" . ($ENV{'CURL_DIRSUFFIX'} || ''));
    116 our $TESTDIR="$srcdir/data";
    117 our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) .
    118     "curl".exe_ext('TOOL'); # what curl binary to run on the tests
    119 our $CURLINFO=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) .
    120     "curlinfo".exe_ext('TOOL'); # what curlinfo binary to run on the tests
    121 
    122 our $VCURL=$CURL;  # what curl binary to use to verify the servers with
    123                    # VCURL is handy to set to the system one when the one you
    124                    # just built hangs or crashes and thus prevent verification
    125 # the path to the script that analyzes the memory debug output file
    126 our $memanalyze="$perl " . shell_quote("$srcdir/memanalyze.pl");
    127 our $valgrind;     # path to valgrind, or empty if disabled
    128 our $dev_null = File::Spec->devnull();   # null device path, eg: /dev/null
    129 
    130 # paths in $LOGDIR
    131 our $LOCKDIR = "lock";          # root of the server directory with lock files
    132 our $PIDDIR = "server";         # root of the server directory with PID files
    133 our $SERVERIN="server.input";   # what curl sent the server
    134 our $PROXYIN="proxy.input";     # what curl sent the proxy
    135 our $MEMDUMP="memdump";         # file that the memory debugging creates
    136 our $SERVERCMD="server.cmd";    # copy server instructions here
    137 our $DNSCMD="dnsd.cmd";         # write DNS instructions here
    138 
    139 # other config variables
    140 our @protocols;   # array of lowercase supported protocol servers
    141 our %feature;     # hash of enabled features
    142 our %keywords;    # hash of keywords from the test spec
    143 
    144 1;