]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix "make check" to test headers (#1463)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Tue, 3 Oct 2023 22:38:02 +0000 (22:38 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 6 Oct 2023 08:06:19 +0000 (08:06 +0000)
A "make check" testHeaders target is supposed to check that C/C++ header
files can be compiled "autonomously" (i.e. without any other code except
the required squid.h). Since 2010 commit a0fdc9b, existing testHeaders
were not detecting problems in any headers due to a use of a shell
heredoc with echo, a command that does not read from standard input.

This fix ensures that all C/C++ header files used by "make" are tested
in the corresponding "make check".

This change also improves parallel testing of individual header files.

121 files changed:
compat/Makefile.am
configure.ac
include/splay.h
lib/Makefile.am
lib/libTrie/Makefile.am
lib/ntlmauth/Makefile.am
lib/sspi/Makefile.am
src/ClientRequestContext.h
src/Common.am
src/DiskIO/AIO/Makefile.am
src/DiskIO/Blocking/Makefile.am
src/DiskIO/DiskDaemon/Makefile.am
src/DiskIO/DiskThreads/Makefile.am
src/DiskIO/IpcIo/Makefile.am
src/DiskIO/Makefile.am
src/DiskIO/Mmapped/Makefile.am
src/HappyConnOpener.h
src/HttpUpgradeProtocolAccess.h
src/Makefile.am
src/MemObject.h
src/NeighborTypeDomainList.h
src/NullDelayId.h
src/Pipeline.h
src/ResolvedPeers.h
src/SnmpRequest.h
src/SquidConfig.h
src/TestHeaders.am
src/acl/Arp.h
src/acl/Certificate.h
src/acl/CertificateData.h
src/acl/Eui64.h
src/acl/Makefile.am
src/acl/ServerCertificate.h
src/acl/SourceDomain.h
src/adaptation/Makefile.am
src/adaptation/ecap/Makefile.am
src/adaptation/icap/Makefile.am
src/anyp/Makefile.am
src/auth/Makefile.am
src/auth/QueueNode.h
src/auth/basic/Makefile.am
src/auth/digest/Makefile.am
src/auth/digest/UserRequest.h
src/auth/digest/eDirectory/edir_ldapext.h
src/auth/forward.h
src/auth/negotiate/Makefile.am
src/auth/ntlm/Makefile.am
src/base/AsyncCall.h
src/base/AsyncCallList.h
src/base/Makefile.am
src/base/ToCpp.h [new file with mode: 0644]
src/clients/HttpTunnelerAnswer.h
src/clients/Makefile.am
src/comm/Makefile.am
src/debug/Makefile.am
src/dns/Makefile.am
src/error/Makefile.am
src/esi/Context.h
src/esi/Include.h
src/esi/Makefile.am
src/eui/Makefile.am
src/format/Makefile.am
src/fs/Makefile.am
src/fs/ufs/UFSStoreState.h
src/ftp/Makefile.am
src/helper/Makefile.am
src/helper/Request.h
src/htcp.h
src/http/Makefile.am
src/http/Stream.h
src/http/one/Makefile.am
src/icmp/Makefile.am
src/ident/Makefile.am
src/ip/Intercept.h
src/ip/Makefile.am
src/ip/NfMarkConfig.h
src/ip/QosConfig.h
src/ipc/Makefile.am
src/ipc/Response.h
src/ipc/SharedListen.h
src/log/Makefile.am
src/log/TcpLogger.h
src/mem/Makefile.am
src/mgr/Filler.h
src/mgr/Makefile.am
src/mgr/Request.h
src/parser/Makefile.am
src/proxyp/Makefile.am
src/refresh.h
src/repl/Makefile.am
src/sbuf/Makefile.am
src/security/BlindPeerConnector.h
src/security/Certificate.h
src/security/CommunicationSecrets.h
src/security/EncryptorAnswer.h
src/security/LockingPointer.h
src/security/Makefile.am
src/security/PeerOptions.h
src/security/Session.h
src/security/cert_generators/file/Makefile.am
src/security/forward.h
src/servers/FtpServer.h
src/servers/Http1Server.h
src/servers/Makefile.am
src/servers/Server.h
src/servers/forward.h
src/snmp/Forwarder.h
src/snmp/Makefile.am
src/snmp_core.h
src/ssl/Makefile.am
src/ssl/context_storage.h
src/ssl/gadgets.h
src/ssl/support.h
src/store/Makefile.am
src/store/SwapMetaOut.h
src/store/SwapMetaView.h
src/time/Makefile.am
src/whois.h
test-suite/Makefile.am
test-suite/testHeader.cc.in [new file with mode: 0644]
test-suite/testheaders.sh [deleted file]

index c819834d7d16f9d908a12cde77987a48cd98d17d..0943b865699d69c2d11fb9086fbbcf9d4cfcc3a2 100644 (file)
@@ -14,8 +14,19 @@ include $(top_srcdir)/src/Common.am
 
 # Port Specific Configurations
 
+COMPAT_SSL_ALL_SOURCES = \
+       openssl.h
+
+if ENABLE_SSL
+COMPAT_SSL_SOURCES = $(COMPAT_SSL_ALL_SOURCES)
+else
+COMPAT_SSL_SOURCES =
+EXCLUDE_FROM_HDR_TESTING += $(COMPAT_SSL_ALL_SOURCES)
+endif
+
 noinst_LTLIBRARIES = libcompatsquid.la
 libcompatsquid_la_SOURCES = \
+       $(COMPAT_SSL_SOURCES) \
        assert.cc \
        assert.h \
        cmsg.h \
@@ -34,7 +45,6 @@ libcompatsquid_la_SOURCES = \
        memrchr.cc \
        memrchr.h \
        mswindows.cc \
-       openssl.h \
        os/aix.h \
        os/android.h \
        os/dragonfly.h \
@@ -85,16 +95,3 @@ testPreCompiler_SOURCES = \
        testPreCompiler.cc
 testPreCompiler_LDADD= $(LIBCPPUNIT_LIBS)
 testPreCompiler_LDFLAGS=
-
-# os/ subdir prevents us using src/TestHeaders.am
-#
-TESTS += testHeaders
-
-## Special Universal .h dependency test script
-## aborts if error encountered
-testHeaders: $(srcdir)/*.h $(srcdir)/os/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
-
-CLEANFILES += testHeaders
-
-.PHONY: testHeaders
index c5c27c5c09512c3955a59dc93b77088f9093e718..05cc1af3a29f116df98fe56d193ca2c3b57c6c02 100644 (file)
@@ -1148,6 +1148,7 @@ AS_IF([test "x$with_openssl" = "xyes"],[
     openssl/x509v3.h \
     openssl/engine.h \
     openssl/txt_db.h \
+    openssl/pem.h \
   )
 
   # User may have provided a custom location for OpenSSL. Otherwise...
index d1d1fd00fa0d3ef89a86851d17e87cce33b9aa46..8c0f788f423c35efa30646c59f1e0025344ce4b2 100644 (file)
@@ -10,6 +10,7 @@
 #define SQUID_SPLAY_H
 
 #include "fatal.h"
+#include <cstddef>
 #include <stack>
 
 // private class of Splay. Do not use directly
index edcb0de81a6e1432fe6a19d9a3b925ccc9c398a3..77e6f48bf729acb719d5e1c6717d9c8889ad068d 100644 (file)
@@ -77,12 +77,4 @@ tests_testRFC1738_LDADD= \
 
 tests_testRFC1738_LDFLAGS = $(LIBADD_DL)
 
-
-## Special Universal .h dependency test script
-## aborts if error encountered
 testHeaders: $(top_srcdir)/include/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
-
-TESTS += testHeaders
-CLEANFILES += testHeaders
-.PHONY: testHeaders
index d3d849bd94efaa1961176dead0f422657e3fdfc3..cbd016b9d1f258ced2b430ec20c702b9857a5e53 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS = . test
 
index 1d65e170de0e5ba681f58204a53bc6e52ce59ac8..c44f12c548e51f7ae68e5be037a869c3632d879a 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 AM_CPPFLAGS += -I$(top_srcdir)/lib
 
index cfd3453426581f4713982e1f8d87dc770a97c11d..30c888b813b0a02d69f5fb433dd518eb81a78f82 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libsspwin32.la
 
index b4ad460dbfb82fd204e6f18ccf9f4926f00c85dc..16c33bba4bc84d74e5fe59d0f5be7c351bf07349 100644 (file)
@@ -9,8 +9,10 @@
 #ifndef SQUID_CLIENTREQUESTCONTEXT_H
 #define SQUID_CLIENTREQUESTCONTEXT_H
 
+#include "acl/forward.h"
 #include "base/RefCount.h"
 #include "cbdata.h"
+#include "defines.h"
 #include "dns/forward.h"
 #include "helper/forward.h"
 #include "ipcache.h"
index 99a05ac3722f9aca1016b3bbf3e0c623b7ec6329..647d4ae8b0702f2bc48e2914e36744db9d2061b7 100644 (file)
@@ -73,3 +73,5 @@ COMPAT_LIB = $(top_builddir)/compat/libcompatsquid.la $(LIBPROFILER)
 
 ## Some helpers are written in Perl and need the local shell defined properly
 subst_perlshell = sed -e 's,[@]PERL[@],$(PERL),g' <$(srcdir)/$@.pl.in >$@ || ($(RM) -f $@ ; exit 1)
+
+include $(top_srcdir)/src/TestHeaders.am
index 8890f14b8029b584c25626ecbcc485d6d9fdf65e..4b7db6ec556480259da29b180d805ea04349c55f 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libAIO.la
 
index 56bfc76398ff90b92116daf487a32828f028c476..fd5f785934e012a995921b2fe7fd36b53d002cef 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libBlocking.la
 
index 61d418991144a9592f95ce20852a465447a5835a..7abfcf628a6cbd1b127e1d6bfc3676ba40b8db6b 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libDiskDaemon.la
 libexec_PROGRAMS = diskd
index 02ee5f4e6ad6ff596b96c2088173d107b2c0525b..c417f1a6421966e1b7d4f9f0856fb4734703e195 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libDiskThreads.la
 
index 79ddfc635cc9850a5321ce4be465f0261724a49e..21fb099b494c785da2811b35b5f82013dadba29c 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libIpcIo.la
 
index a21ebd448d60e39b66673f43d273c950649d262a..1e63d62c3e39c7d4be11d08fcac3dc5cf3f73907 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS=
 
index f8b041ca517b83f0fce9ea4299c6778814087c82..f19edadc54bbff6008c4c212098f0a09c2c6f86b 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libMmapped.la
 
index 83946ee257d05bf7261f0d57fd8ff0b19e6aa5e3..9e569c71db95ed5a963f1d8232b99a60eff4fe50 100644 (file)
@@ -8,10 +8,13 @@
 
 #ifndef SQUID_HAPPYCONNOPENER_H
 #define SQUID_HAPPYCONNOPENER_H
+#include "base/AsyncCallbacks.h"
+#include "base/JobWait.h"
 #include "base/RefCount.h"
 #include "comm.h"
 #include "comm/Connection.h"
 #include "comm/ConnOpener.h"
+#include "errorpage.h"
 #include "http/forward.h"
 #include "log/forward.h"
 #include "ResolvedPeers.h"
index 078282a87d8f37e31b91a3e2c94abee37ffd29b7..d9d1574faf9f48438bcfadafc393091ae63ddb6d 100644 (file)
@@ -12,6 +12,7 @@
 #include "acl/forward.h"
 #include "sbuf/SBuf.h"
 
+#include <deque>
 #include <map>
 
 /// a reference to a protocol name[/version] string; no 0-termination is assumed
@@ -40,6 +41,8 @@ vAinB(const ProtocolView &a, const ProtocolView &b)
     return b.version.isEmpty() || (a.version == b.version);
 }
 
+class ConfigParser;
+
 /// Allows or blocks HTTP Upgrade protocols (see http_upgrade_request_protocols)
 class HttpUpgradeProtocolAccess
 {
index 26ba97859d4295cdf1df5a580f83a64b58a4a215..f187ed46f3c8082ff2f0b60ed293c53078291db4 100644 (file)
@@ -41,12 +41,14 @@ SNMP_ALL_SOURCE = \
        snmp_core.cc \
        snmp_agent.h \
        snmp_agent.cc
+
 if ENABLE_SNMP
 SNMP_SOURCE = $(SNMP_ALL_SOURCE)
 SUBDIRS += snmp
 SNMP_LIBS = snmp/libsnmp.la $(SNMPLIB)
 else
 SNMP_SOURCE =
+EXCLUDE_FROM_HDR_TESTING += $(SNMP_ALL_SOURCE)
 endif
 
 if ENABLE_ADAPTATION
@@ -100,10 +102,14 @@ if ENABLE_DELAY_POOLS
 DELAY_POOL_SOURCE = $(DELAY_POOL_ALL_SOURCE)
 else
 DELAY_POOL_SOURCE =
+EXCLUDE_FROM_HDR_TESTING += $(DELAY_POOL_ALL_SOURCE)
 endif
 
+KNOWN_HTCP_SOURCE = htcp.cc htcp.h
 if ENABLE_HTCP
-HTCPSOURCE = htcp.cc htcp.h
+HTCPSOURCE = $(KNOWN_HTCP_SOURCE)
+else
+EXCLUDE_FROM_HDR_TESTING += $(KNOWN_HTCP_SOURCE)
 endif
 
 if ENABLE_UNLINKD
@@ -772,7 +778,7 @@ check_PROGRAMS += tests/testRandomUuid
 tests_testRandomUuid_SOURCES = \
        tests/testRandomUuid.cc
 nodist_tests_testRandomUuid_SOURCES = \
-       RandomUuid.h \
+       base/RandomUuid.h \
        tests/stub_debug.cc \
        tests/stub_libmem.cc
 tests_testRandomUuid_LDADD = \
@@ -2745,16 +2751,3 @@ tests_testEventLoop_LDADD = \
        $(COMPAT_LIB) \
        $(XTRA_LIBS)
 tests_testEventLoop_LDFLAGS = $(LIBADD_DL)
-
-## Run the unit tests. check_PROGRAMS only builds the binaries.
-TESTS += $(check_PROGRAMS) testHeaders
-
-## Special Universal .h dependency test script
-## aborts if error encountered
-testHeaders: $(srcdir)/*.h $(srcdir)/DiskIO/*.h $(srcdir)/DiskIO/*/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
-## src/repl/ has no .h files and its own makefile.
-
-CLEANFILES += testHeaders
-.PHONY: testHeaders
-
index 68007662405bc083afd0ad515348ba5f8f76942b..1e842d2b2b69c9246afeb40098d62761d9bdaebb 100644 (file)
@@ -12,6 +12,7 @@
 #include "base/DelayedAsyncCalls.h"
 #include "dlink.h"
 #include "http/RequestMethod.h"
+#include "HttpReply.h"
 #include "RemovalPolicy.h"
 #include "SquidString.h"
 #include "stmem.h"
index 263e346c4c75dcce9e8e35f7b985da85502fd790..0cee01d8849c0a1588647931434588b7a06e15b4 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_NEIGHBORTYPEDOMAINLIST_H_
 #define SQUID_NEIGHBORTYPEDOMAINLIST_H_
 
+#include "enums.h"
+
 /// representation of a neighbor_type_domain configuration directive. A POD
 class NeighborTypeDomainList
 {
index 02f29d973cd816b3a3c0783b026ae6318ddae0ad..628a3af59505e272c73bea8effb692d1de5f98fd 100644 (file)
@@ -13,6 +13,7 @@
 
 #if USE_DELAY_POOLS
 #include "DelayIdComposite.h"
+#include "mem/AllocatorProxy.h"
 
 class NullDelayId : public DelayIdComposite
 {
index 2339802395ab61da87cd5e08935996d6ec0a336f..54a9e15707935402d070635007a3ea8e05071d11 100644 (file)
@@ -10,7 +10,7 @@
 #define SQUID_SRC_PIPELINE_H
 
 #include "base/RefCount.h"
-#include "http/forward.h"
+#include "http/Stream.h"
 
 #include <list>
 
index a5ae6d0832dc1b2730e75a7ef1bfb71b79216cec..c1125896cad55dc1b5cbd517c7770eee15550bba 100644 (file)
@@ -10,7 +10,8 @@
 #define SQUID_RESOLVEDPEERS_H
 
 #include "base/RefCount.h"
-#include "comm/forward.h"
+#include "comm/Connection.h"
+#include "mem/AllocatorProxy.h"
 
 #include <iosfwd>
 #include <limits>
index 3b1403b426eb680460744c27d8270129ca9092eb..b6e2315a17334e4f1697614d0b04c0e5cd59ef13 100644 (file)
@@ -10,6 +10,8 @@
 #define SQUID_SNMPREQUEST_H_
 
 #if SQUID_SNMP
+#include "acl/forward.h"
+#include "ip/Address.h"
 #include "snmp_session.h"
 
 // POD
index d9ec3d0935a7c42035996cc06df17fc1e8306465..5f1bd5fa79007a8a0eaccc2df1c994f6e9c39203 100644 (file)
@@ -23,6 +23,7 @@
 #include "MessageDelayPools.h"
 #endif
 #include "Notes.h"
+#include "security/Context.h"
 #include "security/forward.h"
 #if USE_OPENSSL
 #include "ssl/support.h"
index e88a480c44aae5a8d3a2f591f575915937c31f78..d2406ddece86f0879fb742390dc42d3e7c65255a 100644 (file)
@@ -5,21 +5,31 @@
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-## Test ./*.h files in a directory using test-suite/testheaders.sh
+# A space-separated list of header files to be skipped by
+# testHeaders during "make check"
+EXCLUDE_FROM_HDR_TESTING =
 
-## TODO: include in src/Common.am when all testHeaders users are the same.
 
-TESTS += testHeaders
-
-## .h dependency test script
-## aborts build process on errors; XXX: even with "make -k"
-testHeaders: $(srcdir)/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
+# to test header files in addition to those tested by default,
+# add an empty target named 'testHeaders' depending on the additional
+# headers to test
 
-## XXX: this is only needed because testheaders.sh creates a dummy file called
-## testHeaders and distclean does not know about it.
-## Remove when testheaders.sh and its users are fixed.
-CLEANFILES += testHeaders
+testHeaders: $(SOURCES) $(noinst_HEADERS) $(EXTRA_DIST) $(top_srcdir)/test-suite/testHeader.cc.in
+       $(MAKE) $(^:.h=.hdrtest) && cp $(TRUE) $@
 
+.h.hdrtest:
+       @SrcFilePath=`echo $< | $(SED) 's%^$(top_srcdir)/%%'`; \
+       SrcFileName=`basename $$SrcFilePath`; \
+       TargetFileName=`basename $@`; \
+       if test "$(EXCLUDE_FROM_HDR_TESTING)" != "" && echo "$(EXCLUDE_FROM_HDR_TESTING)" | $(TR) ' ' '\n' | $(FGREP) -x -q "$$SrcFileName" ; then \
+               echo "header-test: skip - $$SrcFilePath"; \
+               exit 0; \
+       fi; \
+       $(SED) "s%[@]HEADER[@]%${<}%" "$(top_srcdir)/test-suite/testHeader.cc.in" >"$$TargetFileName.cc" && \
+       echo "$(CXXCOMPILE) -c -o" "$$TargetFileName" "$$TargetFileName.cc" && \
+       if $(CXXCOMPILE) -c -o "$$TargetFileName" "$$TargetFileName.cc" ; \
+               then echo "header-test: ok - $$SrcFilePath"; $(RM) "$$TargetFileName.cc" "$$TargetFileName"; \
+               else echo "header-test: not ok - $$SrcFilePath"; exit 1; fi
 
-.PHONY: testHeaders
+TESTS += testHeaders
+CLEANFILES += testHeaders
index 50ebe9f9990c9ef78ad4a3e6e4a94b6823f26e71..a37415635f9aa612dbac0c50a03f8d082ccda0f9 100644 (file)
 #define SQUID_ACLARP_H
 
 #include "acl/Acl.h"
+#include "eui/Eui48.h"
 
 #include <set>
 
-namespace Eui
-{
-class Eui48;
-};
-
 /// \ingroup ACLAPI
 class ACLARP : public ACL
 {
index baadebce85d3a66730b8c6b3a5c0458345687f9d..5d0f546354f60849d5e1ce8381d9492ecc61b6c5 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "acl/Data.h"
 #include "acl/ParameterizedNode.h"
+#include "security/forward.h"
 #include "ssl/support.h"
 
 namespace Acl
index d9622976fa4a9c5efcc4c4c7213b8c32b151df06..cd690039a278c5022c6fdbe1789d9ac6dd575e98 100644 (file)
@@ -12,6 +12,7 @@
 #include "acl/Acl.h"
 #include "acl/Data.h"
 #include "acl/StringData.h"
+#include "security/forward.h"
 #include "ssl/support.h"
 #include <string>
 #include <list>
index ad7363f25ad2574d9079cecaadb7890f512ee583..10c97862912249d4b3b73a13cd5e7c949a2df3b3 100644 (file)
 #define SQUID_ACLEUI64_H
 
 #include "acl/Acl.h"
+#include "eui/Eui64.h"
 
 #include <set>
 
-namespace Eui
-{
-class Eui64;
-};
-
 class ACLEui64 : public ACL
 {
     MEMPROXY_CLASS(ACLEui64);
index a2904d664a4c45b550b08077caff83b5d5e9cd53..6e188ffc65d74eb02ff42ceb8c343d7b8ab457eb 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS= external
 
@@ -177,6 +176,8 @@ SSL_ACLS = \
 
 if ENABLE_SSL
 libacls_la_SOURCES += $(SSL_ACLS)
+else
+EXCLUDE_FROM_HDR_TESTING += $(SSL_ACLS)
 endif
 EXTRA_libacls_la_SOURCES += $(SSL_ACLS)
 
@@ -188,6 +189,8 @@ ADAPT_ACLS= \
 
 if ENABLE_ADAPTATION
 libacls_la_SOURCES += $(ADAPT_ACLS)
+else
+EXCLUDE_FROM_HDR_TESTING += $(ADAPT_ACLS)
 endif
 EXTRA_libacls_la_SOURCES += $(ADAPT_ACLS)
 
@@ -195,5 +198,7 @@ ARP_ACLS = Arp.cc Arp.h Eui64.cc Eui64.h
 
 if ENABLE_EUI
 libacls_la_SOURCES += $(ARP_ACLS)
+else
+EXCLUDE_FROM_HDR_TESTING += $(ARP_ACLS)
 endif
 EXTRA_libacls_la_SOURCES += $(ARP_ACLS)
index a25d641d62dc605f44e7c7f5ec50f21906f2c919..9c195aed231ab0f141b36faca4a8d95e7cee8998 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "acl/Data.h"
 #include "acl/ParameterizedNode.h"
+#include "security/forward.h"
 #include "ssl/support.h"
 
 namespace Acl
index 2a327923641fa872920d16bb67a725da587867a0..854d1a2eebadd4e1427d9b34dbe89eeecb6f43bb 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_ACLSOURCEDOMAIN_H
 #define SQUID_ACLSOURCEDOMAIN_H
 
+#include "acl/Checklist.h"
 #include "acl/Data.h"
 #include "acl/ParameterizedNode.h"
 #include "dns/forward.h"
index 87fa8bead7da0e268b56c76454acf2adc25a70fd..f9da5c42ca9580cfbb616f78b7c72da34eb8d0ad 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS =
 
index 7b0dd59969a9da637401d16561cef512b5a972f3..9045a0c0a8d4326259a69687815bb258fcf27bd4 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libecapsquid.la
 
index bc5a2953a00f5b69375e8f2fe5b6ce676e8cb713..bb6be60414da7c643a0d62b88568d04486d51844 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libicap.la
 
index 7913dcbc7e9dffdc97b3ec9cff913283b9c08cf5..62c720e2d5e08df238f47f5d064aa05a23df8202 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libanyp.la
 
index be458c9da1371f880dc131a0dd693dabbbdd9432..560bf3dadd8299eca7aa4e7cce3a0ab94e8a0d7c 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS = $(AUTH_MODULES)
 DIST_SUBDIRS = basic digest negotiate ntlm
index 128862651a03315df0d9e0b3e41af082ee6465e6..eba51701e986c56f3069b6cfb7c1cfa884f434cb 100644 (file)
@@ -9,8 +9,9 @@
 #ifndef SQUID_SRC_AUTH_QUEUENODE_H
 #define SQUID_SRC_AUTH_QUEUENODE_H
 
-#include "auth/forward.h"
+#include "auth/UserRequest.h"
 #include "cbdata.h"
+#include "mem/AllocatorProxy.h"
 
 namespace Auth
 {
index f84cbbed913ac4611bedbe11ee7de2b22afd55dd..54bdc47588b03e323fd140d8b0c4c6ff101671a2 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 DIST_SUBDIRS = \
         DB \
index cc2b9b651923c32c326bdb722b077475c38eae8a..0c74ad7d2843f74454e8d74bc5465cea3d1356d3 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 DIST_SUBDIRS= eDirectory file LDAP
 SUBDIRS= $(DIGEST_AUTH_HELPERS)
index 16433585b4a843f149fbf4b0504fd93a3e98f52f..a569cb22c8ddcb5aeceab2a909d2b90c97cb2400 100644 (file)
@@ -11,6 +11,7 @@
 
 #if HAVE_AUTH_MODULE_DIGEST
 
+#include "auth/digest/Config.h"
 #include "auth/UserRequest.h"
 
 class ConnStateData;
index 2a8051122ac39e1b124335d265a3aabd41d78b0c..e882dc82dbcc2e5eab0ac649b2a053888760a611 100644 (file)
@@ -6,5 +6,9 @@
  * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
+#if HAVE_LDAP_H
+#include <ldap.h>
+#endif
+
 int nds_get_password(LDAP *ld, char *object_dn, size_t * pwd_len, char *pwd);
 
index cf977b88a9f5caab6f7617c3fbfec8b9dad35a0a..bc4dfc2c3553a3a4bfb54c7e9b6facbdb7d484d4 100644 (file)
@@ -23,6 +23,8 @@ class Scheme;
 class SchemeConfig;
 typedef std::vector<Auth::SchemeConfig *> ConfigVector;
 
+class UserRequest;
+
 } // namespace Auth
 
 #endif /* USE_AUTH */
index 935bba2f4d85caa8c88be1ab5705394f4dc192b0..558fe3932a0629d99c7f1bc45c4807833da14988 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 DIST_SUBDIRS= kerberos SSPI wrapper
 SUBDIRS= $(NEGOTIATE_AUTH_HELPERS)
index c0f8c280b0ad23a0932f8771fa63fe66e06d3b50..b2a1176f70fa823de7483fc0bade8f5ad486bcbd 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 DIST_SUBDIRS= fake SMB_LM SSPI
 SUBDIRS= $(NTLM_AUTH_HELPERS)
index 3dc638ee6968fee1203c4ba9a8b18c01fec29e8c..7e1afb1ff2a1bb32e53357d781e215b9edaeca72 100644 (file)
@@ -10,6 +10,7 @@
 #define SQUID_ASYNCCALL_H
 
 #include "base/CodeContext.h"
+#include "base/forward.h"
 #include "base/InstanceId.h"
 #include "event.h"
 #include "RefCount.h"
@@ -39,7 +40,7 @@ class CallDialer;
 class AsyncCall: public RefCountable
 {
 public:
-    typedef RefCount <AsyncCall> Pointer;
+    using Pointer = AsyncCallPointer;
 
     AsyncCall(int aDebugSection, int aDebugLevel, const char *aName);
     ~AsyncCall() override;
index 8c0941c63094ec74b968902042e252b89ca4d12a..36dda7b46418a5cae05d7fb8f42c99343197d1d6 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef SQUID_BASE_ASYNCCALLLIST_H
 #define SQUID_BASE_ASYNCCALLLIST_H
 
-#include "base/forward.h"
+#include "base/AsyncCall.h"
 #include "base/RefCount.h"
 
 /// An efficient (but intrusive) AsyncCall storage preserving FIFO order.
index 37c1d32d06c362aa9cd422e3b1cccde54accd3ca..ba18de1f8cc652e77afe1454185f48b464c9d4fa 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libbase.la
 
@@ -69,6 +68,7 @@ libbase_la_SOURCES = \
        SupportOrVeto.h \
        TextException.cc \
        TextException.h \
+       ToCpp.h \
        TypeTraits.h \
        YesNoNone.h \
        forward.h
diff --git a/src/base/ToCpp.h b/src/base/ToCpp.h
new file mode 100644 (file)
index 0000000..ab1ff98
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
+#ifndef SQUID_SRC_BASE_TOCPP_H
+#define SQUID_SRC_BASE_TOCPP_H
+
+/// Defines a C++ equivalent of an extern "C" function.
+/// The defined C++ function name uses a _cpp suffix.
+#define CtoCpp1(function, argument)                     \
+    extern "C++" inline void function##_cpp(argument a) \
+    {                                                   \
+        function(a);                                    \
+    }
+
+#endif /* SQUID_SRC_BASE_TOCPP_H */
+
index 50018d690efad1720058377261307ed68632ebff..90237c465d032f45a9c67ea235948c9c408f660c 100644 (file)
@@ -10,7 +10,7 @@
 #define SQUID_SRC_CLIENTS_HTTP_TUNNELERANSWER_H
 
 #include "base/CbcPointer.h"
-#include "comm/forward.h"
+#include "comm/Connection.h"
 #include "http/StatusCode.h"
 #include "sbuf/SBuf.h"
 
index 2bee0ee64bae16e27bd25371d2345a171b8e5bfe..1ee7af5d76d24eb2a65181119a15c3237fa6dbfb 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libclients.la
 
index d8c63c447d680e038af658864cd81f4742ffcf67..630a238476463cdae66234c90e5a5861bf8050d2 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = \
        libcomm.la \
index 7d8fe77e4b39018450dbc8ee669ea840b601fefe..c2b11105906d81182b3290a17728ae98bd496fe0 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libdebug.la
 
index 84de533cc26b6d09bcc2c6077c5eaae34eed72f9..b5e4df89a1855e7703c9c99657a767baee9a4705 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libdns.la
 
index a1d5d65f793e404782037b0f5a472f739527fdf3..ad09fc154963f454f8ad9da38a6edae06c0feb78 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 categories.cc: forward.h $(top_srcdir)/src/mk-string-arrays.awk
        $(AWK) -f $(top_srcdir)/src/mk-string-arrays.awk ifile=error/forward.h < $(srcdir)/forward.h > $@ || ($(RM) -f $@ && exit 1)
index fd44d863c2a35e4f7e3f255ba523c6799e10ea03..73f7047093bd3b26ba576b5495fc7308382e4c68 100644 (file)
@@ -16,6 +16,7 @@
 #include "esi/Parser.h"
 #include "http/forward.h"
 #include "http/StatusCode.h"
+#include "HttpReply.h"
 
 class ESIVarState;
 class ClientHttpRequest;
index d0dc527adeab64e57ab7023beeb56de18d9cfe98..b5060a83130f88f3e63c31217a6cb35ef565fe19 100644 (file)
@@ -14,6 +14,7 @@
 #include "esi/Context.h"
 #include "esi/Element.h"
 #include "esi/Segment.h"
+#include "HttpHeader.h"
 
 class ESIInclude;
 typedef RefCount<ESIInclude> ESIIncludePtr;
index acd4a6b3df2c4389ca7d99b308e9994e14159688..3c73fcd430e324513ad0ff1090309d0bfefb1fa9 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libesi.la
 
index e6c0b6c854aad3d2f5f3cc25774dfe1b42d46606..13c37a55bc423202b97b77ff5830c75bdd13208f 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libeui.la
 
index 195d6f4198452e5adfebb8c1475f4479cfdbd158..17e7622feb168b89481749d58f4f529db10d5a19 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libformat.la
 
index 8ee268713f7d5b4800220ac24f3fd9cd80811cdc..564932494e2e89cf427a0b505060447562f897f4 100644 (file)
@@ -65,17 +65,3 @@ ufs/clean: clean
 rock/all: librock.la
 rock/clean: clean
 
-
-TESTS += testHeaders
-
-## Special Universal .h dependency test script
-## aborts if error encountered
-testHeaders: $(srcdir)/ufs/*.h $(srcdir)/rock/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
-## diskd/ has no .h files
-## aufs/ has no .h files
-## ./ has no .h files
-
-CLEANFILES += testHeaders
-
-.PHONY: testHeaders
index b252410cda30511d536b59d842e06aed7342e8a5..296bdaad77969443eca3afc933adc0ed140607ca 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_FS_UFS_UFSSTORESTATE_H
 #define SQUID_FS_UFS_UFSSTORESTATE_H
 
+#include "DiskIO/DiskFile.h"
 #include "DiskIO/IORequestor.h"
 #include "StoreIOState.h"
 
index c05da1f5fc4ddc588cc91c1e54f5a564cda8f6dc..5c5874e84f7f2af70b60dded28c0f526eac6b196 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libftp.la
 
index 54246148d2335602b2199ddc725d6358e00da7c0..4d7e9c50b39ad9be64c969a58cb169e8b28370a4 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libhelper.la
 
index f9cea94ba786603f11d79ffc9da9f58ec3d7f9f3..ec86d778093e2ca694890c17ac2523ba68cc0629 100644 (file)
@@ -9,7 +9,9 @@
 #ifndef _SQUID_SRC_HELPER_REQUEST_H
 #define _SQUID_SRC_HELPER_REQUEST_H
 
+#include "cbdata.h"
 #include "helper/forward.h"
+#include "mem/AllocatorProxy.h"
 #include "time/gadgets.h"
 
 namespace Helper
index 159a6bdd754017ee73528182d6f1719f9a7e768f..b4c02cfe84d6dafde2ad746047c0babfae4a5306 100644 (file)
@@ -11,6 +11,7 @@
 
 #if USE_HTCP
 
+#include "enums.h"
 #include "http/forward.h"
 #include "HttpHeader.h"
 #include "ip/forward.h"
@@ -45,6 +46,8 @@ void neighborsHtcpReply(const cache_key *, HtcpReplyData *, const Ip::Address &)
 /// \ingroup ServerProtocolHTCP
 void htcpOpenPorts(void);
 
+class CachePeer;
+
 /**
  * \ingroup ServerProtocolHTCP
  *
index 492fb23e734e0c6b3339641512b4f53484d688d5..a976b2024d5291b458cdeb565425e55c92f34e77 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS = one url_rewriters
 
index e0d2abef2eec1fd35b57a5f810dedacfb0b5b6c3..9708e8e1b97e6bda401f9f968248d468598d589e 100644 (file)
@@ -9,16 +9,19 @@
 #ifndef SQUID_SRC_HTTP_STREAM_H
 #define SQUID_SRC_HTTP_STREAM_H
 
+#include "clientStreamForward.h"
+#include "comm/forward.h"
+#include "debug/Stream.h"
+#include "error/Error.h"
 #include "http/forward.h"
+#include "log/forward.h"
 #include "mem/forward.h"
+#include "servers/forward.h"
 #include "StoreIOBuffer.h"
 #if USE_DELAY_POOLS
 #include "MessageBucket.h"
 #endif
 
-class clientStreamNode;
-class ClientHttpRequest;
-
 namespace Http
 {
 
index d0524059ef43878a6b5859f93db2d7f38ea9b87c..e196047cdbb3a74fa1b31e3f6ba84f83a72a28d9 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libhttp1.la
 
index 39b4030c8edec6cb85fdc8acb2d2de62a951d156..daa516b2871f186ddb7f3233d34e4e5ee6c94c5e 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 # ICMP Specific Configurations
 
index e98478e8ff70bf989d27383c3dec1f28e6118b6e..519cd6f71927545ba69ee6c63a5c1d3cfd3efd63 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libident.la
 
index 02a51298563e21058791b03e1bcdc2042d2329ad..e55cd82b1f88924e224c0bbb76cb14a908cb86d3 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef SQUID_IP_IPINTERCEPT_H
 #define SQUID_IP_IPINTERCEPT_H
 
+#include "comm/forward.h"
+
 namespace Ip
 {
 
index 30967f840418bcf953fd42c3bfb93b8077935d0c..5f64a97faad740ec0d49dde259cd9fdc39b06694 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libip.la
 
index 6aa90610e7c9d8aa34849d1728178f4e577deb30..6e2c6ed3a78e3e786a9714ce75250e98132ed47b 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "ip/forward.h"
 
+#include <iosfwd>
+
 class SBuf;
 
 namespace Ip
index 5a30e1df59886584a31a4b3d7ba083ffde01fa77..613aa0a19868e243d117b69cc09023e96c2480da 100644 (file)
@@ -10,6 +10,8 @@
 #define SQUID_QOSCONFIG_H
 
 #include "acl/forward.h"
+#include "cbdata.h"
+#include "comm/forward.h"
 #include "hier_code.h"
 #include "ip/forward.h"
 #include "ip/NfMarkConfig.h"
index e268fe2c1e04fb388c4abb9c90f8fb4f6b24784c..29c1feab97bdde754659656b9e3116d177ccdf6b 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libipc.la
 
index 51562d96c1730f2f19a8431ab46338cf4869d223..1aed2c1e059c6bd2355de9a3239fe0807bfe018f 100644 (file)
@@ -13,8 +13,8 @@
 
 #include "base/RefCount.h"
 #include "base/TypeTraits.h"
-#include "ipc/forward.h"
 #include "ipc/QuestionerId.h"
+#include "ipc/RequestId.h"
 
 namespace Ipc
 {
index 3f1ac05449c61640b17c423fc8f264eb8488550a..7a5d9127992f226c5e3f2c0fc27dccc1a2be7777 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "base/AsyncCall.h"
 #include "base/Subscription.h"
+#include "ip/Address.h"
 #include "ipc/QuestionerId.h"
 #include "ipc/RequestId.h"
 #include "ipc/StartListening.h"
index 8b8e0637d1ed26dde8f0ed918751bd1955b8466a..44e870bf6177f7a17f31fb1c8fb03f474b48c502 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 DIST_SUBDIRS= DB file
 SUBDIRS= $(LOG_DAEMON_HELPERS)
index abd4a235e200f94bd0f460e1eeaba13a528e4f55..0347a6fc39c41967f67f3364b5bfb8751b91a2f3 100644 (file)
 #include "base/JobWait.h"
 #include "comm/forward.h"
 #include "ip/Address.h"
+#include "log/forward.h"
 
 #include <list>
 
+class CommCloseCbParams;
+class CommConnectCbParams;
+class CommIoCbParams;
 class MemBlob;
 typedef RefCount<MemBlob> MemBlobPointer;
 
index 7e34f3bed4cc17880046543cf8850a8e04b32a69..d2faac996393292aafd0405a600c4c8bc3aede75 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = \
        libmem.la \
index 490d294c4fba86d17c7bf0040c6b0add0e86f5dc..10e31c1496a60b4a971093e23bb77a1b776fbf74 100644 (file)
@@ -12,7 +12,7 @@
 #define SQUID_MGR_FILLER_H
 
 #include "comm/forward.h"
-#include "ipc/forward.h"
+#include "ipc/RequestId.h"
 #include "mgr/Action.h"
 #include "mgr/StoreToCommWriter.h"
 
index e1c44afeaba562961899131eabc71f7e01a5700e..0771ce3699ebb3a8fc5b001e25fe47b0e7a7f0c1 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libmgr.la
 
index 21a89fce7b10dc079957d060c95fb1db21db7924..d917da050ae59fb61d1f002866dd120a4a9f7165 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef SQUID_MGR_REQUEST_H
 #define SQUID_MGR_REQUEST_H
 
+#include "comm/forward.h"
 #include "ipc/forward.h"
 #include "ipc/Request.h"
 #include "mgr/ActionParams.h"
index 176835a9162a387eb088f9f8b84568f12eaa9f39..7ed1a0d5c56a93d4fb3a50a0fb2009544ad5196c 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libparser.la
 
index 8b2fa1bfd42273d98cccd7e23fb346a57240d61a..f03c87c55df4a6e30918e4a904fc1ba06a4d5913 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libproxyp.la
 
index 46832a1bd29f240a53958fc915d2b1998ac96c2e..e2727132d65d85b2f4fe4e87dae2b7e220b2144f 100644 (file)
@@ -11,7 +11,8 @@
 #ifndef SQUID_REFRESH_H_
 #define SQUID_REFRESH_H_
 
-class RefreshPattern;
+#include "http/forward.h"
+#include "store/forward.h"
 
 void refreshAddToList(const char *, int, time_t, int, time_t);
 bool refreshIsCachable(const StoreEntry *);
@@ -21,6 +22,8 @@ int refreshCheckHTCP(const StoreEntry *, HttpRequest *);
 int refreshCheckDigest(const StoreEntry *, time_t delta);
 time_t getMaxAge(const char *url);
 void refreshInit(void);
+
+class RefreshPattern;
 const RefreshPattern *refreshLimits(const char *url);
 
 #endif /* SQUID_REFRESH_H_ */
index e8d9e0299fe044fbbc3230bf052cc9b38d1fd431..5af3e372022c0e35588684f33d99cbf65538645a 100644 (file)
@@ -21,16 +21,3 @@ libheap_a_SOURCES = \
        heap/store_heap_replacement.h \
        heap/store_repl_heap.cc
 
-
-## Until such time as we have a makefile in src/repl/heap etc.
-TESTS += testHeaders
-
-## Special Universal .h dependency test script
-## aborts if error encountered
-testHeaders: $(srcdir)/heap/*.h
-       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" $^ || exit 1
-## ./ has no .h files.
-## ./lru/ has no .h files.
-
-CLEANFILES += testHeaders
-.PHONY: testHeaders
index b265faa5aadbba300ded1fda33e9e50e299f0710..f36558e37d9642e31b71015a6c54dcad330a2818 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libsbuf.la
 
index c2f1a712cadf6363f38bc2bb43c18b25dda77f5a..62e19c77f519cfa9edc737cb407a1e5b41ccaa42 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_SRC_SECURITY_BLINDPEERCONNECTOR_H
 #define SQUID_SRC_SECURITY_BLINDPEERCONNECTOR_H
 
+#include "http/forward.h"
+#include "HttpRequest.h"
 #include "security/PeerConnector.h"
 
 class ErrorState;
index 04803b4e78058919a198345f2d702bc5d37ef31f..06c4a609ff3f674c30644ee16ad2f50f535e1388 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_SRC_SECURITY_CERTIFICATE_H
 #define SQUID_SRC_SECURITY_CERTIFICATE_H
 
+#include "sbuf/forward.h"
 #include "security/forward.h"
 
 // The accessing/testing functions below require a non-constant Certificate when
index e802c81ada3c1da33899afc03b16f549c0833f1e..42b734c6b38ad9044856ac044f5cc3ac0068f3d7 100644 (file)
@@ -10,7 +10,7 @@
 #define SQUID_SRC_SECURITY_COMMUNICATION_SECRETS_H
 
 #include "sbuf/SBuf.h"
-#include "security/forward.h"
+#include "security/Session.h"
 
 #include <iosfwd>
 
index 3ba646dc6f5720317a51fe221652b973b0c82e62..2b9515dc36de7cc79de58064816efdd6a15b5696 100644 (file)
@@ -10,7 +10,7 @@
 #define SQUID_SECURITY_ENCRYPTORANSWER_H
 
 #include "base/CbcPointer.h"
-#include "comm/forward.h"
+#include "comm/Connection.h"
 
 class ErrorState;
 
index 60b4d05dd6172add2f1df959ab1472d28904370e..99b4d623f4d20e08d96c33a18c9ddc3172798405 100644 (file)
 
 #endif /* USE_OPENSSL */
 
-// Macro to be used to define the C++ equivalent function of an extern "C"
-// function. The C++ function suffixed with the _cpp extension
-#define CtoCpp1(function, argument) \
-        extern "C++" inline void function ## _cpp(argument a) { \
-            function(a); \
-        }
-
 namespace Security
 {
 
index 18416f44c17b2843ffe0defc4f01ba6a484aa115..df152d5a995b49aa5a71d53a15ec7764988fed36 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS= cert_generators cert_validators
 
index 72ca02635caecd2f766ac65c2bffd272c65c024e..7aed44e5bd67a6cf28ac17e53f11e3bcdf20d3ed 100644 (file)
 
 #include "base/YesNoNone.h"
 #include "ConfigParser.h"
+#include "security/Context.h"
 #include "security/forward.h"
 #include "security/KeyData.h"
+#include "security/Session.h"
 
 class Packable;
 
index 2fcc9c1750795257dfaf446e1c912ff417808629..127f87a76f9c1a7f7ccc644c314e6b6a32ed1a18 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "base/HardFun.h"
 #include "comm/forward.h"
-#include "security/forward.h"
+#include "security/Context.h"
 #include "security/LockingPointer.h"
 
 #include <memory>
index 821c2dcc185ba8e390406e3675a77fef4b061e7c..070dc95e6083fc51446098ebdf810bfac99aa0b0 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 include $(top_srcdir)/doc/manuals/Substitute.am
 
 security_file_certgen.8: $(srcdir)/security_file_certgen.8.in Makefile
index 57191ddfd0dc6e3f69201f3ed3ce312af8732bd1..10cf9b3afa3bb5a2bafcfe8e387a005435e3de11 100644 (file)
 
 #include "base/CbDataList.h"
 #include "base/forward.h"
-#include "security/Context.h"
-#include "security/Session.h"
+#include "base/ToCpp.h"
+#include "security/LockingPointer.h"
 
 #if USE_GNUTLS && HAVE_GNUTLS_ABSTRACT_H
 #include <gnutls/abstract.h>
 #endif
 #include <list>
 #include <limits>
+#include <memory>
 #if USE_OPENSSL
 #include "compat/openssl.h"
 #if HAVE_OPENSSL_BN_H
@@ -30,6 +31,9 @@
 #if HAVE_OPENSSL_RSA_H
 #include <openssl/rsa.h>
 #endif
+#if HAVE_OPENSSL_X509_H
+#include <openssl/x509.h>
+#endif
 #endif /* USE_OPENSSL */
 #include <unordered_set>
 
index 084d0d4323e464abdab23c84af115b07ff82f431..4f6ab9264b98a2fe2d46af15b28bd8f6aae351fe 100644 (file)
@@ -15,6 +15,7 @@
 #include "base/Lock.h"
 #include "client_side.h"
 #include "comm/forward.h"
+#include "http/forward.h"
 
 namespace Ftp
 {
index 4e840ca55270f591fcc9cb5488f0c6a0060cc98e..e97a1f3335906615451e98c049415f84d8286205 100644 (file)
@@ -9,6 +9,9 @@
 #ifndef SQUID_SRC_SERVERS_HTTP1SERVER_H
 #define SQUID_SRC_SERVERS_HTTP1SERVER_H
 
+#include "client_side.h"
+#include "http/one/RequestParser.h"
+#include "http/Stream.h"
 #include "servers/forward.h"
 
 namespace Http
index 769f8e806a47d2c500a792894d688c210473342e..67d85a53a5aabbec0958f94333a010bfbd9978e9 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libservers.la
 
index f890584477616431e9f32658fa67868b14db16fd..01cfae1eff6d75185f21a671587e382059d56013 100644 (file)
@@ -17,6 +17,8 @@
 #include "BodyPipe.h"
 #include "comm/Write.h"
 #include "CommCalls.h"
+#include "error/forward.h"
+#include "http/Stream.h"
 #include "log/forward.h"
 #include "Pipeline.h"
 #include "sbuf/SBuf.h"
index 3961b89f3c0390c058c48159982b30cf31f666d3..dd08ae1a03948bd3eeb53101846439148ff88dcc 100644 (file)
@@ -24,7 +24,7 @@ class Server;
 } // namespace One
 
 /// create a new HTTP connection handler; never returns NULL
-ConnStateData *NewServer(const MasterXaction::Pointer &xact);
+ConnStateData *NewServer(const MasterXactionPointer &xact);
 
 } // namespace Http
 
@@ -32,7 +32,7 @@ namespace Https
 {
 
 /// create a new HTTPS connection handler; never returns NULL
-ConnStateData *NewServer(const MasterXaction::Pointer &xact);
+ConnStateData *NewServer(const MasterXactionPointer &xact);
 
 } // namespace Https
 
index 2932c44971f6ee25fc708c2c0db109a9ed01bbef..34bd70e78a697680c5a86983eea5ee314c30a8fe 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef SQUID_SNMPX_FORWARDER_H
 #define SQUID_SNMPX_FORWARDER_H
 
+#include "ip/forward.h"
 #include "ipc/Forwarder.h"
 #include "snmp/Pdu.h"
 #include "snmp/Session.h"
index d01733cf52c86a2d19769cebca8d824e36014ccd..70046285e1adc24372666d972e612aa8ebeb079f 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libsnmp.la
 
index 3f67c4fe1b702b70d5bae5e54fd5282828e77035..5b0f1e8474693fdd30d2e9de60de82cd202e6cde 100644 (file)
@@ -16,6 +16,7 @@
 #include "cache_snmp.h"
 #include "comm/forward.h"
 #include "ip/forward.h"
+#include "snmp_vars.h"
 
 class MemBuf;
 
index 58c46e9f09c80654bcf17ed0979dfd62ed2b4b7a..9d252a999bcac526145a8278495e815e64dcfe5e 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libsslsquid.la libsslutil.la
 
index bfc5ce408b7248715b940265e96a18c7eede1806..ed2968a3dd4ca0dda847714a9ecf12a41e07247d 100644 (file)
@@ -17,7 +17,7 @@
 #include "ip/Address.h"
 #include "mgr/Action.h"
 #include "mgr/Command.h"
-#include "security/forward.h"
+#include "security/Context.h"
 #include "ssl/gadgets.h"
 
 #include <list>
index be1e6c6320dc54ba07534e18195e2ad3f6746fd8..b4a69695133ff4b4f0d7779ecc88d5bdba17c500 100644 (file)
@@ -21,6 +21,9 @@
 #if HAVE_OPENSSL_ASN1_H
 #include <openssl/asn1.h>
 #endif
+#if HAVE_OPENSSL_PEM_H
+#include <openssl/pem.h>
+#endif
 #if HAVE_OPENSSL_TXT_DB_H
 #include <openssl/txt_db.h>
 #endif
index 3e134510c98e24bceee4d28fd537c8586b1cd703..9750416d5f945c5434d31d4236390d9496b54495 100644 (file)
@@ -17,7 +17,7 @@
 #include "comm/forward.h"
 #include "compat/openssl.h"
 #include "sbuf/SBuf.h"
-#include "security/forward.h"
+#include "security/Session.h"
 #include "ssl/gadgets.h"
 
 #if HAVE_OPENSSL_X509V3_H
index 1830f42eaeef9db369d1ee4e4352656ad3a98f28..4fbfc1e3416e2dea4c5514e111adaedb9aade2a2 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 SUBDIRS= id_rewriters
 
index b225df4ad2e243376ba375feff859279ea635ad9..0d219d965d1fc6cd58e7840fa95e219158c11eb0 100644 (file)
 #define SQUID_SRC_STORE_SWAPMETAOUT_H
 
 #include "base/HardFun.h"
+#include "base/ToCpp.h"
 #include "store/forward.h"
 
 #include <memory>
 
-// TODO: Use CtoCpp1() from security/LockingPointer.h by moving that into base/ToCpp.h or similar.
 /// C++ wrapper for the legacy xmalloc()/xcalloc() deallocator
 /// \sa xfree_cppwrapper() with a slightly different (FREE-matching) signature.
-extern "C++" inline void xfree_cpp(const void * const x) { xfree(x); }
+CtoCpp1(xfree, const void *)
 
 // TODO: Move AllocedBuf and xfree_cpp() to src/base/Memory.h or similar.
 /// memory allocated by xmalloc() or xcalloc(), to be freed by xfree()
index 4956869be96b35e95bd771a518e0106ed45432f1..c8c5ed8b75ea18624ecc7160af66112a9934af53 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_SRC_STORE_SWAPMETAVIEW_H
 #define SQUID_SRC_STORE_SWAPMETAVIEW_H
 
+#include "base/TextException.h"
 #include "store/SwapMeta.h"
 
 #include <iosfwd>
index 6a6b19cc0ddfeff4fa8c7e9ea61b3e8ba13846b8..c14e5de4775f9c242602872899ba2dd102cf3664 100644 (file)
@@ -6,7 +6,6 @@
 ##
 
 include $(top_srcdir)/src/Common.am
-include $(top_srcdir)/src/TestHeaders.am
 
 noinst_LTLIBRARIES = libtime.la
 
index 6977ad0ea7ee9c4d12dfc0223b56cb2689dfe22e..35d40caaaf3120e7d4d47e2ff861d701eb51f9f2 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef SQUID_WHOIS_H_
 #define SQUID_WHOIS_H_
 
+#include "clients/forward.h"
+
 /**
  * \defgroup ServerProtocolWhoisAPI Server-Side WHOIS API
  * \ingroup ServerProtocol
index 8becdbcb2483952983a5375f4e79172fb552ad89..b46d3851b4b8f39c1c84117e80d7d899ddeb2b4e 100644 (file)
@@ -25,7 +25,7 @@ EXTRA_DIST = \
        test-functionality.sh \
        test-sources.sh \
        test-squid-conf.sh \
-       testheaders.sh
+       testHeader.cc.in
 
 ESI_ALL_TESTS = \
        ESIExpressions
diff --git a/test-suite/testHeader.cc.in b/test-suite/testHeader.cc.in
new file mode 100644 (file)
index 0000000..0e8577b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
+/*
+ * This file is used to test whether Squid header files can be compiled on their own.
+ * See the testHeaders target in src/TestHeaders.am.
+ */
+
+#include "squid.h"
+#include "@HEADER@"
+
+int
+main(int, char **) {
+    return 0;
+}
+
diff --git a/test-suite/testheaders.sh b/test-suite/testheaders.sh
deleted file mode 100755 (executable)
index 86edf4e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
-##
-## Squid software is distributed under GPLv2+ license and includes
-## contributions from numerous individuals and organizations.
-## Please see the COPYING and CONTRIBUTORS files for details.
-##
-
-# test all header files (.h) for dependency issues.
-#
-# Ideally this test should be performed twice before any code is accepted.
-# With or without inline enabled.  This is needed because the .cci files
-#  are only included into the .h files when inline mode is enabled.
-#
-# This script should be run from the makefile with the directory path and ccflags
-#
-cc="${1}"
-shift
-for dir in /usr/bin /usr/local/bin /usr/gnu/bin
-do
-       test -x ${dir}/true && TRUE=${dir}/true
-done
-TRUE=${TRUE:-/bin/true}
-
-exitCode=0
-
-for f in $@; do
-       echo -n "Testing ${f} ..."
-    t="testhdr_`basename ${f}`"
-    if [ ! -f "$t.o" -o $f -nt "$t.o" ]; then
-        echo >$t.cc <<EOF
-/* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */
-#include "squid.h"
-#include "${f}"
-int main( int argc, char* argv[] ) { return 0; }
-EOF
-        if ${cc} -c -o $t.o $t.cc ; then
-            echo "Ok."
-        else
-            echo "Fail."
-            exitCode=1
-        fi
-        rm -f $t.cc $t.o
-    fi
-    test $exitCode -eq 0 || break
-done
-
-#who ever said that the test program needs to be meaningful?
-test $exitCode -eq 0 && cp ${TRUE} testHeaders
-exit $exitCode