2
0

globalconfig.pm 4.3 KB

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