Skip to content

Commit 24216b2

Browse files
committed
Added all files from UnitTest++ v1.4
0 parents  commit 24216b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+6316
-0
lines changed

COPYING

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2006 Noel Llopis and Charles Nicholson
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included
12+
in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
CXX = g++
2+
CXXFLAGS ?= -g -Wall -W -ansi # -pedantic
3+
LDFLAGS ?=
4+
SED = sed
5+
MV = mv
6+
RM = rm
7+
8+
.SUFFIXES: .o .cpp
9+
10+
lib = libUnitTest++.a
11+
test = TestUnitTest++
12+
13+
src = src/AssertException.cpp \
14+
src/Test.cpp \
15+
src/Checks.cpp \
16+
src/TestRunner.cpp \
17+
src/TestResults.cpp \
18+
src/TestReporter.cpp \
19+
src/TestReporterStdout.cpp \
20+
src/ReportAssert.cpp \
21+
src/TestList.cpp \
22+
src/TimeConstraint.cpp \
23+
src/TestDetails.cpp \
24+
src/MemoryOutStream.cpp \
25+
src/DeferredTestReporter.cpp \
26+
src/DeferredTestResult.cpp \
27+
src/XmlTestReporter.cpp \
28+
src/CurrentTest.cpp
29+
30+
ifeq ($(MSYSTEM), MINGW32)
31+
src += src/Win32/TimeHelpers.cpp
32+
else
33+
src += src/Posix/SignalTranslator.cpp \
34+
src/Posix/TimeHelpers.cpp
35+
endif
36+
37+
test_src = src/tests/Main.cpp \
38+
src/tests/TestAssertHandler.cpp \
39+
src/tests/TestChecks.cpp \
40+
src/tests/TestUnitTest++.cpp \
41+
src/tests/TestTest.cpp \
42+
src/tests/TestTestResults.cpp \
43+
src/tests/TestTestRunner.cpp \
44+
src/tests/TestCheckMacros.cpp \
45+
src/tests/TestTestList.cpp \
46+
src/tests/TestTestMacros.cpp \
47+
src/tests/TestTimeConstraint.cpp \
48+
src/tests/TestTimeConstraintMacro.cpp \
49+
src/tests/TestMemoryOutStream.cpp \
50+
src/tests/TestDeferredTestReporter.cpp \
51+
src/tests/TestXmlTestReporter.cpp \
52+
src/tests/TestCurrentTest.cpp
53+
54+
objects = $(patsubst %.cpp, %.o, $(src))
55+
test_objects = $(patsubst %.cpp, %.o, $(test_src))
56+
dependencies = $(subst .o,.d,$(objects))
57+
test_dependencies = $(subst .o,.d,$(test_objects))
58+
59+
define make-depend
60+
$(CXX) $(CXXFLAGS) -M $1 | \
61+
$(SED) -e 's,\($(notdir $2)\) *:,$(dir $2)\1: ,' > $3.tmp
62+
$(SED) -e 's/#.*//' \
63+
-e 's/^[^:]*: *//' \
64+
-e 's/ *\\$$//' \
65+
-e '/^$$/ d' \
66+
-e 's/$$/ :/' $3.tmp >> $3.tmp
67+
$(MV) $3.tmp $3
68+
endef
69+
70+
71+
all: $(test)
72+
73+
74+
$(lib): $(objects)
75+
@echo Creating $(lib) library...
76+
@ar cr $(lib) $(objects)
77+
78+
$(test): $(lib) $(test_objects)
79+
@echo Linking $(test)...
80+
@$(CXX) $(LDFLAGS) -o $(test) $(test_objects) $(lib)
81+
@echo Running unit tests...
82+
@./$(test)
83+
84+
clean:
85+
-@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null
86+
87+
%.o : %.cpp
88+
@echo $<
89+
@$(call make-depend,$<,$@,$(subst .o,.d,$@))
90+
@$(CXX) $(CXXFLAGS) -c $< -o $(patsubst %.cpp, %.o, $<)
91+
92+
93+
ifneq "$(MAKECMDGOALS)" "clean"
94+
-include $(dependencies)
95+
-include $(test_dependencies)
96+
endif

