Background: I use cppunit 1.12.1 on a Linux/GCC platform. I like to put my testing classes in a namespace, such as:
-- MyTests.cpp:
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
namespace Testing
{
class MyTests : public CppUnit::TestFixture
{
public:
void setUp();
void tearDown();
void myTestcase();
protected:
CPPUNIT_TEST_SUITE(Testing::MyTests);
CPPUNIT_TEST(myTestcase);
CPPUNIT_TEST_SUITE_END();
};
}
--
-- textmain.cpp:
int main(int argc, const char* argv[])
{
CppUnit::TextTestRunner runner;
runner.addTest(Testing::MyTests::suite());
CppUnit::BriefTestProgressListener listener;
runner.eventManager().addListener(&listener);
bool result = runner.run(argc > 1 ? argv[1] : "",
false, // doWait
true, // doPrintResult
true); // doPrintProgress
return result ? 0 : 1;
}
--
Problem: The name of the testing class is not properly demangled. For example:
"N7Testing7MyTestsE::myTestcase. : OK"
^^ ^ ^
Hi there,
I've also experienced same bug issue, for some reason cppunit prints the length of the namespace.
Last edit: Emilio Garcia Quintana 2021-01-18