Unit tests in Singular kernel

6 views
Skip to first unread message

benjamin schnitzler

unread,
Nov 19, 2013, 1:24:01 PM11/19/13
to singula...@googlegroups.com
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

Oleksandr

unread,
Nov 22, 2013, 9:51:39 AM11/22/13
to singula...@googlegroups.com, benjamins...@googlemail.com
Hi Benjamin,

AFAIK, that part is current not useable by Singular ([master]) in any way :(

Note that in [Spielwiese] Singular we use a light-weight unit-testing-framework: CxxTests (see libpolys/tests/), 
which is easier to use. Therefore it is not likely that we will resurrect that part in [Spielwiese] anytime soon.

Sorry, but i can only help with writing unit-tests for [Spielwiese] Singular.

Cheers,
 Oleksandr
Reply all
Reply to author
Forward
0 new messages