Menu

Progress display

Help
Rob
2005-10-28
2013-04-22
  • Rob

    Rob - 2005-10-28

    I am new to CppUnit (haven't used equivalents e.g. JUnit either). I've been evaluating it using a simple stack class, and am getting some test failures, woohoo! :D
    I have created a TestFixture like this:

    class StackTest : public TestFixture
    {
       //...
       CPPUNIT_TEST(testConstructor);
       // ...
    };

    There are several tests, and one of them is creating a seg fault (joy!)
    What I want to do is to be able to see the name of each test as it is run so that I can easily identify which test segfaults without having to count the dots...
    Is it possible to do this? Here is the code that runs the testing:

    CPPUNIT_TEST_SUITE_REGISTRATION(StackTest);
    int main(void)
    {
       CppUnit::TextTestRunner runner;
       CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
       runner.addTest(registry.makeTest());
       bool success = runner.run("", false);
       return success? 0 : 1;
    }

     
    • Baptiste Lepilleur

      Use BriefTestProgressListener for this. Look at DllPlugInTester to see how to use it.

      Baptiste.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.