Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: whatx on January 24, 2008, 03:59:56 am

Title: Could I use CppUnit in code::blocks?
Post by: whatx on January 24, 2008, 03:59:56 am
I want to make unit test in code::blocks,
Is there convinent way to plug CppUnit into the IDE.
Or is it support some other test framework?
 Thanks a lot
Title: Re: Could I use CppUnit in code::blocks?
Post by: killerbot on January 24, 2008, 07:38:53 am
HI,

I think you should be able to use it.
I myself am using : UnitTest++ http://unittest-cpp.sourceforge.net/.
It is a very good framework.

I will write an article about it, you can run the tests as post build steps and when a test fails you can click in the build messages list to jump to the failing test.

Just give me a few days to write the article ;-)
Title: Re: Could I use CppUnit in code::blocks?
Post by: Mr_LJ on April 21, 2009, 09:15:49 pm
Hello,

I would like to use CppUnit with Codeblocks as well (or perhaps UnitTest if it's easier to make it work).
Is there any article about it by now?

best regards
L J
Title: Re: Could I use CppUnit in code::blocks?
Post by: killerbot on April 21, 2009, 11:51:00 pm
shame on me :-(

Will try to do it in the coming weeks  :oops:
Title: Re: Could I use CppUnit in code::blocks?
Post by: Mr_LJ on April 24, 2009, 12:26:00 pm
Hi killerbot,

that would be great!

best regards
LJ
Title: Re: Could I use CppUnit in code::blocks?
Post by: Mr_LJ on June 01, 2009, 02:13:48 pm
Hello killerbot,

How do things look?
Title: Re: Could I use CppUnit in code::blocks?
Post by: killerbot on June 01, 2009, 03:52:14 pm
have made some progress !!! Not completely finished yet.
Title: Re: Could I use CppUnit in code::blocks?
Post by: Mr_LJ on September 01, 2009, 04:21:15 pm
Hello,

how do you get ahead with the article?

regards
LJ
Title: Re: Could I use CppUnit in code::blocks?
Post by: oBFusCATed on September 01, 2009, 05:05:32 pm
Tutorial for unittest++:

0. Read the docs first :lol: at http://unittest-cpp.sourceforge.net/UnitTest++.html
1. Create console project
2. Change the code in main.cpp to look like this:

Code
// test.cpp
  #include <UnitTest++.h>

  TEST(FailSpectacularly)
  {
    CHECK(false);
  }

  int main()
  {
    return UnitTest::RunAllTests();
  }
3. Add the include paths to the unittest++
4. Add linking options
5. Compile and run it...
6. If errors goto 3/4
7. Add a post build step for the test project to run the resulting executable
8. Write you tests and have fun.

If you know how to setup projects with codeblocks you won't have problems with this.

Best regards
Title: Re: Could I use CppUnit in code::blocks?
Post by: Mr_LJ on September 03, 2009, 11:24:11 pm
thanks for that instruction :D
Title: Re: Could I use CppUnit in code::blocks?
Post by: MortenMacFly on September 04, 2009, 06:38:38 am
thanks for that instruction :D
--> Isn't that something for the WiKi?
Title: Re: Could I use CppUnit in code::blocks?
Post by: oBFusCATed on September 04, 2009, 01:28:08 pm
Probably, but where to put it?
Title: Re: Could I use CppUnit in code::blocks?
Post by: MortenMacFly on September 04, 2009, 09:09:54 pm
Probably, but where to put it?
How about a new sub-section here:
http://wiki.codeblocks.org/index.php?title=User_documentation#Third-party_libraries

(Scroll down untilo you see the section "Third-party libraries ".)