Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 08-Sep-2021 | - | ||||
cxxtest/ | H | 08-Sep-2021 | - | 5,685 | 4,256 | |
docs/ | H | 03-May-2022 | - | 84 | 58 | |
INSTALL_NOTES | H A D | 08-Sep-2021 | 66 | 2 | 1 | |
Versions | H A D | 08-Sep-2021 | 4.5 KiB | 153 | 129 | |
copying | H A D | 08-Sep-2021 | 25.8 KiB | 505 | 418 | |
cxxtest.spec | H A D | 08-Sep-2021 | 1 KiB | 41 | 33 | |
cxxtestgen.pl | H A D | 08-Sep-2021 | 14.1 KiB | 552 | 467 | |
cxxtestgen.py | H A D | 08-Sep-2021 | 21.1 KiB | 606 | 522 | |
readme | H A D | 08-Sep-2021 | 1.2 KiB | 64 | 43 | |
todo | H A D | 08-Sep-2021 | 949 | 35 | 23 |
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