From: Francesco Chemolli Date: Wed, 3 Jun 2020 08:29:24 +0000 (+0000) Subject: SourceLayout: Avoid including cppunit outside unit tests (#649) X-Git-Tag: SQUID_5_0_4~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45284ba33310b89e02694f54151ed3e67b332e62;p=thirdparty%2Fsquid.git SourceLayout: Avoid including cppunit outside unit tests (#649) compat/cppunit.h is needed on some soon-to-be-deprecated OSes (centos-6). But it's not necessary to include it everywhere. Change so that it is only included in unit tests --- diff --git a/compat/compat.h b/compat/compat.h index ec72e60a9d..a8967cb571 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -114,8 +114,5 @@ */ #include "compat/GnuRegex.h" -/* cppunit is not quite C++0x compatible yet */ -#include "compat/cppunit.h" - #endif /* _SQUID_COMPAT_H */ diff --git a/src/tests/testACLMaxUserIP.h b/src/tests/testACLMaxUserIP.h index 297d079e14..cc40fc1884 100644 --- a/src/tests/testACLMaxUserIP.h +++ b/src/tests/testACLMaxUserIP.h @@ -11,7 +11,7 @@ #if USE_AUTH -#include +#include "compat/cppunit.h" /* * demonstration test file, as new idioms are made they will diff --git a/src/tests/testAuth.h b/src/tests/testAuth.h index e4d9172aba..8bcdf9d2f2 100644 --- a/src/tests/testAuth.h +++ b/src/tests/testAuth.h @@ -11,7 +11,7 @@ #if USE_AUTH -#include +#include "compat/cppunit.h" /* * test the auth Config framework diff --git a/src/tests/testBoilerplate.h b/src/tests/testBoilerplate.h index 460d5b9b44..d4bc44ac48 100644 --- a/src/tests/testBoilerplate.h +++ b/src/tests/testBoilerplate.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_BOILDERPLATE_H #define SQUID_SRC_TEST_BOILDERPLATE_H -#include +#include "compat/cppunit.h" /* * demonstration test file, as new idioms are made they will diff --git a/src/tests/testCacheManager.h b/src/tests/testCacheManager.h index 07d933db22..8be302fb2b 100644 --- a/src/tests/testCacheManager.h +++ b/src/tests/testCacheManager.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_CACHEMANAGER_H #define SQUID_SRC_TEST_CACHEMANAGER_H -#include +#include "compat/cppunit.h" /* * test the CacheManager implementation diff --git a/src/tests/testCharacterSet.h b/src/tests/testCharacterSet.h index 1734ebe129..8f6c4d6acd 100644 --- a/src/tests/testCharacterSet.h +++ b/src/tests/testCharacterSet.h @@ -9,7 +9,7 @@ #ifndef SQUID_BASE_TESTCHARACTERSET_H #define SQUID_BASE_TESTCHARACTERSET_H -#include +#include "compat/cppunit.h" class testCharacterSet : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testConfigParser.h b/src/tests/testConfigParser.h index a44e365493..8e51fd219d 100644 --- a/src/tests/testConfigParser.h +++ b/src/tests/testConfigParser.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_CONFIG_PARSER_H #define SQUID_SRC_TEST_CONFIG_PARSER_H -#include +#include "compat/cppunit.h" /* * test the ConfigParser framework diff --git a/src/tests/testDiskIO.h b/src/tests/testDiskIO.h index 4d1fba31fe..4ed7ff3a4f 100644 --- a/src/tests/testDiskIO.h +++ b/src/tests/testDiskIO.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_DISKIO_H #define SQUID_SRC_TEST_DISKIO_H -#include +#include "compat/cppunit.h" /* * test the DiskIO framework diff --git a/src/tests/testEnumIterator.h b/src/tests/testEnumIterator.h index a790afd396..6439a480bd 100644 --- a/src/tests/testEnumIterator.h +++ b/src/tests/testEnumIterator.h @@ -11,7 +11,7 @@ #include "base/EnumIterator.h" -#include +#include "compat/cppunit.h" class testEnumIterator : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testEvent.h b/src/tests/testEvent.h index a96076b0b3..eb570e7207 100644 --- a/src/tests/testEvent.h +++ b/src/tests/testEvent.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_EVENT_H #define SQUID_SRC_TEST_EVENT_H -#include +#include "compat/cppunit.h" /* * test the event module. diff --git a/src/tests/testEventLoop.h b/src/tests/testEventLoop.h index 964c5322cc..e2c25fc2ad 100644 --- a/src/tests/testEventLoop.h +++ b/src/tests/testEventLoop.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_EVENTLOOP_H #define SQUID_SRC_TEST_EVENTLOOP_H -#include +#include "compat/cppunit.h" /* * test the EventLoop implementation diff --git a/src/tests/testHttp1Parser.h b/src/tests/testHttp1Parser.h index acf7d5e7fd..808b0b2fbd 100644 --- a/src/tests/testHttp1Parser.h +++ b/src/tests/testHttp1Parser.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTHTTP1PARSER_H #define SQUID_SRC_TESTS_TESTHTTP1PARSER_H -#include +#include "compat/cppunit.h" class testHttp1Parser : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testHttpReply.h b/src/tests/testHttpReply.h index d90b6534a0..d3c9c25538 100644 --- a/src/tests/testHttpReply.h +++ b/src/tests/testHttpReply.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_HTTP_REPLY_H #define SQUID_SRC_TEST_HTTP_REPLY_H -#include +#include "compat/cppunit.h" /* * test HttpReply diff --git a/src/tests/testHttpRequest.h b/src/tests/testHttpRequest.h index 72cd654b86..b9c1d196ce 100644 --- a/src/tests/testHttpRequest.h +++ b/src/tests/testHttpRequest.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_HTTP_REQUEST_H #define SQUID_SRC_TEST_HTTP_REQUEST_H -#include +#include "compat/cppunit.h" /* * test HttpRequest diff --git a/src/tests/testHttpRequestMethod.h b/src/tests/testHttpRequestMethod.h index 928f318a15..c95fd970f0 100644 --- a/src/tests/testHttpRequestMethod.h +++ b/src/tests/testHttpRequestMethod.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_HTTP_REQUEST_METHOD_H #define SQUID_SRC_TEST_HTTP_REQUEST_METHOD_H -#include +#include "compat/cppunit.h" /* * test HttpRequestMethod diff --git a/src/tests/testIcmp.h b/src/tests/testIcmp.h index 4d7e010489..ae402dc394 100644 --- a/src/tests/testIcmp.h +++ b/src/tests/testIcmp.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTICMP_H #define SQUID_SRC_TESTS_TESTICMP_H -#include +#include "compat/cppunit.h" #if USE_ICMP diff --git a/src/tests/testIpAddress.h b/src/tests/testIpAddress.h index 3de76e6bf5..c855db22a8 100644 --- a/src/tests/testIpAddress.h +++ b/src/tests/testIpAddress.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_IPADDRESS_H #define SQUID_SRC_TEST_IPADDRESS_H -#include +#include "compat/cppunit.h" /* * test the IP storage type diff --git a/src/tests/testLookupTable.h b/src/tests/testLookupTable.h index a9d311e724..d42994269a 100644 --- a/src/tests/testLookupTable.h +++ b/src/tests/testLookupTable.h @@ -9,7 +9,7 @@ #ifndef SQUID_TESTLOOKUPTABLE_H_ #define SQUID_TESTLOOKUPTABLE_H_ -#include +#include "compat/cppunit.h" class testLookupTable : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testMem.h b/src/tests/testMem.h index 263344a491..8568580e5f 100644 --- a/src/tests/testMem.h +++ b/src/tests/testMem.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTMEM_H #define SQUID_SRC_TESTS_TESTMEM_H -#include +#include "compat/cppunit.h" class testMem : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testNetDb.h b/src/tests/testNetDb.h index 9045d43582..ce734aaca7 100644 --- a/src/tests/testNetDb.h +++ b/src/tests/testNetDb.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTNETDB_H #define SQUID_SRC_TESTS_TESTNETDB_H -#include +#include "compat/cppunit.h" class testNetDb : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testPackableStream.h b/src/tests/testPackableStream.h index 6f342001fc..05c32ea390 100644 --- a/src/tests/testPackableStream.h +++ b/src/tests/testPackableStream.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTPACKABLESTREAM_H #define SQUID_SRC_TESTS_TESTPACKABLESTREAM_H -#include +#include "compat/cppunit.h" /* * test PackableStream diff --git a/src/tests/testRFC1035.h b/src/tests/testRFC1035.h index 1e130b0351..7f2be1fc12 100644 --- a/src/tests/testRFC1035.h +++ b/src/tests/testRFC1035.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_RFC1035_H #define SQUID_SRC_TEST_RFC1035_H -#include +#include "compat/cppunit.h" /* * test the DNS resolver RFC 1035 Engine diff --git a/src/tests/testRefCount.h b/src/tests/testRefCount.h index d5762fa8c8..d6b27582fc 100644 --- a/src/tests/testRefCount.h +++ b/src/tests/testRefCount.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_REFCOUNT_H #define SQUID_SRC_TEST_REFCOUNT_H -#include +#include "compat/cppunit.h" class testRefCount : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testRock.h b/src/tests/testRock.h index 211f468e73..3342e091aa 100644 --- a/src/tests/testRock.h +++ b/src/tests/testRock.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_TESTROCK_H #define SQUID_SRC_TEST_TESTROCK_H -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testSBuf.h b/src/tests/testSBuf.h index 72cbb7bebd..d07feaba5f 100644 --- a/src/tests/testSBuf.h +++ b/src/tests/testSBuf.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_TESTSBUF_H #define SQUID_SRC_TEST_TESTSBUF_H -#include +#include "compat/cppunit.h" #include "base/TextException.h" diff --git a/src/tests/testSBufList.h b/src/tests/testSBufList.h index 423df608c6..29477d3bf4 100644 --- a/src/tests/testSBufList.h +++ b/src/tests/testSBufList.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_TESTSBUF_H #define SQUID_SRC_TEST_TESTSBUF_H -#include +#include "compat/cppunit.h" class testSBufList : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testStatHist.h b/src/tests/testStatHist.h index c0f2a90bf5..1173c331e4 100644 --- a/src/tests/testStatHist.h +++ b/src/tests/testStatHist.h @@ -13,7 +13,7 @@ #ifndef TESTSTATHIST_H_ #define TESTSTATHIST_H_ -#include +#include "compat/cppunit.h" class testStatHist : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testStore.h b/src/tests/testStore.h index 91dda25118..dee168ff89 100644 --- a/src/tests/testStore.h +++ b/src/tests/testStore.h @@ -12,7 +12,7 @@ #include "Store.h" #include "store/Controlled.h" -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testStoreController.h b/src/tests/testStoreController.h index e6282813ba..544590abe0 100644 --- a/src/tests/testStoreController.h +++ b/src/tests/testStoreController.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_STORECONTROLLER_H #define SQUID_SRC_TEST_STORECONTROLLER_H -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testStoreHashIndex.h b/src/tests/testStoreHashIndex.h index a8ccd6b6e3..f237822218 100644 --- a/src/tests/testStoreHashIndex.h +++ b/src/tests/testStoreHashIndex.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_STOREHASHINDEX_H #define SQUID_SRC_TEST_STOREHASHINDEX_H -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testString.h b/src/tests/testString.h index 48899ba798..94235f47a1 100644 --- a/src/tests/testString.h +++ b/src/tests/testString.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_STRING_H #define SQUID_SRC_TEST_STRING_H -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testTokenizer.h b/src/tests/testTokenizer.h index c1bdadba69..353b917080 100644 --- a/src/tests/testTokenizer.h +++ b/src/tests/testTokenizer.h @@ -9,7 +9,7 @@ #ifndef SQUID_TESTTOKENIZER_H_ #define SQUID_TESTTOKENIZER_H_ -#include +#include "compat/cppunit.h" class testTokenizer : public CPPUNIT_NS::TestFixture { diff --git a/src/tests/testURL.h b/src/tests/testURL.h index 063cbed0ba..f0dbd073ac 100644 --- a/src/tests/testURL.h +++ b/src/tests/testURL.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_URL_H #define SQUID_SRC_TEST_URL_H -#include +#include "compat/cppunit.h" /* * test the URL class. diff --git a/src/tests/testUfs.h b/src/tests/testUfs.h index 0030d6f69e..66e4f64e3f 100644 --- a/src/tests/testUfs.h +++ b/src/tests/testUfs.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TEST_STORECONTROLLER_H #define SQUID_SRC_TEST_STORECONTROLLER_H -#include +#include "compat/cppunit.h" /* * test the store framework diff --git a/src/tests/testUriScheme.h b/src/tests/testUriScheme.h index a324cdc853..8f9d509625 100644 --- a/src/tests/testUriScheme.h +++ b/src/tests/testUriScheme.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTURISCHEME_H #define SQUID_SRC_TESTS_TESTURISCHEME_H -#include +#include "compat/cppunit.h" /* * test UriScheme diff --git a/src/tests/testYesNoNone.h b/src/tests/testYesNoNone.h index d978bf4b7b..230a73e08b 100644 --- a/src/tests/testYesNoNone.h +++ b/src/tests/testYesNoNone.h @@ -9,7 +9,7 @@ #ifndef SQUID_SRC_TESTS_TESTYESNONONE_H #define SQUID_SRC_TESTS_TESTYESNONONE_H -#include +#include "compat/cppunit.h" /* * demonstration test file, as new idioms are made they will diff --git a/test-suite/splay.cc b/test-suite/splay.cc index c17792c994..f788019d79 100644 --- a/test-suite/splay.cc +++ b/test-suite/splay.cc @@ -16,6 +16,7 @@ #include "util.h" #include +#include #if HAVE_UNISTD_H #include #endif