Skip to content

Commit 1e18e44

Browse files
author
Baptiste Lepilleur
committed
* include/cppunit/plugin/PlugInManager.h:
* src/cppunit/PlugInManager.cpp: added two methods to use the plug-in interface for Xml Outputter hooks. * include/cppunit/plugin/TestPlugIn.h: added two methods to the plug-in interface for Xml Outputter hooks. * include/cppunit/plugin/TestPlugInAdapter.h: * src/cppunit/plugin/TestPlugInAdapter.cpp: renamed TestPlugInDefaultImpl. Added empty implementation for Xml outputter hook methods. * include/cppunit/tools/StringTools.h: * src/cppunit/tools/StringTools.cpp: added. Functions to manipulate string (conversion, wrapping...) * include/cppunit/tools/XmlElement.h: * src/cppunit/XmlElement.cpp: renamed addNode() to addElement(). Added methods to walk and modify XmlElement (for hook). Added documentation. Use StringTools. * include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: added hook calls & management. * include/cppunit/XmlOutputterHook.h: * src/cppunit/XmlOutputterHook.cpp: added. Hook to customize XML output. * src/DllPlugInTester/DllPlugInTester.cpp: call plug-in XmlOutputterHook when writing XML output. Modified so that memory is freed before unloading the test plug-in (caused crash when freeing the XmlDocument). * examples/ReadMe.txt: * examples/ClockerPlugIn/ReadMe.txt: added details about the plug-in (usage, xml content...) * examples/ClockerPlugIn/ClockerModel.h: * examples/ClockerPlugIn/ClockerModel.cpp: extracted from ClockerListener. Represents the test hierarchy and tracked time for each test. * examples/ClockerPlugIn/ClockerListener.h: * examples/ClockerPlugIn/ClockerListener.cpp: extracted test hierarchy tracking to ClockerModel. Replaced the 'flat' view option with a 'text' option to print the timed test tree to stdout. * examples/ClockerPlugIn/ClockerPlugIn.cpp: updated to hook the XML output and use the new classes. * examples/ClockerPlugIn/ClockerXmlHook.h: * examples/ClockerPlugIn/ClockerXmlHook.cpp: added. XmlOutputterHook to includes the timed test hierarchy and test timing in the XML output. * examples/cppunittest/XmlElementTest.h: * examples/cppunittest/XmlElementTest.cpp: added new test cases. * examples/cppunittest/XmlOutputterTest.h: * examples/cppunittest/XmlOutputterTest.cpp: added tests for XmlOutputterHook.
1 parent 02b41ab commit 1e18e44

41 files changed

Lines changed: 1518 additions & 356 deletions

Some content is hidden

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

