• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..08-Sep-2021-

cxxtest/H08-Sep-2021-5,6854,256

docs/H03-May-2022-8458

INSTALL_NOTESH A D08-Sep-202166 21

VersionsH A D08-Sep-20214.5 KiB153129

copyingH A D08-Sep-202125.8 KiB505418

cxxtest.specH A D08-Sep-20211 KiB4133

cxxtestgen.plH A D08-Sep-202114.1 KiB552467

cxxtestgen.pyH A D08-Sep-202121.1 KiB606522

readmeH A D08-Sep-20211.2 KiB6443

todoH A D08-Sep-2021949 3523

readme

1Introduction
2------------
3
4CxxTest is a JUnit/CppUnit/xUnit-like framework for C++.
5
6Its advantages over existing alternatives are that it:
7 - Doesn't require RTTI
8 - Doesn't require member template functions
9 - Doesn't require exception handling
10 - Doesn't require any external libraries (including memory management,
11   file/console I/O, graphics libraries)
12
13This makes it extremely portable and usable.
14
15CxxTest is available under the GNU Lesser General Public Licence (LGPL).
16See http://www.gnu.org/copyleft/lesser.html for the license.
17
18Simple user's guide
19-------------------
20
211. Create a test suite header file:
22
23MyTest.h:
24  #include <cxxtest/TestSuite.h>
25
26  class MyTestSuite : public CxxTest::TestSuite
27  {
28  public:
29      void testAddition( void )
30      {
31          TS_ASSERT( 1 + 1 > 1 )
32          TS_ASSERT_EQUALS( 1 + 1, 2 )
33      }
34  };
35
36
372. Generate the tests file:
38
39 # cxxtestgen.pl -o tests.cpp MyTestSuite.h
40
41
423. Create a main function that runs the tests
43
44main.cpp:
45  #include <cxxtest/ErrorPrinter.h>
46
47  int main( void )
48  {
49      CxxText::ErrorPrinter::runAllTests();
50      return 0;
51  }
52
53
544. Compile and run!
55
56  # g++ -o main main.cpp tests.cpp
57  # ./main
58  Running 1 test(s).OK!
59
60
61Advanced User's Guide
62---------------------
63See docs/guide.html.
64