commit f476bd6b324b6151c6d45a6859735d617e872b38
Author: Guenter Obiltschnig
Date: Tue Jul 11 16:33:40 2006 +0000
initial import
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 000000000..298e731a3
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,370 @@
+This is the changelog file for the C++ Portable Components.
+
+Release 1.1.2 (2006-07-07)
+==========================
+
+- Changed license to Boost license
+
+
+Release 1.1.1 (2006-04-03)
+==========================
+
+- NetSSL_OpenSSL now supports separate certificate verification
+ settings for client and server.
+- fixed SF #1460309 (enumerating network interfaces failed on 64bit Linux)
+- TCPServer no longer crashes if accept() fails
+
+
+Release 1.1.0 (2006-03-23)
+==========================
+
+- events no longer require awkward += new syntax
+- source code and documentation cleanups
+- basic support for new compilers and platforms
+
+
+Release 1.1b2 (2006-03-04)
+==========================
+
+- made NetSSL threadsafe (added locking callbacks for OpenSSL)
+- improved OpenSSL initialization (random generator seeding)
+- various changes to improve compatibility with various platforms
+
+
+Release 1.1b1 (2006-03-03)
+==========================
+
+- New Events package in Foundation. The package supports C#-style event handling
+- New Cache package in Foundation: a templates-based caching framework
+- added Any class to Foundation
+- added DBLite library
+- fixed a memory leak with layered configurations in the application
+- made POCO_DLL the default (unless POCO_STATIC is #defined)
+ It is no longer necessary to specify POCO_DLL in projects that use Poco
+ (SourceForge Patch #1408231 and Feature Request #1407575).
+- added Buffer template class to Foundation
+- added the UnicodeConverter utility class. This is mainly used for Windows Unicode support and probably of little use for anything else.
+- added Path::resolve()
+- added Windows Unicode support. This calls the Unicode variant of the Windows API functions.
+ For this to work, all strings must be UTF-8 encoded and POCO_WIN32_UTF8 must be defined in all compilation units.
+- added StreamCopier::copyToString()
+- added URIStreamOpener::unregisterStreamFactory() and new variants of URIStreamOpener::open() that also work with filesystem paths.
+ This fixes SourceForge Bug #1409064 and Feature Request #1409062.
+- added NodeIterator::currentNodeNP() to XML library
+- added some sanity checks to UTF8Encoding::convert()
+- added NetSSL - SSL support for Net library, based on OpenSSL
+- console output of processes launched with Process::launch() is now visible
+
+
+Release 1.0.0 (2006-01-19)
+==========================
+
+- removed unnecessary console output from ProcessTest
+- documentation fixes
+
+
+Release 1.0b2 (2006-01-16)
+==========================
+
+- added ProcessHandle class
+- Process::launch() now returns a ProcessHandle instead of a process ID.
+ This fixes a potential problem on Windows with Process::wait() when
+ the process terminates before wait() is called.
+- added SplitterChannel::close()
+- added Logger::destroy()
+- added POP3ClientSession::deleteMessage()
+- added test for Process::launch()
+- documentation fixes
+
+
+Release 1.0b1 (2006-01-09)
+==========================
+
+- improved recognition of Windows paths in Path::parseGuess()
+- added setCurrentLineNumber()/getCurrentLineNumber() to CountingStreamBuf
+- improvememts to StreamTokenizer and Token; fixed documentation
+- added a workaround for some strange istream behaviour with VS 2005 and FTPClientSessionTest
+- improved exception/error reporting in cppunit
+- added POP3ClientSession
+- added Process::launch() and Process::wait()
+- added Mail sample
+- added MailStream and SMTPClientSession classes
+- renamed some methods in DialogSocket to make them more general
+- NullPartHandler has moved out of HTMLForm.cpp into a separate file
+- Base64Encoder now always writes \r\n line ends
+- MessageHeader::quote has an optional addition arg controlling the treatment of whitespace
+- bugfix: MultipartReader had a problem with empty lines (\r\n sequences) in a part
+- added MailMessage and MailRecipient classes
+- added text encoding support for Windows-1252 codepage
+
+
+Release 1.0a1 (2006-01-03) [internal]
+=====================================
+
+- mediaType is used consistently to refer to a MIME media type (some occurences of contentType and mimeType have been replaced)
+- moved MediaType::quote() to MessageHeader and made it public
+- added MultipartWriter::stream()
+- Renamed AttachmentSource to PartSource and AttachmentHandler to PartHandler
+- SIGPIPE is always blocked in main thread on Unix systems
+- added EchoServer sample
+- fixed a bug in SocketImpl::setBlocking() - did exactly the opposite (value to ioctl was wrong)
+- fixed a memory leak in NotificationQueue sample
+- added comparison operators to Socket so that Sockets can be used as keys in maps
+- added Socket::setBlocking()
+- added StreamSocket::connectNB() (non-blocking connect)
+- added Observer::accepts()
+- added SocketReactor, SocketConnector and SocketAcceptor classes to support event-based socket programming
+- NamespacePrefixesStrategy now uses expat's XML_SetReturnNSTriplet().
+ The previously used separate namespace handling code has been removed.
+ This improves performance if NamespacePrefixesStrategy is used (both the n
+ amespaces and namespace-prefixes SAX2 features are used)
+- upgraded expat to 2.0 pre-release (2005-12-27) snapshot
+- added TeeInputStream and TeeOutputStream classes
+- added download sample for URIStreamOpener
+- renamed registerOpener() to registerFactory() in HTTPStreamFactory and FTPStreamFactory
+- added LineEndingConverter streams
+- added FTPClientSession
+- code and documentation clean-up
+- added DialogSocket class
+- reorganized HTTP test suites
+- added FTPClientSession and FTPStreamFactory
+- added DialogSocket class
+
+
+Release 0.96.1 (2005-12-28)
+===========================
+
+- fixed a memory leak caused by a bug in Microsoft's stream implementation (see the comment in Foundation/StreamUtil.h for an explanation)
+- added samples for Net library
+- added uptime() and startTime() to Util::Application
+- added DateTimeFormatter::format() for Timespan
+- added ErrorHandler class and better exception handling for threads
+- added poco_debugger() and poco_debugger_msg() macros
+- added project and solution files for Visual Studio 2005 (due to some bugs/leaks in Microsofts standard library - see
+ http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=e08bd793-3fef-40ff-adda-ed313e0eafcc
+ we do not recommend using this for production purposes)
+- fixed two problems with out-of-range string iterator in Path (the testsuite triggered an assertion in VC++ 8.0)
+- fixed mac line endings in a few files
+- added a workaround to the class loader that fixes strange behavior with VC++ 8.0. There seems to be a problem with typeid() not returning a valid typeinfo under certain circumstances.
+- added buffer allocator argument to buffered stream buffer templates
+- added buffer pools to HTTP to reduce memory fragmentation and to improve performance
+- added Net to Windows build.cmd script
+- added swap() to various classes that already support assignment
+- added a null pointer check in DOMWriter::writeNode()
+- fixed documentation in BinaryWriter.h and BinaryReader.h
+- added explicit support for network byte order to BinaryReader and BinaryWriter
+- added basic support for FreeBSD (needs more testing)
+- BinaryReader: renamed readRawData() to readRaw() to be consistent with BinaryWriter::writeRaw()
+- added support for uppercase output to HexBinaryEncoder.
+- added MediaType class
+- added QuotedPrintableEncoder and QuotedPrintableDecoder classes
+- renamed ObjectFactory to Instantiator. This should prevent the confusion caused by DynamicFactory and ObjectFactory. Sorry for the inconvenience if you are already using this.
+- AttachmentSource::filename() now returns const string&
+- added StringAttachmentSource
+- replaced old-style C casts with C++ casts in NetworkInterface.cpp
+- MutexImpl (WIN32): replaced InitializeCriticalSection with InitializeCriticalSectionAndSpinCount, which should increase performance on multiprocessor or multicore systems when many locks are used.
+- fixed a problem with STLport 5.0 when compiling StreamTokenizer
+- HTTPStreamOpener now also works with no-path URIs (like http://www.appinf.com)
+- fixed wrong delete usage (plain delete instead of delete [] was used in a few cases)
+- fixed a handle leak in WinTestRunner
+
+
+Release 0.95.4 (2005-11-07)
+===========================
+
+- fixed #1348006 and #1348005
+
+
+Release 0.95.3 (2005-10-28) [internal]
+======================================
+
+- updated build scripts (patch #1339015)
+- added support for AMD64 platforms (patch #1339015)
+- MultipartWriter creates its own boundary if an empty string is passed in as boundary
+- made MultipartWriter::createBoundary() public
+- fixed wrong documentation for DateTimeFormat::HTTP_FORMAT
+- added support for HTTP Basic authentication
+- added support for HTTP Cookies
+- added support for HTML forms
+
+
+Release 0.95.2 (2005-10-22) [internal]
+======================================
+
+- fixed a potential problems with streams when close in destructor fails (added try..catch block around close in destructors)
+- added HTTPServer & friends
+- added hasIdleThreads() method to NotificationQueue
+- added TCPServer and friend
+- added support for HTTP proxies to HTTPClientSession and HTTPStreamOpener
+- fixed documentation bugs (Mutex.h, ClassLoader.h)
+
+
+Relesae 0.95.1 (2005-10-15) [internal]
+======================================
+
+- Tasks can now throw custom notifications (contributed by Alex Fabijanic)
+- renamed URIFileStreamFactory to FileStreamFactory
+- added a few methods to URI (setPathEtc(), getPathEtc(), getPathAndQuery())
+- added new exception classes
+- fixed some documentation
+- added basic checks when reading a MessageHeader from a stream
+- added HTTP classes (testsuite still incomplete)
+- added MessageHeader, NameValueCollection, MultipartReader and MultipartWriter classes
+- added Timespan::useconds()
+- added ClassLoader::isLibraryLoaded()
+- Socket classes use Timespan::useconds() to fill struct timeval
+- added DatagramSocket, MulticastSocket and NetworkInterface classes
+- added socket classes and related basic stuff
+- added additonal constructor/assign to Timespan- added BasicBufferedBidirectionalStreamBuf
+- fixed a potential MT issue in Base64Decoder
+- code beautifying in [Un]BufferedStreamBuf
+- more improvements to ClassLoader
+- code cleanup and naming convention fixes (changed all *Imp classes to *Impl for consistency)
+
+
+Release 0.94.1 (2005-09-30) [internal]
+======================================
+
+- added MetaSingleton (based on a contribution by Alex Fabijanic)
+- added ClassLoader::create()
+- added ClassLoader::instance()
+- code clean-ups in FileChannel and related classes
+- added SimpleFileChannel
+- RotateAtTimeStrategy:
+ ::getNextRollover() rewritten (buggy)
+- DateTime
+ microseconds assert corrected
+ asserts in computeGregorian() (except for year - see comment in computeGregorian())
+ milliseconds calculation modified in computeGregorian()
+ microseconds assigned in computeGregorian()
+ normalize() and checkLimit() private functions to correct cases of overflow for milli/microseconds
+- LocalDateTime: added timestamp() method
+- FileChannel:
+ added "times" property (used to determine whether to use UTC or local time with RotateAtTimeStrategy)
+ ::setProperty() modified (whenever "times" property is set, methods setRotation and setArchive are
+ reinvoked to reflect the change)
+- FileChannel: added support for archived file compression and archived file purging
+- FileChannel tests modified
+- FileChannel: put LogFile, RotateStrategy and ArchiveStrategy into their own files
+- Message: added thread id field
+- PatternFormatter: added %I specifier for thread id
+- ThreadPool: PooledThread can be assigned a name
+- TaskManager: task name is reflected in thread name
+- fixed LocalDateTime::operator - (const Timespan&) [#0000004]
+- upon startup all loggers' channels are set to a console channel
+- improved search for application configuration files (see loadConfiguration()).
+- added Glob class (fixes #1249700)
+- upgraded to zlib 1.2.3 (fixes #1261712)
+- added Logger::dump()
+- fixed a wrong condition in Logger::log(const Message&)
+- Path::find() now also works with relative paths in addition to plain file names
+- added Path(const Path&, const Path&) constructor
+- added SharedPtr template
+- added Path::tryParse()
+- SAXParser::parse()/EntityResolverImpl now works for both URIs and local filesystem paths (fixes #1254812)
+
+
+Release 0.93.1 (2005-08-01)
+===========================
+
+This release contains various new features, improvements and bugfixes:
+- bugfix: UUIDGenerator throws an exception if no connected ethernet adapter can
+ be found (and thus no MAC address can be obtained)
+- added UUIDGenerator::createOne() method
+- added error handling to UUID sample application
+- added relational (==, !=, <, <=, >, >=) and arithmetic operators (+, -, +=, -=) to DateTime
+- added LocalDateTime class
+- added support for LocalDateTime to DateTimeParser and DateTimeFormatter
+- added enqueueUrgentNotification() to NotificationQueue
+- added support for timezone specifiers (%z, %Z) to PatternFormatter
+- added [] operator and count() to StringTokenizer
+- added elapsed() and isElapsed() to Timestamp
+- added tzd() to Timezone
+- added WinRegistryKey and WinService classes (Windows only)
+- added index operator and count() to StringTokenizer
+- added day/time-based log rotation (thanks to Alex Fabijanic), minor improvements to DateTimeParser
+- support for Mac OS X 10.4/gcc 4.0.0
+- added NamedMutex and NamedEvent
+- added Process::kill()
+- added NoPermissionException
+- added Task and TaskManager classes
+- added ServerApplication class
+- bugfix: EventLogChannel - _logFile was not properly initialized in one constructor
+- bugfix: File::createDirectories did not work for hierarchies deeper than three
+- added Util::FilesystemConfiguration
+- documented logging policy: log() must open channel if it hasn't been opened yet
+- FileChannel::log() opens channel if necessary
+- the application reference passed to initialize() and reinitialize() is no longer const
+- improved application logging initialization
+- fixed a problem with configuration view and property placeholders
+- fixed Util build configuration for Visual Studio
+- improved application samples
+- fixed documentation for Semaphore class
+
+
+Release 0.92.1 (2005-05-09)
+===========================
+
+This release introduces the Util library that provides support for
+configuration file parsing (different file formats), command line
+argument processing, logging configuration and a framework for
+command line/server applications.
+There have also been various changes to the Foundation library:
+- a new RefCountedObject class that acts as a base class for
+ various classes that use reference counting
+- some missing members have been added to the AutoPtr template
+- various improvements and bugfixes to the Logging framework, as well as
+ new LoggingFactory and LoggingRegistry classses, and a NullChannel class
+- the SignalHandler class (Unix platforms only)
+- ObjectFactory and DynamicFactory template classes
+- the Path::find method for searching a file in a list of directories
+- various new Exception classes
+
+
+Release 0.91.4 (2005-04-11)
+===========================
+
+This is mainly a maintenance release that adds support for QNX Neutrino
+and OpenVMS. There are also minor bugfixes and improvements.
+
+The Unix build system has been modified to work on QNX Neutrino.
+The OpenVMS build system has been fixed and works now.
+Some missing #include's have been added for QNX Neutrino.
+Foundation/String.h: icompare now supports comparison with const char*;
+the classic C version of isspace() has been used in a few places instead of the
+C++ version, this has been fixed.
+Foundation/Exception.h: IllegalStateException added.
+
+
+Release 0.91.3 (2005-03-19)
+===========================
+
+This is a maintenance release that adds support for Solaris/Sun Forte C++.
+No new features have been added.
+
+An implementation of FPEnvironment for Solaris has been included.
+All stream classes have been modified to work around an initialization
+problem that surfaced with Sun's C++ compiler when using STLport.
+Source-code compatibility with the previous release is not affected. Various
+minor changes, mostly adding missing #include's for Solaris.
+
+
+Release 0.91.2 (2005-02-27)
+===========================
+
+Minor improvements to the Unix build system. No actual changes in the
+libraries.
+
+
+Release 0.91.1 (2005-02-21)
+===========================
+
+This is the first public release of the C++ Portable Components.
+The release does not contain all features planned for the later 1.0 release
+(the NET library is missing, for example), but is already quite usable.
+Please refer to the README file for more information and instructions for
+building the libraries.
+
+
+--
+$Id: //poco/1.1.0/dist/CHANGELOG#3 $
diff --git a/CppUnit/CppUnit_vs71.sln b/CppUnit/CppUnit_vs71.sln
new file mode 100644
index 000000000..cdd04fc7a
--- /dev/null
+++ b/CppUnit/CppUnit_vs71.sln
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_VS71.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_VS71.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
+ ProjectSection(ProjectDependencies) = postProject
+ {138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ debug_shared = debug_shared
+ release_shared = release_shared
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.ActiveCfg = debug_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared.Build.0 = debug_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.ActiveCfg = release_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared.Build.0 = release_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.ActiveCfg = debug_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared.Build.0 = debug_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.ActiveCfg = release_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared.Build.0 = release_shared|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/CppUnit/CppUnit_vs71.vcproj b/CppUnit/CppUnit_vs71.vcproj
new file mode 100644
index 000000000..0422e1d25
--- /dev/null
+++ b/CppUnit/CppUnit_vs71.vcproj
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CppUnit/CppUnit_vs80.sln b/CppUnit/CppUnit_vs80.sln
new file mode 100644
index 000000000..622312720
--- /dev/null
+++ b/CppUnit/CppUnit_vs80.sln
@@ -0,0 +1,28 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppUnit", "CppUnit_vs80.vcproj", "{138BB448-808A-4FE5-A66D-78D1F8770F59}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinTestRunner", "WinTestRunner\WinTestRunner_vs80.vcproj", "{BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}"
+ ProjectSection(ProjectDependencies) = postProject
+ {138BB448-808A-4FE5-A66D-78D1F8770F59} = {138BB448-808A-4FE5-A66D-78D1F8770F59}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ debug_shared|Win32 = debug_shared|Win32
+ release_shared|Win32 = release_shared|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {138BB448-808A-4FE5-A66D-78D1F8770F59}.release_shared|Win32.Build.0 = release_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.debug_shared|Win32.Build.0 = debug_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.ActiveCfg = release_shared|Win32
+ {BA620CC4-0E7D-4B9D-88E2-6DBE5C51FCBD}.release_shared|Win32.Build.0 = release_shared|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/CppUnit/CppUnit_vs80.vcproj b/CppUnit/CppUnit_vs80.vcproj
new file mode 100644
index 000000000..5dfcf66e5
--- /dev/null
+++ b/CppUnit/CppUnit_vs80.vcproj
@@ -0,0 +1,351 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CppUnit/Makefile b/CppUnit/Makefile
new file mode 100644
index 000000000..c997ad8ad
--- /dev/null
+++ b/CppUnit/Makefile
@@ -0,0 +1,18 @@
+#
+# Makefile
+#
+# $Id: //poco/1.1.0/CppUnit/Makefile#1 $
+#
+# Makefile for Poco CppUnit
+#
+
+include $(POCO_BASE)/build/rules/global
+
+objects = CppUnitException TestDecorator TestResult TestSuite \
+ TestCase TestFailure TestRunner TextTestResult
+
+target = CppUnit
+target_version = 1
+target_libs =
+
+include $(POCO_BASE)/build/rules/lib
diff --git a/CppUnit/WinTestRunner/WinTestRunner_vs71.vcproj b/CppUnit/WinTestRunner/WinTestRunner_vs71.vcproj
new file mode 100644
index 000000000..8d670c7de
--- /dev/null
+++ b/CppUnit/WinTestRunner/WinTestRunner_vs71.vcproj
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CppUnit/WinTestRunner/WinTestRunner_vs80.vcproj b/CppUnit/WinTestRunner/WinTestRunner_vs80.vcproj
new file mode 100644
index 000000000..797d79ba7
--- /dev/null
+++ b/CppUnit/WinTestRunner/WinTestRunner_vs80.vcproj
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h b/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h
new file mode 100644
index 000000000..cda856266
--- /dev/null
+++ b/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h
@@ -0,0 +1,68 @@
+//
+// WinTestRunner.h
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/include/WinTestRunner/WinTestRunner.h#1 $
+//
+// Application shell for CppUnit's TestRunner dialog.
+//
+
+
+#ifndef WinTestRunner_H_INCLUDED
+#define WinTestRunner_H_INCLUDED
+
+
+#if defined(WinTestRunner_EXPORTS)
+ #define WinTestRunner_API __declspec(dllexport)
+#else
+ #define WinTestRunner_API __declspec(dllimport)
+#endif
+
+
+#ifndef CppUnit_CppUnit_INCLUDED
+#include "CppUnit/CppUnit.h"
+#endif
+#ifndef STD_VECTOR_INCLUDED
+#include
+#define STD_VECTOR_INCLUDED
+#endif
+#include
+
+
+CppUnit_BEGIN
+
+
+class Test;
+
+
+class WinTestRunner_API WinTestRunner
+{
+public:
+ WinTestRunner();
+ ~WinTestRunner();
+
+ void run();
+ void addTest(Test* pTest);
+
+private:
+ std::vector _tests;
+};
+
+
+class WinTestRunner_API WinTestRunnerApp: public CWinApp
+ /// A simple application class that hosts the TestRunner dialog.
+ /// Create a subclass and override the TestMain() method.
+{
+public:
+ virtual BOOL InitInstance();
+
+ virtual void TestMain() = 0;
+
+ DECLARE_MESSAGE_MAP()
+};
+
+
+CppUnit_END
+
+
+#endif // WinTestRunner_H_INCLUDED
+
diff --git a/CppUnit/WinTestRunner/res/Resource.h b/CppUnit/WinTestRunner/res/Resource.h
new file mode 100644
index 000000000..c30c88ece
--- /dev/null
+++ b/CppUnit/WinTestRunner/res/Resource.h
@@ -0,0 +1,27 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by TestRunner.rc
+//
+#define IDD_DIALOG_TESTRUNNER 129
+#define IDC_LIST 1000
+#define ID_RUN 1001
+#define ID_STOP 1002
+#define IDC_PROGRESS 1003
+#define IDC_INDICATOR 1004
+#define IDC_COMBO_TEST 1005
+#define IDC_STATIC_RUNS 1007
+#define IDC_STATIC_ERRORS 1008
+#define IDC_STATIC_FAILURES 1009
+#define IDC_EDIT_TIME 1010
+#define IDC_CHK_AUTORUN 1013
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 131
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1014
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/CppUnit/WinTestRunner/res/WinTestRunner.rc b/CppUnit/WinTestRunner/res/WinTestRunner.rc
new file mode 100644
index 000000000..71c0e8779
--- /dev/null
+++ b/CppUnit/WinTestRunner/res/WinTestRunner.rc
@@ -0,0 +1,175 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif\r\n"
+ "#include ""..\\res\\WinTestRunner.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "CppUnit WinTestRunner DLL"
+ VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "InternalName", "WinTestRunner"
+ VALUE "LegalCopyright", "Copyright (c) 2005"
+ VALUE "OriginalFilename", "TestRunner.dll"
+ VALUE "ProductName", "CppUnit WinTestRunner Dynamic Link Library"
+ VALUE "ProductVersion", "1, 0, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG_TESTRUNNER DIALOGEX 0, 0, 512, 300
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "CppUnit WinTestRunner"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ COMBOBOX IDC_COMBO_TEST,7,20,424,273,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "Run",ID_RUN,455,7,50,14
+ DEFPUSHBUTTON "Stop",ID_STOP,455,24,50,14
+ CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | WS_BORDER |
+ WS_TABSTOP,7,110,498,160
+ PUSHBUTTON "Close",IDOK,455,279,50,14
+ LTEXT "Test Name:",IDC_STATIC,7,9,179,9
+ LTEXT "Progress:",IDC_STATIC,7,55,49,9
+ LTEXT "Errors and Failures:",IDC_STATIC,7,99,67,9
+ LTEXT "Runs:",IDC_STATIC,457,54,26,10
+ LTEXT "Failures:",IDC_STATIC,457,80,26,10
+ LTEXT "Errors:",IDC_STATIC,457,67,26,10
+ RTEXT "0",IDC_STATIC_RUNS,487,54,16,10
+ RTEXT "0",IDC_STATIC_ERRORS,487,67,16,10
+ RTEXT "0",IDC_STATIC_FAILURES,487,80,16,10
+ EDITTEXT IDC_EDIT_TIME,7,281,440,12,ES_AUTOHSCROLL | ES_READONLY |
+ NOT WS_BORDER
+ LTEXT "",IDC_PROGRESS,7,67,424,20,SS_SUNKEN | NOT WS_VISIBLE
+ CONTROL "Auto Run",IDC_CHK_AUTORUN,"Button",BS_AUTOCHECKBOX |
+ BS_LEFTTEXT | WS_TABSTOP,383,38,46,10
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_DIALOG_TESTRUNNER, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 505
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 293
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif
+#include "afxres.rc" // Standard components
+#endif
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/CppUnit/WinTestRunner/src/ActiveTest.cpp b/CppUnit/WinTestRunner/src/ActiveTest.cpp
new file mode 100644
index 000000000..4baf58671
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/ActiveTest.cpp
@@ -0,0 +1,44 @@
+//
+// ActiveTest.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ActiveTest.cpp#1 $
+//
+
+
+#include
+#include "ActiveTest.h"
+
+
+CppUnit_BEGIN
+
+
+// Spawn a thread to a test
+void ActiveTest::run(TestResult* result)
+{
+ CWinThread* thread;
+
+ setTestResult(result);
+ _runCompleted.ResetEvent();
+
+ thread = AfxBeginThread(threadFunction, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
+ DuplicateHandle(GetCurrentProcess(), thread->m_hThread, GetCurrentProcess(), &_threadHandle, 0, FALSE, DUPLICATE_SAME_ACCESS);
+
+ thread->ResumeThread();
+}
+
+
+// Simple execution thread. Assuming that an ActiveTest instance
+// only creates one of these at a time.
+UINT ActiveTest::threadFunction(LPVOID thisInstance)
+{
+ ActiveTest* test = (ActiveTest*) thisInstance;
+
+ test->run();
+ test->_runCompleted.SetEvent();
+
+ return 0;
+}
+
+
+CppUnit_END
+
diff --git a/CppUnit/WinTestRunner/src/ActiveTest.h b/CppUnit/WinTestRunner/src/ActiveTest.h
new file mode 100644
index 000000000..2ccd888d3
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/ActiveTest.h
@@ -0,0 +1,93 @@
+//
+// ActiveTest.h
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ActiveTest.h#1 $
+//
+
+
+#ifndef ActiveTest_INCLUDED
+#define ActiveTest_INCLUDED
+
+
+#ifndef CppUnit_CppUnit_INCLUDED
+#include "CppUnit/CppUnit.h"
+#endif
+#ifndef CppUnit_TestDecorator_INCLUDED
+#include "CppUnit/TestDecorator.h"
+#endif
+#include
+
+
+CppUnit_BEGIN
+
+
+/* A Microsoft-specific active test
+ *
+ * An active test manages its own
+ * thread of execution. This one
+ * is very simple and only sufficient
+ * for the limited use we put it through
+ * in the TestRunner. It spawns a thread
+ * on run (TestResult *) and signals
+ * completion of the test.
+ *
+ * We assume that only one thread
+ * will be active at once for each
+ * instance.
+ *
+ */
+class ActiveTest: public TestDecorator
+{
+public:
+ ActiveTest(Test* test);
+ ~ActiveTest();
+
+ void run(TestResult* result);
+
+protected:
+ HANDLE _threadHandle;
+ CEvent _runCompleted;
+ TestResult* _currentTestResult;
+
+ void run ();
+ void setTestResult(TestResult* result);
+ static UINT threadFunction(LPVOID thisInstance);
+};
+
+
+// Construct the active test
+inline ActiveTest::ActiveTest(Test *test): TestDecorator(test)
+{
+ _currentTestResult = NULL;
+ _threadHandle = INVALID_HANDLE_VALUE;
+}
+
+
+// Pend until the test has completed
+inline ActiveTest::~ActiveTest()
+{
+ CSingleLock(&_runCompleted, TRUE);
+ CloseHandle(_threadHandle);
+}
+
+
+// Set the test result that we are to run
+inline void ActiveTest::setTestResult(TestResult* result)
+{
+ _currentTestResult = result;
+}
+
+
+// Run our test result
+inline void ActiveTest::run()
+{
+ TestDecorator::run(_currentTestResult);
+}
+
+
+CppUnit_END
+
+
+#endif // ActiveTest_INCLUDED
+
+
diff --git a/CppUnit/WinTestRunner/src/DLLMain.cpp b/CppUnit/WinTestRunner/src/DLLMain.cpp
new file mode 100644
index 000000000..e7e92204b
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/DLLMain.cpp
@@ -0,0 +1,50 @@
+//
+// DLLMain.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/DLLMain.cpp#1 $
+//
+
+
+#include
+#include
+
+
+static AFX_EXTENSION_MODULE TestRunnerDLL = { NULL, NULL };
+
+
+extern "C" int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+ // Remove this if you use lpReserved
+ UNREFERENCED_PARAMETER(lpReserved);
+
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ TRACE0("WinTestRunner.DLL Initializing\n");
+
+ // Extension DLL one-time initialization
+ if (!AfxInitExtensionModule(TestRunnerDLL, hInstance))
+ return 0;
+
+ // Insert this DLL into the resource chain
+ // NOTE: If this Extension DLL is being implicitly linked to by
+ // an MFC Regular DLL (such as an ActiveX Control)
+ // instead of an MFC application, then you will want to
+ // remove this line from DllMain and put it in a separate
+ // function exported from this Extension DLL. The Regular DLL
+ // that uses this Extension DLL should then explicitly call that
+ // function to initialize this Extension DLL. Otherwise,
+ // the CDynLinkLibrary object will not be attached to the
+ // Regular DLL's resource chain, and serious problems will
+ // result.
+
+ new CDynLinkLibrary(TestRunnerDLL);
+ }
+ else if (dwReason == DLL_PROCESS_DETACH)
+ {
+ TRACE0("WinTestRunner.DLL Terminating\n");
+ // Terminate the library before destructors are called
+ AfxTermExtensionModule(TestRunnerDLL);
+ }
+ return 1; // ok
+}
diff --git a/CppUnit/WinTestRunner/src/GUITestResult.cpp b/CppUnit/WinTestRunner/src/GUITestResult.cpp
new file mode 100644
index 000000000..9bfc65c4f
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/GUITestResult.cpp
@@ -0,0 +1,43 @@
+//
+// GUITestResult.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/GUITestResult.cpp#1 $
+//
+
+
+#include "TestRunnerDlg.h"
+#include "GUITestResult.h"
+
+
+CppUnit_BEGIN
+
+
+void GUITestResult::addError(Test *test, CppUnitException *e)
+{
+ ExclusiveZone zone(_syncObject);
+
+ TestResult::addError(test, e);
+ _runner->addError(this, test, e);
+}
+
+
+void GUITestResult::addFailure(Test *test, CppUnitException *e)
+{
+ ExclusiveZone zone(_syncObject);
+
+ TestResult::addFailure(test, e);
+ _runner->addFailure(this, test, e);
+}
+
+
+void GUITestResult::endTest(Test *test)
+{
+ ExclusiveZone zone(_syncObject);
+
+ TestResult::endTest(test);
+ _runner->endTest(this, test);
+}
+
+
+CppUnit_END
+
diff --git a/CppUnit/WinTestRunner/src/GUITestResult.h b/CppUnit/WinTestRunner/src/GUITestResult.h
new file mode 100644
index 000000000..87d0987f3
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/GUITestResult.h
@@ -0,0 +1,86 @@
+//
+// GUITestResult.h
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/GUITestResult.h#1 $
+//
+
+
+#ifndef GuiTestResult_INCLUDED
+#define GuiTestResult_INCLUDED
+
+
+#ifndef CppUnit_CppUnit_INCLUDED
+#include "CppUnit/CppUnit.h"
+#endif
+#ifndef CppUnit_TestResult_INCLUDED
+#include "CppUnit/TestResult.h"
+#endif
+#include
+
+
+CppUnit_BEGIN
+
+
+class TestRunnerDlg;
+
+
+class GUITestResult: public TestResult
+{
+public:
+ GUITestResult(TestRunnerDlg* runner);
+ ~GUITestResult();
+
+ void addError(Test* test, CppUnitException* e);
+ void addFailure(Test* test, CppUnitException* e);
+
+ void endTest(Test* test);
+ void stop();
+
+protected:
+ class LightweightSynchronizationObject: public TestResult::SynchronizationObject
+ {
+ public:
+ void lock()
+ {
+ _syncObject.Lock();
+ }
+
+ void unlock()
+ {
+ _syncObject.Unlock();
+ }
+
+ private:
+ CCriticalSection _syncObject;
+ };
+
+private:
+ TestRunnerDlg *_runner;
+};
+
+
+
+// Construct with lightweight synchronization
+inline GUITestResult::GUITestResult(TestRunnerDlg* runner): _runner(runner)
+{
+ setSynchronizationObject(new LightweightSynchronizationObject());
+}
+
+
+// Destructor
+inline GUITestResult::~GUITestResult()
+{
+}
+
+
+// Override without protection to prevent deadlock
+inline void GUITestResult::stop()
+{
+ _stop = true;
+}
+
+
+CppUnit_END
+
+
+#endif // GuiTestResult_INCLUDED
diff --git a/CppUnit/WinTestRunner/src/ProgressBar.cpp b/CppUnit/WinTestRunner/src/ProgressBar.cpp
new file mode 100644
index 000000000..dcb6b86bb
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/ProgressBar.cpp
@@ -0,0 +1,140 @@
+//
+// ProgressBar.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ProgressBar.cpp#1 $
+//
+
+
+#include "ProgressBar.h"
+
+
+CppUnit_BEGIN
+
+
+// Paint the progress bar in response to a paint message
+void ProgressBar::paint(CDC& dc)
+{
+ paintBackground (dc);
+ paintStatus (dc);
+}
+
+
+// Paint the background of the progress bar region
+void ProgressBar::paintBackground (CDC& dc)
+{
+ CBrush brshBackground;
+ CPen penGray (PS_SOLID, 1, RGB (128, 128, 128));
+ CPen penWhite (PS_SOLID, 1, RGB (255, 255, 255));
+
+ VERIFY (brshBackground.CreateSolidBrush (::GetSysColor (COLOR_BTNFACE)));
+
+ dc.FillRect (_bounds, &brshBackground);
+
+ CPen *pOldPen;
+
+ pOldPen = dc.SelectObject (&penGray);
+ {
+ dc.MoveTo (_bounds.left, _bounds.top);
+ dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top);
+
+ dc.MoveTo (_bounds.left, _bounds.top);
+ dc.LineTo (_bounds.left, _bounds.top + _bounds.Height () -1);
+
+ }
+ dc.SelectObject (&penWhite);
+ {
+ dc.MoveTo (_bounds.left + _bounds.Width () -1, _bounds.top);
+ dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
+
+ dc.MoveTo (_bounds.left, _bounds.top + _bounds.Height () -1);
+ dc.LineTo (_bounds.left + _bounds.Width () -1, _bounds.top + _bounds.Height () -1);
+
+ }
+ dc.SelectObject (pOldPen);
+
+}
+
+
+// Paint the actual status of the progress bar
+void ProgressBar::paintStatus (CDC& dc)
+{
+ if (_progress <= 0)
+ return;
+
+ CBrush brshStatus;
+ CRect rect (_bounds.left, _bounds.top,
+ _bounds.left + _progressX, _bounds.bottom);
+
+ COLORREF statusColor = getStatusColor ();
+
+ VERIFY (brshStatus.CreateSolidBrush (statusColor));
+
+ rect.DeflateRect (1, 1);
+ dc.FillRect (rect, &brshStatus);
+
+}
+
+
+// Paint the current step
+void ProgressBar::paintStep (int startX, int endX)
+{
+ // kludge: painting the whole region on each step
+ _baseWindow->RedrawWindow (_bounds);
+ _baseWindow->UpdateWindow ();
+
+}
+
+
+// Setup the progress bar for execution over a total number of steps
+void ProgressBar::start (int total)
+{
+ _total = total;
+ reset ();
+}
+
+
+// Take one step, indicating whether it was a successful step
+void ProgressBar::step (bool successful)
+{
+ _progress++;
+
+ int x = _progressX;
+
+ _progressX = scale (_progress);
+
+ if (!_error && !successful)
+ {
+ _error = true;
+ x = 1;
+ }
+
+ paintStep (x, _progressX);
+
+}
+
+
+// Map from steps to display units
+int ProgressBar::scale (int value)
+{
+ if (_total > 0)
+ return max (1, value * (_bounds.Width () - 1) / _total);
+
+ return value;
+
+}
+
+
+// Reset the progress bar
+void ProgressBar::reset ()
+{
+ _progressX = 1;
+ _progress = 0;
+ _error = false;
+
+ _baseWindow->RedrawWindow (_bounds);
+ _baseWindow->UpdateWindow ();
+
+}
+
+
+CppUnit_END
diff --git a/CppUnit/WinTestRunner/src/ProgressBar.h b/CppUnit/WinTestRunner/src/ProgressBar.h
new file mode 100644
index 000000000..df485cf26
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/ProgressBar.h
@@ -0,0 +1,76 @@
+//
+// ProgressBar.h
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/ProgressBar.h#1 $
+//
+
+
+#ifndef ProgressBar_INCLUDED
+#define ProgressBar_INCLUDED
+
+
+#ifndef CppUnit_CppUnit_INCLUDED
+#include "CppUnit/CppUnit.h"
+#endif
+#include
+
+
+CppUnit_BEGIN
+
+
+/* A Simple ProgressBar for test execution display
+ */
+class ProgressBar
+{
+public:
+ ProgressBar(CWnd* baseWindow, CRect& bounds);
+
+ void step(bool successful);
+ void paint(CDC& dc);
+ int scale(int value);
+ void reset();
+ void start(int total);
+
+protected:
+ void paintBackground(CDC& dc);
+ void paintStatus(CDC& dc);
+ COLORREF getStatusColor();
+ void paintStep(int startX, int endX);
+
+ CWnd* _baseWindow;
+ CRect _bounds;
+
+ bool _error;
+ int _total;
+ int _progress;
+ int _progressX;
+};
+
+
+// Construct a ProgressBar
+inline ProgressBar::ProgressBar(CWnd* baseWindow, CRect& bounds):
+ _baseWindow(baseWindow),
+ _bounds(bounds),
+ _error(false),
+ _total(0),
+ _progress(0),
+ _progressX(0)
+{
+ WINDOWINFO wi;
+ wi.cbSize = sizeof(WINDOWINFO);
+ baseWindow->GetWindowInfo(&wi);
+ _bounds.OffsetRect(-wi.rcClient.left, -wi.rcClient.top);
+}
+
+
+// Get the current color
+inline COLORREF ProgressBar::getStatusColor()
+{
+ return _error ? RGB(255, 0, 0) : RGB(0, 255, 0);
+}
+
+
+CppUnit_END
+
+
+#endif // ProgressBar_INCLUDED
diff --git a/CppUnit/WinTestRunner/src/SynchronizedTestResult.h b/CppUnit/WinTestRunner/src/SynchronizedTestResult.h
new file mode 100644
index 000000000..84f461547
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/SynchronizedTestResult.h
@@ -0,0 +1,106 @@
+#ifndef SYNCHRONIZEDTESTRESULTDECORATOR_H
+#define SYNCHRONIZEDTESTRESULTDECORATOR_H
+
+#include
+#include "TestResultDecorator.h"
+
+class SynchronizedTestResult : public TestResultDecorator
+{
+public:
+ SynchronizedTestResult (TestResult *result);
+ ~SynchronizedTestResult ();
+
+
+ bool shouldStop ();
+ void addError (Test *test, CppUnitException *e);
+ void addFailure (Test *test, CppUnitException *e);
+ void startTest (Test *test);
+ void endTest (Test *test);
+ int runTests ();
+ int testErrors ();
+ int testFailures ();
+ bool wasSuccessful ();
+ void stop ();
+
+ vector& errors ();
+ vector& failures ();
+
+private:
+ CCriticalSection m_criticalSection;
+
+};
+
+
+// Constructor
+inline SynchronizedTestResult::SynchronizedTestResult (TestResult *result)
+: TestResultDecorator (result) {}
+
+// Destructor
+inline SynchronizedTestResult::~SynchronizedTestResult ()
+{}
+
+// Returns whether the test should stop
+inline bool SynchronizedTestResult::shouldStop ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->shouldStop (); }
+
+
+// Adds an error to the list of errors. The passed in exception
+// caused the error
+inline void SynchronizedTestResult::addError (Test *test, CppUnitException *e)
+{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addError (test, e); }
+
+
+// Adds a failure to the list of failures. The passed in exception
+// caused the failure.
+inline void SynchronizedTestResult::addFailure (Test *test, CppUnitException *e)
+{ CSingleLock sync (&m_criticalSection, TRUE); m_result->addFailure (test, e); }
+
+
+// Informs the result that a test will be started.
+inline void SynchronizedTestResult::startTest (Test *test)
+{ CSingleLock sync (&m_criticalSection, TRUE); m_result->startTest (test); }
+
+
+// Informs the result that a test was completed.
+inline void SynchronizedTestResult::endTest (Test *test)
+{ CSingleLock sync (&m_criticalSection, TRUE); m_result->endTest (test); }
+
+
+// Gets the number of run tests.
+inline int SynchronizedTestResult::runTests ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->runTests (); }
+
+
+// Gets the number of detected errors.
+inline int SynchronizedTestResult::testErrors ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testErrors (); }
+
+
+// Gets the number of detected failures.
+inline int SynchronizedTestResult::testFailures ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->testFailures (); }
+
+
+// Returns whether the entire test was successful or not.
+inline bool SynchronizedTestResult::wasSuccessful ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->wasSuccessful (); }
+
+
+// Marks that the test run should stop.
+inline void SynchronizedTestResult::stop ()
+{ CSingleLock sync (&m_criticalSection, TRUE); m_result->stop (); }
+
+
+// Returns a vector of the errors.
+inline vector& SynchronizedTestResult::errors ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->errors (); }
+
+
+// Returns a vector of the failures.
+inline vector& SynchronizedTestResult::failures ()
+{ CSingleLock sync (&m_criticalSection, TRUE); return m_result->failures (); }
+
+
+#endif
+
+
diff --git a/CppUnit/WinTestRunner/src/TestResultDecorator.h b/CppUnit/WinTestRunner/src/TestResultDecorator.h
new file mode 100644
index 000000000..ed2d46212
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/TestResultDecorator.h
@@ -0,0 +1,102 @@
+#ifndef CPP_UNIT_TESTRESULTDECORATOR_H
+#define CPP_UNIT_TESTRESULTDECORATOR_H
+
+#include "TestResult.h"
+
+class TestResultDecorator
+{
+public:
+ TestResultDecorator (TestResult *result);
+ virtual ~TestResultDecorator ();
+
+
+ virtual bool shouldStop ();
+ virtual void addError (Test *test, CppUnitException *e);
+ virtual void addFailure (Test *test, CppUnitException *e);
+ virtual void startTest (Test *test);
+ virtual void endTest (Test *test);
+ virtual int runTests ();
+ virtual int testErrors ();
+ virtual int testFailures ();
+ virtual bool wasSuccessful ();
+ virtual void stop ();
+
+ vector& errors ();
+ vector& failures ();
+
+protected:
+ TestResult *m_result;
+};
+
+
+inline TestResultDecorator::TestResultDecorator (TestResult *result)
+: m_result (result) {}
+
+inline TestResultDecorator::~TestResultDecorator ()
+{}
+
+// Returns whether the test should stop
+inline bool TestResultDecorator::shouldStop ()
+{ return m_result->shouldStop (); }
+
+
+// Adds an error to the list of errors. The passed in exception
+// caused the error
+inline void TestResultDecorator::addError (Test *test, CppUnitException *e)
+{ m_result->addError (test, e); }
+
+
+// Adds a failure to the list of failures. The passed in exception
+// caused the failure.
+inline void TestResultDecorator::addFailure (Test *test, CppUnitException *e)
+{ m_result->addFailure (test, e); }
+
+
+// Informs the result that a test will be started.
+inline void TestResultDecorator::startTest (Test *test)
+{ m_result->startTest (test); }
+
+
+// Informs the result that a test was completed.
+inline void TestResultDecorator::endTest (Test *test)
+{ m_result->endTest (test); }
+
+
+// Gets the number of run tests.
+inline int TestResultDecorator::runTests ()
+{ return m_result->runTests (); }
+
+
+// Gets the number of detected errors.
+inline int TestResultDecorator::testErrors ()
+{ return m_result->testErrors (); }
+
+
+// Gets the number of detected failures.
+inline int TestResultDecorator::testFailures ()
+{ return m_result->testFailures (); }
+
+
+// Returns whether the entire test was successful or not.
+inline bool TestResultDecorator::wasSuccessful ()
+{ return m_result->wasSuccessful (); }
+
+
+// Marks that the test run should stop.
+inline void TestResultDecorator::stop ()
+{ m_result->stop (); }
+
+
+// Returns a vector of the errors.
+inline vector& TestResultDecorator::errors ()
+{ return m_result->errors (); }
+
+
+// Returns a vector of the failures.
+inline vector& TestResultDecorator::failures ()
+{ return m_result->failures (); }
+
+
+#endif
+
+
diff --git a/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp b/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp
new file mode 100644
index 000000000..f8e777353
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp
@@ -0,0 +1,424 @@
+//
+// TestRunnerDlg.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/TestRunnerDlg.cpp#1 $
+//
+
+
+#include
+#include
+#include
+#include
+#include "TestRunnerDlg.h"
+#include "ActiveTest.h"
+#include "GUITestResult.h"
+#include "ProgressBar.h"
+#include "CppUnit/TestSuite.h"
+#include "TestRunnerDlg.h"
+
+
+CppUnit_BEGIN
+
+
+TestRunnerDlg::TestRunnerDlg(CWnd* pParent): CDialog(TestRunnerDlg::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(TestRunnerDlg)
+ // NOTE: the ClassWizard will add member initialization here
+ //}}AFX_DATA_INIT
+
+ _testsProgress = 0;
+ _selectedTest = 0;
+}
+
+
+void TestRunnerDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(TestRunnerDlg)
+ // NOTE: the ClassWizard will add DDX and DDV calls here
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(TestRunnerDlg, CDialog)
+ //{{AFX_MSG_MAP(TestRunnerDlg)
+ ON_BN_CLICKED(ID_RUN, OnRun)
+ ON_BN_CLICKED(ID_STOP, OnStop)
+ ON_CBN_SELCHANGE(IDC_COMBO_TEST, OnSelchangeComboTest)
+ ON_BN_CLICKED(IDC_CHK_AUTORUN, OnBnClickedAutorun)
+ ON_WM_PAINT()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+BOOL TestRunnerDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
+ CComboBox *comboBox = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
+
+ ASSERT (listCtrl);
+ ASSERT (comboBox);
+
+ CString title;
+ GetWindowText(title);
+#if defined(_DEBUG)
+ title.Append(" [debug]");
+#else
+ title.Append(" [release]");
+#endif
+ SetWindowText(title);
+
+ listCtrl->InsertColumn (0,"Type", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("Type"), 1);
+ listCtrl->InsertColumn (1,"Name", LVCFMT_LEFT, 16 * listCtrl->GetStringWidth ("X"), 2);
+ listCtrl->InsertColumn (2,"Failed Condition", LVCFMT_LEFT, 24 * listCtrl->GetStringWidth ("M"), 3);
+ listCtrl->InsertColumn (3,"Line", LVCFMT_LEFT, 16 + listCtrl->GetStringWidth ("0000"), 4);
+ listCtrl->InsertColumn (4,"File Name", LVCFMT_LEFT, 36 * listCtrl->GetStringWidth ("M"), 5);
+
+ int numberOfCases = 0;
+
+ CWinApp* pApp = AfxGetApp();
+ CString lastTestCS = pApp->GetProfileString("Tests", "lastTest");
+ std::string lastTest((LPCSTR) lastTestCS);
+ int sel = -1;
+ for (std::vector::iterator it = _tests.begin (); it != _tests.end (); ++it)
+ {
+ std::string cbName(it->level*4, ' ');
+ cbName.append(it->pTest->toString());
+ comboBox->AddString (cbName.c_str ());
+ if (sel < 0)
+ {
+ if (lastTest.empty() || lastTest == it->pTest->toString())
+ {
+ _selectedTest = it->pTest;
+ sel = numberOfCases;
+ }
+ }
+ numberOfCases++;
+ }
+
+ if (numberOfCases > 0)
+ {
+ if (sel < 0)
+ {
+ _selectedTest = _tests[0].pTest;
+ sel = 0;
+ }
+ comboBox->SetCurSel (sel);
+ }
+ else
+ {
+ beRunDisabled ();
+ }
+ CWnd *pProgress = GetDlgItem(IDC_PROGRESS);
+ CRect rect;
+ pProgress->GetWindowRect(&rect);
+ _testsProgress = new ProgressBar (this, rect);
+
+ CButton* autoRunBtn = (CButton*) GetDlgItem(IDC_CHK_AUTORUN);
+ autoRunBtn->SetCheck(pApp->GetProfileInt("Tests", "autoRun", BST_UNCHECKED));
+
+ reset ();
+
+ if (autoRunBtn->GetCheck() == BST_CHECKED)
+ {
+ OnRun();
+ }
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+
+TestRunnerDlg::~TestRunnerDlg ()
+{
+ freeState ();
+ delete _testsProgress;
+}
+
+
+void TestRunnerDlg::OnRun()
+{
+ if (_selectedTest == 0)
+ return;
+
+ freeState ();
+ reset ();
+
+ beRunning ();
+
+ int numberOfTests = _selectedTest->countTestCases ();
+
+ _testsProgress->start (numberOfTests);
+
+ _result = new GUITestResult ((TestRunnerDlg *)this);
+ _activeTest = new ActiveTest (_selectedTest);
+
+ _testStartTime = timeGetTime ();
+
+ _activeTest->run (_result);
+
+ _testEndTime = timeGetTime ();
+
+}
+
+
+void TestRunnerDlg::addListEntry(const std::string& type, TestResult *result, Test *test, CppUnitException *e)
+{
+ char stage [80];
+ LV_ITEM lvi;
+ CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
+ int currentEntry = result->testErrors () + result->testFailures () -1;
+
+ sprintf (stage, "%s", type.c_str ());
+
+ lvi.mask = LVIF_TEXT;
+ lvi.iItem = currentEntry;
+ lvi.iSubItem = 0;
+ lvi.pszText = stage;
+ lvi.iImage = 0;
+ lvi.stateMask = 0;
+ lvi.state = 0;
+
+ listCtrl->InsertItem (&lvi);
+
+ // Set class string
+ listCtrl->SetItemText (currentEntry, 1, test->toString ().c_str ());
+
+ // Set the asserted text
+ listCtrl->SetItemText(currentEntry, 2, e->what ());
+
+ // Set the line number
+ if (e->lineNumber () == CppUnitException::CPPUNIT_UNKNOWNLINENUMBER)
+ sprintf (stage, "");
+ else
+ sprintf (stage, "%ld", e->lineNumber ());
+
+ listCtrl->SetItemText(currentEntry, 3, stage);
+
+ // Set the file name
+ listCtrl->SetItemText(currentEntry, 4, e->fileName ().c_str ());
+
+ listCtrl->RedrawItems (currentEntry, currentEntry);
+ listCtrl->UpdateWindow ();
+
+}
+
+
+void TestRunnerDlg::addError (TestResult *result, Test *test, CppUnitException *e)
+{
+ addListEntry ("Error", result, test, e);
+ _errors++;
+
+ updateCountsDisplay ();
+
+}
+
+
+void TestRunnerDlg::addFailure (TestResult *result, Test *test, CppUnitException *e)
+{
+ addListEntry ("Failure", result, test, e);
+ _failures++;
+
+ updateCountsDisplay ();
+
+}
+
+
+void TestRunnerDlg::endTest (TestResult *result, Test *test)
+{
+ if (_selectedTest == 0)
+ return;
+
+ _testsRun++;
+ updateCountsDisplay ();
+ _testsProgress->step (_failures == 0 && _errors == 0);
+
+ _testEndTime = timeGetTime ();
+
+ updateCountsDisplay ();
+
+ if (_testsRun >= _selectedTest->countTestCases ())
+ beIdle ();
+}
+
+
+void TestRunnerDlg::beRunning ()
+{
+ CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
+ CButton *closeButton = (CButton *)GetDlgItem (IDOK);
+
+ runButton->EnableWindow (FALSE);
+ closeButton->EnableWindow (FALSE);
+
+}
+
+
+void TestRunnerDlg::beIdle ()
+{
+ CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
+ CButton *closeButton = (CButton *)GetDlgItem (IDOK);
+
+ runButton->EnableWindow (TRUE);
+ closeButton->EnableWindow (TRUE);
+
+}
+
+
+void TestRunnerDlg::beRunDisabled ()
+{
+ CButton *runButton = (CButton *)GetDlgItem (ID_RUN);
+ CButton *closeButton = (CButton *)GetDlgItem (IDOK);
+ CButton *stopButton = (CButton *)GetDlgItem (ID_STOP);
+
+ runButton->EnableWindow (FALSE);
+ stopButton->EnableWindow (FALSE);
+ closeButton->EnableWindow (TRUE);
+
+}
+
+
+void TestRunnerDlg::freeState ()
+{
+ delete _activeTest;
+ delete _result;
+
+}
+
+
+void TestRunnerDlg::reset ()
+{
+ _testsRun = 0;
+ _errors = 0;
+ _failures = 0;
+ _testEndTime = _testStartTime;
+
+ updateCountsDisplay ();
+
+ _activeTest = 0;
+ _result = 0;
+
+ CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
+
+ listCtrl->DeleteAllItems ();
+ _testsProgress->reset ();
+
+}
+
+
+void TestRunnerDlg::updateCountsDisplay ()
+{
+ CStatic *statTestsRun = (CStatic *)GetDlgItem (IDC_STATIC_RUNS);
+ CStatic *statErrors = (CStatic *)GetDlgItem (IDC_STATIC_ERRORS);
+ CStatic *statFailures = (CStatic *)GetDlgItem (IDC_STATIC_FAILURES);
+ CEdit *editTime = (CEdit *)GetDlgItem (IDC_EDIT_TIME);
+
+ CString argumentString;
+
+ argumentString.Format ("%d", _testsRun);
+ statTestsRun ->SetWindowText (argumentString);
+
+ argumentString.Format ("%d", _errors);
+ statErrors ->SetWindowText (argumentString);
+
+ argumentString.Format ("%d", _failures);
+ statFailures ->SetWindowText (argumentString);
+
+ argumentString.Format ("Execution time: %3.3lf seconds", (_testEndTime - _testStartTime) / 1000.0);
+ editTime ->SetWindowText (argumentString);
+
+
+}
+
+
+void TestRunnerDlg::OnStop()
+{
+ if (_result)
+ _result->stop ();
+
+ beIdle ();
+
+}
+
+
+void TestRunnerDlg::OnOK()
+{
+ if (_result)
+ _result->stop ();
+
+ CDialog::OnOK ();
+}
+
+
+void TestRunnerDlg::OnSelchangeComboTest()
+{
+ CComboBox *testsSelection = (CComboBox *)GetDlgItem (IDC_COMBO_TEST);
+
+ int currentSelection = testsSelection->GetCurSel ();
+
+ if (currentSelection >= 0 && currentSelection < _tests.size ())
+ {
+ _selectedTest = (_tests.begin () + currentSelection)->pTest;
+ beIdle ();
+ CWinApp* pApp = AfxGetApp();
+ pApp->WriteProfileString("Tests", "lastTest", _selectedTest->toString().c_str());
+ }
+ else
+ {
+ _selectedTest = 0;
+ beRunDisabled ();
+
+ }
+
+ freeState ();
+ reset ();
+
+}
+
+
+void TestRunnerDlg::OnBnClickedAutorun()
+{
+ CButton *autoRunBtn = (CButton *)GetDlgItem (IDC_CHK_AUTORUN);
+ CWinApp* pApp = AfxGetApp();
+ pApp->WriteProfileInt("Tests", "autoRun", autoRunBtn->GetCheck());
+}
+
+
+void TestRunnerDlg::OnPaint()
+{
+ CPaintDC dc (this);
+
+ _testsProgress->paint (dc);
+}
+
+
+void TestRunnerDlg::setTests(const std::vector& tests)
+{
+ _tests.clear();
+ for (std::vector::const_iterator it = tests.begin(); it != tests.end(); ++it)
+ {
+ addTest(*it, 0);
+ }
+}
+
+
+void TestRunnerDlg::addTest(Test* pTest, int level)
+{
+ TestInfo ti;
+ ti.pTest = pTest;
+ ti.level = level;
+ _tests.push_back(ti);
+ TestSuite* pSuite = dynamic_cast(pTest);
+ if (pSuite)
+ {
+ const std::vector& tests = pSuite->tests();
+ for (std::vector::const_iterator it = tests.begin(); it != tests.end(); ++it)
+ {
+ addTest(*it, level + 1);
+ }
+ }
+}
+
+
+CppUnit_END
diff --git a/CppUnit/WinTestRunner/src/TestRunnerDlg.h b/CppUnit/WinTestRunner/src/TestRunnerDlg.h
new file mode 100644
index 000000000..63800ecda
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/TestRunnerDlg.h
@@ -0,0 +1,103 @@
+//
+// TestRunnerDlg.h
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/TestRunnerDlg.h#1 $
+//
+
+
+#ifndef TestRunnerDlg_INCLUDED
+#define TestRunnerDlg_INCLUDED
+
+
+#ifndef CppUnit_CppUnit_INCLUDED
+#include "CppUnit/CppUnit.h"
+#endif
+#ifndef CppUnit_CppUnitException_INCLUDED
+#include "CppUnit/CppUnitException.h"
+#endif
+#ifndef ActiveTest_INCLUDED
+#include "ActiveTest.h"
+#endif
+#ifndef STD_VECTOR_INCLUDED
+#include
+#define STD_VECTOR_INCLUDED
+#endif
+#ifndef IDD_DIALOG_TESTRUNNER
+#include "../res/Resource.h"
+#endif
+#include
+#include "afxwin.h"
+
+
+CppUnit_BEGIN
+
+
+class ProgressBar;
+
+
+class TestRunnerDlg: public CDialog
+{
+public:
+ TestRunnerDlg(CWnd* pParent = NULL);
+ ~TestRunnerDlg();
+
+ void setTests(const std::vector& tests);
+
+ void addError(TestResult* result, Test* test, CppUnitException* e);
+ void addFailure(TestResult* result, Test* test, CppUnitException* e);
+ void endTest(TestResult* result, Test* test);
+
+ //{{AFX_DATA(TestRunnerDlg)
+ enum { IDD = IDD_DIALOG_TESTRUNNER };
+ // NOTE: the ClassWizard will add data members here
+ //}}AFX_DATA
+
+ //{{AFX_VIRTUAL(TestRunnerDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+protected:
+ //{{AFX_MSG(TestRunnerDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnRun();
+ afx_msg void OnStop();
+ virtual void OnOK();
+ afx_msg void OnSelchangeComboTest();
+ afx_msg void OnBnClickedAutorun();
+ afx_msg void OnPaint();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+ void addListEntry(const std::string& type, TestResult* result, Test* test, CppUnitException* e);
+ void beIdle();
+ void beRunning();
+ void beRunDisabled();
+ void reset();
+ void freeState();
+ void updateCountsDisplay();
+ void addTest(Test* pTest, int level);
+
+ struct TestInfo
+ {
+ Test* pTest;
+ int level;
+ };
+ std::vector _tests;
+ ProgressBar* _testsProgress;
+ Test* _selectedTest;
+ ActiveTest* _activeTest;
+ TestResult* _result;
+ int _testsRun;
+ int _errors;
+ int _failures;
+ DWORD _testStartTime;
+ DWORD _testEndTime;
+};
+
+
+CppUnit_END
+
+
+#endif // TestRunnerDlg_INCLUDED
+
diff --git a/CppUnit/WinTestRunner/src/WinTestRunner.cpp b/CppUnit/WinTestRunner/src/WinTestRunner.cpp
new file mode 100644
index 000000000..d0bcfa7c6
--- /dev/null
+++ b/CppUnit/WinTestRunner/src/WinTestRunner.cpp
@@ -0,0 +1,64 @@
+//
+// WinTestRunner.cpp
+//
+// $Id: //poco/1.1.0/CppUnit/WinTestRunner/src/WinTestRunner.cpp#1 $
+//
+
+
+#include "WinTestRunner/WinTestRunner.h"
+#include "TestRunnerDlg.h"
+
+
+CppUnit_BEGIN
+
+
+WinTestRunner::WinTestRunner()
+{
+}
+
+
+WinTestRunner::~WinTestRunner()
+{
+ for (std::vector::iterator it = _tests.begin(); it != _tests.end(); ++it)
+ delete *it;
+}
+
+
+void WinTestRunner::run()
+{
+ TestRunnerDlg dlg;
+
+ dlg.setTests(_tests);
+ dlg.DoModal();
+}
+
+
+void WinTestRunner::addTest(Test* pTest)
+{
+ _tests.push_back(pTest);
+}
+
+
+BEGIN_MESSAGE_MAP(WinTestRunnerApp, CWinApp)
+END_MESSAGE_MAP()
+
+
+BOOL WinTestRunnerApp::InitInstance()
+{
+ AllocConsole();
+ SetConsoleTitle("CppUnit WinTestRunner Console");
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+ freopen("CONIN$", "r", stdin);
+ TestMain();
+ FreeConsole();
+ return FALSE;
+}
+
+
+void WinTestRunnerApp::TestMain()
+{
+}
+
+
+CppUnit_END
diff --git a/CppUnit/cppunit.vmsbuild b/CppUnit/cppunit.vmsbuild
new file mode 100644
index 000000000..3462685a6
--- /dev/null
+++ b/CppUnit/cppunit.vmsbuild
@@ -0,0 +1,14 @@
+#
+# buildfiles.vms
+#
+# $Id: //poco/CppUnit/cppunit.vmsbuild#1 $
+#
+LIB=CppUnit
+CppUnitException
+TestCase
+TestDecorator
+TestFailure
+TestResult
+TestRunner
+TestSuite
+TextTestResult
diff --git a/CppUnit/doc/README.html b/CppUnit/doc/README.html
new file mode 100644
index 000000000..526e22f0b
--- /dev/null
+++ b/CppUnit/doc/README.html
@@ -0,0 +1,75 @@
+
+
+
+
+CppUnit 1.5
+
+
+
+
+
+CppUnit 1.5
+Last Revision: 12/15/99 - Michael Feathers (mfeathers@acm.org) - written in standard C++, tested under Microsoft Visual C++ 6.0
+
+Background
+CppUnit is a simple unit test framework for C++. It is a port from JUnit, a testing framework for Java, developed by Kent Beck and Erich Gamma.
+Contents
+README.html this file
+
+ test the source code
+ framework the testing framework
+ extensions some framework extension classes
+ textui a command line interface to run tests
+ ms code for a Microsoft specific TestRunner
+ samples some example test cases and extensions to the framework
+ multicaster a sample illustrating a publish/subscribe
+ multicaster under test
+ doc documentation
+Installation
+To use the test framework, create a makefile or load all files in test\framework into your IDE. In this incarnation of CppUnit, all includes assume the current directory first. A makefile or project can be used to resolve the dependencies.
+The directory test\textui contains a simple command line example that uses the framework.
+Documentation
+CppUnit comes with the following documentation:
+
+
+- a cookbook: doc\cookbook.htm
+- this file
+
+Samples
+You can find several sample test cases in the samples directory:
+
+
+- ExampleTestCase - some simple tests
+- Multicaster - test cases for a sample publish/subscribe multicaster class
+
+Also, the wiki page http://c2.com/cgi/wiki?ClassHierarchyTestingInCppUnit shows how to automatically apply tests of classes to the classes' subclasses.
+
+Extensions
+You can find several classes that illustrate framework extensions in the extensions directory:
+
+
+- TestDecorator - A Decorator for Test. You can use it as the base class for decorators that extend test cases.
+- TestSetup - A Decorator that can be used to set up and tear down additional fixture state. Subclass TestSetup and insert it into your tests when you want to set up additional state once before the test is run.
+- Orthodox - a template class which can be used to verify operations on an arbitrary class.
+
+
+Notes
+Porting this framework has been fun. I've tried to maintain the spirit and utility of JUnit in a C++ environment. Naturally, the move from Java to standard C++ forces out several nice JUnit features:
+
+
+- Platform independent GUI.
+- Stack traces of test failures
+- Active (threaded) tests
+- Direct invocation of test cases via reflection
+- Run-time loading of new tests
+
+In addition, the lack of garbage collection in C++ requires some careful use of the framework classes. In particular, TestSuites are composites that manage the lifetime of any tests added to them. Holding onto a TestResult past the lifetime of the tests which filled it is a bad idea. This is because TestResults hold TestFailures and TestFailures hold pointers to the Tests that generated them.
+On the plus side, we can use the C++ macro preprocessor to get the exact line at which a failure occurs, along with the actual text inside the assert () call that detected the failure. The features of C++ that enable this are the __LINE__ and __FILE__ preprocessor definitions, along with the stringizing operator. If you find that generating this much literal text bulks up your test executables, you can use the CPP_UNIT_SOURCEANNOT define to disable that portion of the reporting.
+Note: If you use the C++ macro "assert ()" in your code, or include assert.h, you may have a name clash with CppUnit's assert macro. This can be remedied by changing the name of the macro to "cu_assert ()" in TestCase.h.
+I'd like to thank Kent Beck and Erich Gamma for the inspiration, design, and a wonderful cookbook that was easily/shamelessly mutated to describe CppUnit. Double thanks to Erich for thinking up a way to implement TestCaller. Additional thanks to Kent, Ward Cunningham, Ron Jeffries, Martin Fowler, and several other netizens of the WikiWikiWeb. I don't think any other bunch of people could have convinced me that rapid development with unit tests can be both effective and easy.
+Thanks also to Fred Huls for mentioning the idea of template-based testing. The orthodox template class demonstrates only a small part of what can be done with templated test cases.
+History Of Changes
+1.2 -- Added the TestCaller template class. There is now no need to use the CPP_UNIT_TESTCASEDISPATCH macro unless you are using a C++ compiler which does not support templates well. CPP_UNIT_TESTCASEDISPATCH remains in TestCase.h for backward compatibility. I've also kept the use of the macro in the Multicaster sample to leave in an example.
+1.3 -- Retired the CPP_UNIT_TESTCASEDISPATCH macro and cleaned up the include structure. Fixed bug in the textui version.
+1.4 -- Removed using directives for std in CppUnit headers. Merged the old AssertionFailedError into CppUnitException. Fixed a memory leak in the TestRunner class of the MS GUI TestRunner. Removed CppUnit.h file. Now headers for each class must be included directly.
+1.5 -- Upgraded projects from VC++ 5.0 to 6.0.