CppUnit with make

Alex
2006-03-14
2013-04-22
  • Alex
    Alex
    2006-03-14

    Hi !
    I have a little problem with CppUnit :
    I have some Tests as TestSuites(for example:Test1 and Test2). I will a possibility
    to choose which Tests will run. I make it with
    "make" and Macros:
    make TEST="Test1 Test2"
    in the makefile i create another Macro: ALLTESTS,
    it has the following text :
    ALLTESTS="ALLTESTS=CPPUNIT_TEST_SUITE_REGISTRATION(Test1); CPPUNIT_TEST_SUITE_REGISTRATION(TEST2);". In my main-Function stands the following code :
    #ifdef ALLTESTS
    ALLTESTS
    #endif
    the Problem is : you are not allowed to use
    CPPUNIT_TEST_SUITE_REGISTRATION() twice in
    one codeline(why - it stands in the dokumentation of CppUnit).
    Does anyone have ideas how can i solve my problem ?
    thanx

    p.s.: sorry for my english :-)

     
    • Alex
      Alex
      2006-03-14

      i forgot one detail,
      when i compile the file, i make following :

      gcc -D $(ALLTESTS)