README

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
UnitTest++ README
2+
Version: v1.4
3+
Last update: 2008-10-30
4+
5+
UnitTest++ is free software. You may copy, distribute, and modify it under
6+
the terms of the License contained in the file COPYING distributed
7+
with this package. This license is the same as the MIT/X Consortium
8+
license.
9+
10+
See src/tests/TestUnitTest++.cpp for usage.
11+
12+
Authors:
13+
Noel Llopis (llopis@convexhull.com)
14+
Charles Nicholson (charles.nicholson@gmail.com)
15+
16+
Contributors:
17+
Jim Tilander
18+
Kim Grasman
19+
Jonathan Jansson
20+
Dirck Blaskey
21+
Rory Driscoll
22+
Dan Lind
23+
Matt Kimmel -- Submitted with permission from Blue Fang Games
24+
Anthony Moralez
25+
Jeff Dixon
26+
Randy Coulman
27+
Lieven van der Heide
28+
29+
Release notes:
30+
--------------
31+
Version 1.4 (2008-10-30)
32+
- CHECK macros work at arbitrary stack depth from inside TESTs.
33+
- Remove obsolete TEST_UTILITY macros
34+
- Predicated test execution (via TestRunner::RunTestsIf)
35+
- Better exception handling for fixture ctors/dtors.
36+
- VC6/7/8/9 support
37+
38+
Version 1.3 (2007-4-22)
39+
- Removed dynamic memory allocations (other than streams)
40+
- MinGW support
41+
- Consistent (native) line endings
42+
- Minor bug fixing
43+
44+
Version 1.2 (2006-10-29)
45+
- First pass at documentation.
46+
- More detailed error crash catching in fixtures.
47+
- Standard streams used for printing objects under check. This should allow the
48+
use of standard class types such as std::string or other custom classes with
49+
stream operators to ostream.
50+
- Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS
51+
in Config.h
52+
- Added named test suites
53+
- Added CHECK_ARRAY2D_CLOSE
54+
- Posix library name is libUnitTest++.a now
55+
- Floating point numbers are postfixed with f in the failure reports
56+
57+
Version 1.1 (2006-04-18)
58+
- CHECK macros do not have side effects even if one of the parameters changes state
59+
- Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE)
60+
- Added local and global time constraints
61+
- Removed dependencies on strstream
62+
- Improved Posix signal to exception translator
63+
- Failing tests are added to Visual Studio's error list
64+
- Fixed Visual Studio projects to work with spaces in directories
65+
66+
Version 1.0 (2006-03-15)
67+
- Initial release
68+

