include $(top_srcdir)/src/Common.am
+AUTOMAKE_OPTIONS = subdir-objects
# Ideally this would be 100% inline functions and macro wrappers.
testPreCompiler_SOURCES= \
testPreCompiler.h \
- testPreCompiler.cc \
- $(top_srcdir)/src/tests/testMain.cc
+ testPreCompiler.cc
testPreCompiler_LDADD= $(SQUID_CPPUNIT_LA) $(SQUID_CPPUNIT_LIBS)
testPreCompiler_LDFLAGS=
#include "squid.h"
#include "testPreCompiler.h"
+#include "unitTestMain.h"
#include <cassert>
* Please see the COPYING and CONTRIBUTORS files for details.
*/
+#ifndef SQUID_INCLUDE_UNITTESTMAIN_H
+#define SQUID_INCLUDE_UNITTESTMAIN_H
+
#include "squid.h"
#include <cppunit/BriefTestProgressListener.h>
// Add a listener that print dots as test run.
// use BriefTestProgressListener to get names of each test
// even when they pass.
+// CPPUNIT_NS::BriefTestProgressListener progress;
CPPUNIT_NS::TextTestProgressListener progress;
controller.addListener( &progress );
return result.wasSuccessful() ? 0 : 1;
}
+#endif /* SQUID_INCLUDE_UNITTESTMAIN_H */
include $(top_srcdir)/src/Common.am
+AUTOMAKE_OPTIONS = subdir-objects
+
DIST_SUBDIRS = ntlmauth profiler rfcnb smblib libTrie snmplib
SUBDIRS=
EXTRA_DIST=
util.c \
xusleep.c
-TESTS += tests/testAll
+TESTS += tests/testRFC1035 tests/testRFC1738
-check_PROGRAMS += tests/testAll
+check_PROGRAMS += tests/testRFC1035 tests/testRFC1738
-tests_testAll_SOURCES= \
+tests_testRFC1035_SOURCES= \
tests/testRFC1035.h \
- tests/testRFC1035.cc \
+ tests/testRFC1035.cc
+
+tests_testRFC1035_LDADD= \
+ $(SQUID_CPPUNIT_LA) $(SQUID_CPPUNIT_LIBS) \
+ $(top_builddir)/lib/libmiscencoding.la \
+ $(top_builddir)/lib/libmiscutil.la \
+ $(COMPAT_LIB)
+
+tests_testRFC1035_LDFLAGS = $(LIBADD_DL)
+
+tests_testRFC1738_SOURCES= \
tests/testRFC1738.h \
- tests/testRFC1738.cc \
- tests/testMain.cc
+ tests/testRFC1738.cc
-tests_testAll_LDADD= \
+tests_testRFC1738_LDADD= \
$(SQUID_CPPUNIT_LA) $(SQUID_CPPUNIT_LIBS) \
$(top_builddir)/lib/libmiscencoding.la \
$(top_builddir)/lib/libmiscutil.la \
$(COMPAT_LIB)
-tests_testAll_LDFLAGS = $(LIBADD_DL)
+tests_testRFC1738_LDFLAGS = $(LIBADD_DL)
## Special Universal .h dependency test script
+++ /dev/null
-/*
- * Copyright (C) 1996-2014 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.
- */
-
-#include "squid.h"
-
-#include <cppunit/BriefTestProgressListener.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestRunner.h>
-
-int
-main( int argc, char* argv[] )
-{
- // Create the event manager and test controller
- CPPUNIT_NS::TestResult controller;
-
- // Add a listener that colllects test result
- CPPUNIT_NS::TestResultCollector result;
- controller.addListener( &result );
-
- // Add a listener that print dots as test run.
- CPPUNIT_NS::BriefTestProgressListener progress;
- controller.addListener( &progress );
-
- // Add the top suite to the test runner
- CPPUNIT_NS::TestRunner runner;
- runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
- runner.run( controller );
-
- // Print test in a compiler compatible format.
- CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr );
- outputter.write();
-
- return result.wasSuccessful() ? 0 : 1;
-}
-
#include "squid.h"
#include "testRFC1035.h"
+#include "unitTestMain.h"
#include <cassert>
#include "squid.h"
#include "testRFC1738.h"
+#include "unitTestMain.h"
#include <cassert>
#tests_testX_SOURCES=\
# tests/testX.h \
# tests/testX.cc \
-# tests/testMain.cc \
# X.h \
# X.cc
#nodist_tests_testX_SOURCES=\
tests/stub_HttpRequest.cc \
tests/testHttpReply.cc \
tests/testHttpReply.h \
- tests/testMain.cc \
tests/stub_time.cc \
url.cc \
wordlist.h \
tests/stub_UdsOp.cc \
tests/testACLMaxUserIP.cc \
tests/testACLMaxUserIP.h \
- tests/testMain.cc \
tests/stub_time.cc \
url.cc \
URL.h \
## involved in writing tests.
tests_testBoilerplate_SOURCES = \
tests/testBoilerplate.cc \
- tests/testMain.cc \
tests/testBoilerplate.h \
tests/stub_debug.cc \
tests/stub_time.cc
String.cc \
tests/testCacheManager.cc \
tests/testCacheManager.h \
- tests/testMain.cc \
tests/stub_main_cc.cc \
tests/stub_ipc_Forwarder.cc \
tests/stub_store_stats.cc \
tests/stub_UdsOp.cc \
tests/testDiskIO.cc \
tests/testDiskIO.h \
- tests/testMain.cc \
tests/testStoreSupport.cc \
tests/testStoreSupport.h \
tests/stub_time.cc \
tests/CapturingStoreEntry.h \
tests/testEvent.cc \
tests/testEvent.h \
- tests/testMain.cc \
tests/stub_main_cc.cc \
tests/stub_ipc_Forwarder.cc \
tests/stub_libauth_acls.cc \
tests/stub_SwapDir.cc \
tests/testEventLoop.cc \
tests/testEventLoop.h \
- tests/testMain.cc \
tests/stub_main_cc.cc \
tests/stub_ipc_Forwarder.cc \
tests/stub_libauth_acls.cc \
tests/stub_tools.cc \
tests/testHttp1Parser.cc \
tests/testHttp1Parser.h \
- tests/testMain.cc \
tests/stub_time.cc \
wordlist.h \
wordlist.cc
tests/testHttpRequest.cc \
tests/testHttpRequestMethod.h \
tests/testHttpRequestMethod.cc \
- tests/testMain.cc \
tests/stub_DiskIOModule.cc \
tests/stub_libauth.cc \
tests/stub_main_cc.cc \
Transients.cc \
tests/stub_tools.cc \
tests/stub_UdsOp.cc \
- tests/testMain.cc \
tests/testStore.cc \
tests/testStore.h \
tests/testStoreEntryStream.cc \
$(SBUF_SOURCE) \
SBufDetailedStats.h \
tests/stub_SBufDetailedStats.cc \
- tests/testMain.cc \
tests/testString.cc \
tests/testString.h \
cache_cf.h \
tests_testUfs_SOURCES = \
tests/testUfs.cc \
- tests/testMain.cc \
tests/testUfs.h \
tests/stub_cache_manager.cc \
tests/stub_client_db.cc \
Transients.h \
Transients.cc \
tests/testRock.cc \
- tests/testMain.cc \
tests/testRock.h \
tests/testStoreSupport.cc \
tests/testStoreSupport.h \
tests/testURL.h \
tests/testUriScheme.cc \
tests/testUriScheme.h \
- tests/testMain.cc \
tests/stub_time.cc \
tests/stub_EventLoop.cc \
tools.h \
tests_testSBuf_SOURCES= \
tests/testSBuf.h \
tests/testSBuf.cc \
- tests/testMain.cc \
tests/SBufFindTest.h \
tests/SBufFindTest.cc \
$(SBUF_SOURCE) \
tests_testSBufList_SOURCES= \
tests/testSBufList.h \
tests/testSBufList.cc \
- tests/testMain.cc \
$(SBUF_SOURCE) \
SBufList.h \
SBufList.cc \
ConfigParser.cc \
fatal.h \
tests/stub_fatal.cc \
- tests/testMain.cc \
tests/testConfigParser.cc \
tests/testConfigParser.h \
cache_cf.h \
time.cc \
tools.h \
tests/stub_tools.cc \
- tests/testMain.cc \
tests/testStatHist.cc \
tests/testStatHist.h
nodist_tests_testStatHist_SOURCES = \
testCharacterSet.h \
testCharacterSet.cc
nodist_testCharacterSet_SOURCES = \
- $(top_srcdir)/src/tests/testMain.cc \
$(top_srcdir)/src/tests/stub_debug.cc \
$(top_srcdir)/src/tests/stub_MemBuf.cc \
$(top_srcdir)/src/tests/stub_cbdata.cc
#include "squid.h"
#include "base/CharacterSet.h"
#include "testCharacterSet.h"
+#include "unitTestMain.h"
+
#include <string>
include $(top_srcdir)/src/Common.am
+AUTOMAKE_OPTIONS = subdir-objects
+
EXTRA_LTLIBRARIES = libaufs.la libdiskd.la libufs.la librock.la
noinst_LTLIBRARIES = $(STORE_LIBS_TO_BUILD) libfs.la
testIcmp.h \
testIcmp.cc
nodist_testIcmp_SOURCES = \
- $(top_srcdir)/src/tests/testMain.cc \
$(top_srcdir)/src/SquidTime.h \
$(top_srcdir)/src/tests/stub_debug.cc \
$(top_srcdir)/src/time.cc \
#include <cppunit/TestAssert.h>
#include "testIcmp.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testIcmp );
testAddress.h
nodist_testIpAddress_SOURCES= \
$(top_srcdir)/src/tests/stub_debug.cc \
- $(top_srcdir)/src/tests/stub_tools.cc \
- $(top_srcdir)/src/tests/testMain.cc
+ $(top_srcdir)/src/tests/stub_tools.cc
testIpAddress_LDADD= \
libip.la \
../base/libbase.la \
#include "ip/Address.h"
#include "ip/tools.h"
#include "testAddress.h"
+#include "unitTestMain.h"
+
#include <cstring>
#include <stdexcept>
include $(top_srcdir)/src/Common.am
include $(top_srcdir)/src/TestHeaders.am
+AUTOMAKE_OPTIONS = subdir-objects
+
noinst_LTLIBRARIES = libipc.la
libipc_la_SOURCES = \
testTokenizer.cc \
Tokenizer.h
nodist_testTokenizer_SOURCES = \
- $(top_srcdir)/src/tests/testMain.cc \
$(top_srcdir)/src/tests/stub_libmem.cc \
$(top_srcdir)/src/tests/stub_debug.cc \
$(top_srcdir)/src/tests/stub_time.cc \
#include "base/CharacterSet.h"
#include "parser/Tokenizer.h"
#include "testTokenizer.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testTokenizer );
#include "auth/AclMaxUserIp.h"
#include "ConfigParser.h"
#include "testACLMaxUserIP.h"
+#include "unitTestMain.h"
#include <stdexcept>
#include "auth/UserRequest.h"
#include "ConfigParser.h"
#include "testAuth.h"
+#include "unitTestMain.h"
CPPUNIT_TEST_SUITE_REGISTRATION( testAuth );
CPPUNIT_TEST_SUITE_REGISTRATION( testAuthConfig );
#include "squid.h"
#include "testBoilerplate.h"
+#include "unitTestMain.h"
#include <stdexcept>
#include "mgr/Action.h"
#include "Store.h"
#include "testCacheManager.h"
+#include "unitTestMain.h"
#include <cppunit/TestAssert.h>
#include "event.h"
#include "SquidString.h"
#include "testConfigParser.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testConfigParser);
#include "SwapDir.h"
#include "testDiskIO.h"
#include "testStoreSupport.h"
+#include "unitTestMain.h"
+
#include <stdexcept>
#include "event.h"
#include "stat.h"
#include "testEvent.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testEvent );
#include "SquidTime.h"
#include "stat.h"
#include "testEventLoop.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testEventLoop );
#include "SquidConfig.h"
#include "testHttp1Parser.h"
#include "testHttp1Parser.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testHttp1Parser );
#include "mime_header.h"
#include "SquidConfig.h"
#include "testHttpReply.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpReply );
#include "HttpRequest.h"
#include "mime_header.h"
#include "testHttpRequest.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequest );
#include "SwapDir.h"
#include "testRock.h"
#include "testStoreSupport.h"
+#include "unitTestMain.h"
+
#include <stdexcept>
#if HAVE_SYS_STAT_H
#include "SBufStream.h"
#include "SquidString.h"
#include "testSBuf.h"
+#include "unitTestMain.h"
+
#include <iostream>
#include <stdexcept>
#include "SBufAlgos.h"
#include "SBufList.h"
#include "testSBufList.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testSBufList );
#include "squid.h"
#include "StatHist.h"
#include "testStatHist.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION(testStatHist);
#include "squid.h"
#include "Store.h"
#include "testStore.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testStore );
#include "event.h"
#include "SquidString.h"
#include "testString.h"
+#include "unitTestMain.h"
+
CPPUNIT_TEST_SUITE_REGISTRATION( testString );
#include "testURL.h"
#include "URL.h"
+#include "unitTestMain.h"
+
#include <sstream>
#include "SwapDir.h"
#include "testStoreSupport.h"
#include "testUfs.h"
+#include "unitTestMain.h"
+
#include <stdexcept>