cppunit/ChangeLog

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
2002-06-14 Baptiste Lepilleur <[email protected]>
2+
3+
* include/cppunit/plugin/PlugInManager.h:
4+
* src/cppunit/PlugInManager.cpp: added two methods to use the plug-in
5+
interface for Xml Outputter hooks.
6+
7+
* include/cppunit/plugin/TestPlugIn.h: added two methods to the plug-in
8+
interface for Xml Outputter hooks.
9+
10+
* include/cppunit/plugin/TestPlugInAdapter.h:
11+
* src/cppunit/plugin/TestPlugInAdapter.cpp: renamed TestPlugInDefaultImpl.
12+
Added empty implementation for Xml outputter hook methods.
13+
14+
* include/cppunit/tools/StringTools.h:
15+
* src/cppunit/tools/StringTools.cpp: added. Functions to manipulate string
16+
(conversion, wrapping...)
17+
18+
* include/cppunit/tools/XmlElement.h:
19+
* src/cppunit/XmlElement.cpp: renamed addNode() to addElement(). Added
20+
methods to walk and modify XmlElement (for hook). Added documentation.
21+
Use StringTools.
22+
23+
* include/cppunit/XmlOutputter.h:
24+
* src/cppunit/XmlOutputter.cpp: added hook calls & management.
25+
26+
* include/cppunit/XmlOutputterHook.h:
27+
* src/cppunit/XmlOutputterHook.cpp: added. Hook to customize XML output.
28+
29+
* src/DllPlugInTester/DllPlugInTester.cpp: call plug-in XmlOutputterHook
30+
when writing XML output. Modified so that memory is freed before
31+
unloading the test plug-in (caused crash when freeing the XmlDocument).
32+
33+
* examples/ReadMe.txt:
34+
* examples/ClockerPlugIn/ReadMe.txt: added details about the plug-in
35+
(usage, xml content...)
36+
37+
* examples/ClockerPlugIn/ClockerModel.h:
38+
* examples/ClockerPlugIn/ClockerModel.cpp: extracted from ClockerListener.
39+
Represents the test hierarchy and tracked time for each test.
40+
41+
* examples/ClockerPlugIn/ClockerListener.h:
42+
* examples/ClockerPlugIn/ClockerListener.cpp: extracted test hierarchy
43+
tracking to ClockerModel. Replaced the 'flat' view option with a 'text'
44+
option to print the timed test tree to stdout.
45+
46+
* examples/ClockerPlugIn/ClockerPlugIn.cpp: updated to hook the XML
47+
output and use the new classes.
48+
49+
* examples/ClockerPlugIn/ClockerXmlHook.h:
50+
* examples/ClockerPlugIn/ClockerXmlHook.cpp: added. XmlOutputterHook to
51+
includes the timed test hierarchy and test timing in the XML output.
52+
53+
* examples/cppunittest/XmlElementTest.h:
54+
* examples/cppunittest/XmlElementTest.cpp: added new test cases.
55+
56+
* examples/cppunittest/XmlOutputterTest.h:
57+
* examples/cppunittest/XmlOutputterTest.cpp: added tests for
58+
XmlOutputterHook.
59+
160
2002-06-14 Baptiste Lepilleur <[email protected]>
261

362
* src/cppunit/TypeInfoHelper.cpp: added work around for bug #565481.

cppunit/NEWS

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
New in CppUnit 1.9.8:
22
---------------------
33

4-
- XmlDocument
54
- Custom test macros.
6-
- Exception message
7-
- MFC TestRunner
5+
- Exception message are now structured
6+
- MFC TestRunner, detail field added.
7+
- XmlDocument extracted from XmlOutputter to create different XML output
8+
- Xml output customization.
9+
- Test plug-in XML output Hook
10+
- ClockerPlugIn example includes test time in XML output.
11+
- DllPlugInTester allows test plug-in to hook the XML output.
812

913
* Custom test macros
1014

@@ -37,25 +41,55 @@
3741
This change allow ouputters to deal with all failure the same way (there is no
3842
special case for the equality assertion any more).
3943

44+
* XmlDocument extracted from XmlOutputter to create different XML output
45+
46+
- Classes XmlDocument and XmlElement where extracted from XmlOutputter. This
47+
help writing outputters that use a completly different XML format.
48+
49+
* Xml output customization.
50+
51+
- Xml output can be customized using XmlOutputterHook. To do so, subclass
52+
XmlOutputterHook and register it to the XmlOutputter with addHook() before
53+
call XmlOutputter::write().
54+
55+
Hook can be used to add some datas to the XmlDocument or the XmlElement of
56+
a specific hook. Methods have been added to XmlElement to help walking and
57+
modifying the XmlDocument.
58+
59+
See ClockerPlugIn example.
60+
4061
* MFC TestRunner
4162

63+
- The name of the test is displayed just before being run.
4264
- Browse dialog is resizable
4365
- Better (and cleaner) handling of windows resizing
4466
- Failure list on show the short description of the failure.
4567
- Edit field added to display the details of the failure.
4668

69+
* MFC test plug-in runner (TestPlugInRunner):
70+
71+
- command line: a dll name can be specified on the command after -testsuite:
72+
example: TestPlugInRunnerd.exe -testsuite Simpled.dll
73+
74+
* Test plug-in XML output Hook
75+
76+
- TestPlugIn interface provides a mean for plug-in to register hook for
77+
XML output. Practically, this allow plug-in to add specific data to the
78+
output. See ClockerPlugIn example, which add timing datas to the xml
79+
output.
80+
4781
* DllPlugInTester:
4882

