Menu

VS2005 Wizard always returns OK

Help
starman90
2007-11-14
2013-04-22
  • starman90

    starman90 - 2007-11-14

    I installed CPPUnit and the wizard according to README's and website docs and environment vars and etc... on and on. 

    The wizard creates a project for me just fine (No compiler, linker errors/warnings). 
    However, in the included test1() method I purposely put a "false" value in it to see the result like:  CPPUNIT_ASSERT(  1 == 0 );  or CPPUNIT_ASSERT(  false );

    Neither of these are caught by CPP Unit.  Also, The XML page it generates says that no tests were run.  So somthing is wrong.

    Any help is appreciated:)

     
    • anniehui

      anniehui - 2007-11-19

      Hi starman90,

      I have little doubts on how to setup the VS2005 Wizard. First of all, are downloading from CPPUnitProjectWizard.7z ?I had read the README and from http://cppunit.sourceforge.net/cppunit-wiki/CppUnitVisualStudio2005Wizard but I am confused especially :-

      The project requires that the environment variable CPPUNITDIR is defined so that
      %CPPUNITDIR%\Include contains the folder CPPUNIT\Include and
      %CPPUNITDIR%\LIB contains the CPPUnit LIB files e.g. cppunit.lib.

      Where should I edit this? How should I run my cpp project to call this Wizard? Can you provide any screenshot to follow? You can email me to annieong81@hotmail.com

      Thanks in advance.

      Regards
      Annie

       
    • Daniel

      Daniel - 2007-11-21

      If no tests appear to be running (having run into this myself in the past but I'm not using VS2005) check to see if you are using 'named' suite registration.  If you are, then you must include the name of the suite as a parameter when executing your tests.  If this IS the problem you are seeing, then I'd recommend also registering your suite under the default ('All Tests').

      The command you would use in your test class would look something like the following:

      CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MyClass_test, "MyClass" );  // named suite registration
      CPPUNIT_TEST_SUITE_REGISTRATION( MyClass_test );  //default registration

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.