Author Topic: Unit testing output  (Read 3089 times)

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Unit testing output
« on: April 21, 2008, 02:14:50 am »
I've recently integrated unit-- into one of my projects, and I'd love to get it integrated into the message output when I run my tests, giving clickable errors just like the compiler output.  Is this possible?  The messages themselves are easy to parse, I just don't know where this would go (a plugin?  a tool?  You tell me!)

Quote from: unit--
X
messageTest
C:\dev\Denkatsu\graphNodes\tests\testGraphNodes.cpp:60: Assertion failed: <!node->sendMessage(msg) && "Message should have been received and processed">
X
connectTest
C:\dev\Denkatsu\graphNodes\tests\testGraphNodes.cpp:47: Assertion failed: <f.movieFile->dest() != f.movieClip && "Destination should be set after connection">
.
2 cases failed
Total 3 test cases
0 sec.
Cheers,
Revvy

Offline Greatwolf

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Unit testing output
« Reply #1 on: August 18, 2010, 10:39:40 am »
well one possibility is to set your project up to automatically run the unit tests after a successful build -- under post build section. The unit test results will show in the build log like any other. From there you can have C::B just parse it into the Build messages. Goto Settings->Compiler debugger settings->Other settings->Advance options->Output parsing. From there just define a new parsing regex that describes how to parse the messages from your unit test.

If anyone have any other suggestions, comments or another way to do it please add them here.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Unit testing output
« Reply #2 on: August 18, 2010, 10:44:33 am »
Hi,

have a look here : http://wiki.codeblocks.org/index.php?title=UnitTesting

You just have to make sure that your unit test framework gives its output in gcc compiler messages style.