Menu

How to generate text output for test cases?

Help
2003-05-07
2003-05-16
  • Bernardo Sana

    Bernardo Sana - 2003-05-07

    Hi,

    How can I generate a text report from all the test cases runned in my MFC application? I'm not sure about how to use the  TextOutputter class.

    From my application, the only thing I'm doing right now is:

    (....)
    CppUnit::MfcUi::TestRunner runner;
    runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
    runner.run();
    (...)

    I want to generate a text/xml file with the results right after running all test cases..

    How can i do it?

    regards

    bernardo

     
    • Anonymous

      Anonymous - 2003-05-08

      here it is.... to generate text file.

      std::ofstream ofs;
      ofs.open(".\\output.txt");
      CppUnit::TextOutputter* to = new CppUnit::TextOutputter(&runner.result(), ofs);
      runner.setOutputter(to);

      CppUnit::TestFactoryRegistry& registry=CppUnit::TestFactoryRegistry::getRegistry();

      runner.addTest(registry.makeTest());
      bool wasSucessful = runner.run();

       
    • Bernardo Sana

      Bernardo Sana - 2003-05-16

      Thank Kiran!

       

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.