globalconfig.pm 4.2 KB

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