• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        $has_shared
42        $LIBDIR
43        $listonly
44        $LOCKDIR
45        $LOGDIR
46        $memanalyze
47        $MEMDUMP
48        $perl
49        $PIDDIR
50        $proxy_address
51        $PROXYIN
52        $pwd
53        $randseed
54        $run_event_based
55        $SERVERCMD
56        $SERVERIN
57        $srcdir
58        $TESTDIR
59        $torture
60        $valgrind
61        $VCURL
62        $verbose
63        %feature
64        %keywords
65        @protocols
66    );
67}
68use pathhelp qw(exe_ext);
69use Cwd qw(getcwd);
70
71
72#######################################################################
73# global configuration variables
74#
75
76# config variables overridden by command-line options
77our $verbose;         # 1 to show verbose test output
78our $torture;         # 1 to enable torture testing
79our $proxy_address;   # external HTTP proxy address
80our $listonly;        # only list the tests
81our $run_event_based; # run curl with --test-event to test the event API
82our $automakestyle;   # use automake-like test status output format
83our $anyway;          # continue anyway, even if a test fail
84our $CURLVERSION="";  # curl's reported version number
85our $randseed = 0;    # random number seed
86
87# paths
88our $pwd = getcwd();  # current working directory
89our $srcdir = $ENV{'srcdir'} || '.';  # root of the test source code
90our $perl="perl -I$srcdir"; # invoke perl like this
91our $LOGDIR="log";  # root of the log directory; this will be different for
92                    # each runner in multiprocess mode
93our $LIBDIR="./libtest";
94our $TESTDIR="$srcdir/data";
95our $CURL="../src/curl".exe_ext('TOOL'); # what curl binary to run on the tests
96our $VCURL=$CURL;  # what curl binary to use to verify the servers with
97                   # VCURL is handy to set to the system one when the one you
98                   # just built hangs or crashes and thus prevent verification
99# the path to the script that analyzes the memory debug output file
100our $memanalyze="$perl $srcdir/memanalyze.pl";
101our $valgrind;     # path to valgrind, or empty if disabled
102
103# paths in $LOGDIR
104our $LOCKDIR = "lock";          # root of the server directory with lock files
105our $PIDDIR = "server";         # root of the server directory with PID files
106our $SERVERIN="server.input";   # what curl sent the server
107our $PROXYIN="proxy.input";     # what curl sent the proxy
108our $MEMDUMP="memdump";         # file that the memory debugging creates
109our $SERVERCMD="server.cmd";    # copy server instructions here
110
111# other config variables
112our @protocols;   # array of lowercase supported protocol servers
113our %feature;     # hash of enabled features
114our $has_shared;  # built as a shared library
115our %keywords;    # hash of keywords from the test spec
116
1171;
118