Skip to content

Commit

Permalink
Merge of UnitTest++ using subtree method from github UnitTest++ source
Browse files Browse the repository at this point in the history
  • Loading branch information
paulecoyote committed Jul 1, 2011
2 parents d5b7b18 + 4d3ecd3 commit 0faf5a5
Show file tree
Hide file tree
Showing 84 changed files with 8,430 additions and 0 deletions.
84 changes: 84 additions & 0 deletions unittestpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#Project specific
UnitTest++.vsnet2010.sdf
UnitTest++.opensdf

#ignore thumbnails created by windows
Thumbs.db

#ignore Mercurial files
.hg/
.hgignore

#Ignore files build by Visual Studio
# */*.lib
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.pyc
[Bb]in
[Dd]ebug*/
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
*.vcproj.*
*.vcxproj.filters
*.vcxproj.user
*.ipch
ipch/
_UpgradeReport_Files/

# Linux compile
*.a
*.la
*.lo
*.Po
*.Plo
*.o
*.so
*.so.*
*_debug
core
*.pc
*.gch

# Log dump files
report_refused
report_failed
exception_catched
*.stat
*.log
log.txt

# Mac OS X garbage
.DS_Store

# Vim and kwrite cache
*~

# Kdevelop4 garbage
*.kdev4
.kdev4

# Python cache
*.pyd
*.pyc

# Qt compiler
moc_*.cpp
*.moc
20 changes: 20 additions & 0 deletions unittestpp/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2006 Noel Llopis and Charles Nicholson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
96 changes: 96 additions & 0 deletions unittestpp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
CXX = g++
CXXFLAGS ?= -g -Wall -W -Winline -ansi
LDFLAGS ?=
SED = sed
MV = mv
RM = rm

.SUFFIXES: .o .cpp

lib = libUnitTest++.a
test = TestUnitTest++

src = src/AssertException.cpp \
src/Test.cpp \
src/Checks.cpp \
src/TestRunner.cpp \
src/TestResults.cpp \
src/TestReporter.cpp \
src/TestReporterStdout.cpp \
src/ReportAssert.cpp \
src/TestList.cpp \
src/TimeConstraint.cpp \
src/TestDetails.cpp \
src/MemoryOutStream.cpp \
src/DeferredTestReporter.cpp \
src/DeferredTestResult.cpp \
src/XmlTestReporter.cpp \
src/CurrentTest.cpp

ifeq ($(MSYSTEM), MINGW32)
src += src/Win32/TimeHelpers.cpp
else
src += src/Posix/SignalTranslator.cpp \
src/Posix/TimeHelpers.cpp
endif

test_src = src/tests/Main.cpp \
src/tests/TestAssertHandler.cpp \
src/tests/TestChecks.cpp \
src/tests/TestUnitTest++.cpp \
src/tests/TestTest.cpp \
src/tests/TestTestResults.cpp \
src/tests/TestTestRunner.cpp \
src/tests/TestCheckMacros.cpp \
src/tests/TestTestList.cpp \
src/tests/TestTestMacros.cpp \
src/tests/TestTimeConstraint.cpp \
src/tests/TestTimeConstraintMacro.cpp \
src/tests/TestMemoryOutStream.cpp \
src/tests/TestDeferredTestReporter.cpp \
src/tests/TestXmlTestReporter.cpp \
src/tests/TestCurrentTest.cpp

objects = $(patsubst %.cpp, %.o, $(src))
test_objects = $(patsubst %.cpp, %.o, $(test_src))
dependencies = $(subst .o,.d,$(objects))
test_dependencies = $(subst .o,.d,$(test_objects))

define make-depend
$(CXX) $(CXXFLAGS) -M $1 | \
$(SED) -e 's,\($(notdir $2)\) *:,$(dir $2)\1: ,' > $3.tmp
$(SED) -e 's/#.*//' \
-e 's/^[^:]*: *//' \
-e 's/ *\\$$//' \
-e '/^$$/ d' \
-e 's/$$/ :/' $3.tmp >> $3.tmp
$(MV) $3.tmp $3
endef


all: $(test)


$(lib): $(objects)
@echo Creating $(lib) library...
@ar cr $(lib) $(objects)

$(test): $(lib) $(test_objects)
@echo Linking $(test)...
@$(CXX) $(LDFLAGS) -o $(test) $(test_objects) $(lib)
@echo Running unit tests...
@./$(test)

clean:
-@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null

%.o : %.cpp
@echo $<
@$(call make-depend,$<,$@,$(subst .o,.d,$@))
@$(CXX) $(CXXFLAGS) -c $< -o $(patsubst %.cpp, %.o, $<)


ifneq "$(MAKECMDGOALS)" "clean"
-include $(dependencies)
-include $(test_dependencies)
endif
68 changes: 68 additions & 0 deletions unittestpp/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
UnitTest++ README
Version: v1.4
Last update: 2008-10-30

UnitTest++ is free software. You may copy, distribute, and modify it under
the terms of the License contained in the file COPYING distributed
with this package. This license is the same as the MIT/X Consortium
license.

See src/tests/TestUnitTest++.cpp for usage.

Authors:
Noel Llopis (llopis@convexhull.com)
Charles Nicholson (charles.nicholson@gmail.com)

Contributors:
Jim Tilander
Kim Grasman
Jonathan Jansson
Dirck Blaskey
Rory Driscoll
Dan Lind
Matt Kimmel -- Submitted with permission from Blue Fang Games
Anthony Moralez
Jeff Dixon
Randy Coulman
Lieven van der Heide

Release notes:
--------------
Version 1.4 (2008-10-30)
- CHECK macros work at arbitrary stack depth from inside TESTs.
- Remove obsolete TEST_UTILITY macros
- Predicated test execution (via TestRunner::RunTestsIf)
- Better exception handling for fixture ctors/dtors.
- VC6/7/8/9 support

Version 1.3 (2007-4-22)
- Removed dynamic memory allocations (other than streams)
- MinGW support
- Consistent (native) line endings
- Minor bug fixing

Version 1.2 (2006-10-29)
- First pass at documentation.
- More detailed error crash catching in fixtures.
- Standard streams used for printing objects under check. This should allow the
use of standard class types such as std::string or other custom classes with
stream operators to ostream.
- Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS
in Config.h
- Added named test suites
- Added CHECK_ARRAY2D_CLOSE
- Posix library name is libUnitTest++.a now
- Floating point numbers are postfixed with f in the failure reports

Version 1.1 (2006-04-18)
- CHECK macros do not have side effects even if one of the parameters changes state
- Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE)
- Added local and global time constraints
- Removed dependencies on strstream
- Improved Posix signal to exception translator
- Failing tests are added to Visual Studio's error list
- Fixed Visual Studio projects to work with spaces in directories

Version 1.0 (2006-03-15)
- Initial release

Loading

0 comments on commit 0faf5a5

Please sign in to comment.