Dear Singular developement team,
I recently started to wonder, if there is an official Unit-testing-Interface for Singular and found some Code in tests/Singular . Is this usable and an official method? How do I use it (I tried to understand it, see the next paragraph)? How do I compile it? How to use it from within the Singular kernel?
As far as I understand it, I have to write a test-class lying in Singular::tests which hast to inherit from CPPUNIT_NS::TestFixture, say Singular::tests::ExampleTestClass. I have to write some test function members, say test_member() and have to register them in the class. I also have to implement public setUp() and tearDown() methods and a virtual Destructor. Is that all, do I need anything else, e.g. would this be a valid test-class:
namespace Singular {
namespace tests {
class ExampleTestClass : public CPPUNIT_NS::TestFixture {
CPPUNIT_TEST_SUITE(Singular::tests::ExampleTestClass);
CPPUNIT_TEST( test_member );
CPPUNIT_TEST_SUITE_END();
public:
virtual ~ExampleTestClass() {}
void setUp();
void tearDown();
private:
void test_member();
};
}
}
(Well I guess it would be useful to make test_member() protected if I wanted this test to be extendable.)
Thank you for your help,
Benjamin