Skip to content

Commit 18e0437

Browse files
committed
Making a separate repository for UnitTest++ that all our repos can build against
1 parent 9708bec commit 18e0437

Some content is hidden

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

77 files changed

+6744
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
# Codeblocks generated files and directories
35+
*.depend
36+
*.layout
37+
bin
38+
obj

UnitTest++.cbp

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<CodeBlocks_project_file>
3+
<FileVersion major="1" minor="6" />
4+
<Project>
5+
<Option title="UnitTest++" />
6+
<Option pch_mode="2" />
7+
<Option default_target="Debug(linux)" />
8+
<Option compiler="gcc" />
9+
<Build>
10+
<Target title="Debug">
11+
<Option platforms="Windows;" />
12+
<Option output="./lib/Debug/libUnitTest++.a" prefix_auto="0" extension_auto="0" />
13+
<Option working_dir="" />
14+
<Option object_output="./obj/Debug/" />
15+
<Option type="2" />
16+
<Option compiler="gcc" />
17+
<Option createDefFile="1" />
18+
<Compiler>
19+
<Add option="-Winit-self" />
20+
<Add option="-Wredundant-decls" />
21+
<Add option="-Wcast-align" />
22+
<Add option="-Wundef" />
23+
<Add option="-Wfloat-equal" />
24+
<Add option="-Wmissing-declarations" />
25+
<Add option="-Wmissing-include-dirs" />
26+
<Add option="-Wswitch-enum" />
27+
<Add option="-Wswitch-default" />
28+
<Add option="-Wmain" />
29+
<Add option="-pedantic" />
30+
<Add option="-std=c++0x" />
31+
<Add option="-Wextra" />
32+
<Add option="-Wall" />
33+
<Add option="-g" />
34+
</Compiler>
35+
</Target>
36+
<Target title="Release">
37+
<Option platforms="Windows;" />
38+
<Option output="./lib/Release/libUnitTest++.a" prefix_auto="0" extension_auto="0" />
39+
<Option working_dir="" />
40+
<Option object_output="./obj/Release/" />
41+
<Option type="2" />
42+
<Option compiler="gcc" />
43+
<Option createDefFile="1" />
44+
<Compiler>
45+
<Add option="-O2" />
46+
<Add option="-Winit-self" />
47+
<Add option="-Wredundant-decls" />
48+
<Add option="-Wcast-align" />
49+
<Add option="-Wundef" />
50+
<Add option="-Wfloat-equal" />
51+
<Add option="-Wmissing-declarations" />
52+
<Add option="-Wmissing-include-dirs" />
53+
<Add option="-Wswitch-enum" />
54+
<Add option="-Wswitch-default" />
55+
<Add option="-Wmain" />
56+
<Add option="-pedantic" />
57+
<Add option="-std=c++0x" />
58+
<Add option="-Wextra" />
59+
<Add option="-Wall" />
60+
</Compiler>
61+
<Linker>
62+
<Add option="-s" />
63+
</Linker>
64+
</Target>
65+
<Target title="Debug(linux)">
66+
<Option platforms="Unix;Mac;" />
67+
<Option output="./lib/Debug/libUnitTest++.a" prefix_auto="0" extension_auto="0" />
68+
<Option working_dir="" />
69+
<Option object_output="./obj/Debug/" />
70+
<Option type="2" />
71+
<Option compiler="gcc" />
72+
<Option createDefFile="1" />
73+
<Compiler>
74+
<Add option="-Winit-self" />
75+
<Add option="-Wredundant-decls" />
76+
<Add option="-Wcast-align" />
77+
<Add option="-Wundef" />
78+
<Add option="-Wfloat-equal" />
79+
<Add option="-Wmissing-declarations" />
80+
<Add option="-Wmissing-include-dirs" />
81+
<Add option="-Wswitch-enum" />
82+
<Add option="-Wswitch-default" />
83+
<Add option="-Wmain" />
84+
<Add option="-pedantic" />
85+
<Add option="-Wextra" />
86+
<Add option="-Wall" />
87+
<Add option="-std=c++0x" />
88+
<Add option="-g" />
89+
</Compiler>
90+
</Target>
91+
<Target title="Release(linux)">
92+
<Option platforms="Unix;Mac;" />
93+
<Option output="./lib/Release/libUnitTest++.a" prefix_auto="0" extension_auto="0" />
94+
<Option working_dir="" />
95+
<Option object_output="./obj/Release/" />
96+
<Option type="2" />
97+
<Option compiler="gcc" />
98+
<Option createDefFile="1" />
99+
<Compiler>
100+
<Add option="-O2" />
101+
<Add option="-Winit-self" />
102+
<Add option="-Wredundant-decls" />
103+
<Add option="-Wcast-align" />
104+
<Add option="-Wundef" />
105+
<Add option="-Wfloat-equal" />
106+
<Add option="-Wmissing-declarations" />
107+
<Add option="-Wmissing-include-dirs" />
108+
<Add option="-Wswitch-enum" />
109+
<Add option="-Wswitch-default" />
110+
<Add option="-Wmain" />
111+
<Add option="-pedantic" />
112+
<Add option="-std=c++0x" />
113+
<Add option="-Wextra" />
114+
<Add option="-Wall" />
115+
</Compiler>
116+
<Linker>
117+
<Add option="-s" />
118+
</Linker>
119+
</Target>
120+
</Build>
121+
<VirtualTargets>
122+
<Add alias="All" targets="Debug;Release;Debug(linux);Release(linux);" />
123+
</VirtualTargets>
124+
<Compiler>
125+
<Add option="-fPIC" />
126+
</Compiler>
127+
<Unit filename="UnitTest++/src/AssertException.cpp" />
128+
<Unit filename="UnitTest++/src/AssertException.h" />
129+
<Unit filename="UnitTest++/src/CheckMacros.h" />
130+
<Unit filename="UnitTest++/src/Checks.cpp" />
131+
<Unit filename="UnitTest++/src/Checks.h" />
132+
<Unit filename="UnitTest++/src/Config.h" />
133+
<Unit filename="UnitTest++/src/CurrentTest.cpp" />
134+
<Unit filename="UnitTest++/src/CurrentTest.h" />
135+
<Unit filename="UnitTest++/src/DeferredTestReporter.cpp" />
136+
<Unit filename="UnitTest++/src/DeferredTestReporter.h" />
137+
<Unit filename="UnitTest++/src/DeferredTestResult.cpp" />
138+
<Unit filename="UnitTest++/src/DeferredTestResult.h" />
139+
<Unit filename="UnitTest++/src/ExecuteTest.h" />
140+
<Unit filename="UnitTest++/src/MemoryOutStream.cpp" />
141+
<Unit filename="UnitTest++/src/MemoryOutStream.h" />
142+
<Unit filename="UnitTest++/src/Posix/SignalTranslator.cpp">
143+
<Option target="Debug(linux)" />
144+
<Option target="Release(linux)" />
145+
</Unit>
146+
<Unit filename="UnitTest++/src/Posix/SignalTranslator.h">
147+
<Option target="Debug(linux)" />
148+
<Option target="Release(linux)" />
149+
</Unit>
150+
<Unit filename="UnitTest++/src/Posix/TimeHelpers.cpp">
151+
<Option target="Debug(linux)" />
152+
<Option target="Release(linux)" />
153+
</Unit>
154+
<Unit filename="UnitTest++/src/Posix/TimeHelpers.h">
155+
<Option target="Debug(linux)" />
156+
<Option target="Release(linux)" />
157+
</Unit>
158+
<Unit filename="UnitTest++/src/ReportAssert.cpp" />
159+
<Unit filename="UnitTest++/src/ReportAssert.h" />
160+
<Unit filename="UnitTest++/src/Test.cpp" />
161+
<Unit filename="UnitTest++/src/Test.h" />
162+
<Unit filename="UnitTest++/src/TestDetails.cpp" />
163+
<Unit filename="UnitTest++/src/TestDetails.h" />
164+
<Unit filename="UnitTest++/src/TestList.cpp" />
165+
<Unit filename="UnitTest++/src/TestList.h" />
166+
<Unit filename="UnitTest++/src/TestMacros.h" />
167+
<Unit filename="UnitTest++/src/TestReporter.cpp" />
168+
<Unit filename="UnitTest++/src/TestReporter.h" />
169+
<Unit filename="UnitTest++/src/TestReporterStdout.cpp" />
170+
<Unit filename="UnitTest++/src/TestReporterStdout.h" />
171+
<Unit filename="UnitTest++/src/TestResults.cpp" />
172+
<Unit filename="UnitTest++/src/TestResults.h" />
173+
<Unit filename="UnitTest++/src/TestRunner.cpp" />
174+
<Unit filename="UnitTest++/src/TestRunner.h" />
175+
<Unit filename="UnitTest++/src/TestSuite.h" />
176+
<Unit filename="UnitTest++/src/TimeConstraint.cpp" />
177+
<Unit filename="UnitTest++/src/TimeConstraint.h" />
178+
<Unit filename="UnitTest++/src/TimeHelpers.h" />
179+
<Unit filename="UnitTest++/src/UnitTest++.h" />
180+
<Unit filename="UnitTest++/src/Win32/TimeHelpers.cpp">
181+
<Option target="Debug" />
182+
<Option target="Release" />
183+
</Unit>
184+
<Unit filename="UnitTest++/src/Win32/TimeHelpers.h">
185+
<Option target="Debug" />
186+
<Option target="Release" />
187+
</Unit>
188+
<Unit filename="UnitTest++/src/XmlTestReporter.cpp" />
189+
<Unit filename="UnitTest++/src/XmlTestReporter.h" />
190+
<Extensions>
191+
<envvars />
192+
<code_completion />
193+
<debugger />
194+
</Extensions>
195+
</Project>
196+
</CodeBlocks_project_file>

UnitTest++/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.

UnitTest++/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

UnitTest++/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+

0 commit comments

Comments
 (0)