Author Topic: Unit test integration into IDE  (Read 3749 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Unit test integration into IDE
« on: October 17, 2017, 03:04:44 pm »
Hi,

At times for testing C code I use CUnit. Can this usage be integrated into Code::Blocks IDE ?

As an example visit this link:

https://netbeans.org/kb/docs/cnd/c-unit-test.html

Code::Blocks SVN
OS : Ubuntu LTS

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Unit test integration into IDE
« Reply #1 on: October 17, 2017, 04:32:33 pm »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: Unit test integration into IDE
« Reply #2 on: October 17, 2017, 05:59:03 pm »
hope this helps http://wiki.codeblocks.org/index.php/UnitTesting

I followed the given instructions in the provided link, some points:

  • When I do a Build and run I get the console output. However a Rebuild shows output on Build log as expected.
  • A colored output could be an improvement.
  • Clicking on failure/success may take one to relevant part of code.
Code::Blocks SVN
OS : Ubuntu LTS