no test found under Windows

Help
2004-12-02
2013-04-22
  • xaliphostes

    xaliphostes - 2004-12-02

    I have some trouble using CppUnit under Window$ (which works fine under Linux for the same code).

    I use a TestFixture like that:
    ----------------- begin H ----------------------
    class MyTest : public CPPUNIT_NS::TestFixture  {
      CPPUNIT_TEST_SUITE(MyTest) ;
      CPPUNIT_TEST(test1) ;
      CPPUNIT_TEST_SUITE_END();
    protected:
      void test1() ;
    } ;
    ------------------ end H -----------------------
    ---------------- begin CPP ---------------------
    #include "my_test.h"
    CPPUNIT_TEST_SUITE_REGISTRATION(MyTest) ;
    void MyTest::test1() {
    }
    ------------------ end CPP ---------------------
    This create the dll with the exported function entry:
       "cppunitTestPlugin"

    However, when I load this in the follwing testrunner, the runner load the dll correctly, when no test function are found :-(

    ------------ begin RUNNER -----------------------
    ...
    CppUnit::TextUi::TestRunner runner ;
    ...
    CppUnit::TestFactoryRegistry &registry =
        CppUnit::TestFactoryRegistry::getRegistry() ;
    runner.addTest( registry.makeTest() ) ;
    runner.run( "", false ) ;
    -------------- end RUNNER -----------------------

    What is wrong?
    Note: In the Makefile, the preprocessor CPPUNIT_DLL is defined, and the dll is linked against cppunit_dll.lib, whereas the runner is linked against cppunit.lib

     
    • xaliphostes

      xaliphostes - 2004-12-02

      Oooops I misspell a word:
      "However, when I load this in the follwing testrunner, the runner load the dll correctly, BUT no test function are found...the test1() is not launched"

       

Log in to post a comment.