TestUnitTest++.vsnet2003.vcproj

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<?xml version="1.0" encoding="Windows-1252"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="7.10"
5+
Name="TestUnitTest++.vsnet2003"
6+
ProjectGUID="{ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}"
7+
Keyword="Win32Proj">
8+
<Platforms>
9+
<Platform
10+
Name="Win32"/>
11+
</Platforms>
12+
<Configurations>
13+
<Configuration
14+
Name="Debug|Win32"
15+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
16+
IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
17+
ConfigurationType="1"
18+
CharacterSet="2">
19+
<Tool
20+
Name="VCCLCompilerTool"
21+
Optimization="0"
22+
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
23+
MinimalRebuild="TRUE"
24+
BasicRuntimeChecks="3"
25+
RuntimeLibrary="5"
26+
UsePrecompiledHeader="0"
27+
WarningLevel="4"
28+
Detect64BitPortabilityProblems="TRUE"
29+
DebugInformationFormat="4"/>
30+
<Tool
31+
Name="VCCustomBuildTool"/>
32+
<Tool
33+
Name="VCLinkerTool"
34+
OutputFile="$(OutDir)/TestUnitTest++.vsnet2003.exe"
35+
LinkIncremental="2"
36+
GenerateDebugInformation="TRUE"
37+
ProgramDatabaseFile="$(OutDir)/TestUnitTest++.vsnet2003.pdb"
38+
SubSystem="1"
39+
TargetMachine="1"/>
40+
<Tool
41+
Name="VCMIDLTool"/>
42+
<Tool
43+
Name="VCPostBuildEventTool"
44+
CommandLine="&quot;$(TargetPath)&quot;"/>
45+
<Tool
46+
Name="VCPreBuildEventTool"/>
47+
<Tool
48+
Name="VCPreLinkEventTool"/>
49+
<Tool
50+
Name="VCResourceCompilerTool"/>
51+
<Tool
52+
Name="VCWebServiceProxyGeneratorTool"/>
53+
<Tool
54+
Name="VCXMLDataGeneratorTool"/>
55+
<Tool
56+
Name="VCWebDeploymentTool"/>
57+
<Tool
58+
Name="VCManagedWrapperGeneratorTool"/>
59+
<Tool
60+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
61+
</Configuration>
62+
<Configuration
63+
Name="Release|Win32"
64+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
65+
IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
66+
ConfigurationType="1"
67+
CharacterSet="2">
68+
<Tool
69+
Name="VCCLCompilerTool"
70+
Optimization="2"
71+
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
72+
RuntimeLibrary="4"
73+
UsePrecompiledHeader="0"
74+
WarningLevel="4"
75+
Detect64BitPortabilityProblems="TRUE"
76+
DebugInformationFormat="3"/>
77+
<Tool
78+
Name="VCCustomBuildTool"/>
79+
<Tool
80+
Name="VCLinkerTool"
81+
OutputFile="$(OutDir)/TestUnitTest++.vsnet2003.exe"
82+
LinkIncremental="1"
83+
GenerateDebugInformation="TRUE"
84+
SubSystem="1"
85+
OptimizeReferences="2"
86+
EnableCOMDATFolding="2"
87+
TargetMachine="1"/>
88+
<Tool
89+
Name="VCMIDLTool"/>
90+
<Tool
91+
Name="VCPostBuildEventTool"
92+
CommandLine="&quot;$(TargetPath)&quot;"/>
93+
<Tool
94+
Name="VCPreBuildEventTool"/>
95+
<Tool
96+
Name="VCPreLinkEventTool"/>
97+
<Tool
98+
Name="VCResourceCompilerTool"/>
99+
<Tool
100+
Name="VCWebServiceProxyGeneratorTool"/>
101+
<Tool
102+
Name="VCXMLDataGeneratorTool"/>
103+
<Tool
104+
Name="VCWebDeploymentTool"/>
105+
<Tool
106+
Name="VCManagedWrapperGeneratorTool"/>
107+
<Tool
108+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
109+
</Configuration>
110+
</Configurations>
111+
<References>
112+
</References>
113+
<Files>
114+
<File
115+
RelativePath=".\src\tests\Main.cpp">
116+
</File>
117+
<File
118+
RelativePath=".\src\tests\RecordingReporter.h">
119+
</File>
120+
<File
121+
RelativePath=".\src\tests\ScopedCurrentTest.h">
122+
</File>
123+
<File
124+
RelativePath=".\src\tests\TestAssertHandler.cpp">
125+
</File>
126+
<File
127+
RelativePath=".\src\tests\TestCheckMacros.cpp">
128+
</File>
129+
<File
130+
RelativePath=".\src\tests\TestChecks.cpp">
131+
</File>
132+
<File
133+
RelativePath=".\src\tests\TestCurrentTest.cpp">
134+
</File>
135+
<File
136+
RelativePath=".\src\tests\TestDeferredTestReporter.cpp">
137+
</File>
138+
<File
139+
RelativePath=".\src\tests\TestMemoryOutStream.cpp">
140+
</File>
141+
<File
142+
RelativePath=".\src\tests\TestTest.cpp">
143+
</File>
144+
<File
145+
RelativePath=".\src\tests\TestTestList.cpp">
146+
</File>
147+
<File
148+
RelativePath=".\src\tests\TestTestMacros.cpp">
149+
</File>
150+
<File
151+
RelativePath=".\src\tests\TestTestResults.cpp">
152+
</File>
153+
<File
154+
RelativePath=".\src\tests\TestTestRunner.cpp">
155+
</File>
156+
<File
157+
RelativePath=".\src\tests\TestTestSuite.cpp">
158+
</File>
159+
<File
160+
RelativePath=".\src\tests\TestTimeConstraint.cpp">
161+
</File>
162+
<File
163+
RelativePath=".\src\tests\TestTimeConstraintMacro.cpp">
164+
</File>
165+
<File
166+
RelativePath=".\src\tests\TestUnitTest++.cpp">
167+
</File>
168+
<File
169+
RelativePath=".\src\tests\TestXmlTestReporter.cpp">
170+
</File>
171+
</Files>
172+
<Globals>
173+
</Globals>
174+
</VisualStudioProject>

0 commit comments

Comments
 (0)