4983
- added option -w / --wait to wait for the user to press a key before exiting.
5084

51-
* MfcUi:
85+
- plug-in can now provides XmlOutputterHook to add specific datas to the
86+
XML ouput. See ClockerPlugIn example.
5287

53-
- the name of the test is displayed just before being run.
88+
* Examples:
5489

55-
* MfcUi plug-in runner (TestPlugInRunner):
56-
57-
- command line: a dll name can be specified on the command after -testsuite:
58-
example: TestPlugInRunnerd.exe -testsuite Simpled.dll
90+
- ClockerPlugIn: the example now use the new XmlOutputterHook. Test time are
91+
now included in the XML output. See examples/ClockerPlugIn/ReadMe.txt for
92+
details.
5993

6094
* Bug Fix:
6195

@@ -72,20 +106,17 @@
72106

73107
* Compatibility Break:
74108

109+
- CompilerOutputter: removed printNotEqualMessage() and printDefaultMessage().
110+
No longer needed since Exception message are processed in a generic way.
111+
75112
- Exception constructor takes a Message instead of a string. Notes that the
76113
first argument in Message constructor is a short description, not the message.
77114
Therefore, the change will usualy have the following form:
78115
Exception( Message( "assertion failed", oldMessage ) );
79116
You may want to use Asserter functions instead of constructing and throwing
80117
the exception manually.
81118

82-
- CompilerOutputter: removed printNotEqualMessage() and printDefaultMessage().
83-
No longer needed since Exception message are processed in a generic way.
84-
85-
- XmlOutputter: removed methods writeProlog() and writeTestResult() which
86-
are replaced by XmlDocument.
87-
88-
- XmlOuputter::Node: class has been extracted and renamed XmlElement.
119+
- TestPlugInAdapter: renamed TestPlugInDefaultImpl.
89120

90121
- TestSuiteBuilder: removed default constructor. All remaining constructors
91122
take an additional argument of type TestNamer used to specify the fixture
@@ -96,6 +127,13 @@
96127
- TextTestResult: most printing method were removed. This task is now delegated
97128
to TextOuputter.
98129

130+
- XmlElement: renamed addNode() to addElement().
131+
132+
- XmlOutputter: removed methods writeProlog() and writeTestResult() which
133+
are replaced by XmlDocument.
134+
135+
- XmlOuputter::Node: class has been extracted and renamed XmlElement.
136+
99137
* Deprecated:
100138

101139
- Asserter: all functions that use a string for the failure message. Construct

cppunit/TODO

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
* CppUnit:
2-
- Update MfcTestRunner to use TestPath to store test in the registry
32
- Provide a mean for the user to catch 'custom' exception in TestCase::run
43
(exception that do not subclass std::exception, such as MFC CException, or
54
RogueWave RWXMsg).
@@ -8,8 +7,6 @@
87
(test & doc level).
98
- Allow test plug-in to 'hook' the XmlOutputter when used.
109
- TextUi::TestRunner should use CppUnit::TestRunner as a base class
11-
- Modify MfcUi::TestRunner to expose TestResult (which allow specific TestListener
12-
for global initialization).
1310
- [DONE] Make Exception message more flexible: introduce a Message object which contains:
1411
- a short description ('assertion failed', 'equality assertion failed'...)
1512
- detail strings: "Expected : 3", "Actual : 5"...
@@ -27,6 +24,9 @@
2724
- add tests for test plug-in
2825

2926
* VC++ TestRunner:
27+
- Modify MfcUi::TestRunner to expose TestResult (which allow specific TestListener
28+
for global initialization).
29+
- Update MfcTestRunner to use TestPath to store test in the registry
3030
- [DONE] Add "details" field to show detail of the selected failed test:
3131
- suite and test name,
3232
- failure message. If possible separate "was" and "expected" in the

0 commit comments

Comments
 (0)