1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
|
New in CppUnit 1.12.0:
----------------------
* Portability:
- autogen.sh can now be run on Mac OS X (patch #1449380
contributed by Sander Temme).
* MFC Test runner:
- fixed bug #1498175: double click on failure would sometime
not goto failed assertion in visual studio.
* Documentation:
- now generated with doxygen 1.4.7 new 'tabs' style.
New in CppUnit 1.11.4:
----------------------
* Portability:
- Support for Embedded Visual C++ 4 added. For this purpose, CppUnit now
provides a very simple stream implementation if none is provided.
This should also help porting on other platforms which have STL but
no stream support. Just make sure that CPPUNIT_NO_STREAM is defined
to 1 in your config header.
* Assertion:
- Added missing _MESSAGE variants for the following assertions:
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE
CPPUNIT_ASSERT_THROW_MESSAGE
CPPUNIT_ASSERT_NO_THROW_MESSAGE
CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE
CPPUNIT_ASSERT_ASSERTION_PASS_MESSAGE
Notes: change made to CPPUNIT_ASSERT_THROW may cause compilation error
if you're expecting std::exception as it would be caught twice. Contact us
if it is an issue (we don't see much use for such a test).
Some assertions failure message are now more detailed (exception,
expression).
Thanks to Neil Ferguson who contributed this patch.
- Assertion on real number now output expected and actual value using the
maximum available precision instead of the previous strategy of rounding
to 6 digits.
Thanks to Neil Ferguson who contributed this patch.
* Outputter:
- XML Ouputter: patch #997006 contributed by Akos Maroy makes the
'stand-alone' attribute of the XML header optional.
See XmlOutputter::setStandalone() & XmlDocument::setStandalone().
- Better integration of compiler output for gcc on Mac OS X with Xcode
(contributed by Claus Broch).
* MFC Test Runner
- Integration with VC++ 7.0 & 7.1. Double clicking on a failure will now
to the failure location in the open IDE (no add-in necessary).
This was contributed by Max Quatember and Andreas Pfaffenbichler.
- Progress bar: now use system color to draw border
(patch from bug #1165875 contributed by Pieter Van Dyck).
* QT Test Runner
- Fixed display of multi-line messages (patch contributed by Karol Szkudlarek).
* Compilation:
- The standard pkg-config file is now generated on unix (contributed by
Robert Leight).
- MinGW: patch #1024428 contributed by astar, fixed compilation issue in
Win32DynamicLibraryManager.cpp.
- MinGW, cygwin: enable build of shared library when using libtool.
patch #1194394 contributed by Stphane Fillod.
- autotool: applied patch #1076398 contributed by Henner Sudek. Quote:
"This patch allows AM_PATH_CPPUNIT to accept version
numbers without minor and micro version.
Now you can do:
AM_PATH_CPPUNIT(1.9)
instead of
AM_PATH_CPPUNIT(1.9.0)"
- Visual Studio 2005: removed deprecated warning.
* Documentation:
- Corrected many typos in cookbook and money example. Thanks to all
those who helped !
* Bug Fix:
- cppunit.m4: patch #946302, AM_PATH_CPPUNIT doesn't report result
if CppUnit is missing.
- Message/SourceLine: copy constructor have been specifically implemented
to ensure they are thread-safe even if std::string copy constructor
is not (usually on reference count based implementation).
- TestResultCollector: fixed memory leak occuring when calling reset().
* Contrib:
- added XSLT for compatibility with Ant junit xml formatter.
Patch #1112053 contributed by Norbert Barbosa.
See xml-xsl/cppunit2junit.xsl and cppunit2junit.txt for details.
- xml-xsl/report.xsl has been fixed to work with current xml output.
* (Possible) Compatiblity break:
- All text output is now done on cout() instead of sometime cerr &
sometime cout depending on the component.
- OStringStream definition has been removed from Portability.h. This
means that <sstream> is no longer included, and that ostringstream and
string might not be defined. In practice this should have no impact
since those includes have been moved to other CppUnit headers.
* Notes:
- CppUnit now uses the alias OStream when refering to std::ostream for
portability.
New in CppUnit 1.10.2:
----------------------
* Bug Fix:
- Memory checker: bug #938753, array bound read in
splitPathString() with substr if an empty string is passed.
- Memory leaks: bug #952912, many memory leaks removed in the
MFC test plug-in runner.
- Crash when using CPPUNIT_TEST_SUITE_REGISTRATION with cppunit dll.
Bug #921843. This bug was caused by a known STL bug in VC++ 6.
See http://www.dinkumware.com/vc_fixes.html <xtree> issue with shared
std::map in dll.
* Compilation:
- mingw & cigwin, bug #930338 & #945737 fixed.
- make install does not work on SunOS. Bug #940650 fixed.
- bug #933154, post-build step fails in directory with spaces
with Visual C++.
- DllPlugInTester, bug #941625 (char * string literal). Applied patch
contribued by Curt Arnold.
New in CppUnit 1.10.0 (same as 1.9.14):
--------------------------------------
* Assertions
- Ported exception assertion macros from cppunit 2 to the 1.9.x series:
CPPUNIT_ASSERT_THROW, CPPUNIT_ASSERT_NO_THROW,
CPPUNIT_ASSERT_ASSERTION_FAIL, CPPUNIT_ASSERT_ASSERTION_PASS.
* Deprecated:
- The helper macros: CPPUNIT_TEST_FAIL & CPPUNIT_TEST_EXCEPTION have
been deprecated. Use the new exception assertion macros instead.
* Bug Fix:
- cppunit-config: bug #903363, missing -ldl from the output of
cppunit-config --libs. Fixed thanks Eric Blossom patch.
- test plug-in(unix): Adding RTLD_GLOBAL allows test plug-ins
to provide symbols to shared objects they load themselves.
Thanks goes to Gareth Sylvester for this patch (#816563).
New in CppUnit 1.9.12:
---------------------
* Test Plug-in
- added support contributed support for UNIX systems that
have libdld and not libdl (e.g. hp-ux). Contributed by
Abdessattar Sassi.
* RTTI
- TypeInfoHelper now used gcc c++ abi to demangle typeinfo name thanks to
Neil Ferguson contribution.
* Bug Fix:
- MFC TestRunner: integrated bug fix from Tim Threlkeld for bug
#610191 and #610162. Fixed assertion when minizing dialog
(bug #643612).
- XMLOutputter: Fixed bug #676505: no space inserted between attributes
of XmlElement.
- CppUnit portability: fixed many mistakes relating to compilation
without type info or namespace reported by Philip Craig.
- Missing destructor with no throw specification for
DynamicLibraryManagerException. Bug #619059.
- Fixed missing export for operator <<(TextTestResult). Bug #610119.
- Missing include for typeinfo in TestNamer.h. Bug #662666.
* Compilation
- Fixed compilation issues for Borland C++ 6 and STLPort. Bug #694971,
#699794 and #662666.
- Fixed compilation issues for AIX.
- Fixed compilation issues for Visual C++ .NET 2002.
- Fixed doxygen usage in mingw environment (space not allowed in
doxygen path). Bug #700730.
- Fixed compilation issue for mingw (bug #711583).
New in CppUnit 1.9.10:
---------------------
- Major portability improvement
- Protector
- HelperMacros
- MFC TestRunner bug fixes
- Failure diagnostic
- Asserter
* Major portability improvement:
- Much work has been done to reduce C++ feature requirement to compile
CppUnit. It should now be possible to compile CppUnit on most
compilers, as long as STL are available (in std namespace or not),
with some form of strstream and iostream, as well as exception support.
See CodingGuideLines.txt for details.
* Protector
- Protector can be passed to the TestResult to 'protect' call to
setUp(), runTest() and tearDown() method. With this, it is easy to
capture exceptions which do not have std::exception as a base class,
such as CException or RWXMsg for example. TestResult and Protector
class documentation. Look at src/cppunit/DefaultProtector.cpp for
an example of implementation.
* Helper macros
- Mostly rewritten. It no longer use TestSuiteBuilder. A new object
TestSuiteBuilderContext was introduced. It is used to name test case,
create test fixture instance and add test to the fixture suite. It
is now much more easier to add custom test cases using
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS. Should also prevent most
compability break concerning that macro.
- Useful typedef are now public: TestFixtureType, ParentTestFixtureType.
- New typedef for custom test method parameter:
typedef TestSuiteBuilderContext<TestFixtureType>
TestSuiteBuilderContextType;
- added support for abstract test fixture with
CPPUNIT_TEST_SUITE_END_ABSTRACT(). See documentation for further
detail.
* Failure diagnostic
- setUp() and tearDown() now provides a detailed diagnostic of the
failure (assertion, exception...)
- If RTTI is allowed to extract type info, CppUnit will report the
actual exception type in the diagnostic.
* Asserter:
- A new AdditionalMessage class has been introduced. It is used for
assertion that takes an additional 'message' argument
(CPPUNIT_ASSERT_MESSAGE...). Since this macro has an implicit
constructor that take a string, which creates a Message with the
specified string as detail. That way, additional message can be a
single string or a complex Message object. See documentation for
example of use.
* Bug Fix:
- MFC TestRunner: bug #530426 (conflict between TestRunner and host
application's resources). A huge thanks to Steven Mitter for that one.
- MFC TestRunner: Browse button is now disabled while running test.
* Deprecated
- CppUnit::TextUi::TestRunner moved to CppUnit::TextTestRunner.
- CppUnit::MfcUi::TestRunner moved to CppUnit::MfcTestRunner.
- CppUnit::QtUi::TestRunner moved to CppUnit::QtTestRunner.
* Compatiblity break:
- CppUnitTextUi::TestRunner, removed runTestByName() and runTest().
- TestSuiteBuilder: removed templatized method
addTestCallerForException(). See implementation of
CPPUNIT_TEST_EXCEPTION implementation for an alternative.
- TestAssert: removed deprecated functions (those not using SourceLine)
assertImplementation(), assertNotEqualImplementation(),
assertEquals(). Moved non deprecated functions assertEquals() and
assertEquals() into CppUnit namespace.
- Plug-ins 'Parameters' typedef has been replaced by class
PlugInParameters. The method commandLine() returns what used to be in
Parameters[0]. This should avoid future compatibility break when the
parameters passing API will be defined.
- TestPlugIn::initialize() now takes a PlugInParameters in argument
instead of a Parameters.
- template <class T> void assertEquals() no longer has a default message
value (no impact, unless you used this function directly instead of
assertion macros).
- HelperMacros: renamed CPPUNIT_TEST_ADD to
CPPUNIT_TEST_SUITE_ADD_TEST.
- HelperMacros: removed CPPUNIT_TEST_CUSTOM. Instead use
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS and call context.addTest()
passing the test that was returned.
- HelperMacros: renamed CPPUNIT_TEST_CUSTOMS to
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS. Changed method signature to
static void aMethodName( TestSuiteBuilderContextType &context ).
You can replace the 3 previous parameters by context. (See
documentation for further detail).
New in CppUnit 1.9.8:
---------------------
- New custom test macros for fixture suite
- Exception message are now structured
- Added detail field to MFC TestRunner
- New XmlDocument class to easily create new XML output format
- XmlOutputter customization
- Test plug-in XMLOutputter hook
- ClockerPlugIn example includes test time in XML output
- DllPlugInTester allows test plug-in to hook the XmlOutputter
- Configurable CompilerOutputter wrapping
* New custom test macros
- 3 new macros have been added for use when declaring test fixture suite:
- CPPUNIT_TEST_CUSTOM : to specify a method that returns an instance of
Test to add to the suite
- CPPUNIT_TEST_CUSTOM : to specify a method that add some tests to the
suite
- CPPUNIT_TEST_ADD : to add a test to the suite. Used this to create custom
CPPUNIT_TEST_xxx macros.
See macros documentation for examples and details.
* Exception message
- Exception message are now stored in a Message object instead of a string.
A message is composed of two items:
- a short description (~20/30 characters)
- a list of detail strings
The short description is used to indicate how the detail strings should be
interpreted. It usually indicates the failure types, such as
"assertion failed", "forced failure", "unexpected exception caught",
"equality assertion failed"... It should not contains new line characters
(\n).
Detail strings are used to provide more information about the failure. It
can contains the asserted expression, the expected and actual values in an
equality assertion, some addional messages... Detail strings can contains
new line characters (\n).
This change allow ouputters to deal with all failure the same way (there is
no special case for the equality assertion any more).
* New XmlDocument class to easily create new XML output format
- Classes XmlDocument and XmlElement where extracted from XmlOutputter. This
help writing outputters that use a completly different XML format.
- XmlDocument represents a XML file, and XmlElement represents a XML element.
* XmlOutputter customization
- Xml output can be customized using XmlOutputterHook. To do so, subclass
XmlOutputterHook and register it to the XmlOutputter with addHook() before
call XmlOutputter::write().
Hook can be used to add some datas to the XmlDocument or the XmlElement of
a specific hook. Methods have been added to XmlElement to help navigating
and modifying the XmlDocument.
See ClockerPlugIn example.
* MFC TestRunner
- The name of the test is displayed just before being run.
- Browse Test Hierarchy dialog is resizable.
- Better (and cleaner) handling of windows resizing
- Failure list now only show the short description of the failure.
- Edit field added to display the details of the selected failure.
* MFC test plug-in runner (TestPlugInRunner):
- command line: a dll name can be specified on the command after -testsuite:
example: TestPlugInRunnerd.exe -testsuite Simpled.dll
- Layout configuration is stored/restored.
* Test plug-in XML output Hook
- TestPlugIn interface provides a mean for plug-in to register hook for
XML output. Practically, this allow plug-in to add specific data to the
output. See ClockerPlugIn example, which add timing datas to the xml
output.
* DllPlugInTester:
- added option -w / --wait to wait for the user to press a key before exiting.
- plug-in can now provides XmlOutputterHook to add specific datas to the
XML ouput. See ClockerPlugIn example.
* CompilerOutputter wrapping is parametrized
- Wrap column can be set with setWrapColumn(). Default is now 79 instead of 80.
- Wrapping can be disabled with setNoWrap().
* Examples:
- ClockerPlugIn: the example now use the new XmlOutputterHook. Test time are
now included in the XML output. See examples/ClockerPlugIn/ReadMe.txt for
details.
* Bug Fix:
- CompilerOutputter: fixed wrapping issues (UT magic!)
- DllPlugInTester: use ISO-LATIN1 encoding if none is given. Flag --xsl was
ignored.
- MfcUi plug-in runner (TesTPlugInRunner): better handling of history when
loading and reloading a dll.
- Qt Test Runner: minor bug fixes. Should compile on Unix.
- XmlOutputter: use the default encoding if an empty string is given as
encoding
* Compatibility Break:
- CompilerOutputter: removed printNotEqualMessage() and printDefaultMessage().
No longer needed since Exception message are processed in a generic way.
Removed wrap(). Extracted to StringTools.
- Exception constructor takes a Message instead of a string. Notes that the
first argument in Message constructor is a short description, not the message.
Therefore, the change will usualy have the following form:
Exception( Message( "assertion failed", oldMessage ) );
You may want to use Asserter functions instead of constructing and throwing
the exception manually.
- TestPlugInAdapter: renamed TestPlugInDefaultImpl.
- TestSuiteBuilder: removed default constructor. All remaining constructors
take an additional argument of type TestNamer used to specify the fixture
named and generate test case name. Remove template method
addTestCallerForException(). Use addTest() instead (see
CPPUNIT_TEST_EXCEPTION implementation).
- TextTestResult: most printing method were removed. This task is now delegated
to TextOuputter.
- XmlElement: renamed addNode() to addElement().
- XmlOutputter: removed methods writeProlog() and writeTestResult() which
are replaced by XmlDocument. Renamed makeRootNode() to setRootNode(). It
no longer returns the root node, but set the root node of the XML document.
- XmlOuputter::Node: class has been extracted and renamed XmlElement.
* Deprecated:
- Asserter: all functions that use a string for the failure message. Construct
a Message instead (see Exception constructor compatiblity break and
Exception message feature).
New in CppUnit 1.9.6:
---------------------
- DllPlugInTester can be parametrized from command line
- Two test listener plug-in examples
- An 'hello world' example & getting started document : Money
- Contribution: generic makefile for Borland 5.5 free compiler.
- Bug fixes
* DllPlugInTester:
- Advanced command line to support miscellaneous listener outputer.
Parameters can now be passed to test plug-in:
-c --compiler
Use CompilerOutputter
-x --xml [filename]
Use XmlOutputter (if filename is omitted, then output to cout or
cerr.
-s --xsl stylesheet
XML style sheet for XML Outputter
-e --encoding encoding
XML file encoding (UTF8, shift_jis, ISO-8859-1...)
-b --brief-progress
Use BriefTestProgressListener (default is TextTestProgressListener)
-n --no-progress
Show no test progress (disable default TextTestProgressListener)
-t --text
Use TextOutputter
-o --cout
Ouputters output to cout instead of the default cerr.
filename[="options"]
Many filenames can be specified. They are the name of the
test plug-ins to load. Optional plug-ins parameters can be
specified after the filename by adding '='.
[:testpath]
Optional. Only one test path can be specified. It must
be prefixed with ':'. See TestPath constructor for syntax.
'parameters' (test plug-in or XML filename, test path...) may contains
spaces if double quoted. Quote may be escaped with \".
Some examples of command lines:
DllPlugInTesterd_dll.exe -b -x tests.xml -c simple_plugind.dll CppUnitTestPlugInd.dll
Will load 2 tests plug-ins (available in lib/), use the brief test
progress, output the result in XML in file tests.xml and also
output the result using the compiler outputter.
DllPlugInTesterd_dll.exe ClockerPlugInd.dll="flat" -n CppUnitTestPlugInd.dll
Will load the 2 test plug-ins, and pass the parameter string "flat"
to the Clocker plug-in, disable test progress. Clocker being a test
listener plug-ins (it doesn't implements any tests, it just register
a TestListener), this is equivalent to say 'run all the test
of CppUnitTestPlugIn and use ClockerPlugIn as a TestLisener'.
DllPlugInTesterd_dll.exe CppUnitTestPlugInd.dll :Core
Will run the test named "Core" (a suite in the present case ) of the
test plug-in.
* Documentation
- New getting started documentation. Not completed yet, but probably
a good complement to the current cookbook. Explore the creation
of the Money example.
* Examples
- Money (examples/Money): the 'hello world' example. Unit tests for
a simple Money class.
- DllPlugInTesterTest (src/DllPlugInTester/DllPlugInTester.dsp):
unit tests for CommandLineParser. Not really an example, but only
slightly more complex than Money.
- ClockerPlugIn (examples/ClockerPlugIn): a test listener plug-in
that track tests and test suites running time. Parameter: "flat"
for a reporting with a flattened tree.
- DumperPlugIn (examples/DumperPlugIn): a test listener plug-in that
dump the test tree as it run. Paramater: "flat" for a reporting
with a flattened tree.
- CppUnitTestPlugIn (examples/cppunitest/CppUnitTestPlugIn.dsp):
CppUnit's test suite as a test plug-in.
* Contribution
- Contributed by project cuppa team (http://sourceforge.jp/projects/cuppa/):
- Makefile for CppUnit with Borland C++ 5.5 free compiler: does not
depend on a specific CppUnit version.
* Compatiblity breaks
- DllPlugInTester: (1.9.4 only), should add -c to DllPlugInTester
command line.
* Bug Fix:
- DynamicLibaryManager did not report the library name when loading a
a library.
- BeosDynamicLibraryManager: fixed thanks to Shibu Yoshiki
('cuppa' project team).
- Broken build on Unix should be fixed for most (thanks to
Jeffrey Morgan).
New in CppUnit 1.9.4:
----------------------
- More versatile, easier to make test plug-in.
- A PlugInManager to manage multiple test plug-ins.
- Crossplatform test plug-in runner.
- Crossplatform test plug-in example.
- A brief progress listener
- Easier test hierarchy creation
- Improved documentation.
- Tracking of test run start/end.
- Contribution: XML style sheet & borland 5.5 makefile.
- Help needed on the Unix side!
* Buildling on Unix:
- I did not get any feed back on the previous build issue on Unix. Using
a simple autobook example was useless to try to solve the problem. Here
is the issue:
CppUnit library build fine, it is the example I'm having trouble with.
Since the test plug-in have been added, CppUnit use the function
dlopen(), dlsym() and dlclose() on unix to load/unload the plug-in.
Those functions apparently requires to link another library when
building an exectuable. Here is was should be done:
- linking against the said library for each example.
- generates the shared library for the examples/simple/simple_plugin
example (source files are ExampleTestCase.cpp, ExampleTestCase.cpp
and SimplePlugIn.cpp).
- if possible, makes the above optionnal if --disable-test-plug-in
is defined:
- don't link the dlXXX library
- don't compile the plug-in example
- add #define CPPUNIT_NO_TESTPLUGIN 1 to the config file
Contact me on the mailing-list for more details.
* TestPlugIn:
- A simple fact I realised while testing: if you link your test plug-in
against the DLL version of cppunit (or shared library on Unix), then
test registered to the TestFactoryRegistry (it is what's hide behind
CPPUNIT_TEST_SUITE_REGISTRATION) are automatically shared. Changes
have been made to support that usage (CppUnit was crashing badly).
Using the TestFactoryRegistry provides much more flexiblity that
providing a single suite for the plug-in. As such:
- CppUnit plug-in should be linked against the dll version of CppUnit library.
- Plug-in should register their tests using the CPPUNIT_TEST_SUITE_xxx macros.
- 'homemade' suite can still be registred to the TestFactoryRegistry that is
passed as parameter on plug-in initialization. Notes that you must
unregister those suites during plug-in uninitialization, otherwise on
destruction, the TestFactoryRegistry will attempt to destroy them... Your
plug-in would have been already unloaded...
- Plug-in can accept parameters on initialization (notes that the Parameters
object is far from being stabilized, but whatever form it takes, it will be
a list of string).
- Plug-in can register their one listener for a test run. This means that you
can extends 'DllPlugInTester' by creating test plug-in... This also means
than you can listen to startTestRun()/endTestRun() to do some global
setUp/tearDown (to initialize globales resources, such as COM...)
- Why all this fuss around test plug-in ? Test plug-in are the incarnation of
an old concept: testable components...
* PlugInManager:
- The PlugInManager is used to load/unload plug-ins. It takes care of all
the 'plug-in' protocol and makes it easy to use multiple plug-ins at the
same time. It dispatches the addListener()/removeListener() message to
each plug-in.
* Crossplatform test plug-in runner (src/DllPlugInRunner):
- This application can be used to run your test plug-ins. It can load
multiple test plug-ins and run all or a specific test in the test
hierarchy returned by TestFactoryRegistry::getRegistry().makeTest().
- Plug-in loaded by the plug-in may also be custom TestListener.
- It can be use for post-build check and to debug the plug-in.
- Why use it? It keep you away from CppUnit API changes!
* Easier test hierarchy creation (TestFactoryRegistry/HelperMacros):
- added method addRegistry(name) to add a named registry to the registry.
see TestFactoryRegistry for an example of use.
- added macros CPPUNIT_REGISTRY_ADD( which, to ) and
CPPUNIT_REGISTRY_ADD_TO_DEFAULT( which ) to create test hierarchy at static
initialization (in the spirit of CPPUNIT_TEST_SUITE_xxx() macros).
* VerboseTestProgressListener:
- A new TestListener that prints the test name before running it. Most useful when
a test crashing, mean a application crash.
* Documentation:
- More details about the test plug-in, how to use it, how does it works...
See module/Writing Test Plug-in.
* Examples:
- examAdded crossplatform simple example. Equivalent to VC++ HostApp example.
- examples/simple: a very simple example, demonstrating the use of CppUnit
with a single TestFixture. Demonstrate both how to build an application
using TestRunner, and how to build a test plug-in to use with the
test plug-in runner.
* Contribution
- Contributed by project cuppa team (http://sourceforge.jp/projects/cuppa/):
- XML style sheet: transform CppUnit XML output into HTML.
- Makefile for CppUnit with Borland C++ 5.5 free compiler.
* Behavior changes:
- Test runner should call TestResult::runTest() to run the 'top level' test. This
will inform the TestListener of the test run start/end.
* Compatiblity break:
- TestFactoryRegistry don't own register test anymore. AutoRegisterSuite has
been updated to preverse its apparent behavior. It should be of concern
if you created and registered custom TestFactory.
- Removed TextTestProgressListener::done(). No longer needed, it listens
for endTestRun().
* Compatiblity Break for 1.9.2 users:
- TestPlugIn.h: CppUnitTestPlugIn as been completly rewritten.
- TestPlugIn.h: macro CPPUNIT_PLUGIN_IMPLEMENT() don't take any arguments.
- TestSuitePlugIn: removed. A similar functionnality is provided by
PlugInManager.
- TestPlugInDefaultImpl: renamed TestPlugInAdapter. It does not implements
any default behavior anymore.
- DllPlugInRunner: no longer support multiple specific tests. The test path must
be prefixed with ':'. Release and Debug configuration links against cppunit_dll.
* Bug Fix:
- Crash when linking CppUnit DLL within another DLL that registered test. Caused
by the destruction of tests registered to TestFactoryRegistry. Fixed by
providing a register/unregister interface and removing the ownership of
TestFactory to TestFactoryRegistry.
New in CppUnit 1.9.2:
----------------------
In short:
- Cleaner XML output
- Crossplatform Test plug-in
- TestPlugInSuite to wrap test plug-in
- More TestPlugIn documentation.
* TestPlugIn:
- The test plug-in functionnality has been rewritten from scrash.
TestPlugIn related macro are now crossplatform (exporting the plug-in
function from the dynamic library...).
- Class DynamicLibraryManager provides a generic way to access dynamic
library. Platform specific implementation provided for WIN32, unix, BeOs.
Can be very easily ported to new platform.
- A More flexible and hopefully extensible interface has been introduced
(CppUnitPlugIn).
- A default implementation using the test factory registry is provided
(TestPlugInDefaultImpl). Can be easily customized.
- The one line test plug-in declaration was renamed CPPUNIT_PLUGIN_IMPLEMENT.
See modules/Writing Test Plug-in documentation and examples/EasyTestPlugIn.
* XmlOutputter:
- XML output is now indented. Nodes that don't have children are one line
tag. The output can now easily be read.
* Compatibility break:
- class TestSucessListener was renamed to TestSuccessListener.
- XmlOutput: renamed tag <SuccessfulTests> to <SuccessfulTests>
- Global fix of the 'success' typo (was misspelled 'sucess'). Main impacts are listed
above, but check your own code in case you override some protected/private methods.
- TestPlugInInterface (include/msvc6/TestPlugInInterface.h): this header and class
are now obsolete. You should use include/cppunit/plugin/TestPlugIn.h instead.
Macro CPPUNIT_TESTPLUGIN_IMPL have been replaced by CPPUNIT_PLUGIN_IMPLEMENT.
- TestDecorator inherits Test instead of TestLeaf.
- DllPlugInTester only run DLL implementing the new new TestPlugIn interface.
New in CppUnit 1.9.0:
----------------------
In short:
- Exploration of the test hierarchy without RTTI support
- Utility methods to find a test in the hierarchy
- TestPath to store/load the path to a specific test in the hierarchy
- Generic TestRunner
- Style sheet support added to XML ouput.
- CompilerOutputter supports run-time parametrization of error location format.
- Tracking of test suite run.
- Debugging and post-build testing of DLL using DllPlugInTester.
- Easy creation a test plug-in and test plug-in new example
* Test:
- Exploration of the test hierarchy without RTTI support:
Added Test::getChildTestCount() and Test::getChildTestAt() to walk the test hierarchy
without RTTI.
- Utility methods to find a test in the hierarchy:
Added Test::findTest(), Test::findTestPath() and Test::resolveTestPath().
* TestPath:
- A new class that store the path to a specific test (list of pointer). Can be
converted into a string and constructed from a string. Typically used with
TestRunner.
* TestListener:
- Added startSuite() and endSuite() callback that are called before and after a
test suite runs its child tests. See TestListener for detail and new example.
* CompilerOutputter:
- Support run-time parametrization of compiler error format. Support for gcc error
format added. See CompilerOutputter::setLocationFormat().
* XmlOutputter:
- Added style sheet support.
- XML structure change (see Compatibility break)
* DllPlugInTester: (src/msvc6/DllPlugInTester, in src/CppUnitLibraries.dsw)
- An application to load a DLL test plug-in and run the specified test. Test
result are reported using a CompilerOutputter. It can be used for post-build
testing, but to debug DLL too! See examples/msvc6/TestPlugIn/TestPlugIn.dsp
which demonstrate both.
* TestPlugInInterface (include/msvc6/TestPlugInInterface.h):
- Easy creation a test plug-in with the new macro CPPUNIT_TESTPLUGIN_IMPL
that implements and exports everything for you.
See examples/msvc6/EasyTestPlugIn for an example.
* Compatibility break:
- Test::toString() has been removed. Applies to all subclass of Test.
It was not used by the framework and was source of confusion with getName().
- TestCase::run(void) and TestCase::defaultResult() have been removed. Using the
run() method with a TestResult instead.
- XmlOutput: added a message element to the XML structure. The message associated
to a failure is now in the content of <Message> element instead of in the content
of the <FailedTest> element.
Changed from:
<FailedTest id="6">
<Name>test6</Name>
<FailureType>Error</FailureType>
error2
</FailedTest>
To:
<FailedTest id="6">
<Name>test6</Name>
<FailureType>Error</FailureType>
<Message>error2</Message>
</FailedTest>
* Deprecated:
- CompilerOutputter::defaultOutputter(): use default constructor instead.
* Bug fix:
- XmlOutputter: did not escape content (bug #540944).
- Included qt/examples in distribution
- Removed dependency of MfcTestRunner on DSPlugIn. It should now compile with
VC++ 7.
New in CppUnit 1.8.0:
----------------------
In short:
- new assertions
- new facilities to write custom assertions
- new macros to define test case in your fixture
- registration of test fixture in named suite
- xml & compiler format test result output
- a new graphic test runner for the QT library
- MFC test runner window is resizable
- cppunit as a DLL
- Unicode support for MFC test runner.
- architecture clean-up: TestResultCollector extracted from TestResult.
- architecture clean-up: TestFixture extracted from TestCase.
- cookbook and documentation updated.
* New assertion (TestAssert.h):
CPPUNIT_FAIL(message) : equivalent to CPPUNIT_ASSERT_MESSAGE( message, false )
CPPUNIT_ASSERT_EQUAL_MESSAGE( expectedValue, actualValue, additionalMessage ):
behave like CPPUNIT_ASSERT_EQUAL but allow to add some contextual information.
* New macros to write test case (HelperMacros.h):
CPPUNIT_TEST_EXCEPTION that expect an exception of a specified type to
be thrown.
CPPUNIT_TEST_FAIL that expect a test to fail.
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION to register a suite in a named suite. See
cppunittest example for a demo.
* TextTestRunner (TextTestRunner.h):
-run() returns a boolean indicating is the run was successful.
-the constructor and setOutputter() allow you do define a specific outputter
to print the test result (CompilerOutputter, TextOutputter, XmlOutputter...)
-result() provide access to the result of the test run.
-eventManager() give access to the TestResult, allowing you to register others
TestListener.
* TestResult (TestResult.h):
- That class has been splitted in two: TestResult and TestResultCollector.
- TestResult manages the TestListener (registration and event dispatch), as
well as the stop flag indicating if the current test run should be interrupted.
All other responsabilites have been moved to TestResultCollector.
- TestResult no longer hold the result of the test run (this is done by
TestResultCollector which is a TestListener).
* TestListener (TestListener.h):
- all failures and errors are reported using a single method:
virtual void addFailure( const TestFailure &failure )
=> the failure object life time is limited to that of the method call.
Use TestFailure::isError() to distinguish error from failure.
Use TestFailure::clone() to obtain a duplicate of the failure.
* New helpers to construct your own assertion (Asserter.h):
It is now very easy to create your own assertion macro with failure
location.
Asserter namespace contains functions used to construct and throw exception
to report failure. See Asserter documentation for an example of usage, and
examples/cppunittest/XmlUniformiser.h for a real life example.
CPPUNIT_SOURCELINE() macro have been added (SourceLine.h). It captures the
failure location in a SourceLine object. Use it to write your own macros.
Asserter namespace contains functions used to construct and throw exception
to report failure. See Asserter documentation for an example of usage, and
examples/cppunittest/XmlUniformiser.h for a real life example.
* TestListener (TestListener.h):
- TestSucesssListener : a simple listener that checks if a test has failed.
- TestResultCollector : store all the test result. This class has been
extracted from the hold TestResult class.
- TextTestProgressListener : print dot on cout to each time a test ends.
Letter 'F' and 'E' are printed when a failure or an error occurs.
* Output (Outputter.h):
- XML output: You can dump the TestResult as an XML document using
XmlOutputter. See examples/cppunittest/XmlOutputterTest.cpp for document
structure and usage.
- Compiler compatible output : CompilerOutputter print the result in a
compiler compatible format. You can use your IDE to jump to the first
failure. See examples/cppunittest/CppUniTestMain.cpp for an example of usage.
- Text output : replace the deprecated TextTestResult. Print the result in
a human readable format.
* NotEqualException constructor take an additional message (usually used to
point out where the difference occured between the expected and actual value)
that can be retreived with additionalMessage(). See Asserter documentation for
an example of usage.
* CppUnit
- CppUnit can be compiled as a DLL (WIN32 platform).
DLL can be generated by the cppunit_dll.dsp project. You must define the
pre-processor symbol CPPUNIT_DLL when linking against CppUnit DLL.
See cppunittests examples for an example.
* TestRunner
- Qt TestRunner : a test runner for the Qt library (http://www.trolltech.com).
See examples/qt for an example of use.
- MFC TestRunner : the dialog can now be resized. List view column sizes,
as well as the dialog size, are saved. Unicode configurations have been added.
* Deprecated
- TextTestResult : use the test listener TextTestProgressListener and the
ouputter TextOuputter instead.
- Methods having fileName, lineNumber as parameter. Usually replaced by
a similar method that take a SourceLine parameter. Exception and
TestAssert are impacted.
- TestRegistryFactory::registerFactory( const std::string &name,
TestFactory *factory ).
You must define the symbol CPPUNIT_ENABLE_SOURCELINE_DEPRECATED to enable
old Exception constructor, UNKNOWNFILENAME and UNKNOWNLINENUMBER, as well
as function defined in the TestAssert namespace. The exception construction
and throwing as been moved to Asserter namespace.
* Compatibility break:
TestResult has been splitted in two class. TestResultCollector compatibility
breaks refer to the methods that were previously in TestResult.
- TestListener::addError() was removed. addFailure() is used to report
any kind of failure.
- TestResultCollector::errors() was removed. Use failures() instead.
- TestResultCollector::failures() now reports all kind of failures.
- TestResultCollector::failures() returns a const reference.
- void TestListener::addFailure( TestFailure *failure ) was removed.
- void TestListener::addError( TestFailure *failure ) signature changed.
- CPPUNIT_ASSERT_EQUAL_MESSAGE: changed arguments order. 'message' is now
the first argument instead of the last (like CPPUNIT_ASSERT_MESSAGE).
Notes that CPPUNIT_ASSERT_EQUAL was introduced in release 1.7.3.
- directory for TestRunners as moved from cppunitui/ to cppunit/ui/ (concern
only users of release 1.7.10)
* Bug fix:
- test ExceptionTest.testAssignment() don't fail anymore on VC++. See FAQ
for detail.
New in CppUnit 1.6.1
--------------------
* This is a bug-fixing release.
New in CppUnit 1.6.0
--------------------
* All CppUnit macros now begin with "CPPUNIT_".
Macros CU_TEST_SUITE, CU_TEST, CU_TEST_SUITE_END, CU_TEST_SUB_SUITE,
and CU_TEST_SUITE_REGISTRATION are renamed but are otherwise unchanged;
they take the same arguments, and have the same effect. The old-style
macros can be used if your sources #define CPPUNIT_ENABLE_CU_TEST_MACROS
to 1 before including any CppUnit headers.
Macros assert, assertEqual, and assertDoublesEqual, have been replaced
by CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, and CPPUNIT_ASSERT_DOUBLES_EQUAL,
respectively. Macro assertLongsEqual is replaced by CPPUNIT_ASSERT_EQUAL.
The old assert macros can be used if your sources #define
CPPUNIT_ENABLE_NAKED_ASSERT to 1 before including any CppUnit headers.
The old macro names are deprecated and will vanish in a future version
of CppUnit.
* Equality assertion CPPUNIT_ASSERT_EQUAL(expected,actual) can test
any type of expression. The types of "expected" and "actual" must
be the same; use a cast if necessary.
* Equality tested using CPPUNIT_ASSERT_EQUAL may be re-defined using
a traits class. Ditto for the string representation used in the
diagnostic messages.
* New assertion with arbitrary message: CPPUNIT_ASSERT_MESSAGE.
* A test case obtained using class TestCaller may check that
a particular exception is thrown.
* CppUnit has a test suite for itself!
* VC++ integration for MFC TestRunner.
|