xref: /curl/tests/globalconfig.pm (revision cbafcec5)
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
28package globalconfig;
29
30use strict;
31use warnings;
32
33BEGIN {
34    use base qw(Exporter);
35
36    our @EXPORT = qw(
37        $anyway
38        $automakestyle
39        $CURL
40        $CURLVERSION
41        $CURLVERNUM
42        $DATE
43        $has_shared
44        $LIBDIR
45        $listonly
46        $LOCKDIR
47        $LOGDIR
48        $memanalyze
49        $MEMDUMP
50        $perlcmd
51        $perl
52        $PIDDIR
53        $proxy_address
54        $PROXYIN
55        $pwd
56        $randseed
57        $run_duphandle
58        $run_event_based
59        $SERVERCMD
60        $SERVERIN
61        $srcdir
62        $TESTDIR
63        $torture
64        $valgrind
65        $VCURL
66        $verbose
67        %feature
68        %keywords
69        @protocols
70        $bundle
71        $dev_null
72    );
73}
74use pathhelp qw(exe_ext);
75use Cwd qw(getcwd);
76
77
78#######################################################################
79# global configuration variables
80#
81
82# config variables overridden by command-line options
83our $verbose;         # 1 to show verbose test output
84our $torture;         # 1 to enable torture testing
85our $proxy_address;   # external HTTP proxy address
86our $listonly;        # only list the tests
87our $run_duphandle;   # run curl with --test-duphandle to verify handle duplication
88our $run_event_based; # run curl with --test-event to test the event API
89our $automakestyle;   # use automake-like test status output format
90our $anyway;          # continue anyway, even if a test fail
91our $CURLVERSION="";  # curl's reported version number
92our $CURLVERNUM="";   # curl's reported version number (without -DEV)
93our $randseed = 0;    # random number seed
94
95# paths
96our $pwd = getcwd();  # current working directory
97our $srcdir = $ENV{'srcdir'} || '.';  # root of the test source code
98our $perlcmd="$^X";
99our $perl="$perlcmd -I. -I$srcdir"; # invoke perl like this
100our $LOGDIR="log";  # root of the log directory; this will be different for
101                    # each runner in multiprocess mode
102our $LIBDIR="./libtest";
103our $TESTDIR="$srcdir/data";
104our $CURL="../src/curl".exe_ext('TOOL'); # what curl binary to run on the tests
105our $VCURL=$CURL;  # what curl binary to use to verify the servers with
106                   # VCURL is handy to set to the system one when the one you
107                   # just built hangs or crashes and thus prevent verification
108# the path to the script that analyzes the memory debug output file
109our $memanalyze="$perl $srcdir/memanalyze.pl";
110our $valgrind;     # path to valgrind, or empty if disabled
111our $bundle = 0;   # use bundled server, libtest, unit binaries
112our $dev_null = ($^O eq 'MSWin32' ? 'NUL' : '/dev/null');
113
114# paths in $LOGDIR
115our $LOCKDIR = "lock";          # root of the server directory with lock files
116our $PIDDIR = "server";         # root of the server directory with PID files
117our $SERVERIN="server.input";   # what curl sent the server
118our $PROXYIN="proxy.input";     # what curl sent the proxy
119our $MEMDUMP="memdump";         # file that the memory debugging creates
120our $SERVERCMD="server.cmd";    # copy server instructions here
121
122# other config variables
123our @protocols;   # array of lowercase supported protocol servers
124our %feature;     # hash of enabled features
125our $has_shared;  # built as a shared library
126our %keywords;    # hash of keywords from the test spec
127
1281;
129