This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hello All, I updated my cygwin installation using setup.exe version 2.774, and I included the binary?distribution?of the cppunit package (cygwin package version?1.12.1-2). I wrote compiled and built a simple unit test program using G++ (cygwin package version 3.4.4-999). After building and running the unit testing program, program gives the following message (in summary): terminate called after throwing an instance of 'CppUnit::Exception' This is not correct. The CppUnit framework should catch all CppUnit exceptions and report them as unit test failures. Next, I copied the source code package (using setup.exe). Then, I un-compressed the tarball, and I built and installed the cppunit package over the top of the binary distribution (using ./configure, make, make check, make install). I re-built my simple unit testing program, and I get the output: $ ./a.exe .F !!!FAILURES!!! Test Results: Run:? 1?? Failures: 1?? Errors: 0 1) test: MyUnitTests::test1 (F) line: 29 testme.cpp forced failure - This is a failure. This is the expected output of this unit test. I have attached the simple unit test example and my cygcheck output file for your reference.
#include <iostream> using namespace std; #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/ui/text/TestRunner.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> class MyUnitTests : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( MyUnitTests ); CPPUNIT_TEST( test1 ); CPPUNIT_TEST_SUITE_END(); public: MyUnitTests() {} virtual ~MyUnitTests() {} void setUp() { } void tearDown() { } void test1(void) { CPPUNIT_FAIL("This is a failure."); } }; CPPUNIT_TEST_SUITE_REGISTRATION( MyUnitTests ); int main( int argc, char **argv) { CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); bool wasSuccessful = runner.run( "", false ); if (wasSuccessful) return 0; else return 1; }
Attachment:
cygcheck.out
Description: Binary data
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |