Cxxtest guide CxxTest User ? s Guide Revision Erez Volk erez v at users dot sourceforge dot net Ci Table of Contents Introduction About this guide Getting started Getting CxxTest Your ?rst test Your second test Graphical user interface Really using CxxTes

CxxTest User ? s Guide Revision Erez Volk erez v at users dot sourceforge dot net Ci Table of Contents Introduction About this guide Getting started Getting CxxTest Your ?rst test Your second test Graphical user interface Really using CxxTest What can you test TSFAIL TSASSERT TSASSERTEQUALS TSASSERTSAMEDATA TSASSERTDELTA TSASSERTDIFFERS TSASSERTLESSTHAN TSASSERTLESSTHANEQUALS TSASSERTPREDICATE TSASSERTRELATION TSASSERTTHROWS and friends TSTRACE and TSWARN The ETS macros The TSM macros The ETSM macros Running the samples Test ?xtures Test suite level ?xtures Integrating with your build environment Overview Actually doing it Using Make ?les Using Cons Using Microsoft Visual Studio Using Microsoft Windows DDK Graphical user interface Starting the GUI minimized Leaving the GUI open Screenshots Cii Advanced topics Aborting tests after failures Controlling this behavior at runtime Commenting out tests Comparing equality for your own types The equality operator Value traits Unknown types Enumeration traits De ?ning new value traits De ?ning value traits for template classes Overriding the default value traits Global Fixtures World ?xtures Mock Objects Actually doing it Advanced topic with mock functions Void functions Calling the real functions while testing When there is no real function Functions in namespaces Overloaded functions Changing the mock namespace Test Listeners and Test Runners Other test listeners The stdio printer The Yes No runner Template ?les Dynamically creating test suites Static initialization Appendix A Command line options A ? -- version ? A ? --output ? A ? --error-printer ? A ? -- runner ? A ? --gui ? A ? --include ? A ? --template ? A ? --have-eh ? A ? --no-eh ? A ? --have-std ? A ? --no-std ? A ? --longlong ? A ? --abort-on-fail ? A ? -- part ? A ? --root ? A ? --no-static-init ? Ciii Appendix B Controlling the behavior of CxxTest B CXXTESTHAVESTD B CXXTESTHAVEEH B CXXTESTABORTTESTONFAIL B CXXTESTUSERVALUETRAITS B CXXTESTOLDTEMPLATESYNTAX B CXXTESTOLDSTD B CXXTESTMAXDUMPSIZE B CXXTESTDEFAULTABORT B CXXTESTLONGLONG Appendix C Runtime options C setAbortTestOnFail bool C setMaxDumpSize unsigned Appendix D Version history CChapter Introduction Introduction CxxTest is a JUnit CppUnit xUnit-like framework for C Its advantages over existing alternatives are that it ? Doesn ? t require RTTI ? Doesn ? t require member template functions ? Doesn ? t require exception handling ? Doesn ? t require any external libraries including memory management ?le console I O graphics libraries In other words CxxTest is designed to be as portable as possible Its only requirements are a reasonably modern C compiler and either Perl or Python However when advanced features are supported in your environment CxxTest can use them e g catch unhandled exceptions and even display a GUI In addition CxxTest is slightly easier to use than the C alternatives since you don ? t need to ??register ? your tests It also features some extras like a richer set of assertions and even support for a ??to do ? list see TS WARN CxxTest is available under the GNU Lesser General Public License About this guide This guide is

  • 34
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise
Partager