User forums > Using Code::Blocks
Using CodeBlocks projects with unit testing.
Slix:
--- Quote from: oBFusCATed on July 24, 2010, 11:21:59 pm ---Run the test executable as a post build and make it print its output to stdout or stderr
--- End quote ---
Yeah, but which project's post build?
killerbot:
the unit test project build step, cause that on is producing an executable [$exe_output]
chocbudda:
OK:
I have followed the instructions laid out above and it all makes sense,
right up until I try to write a test.
i get the auto complete so im guessing ive linked things correctly ...however when i try to compile i get errors.
I am very new to C++ and i am sure i am missing something in how to reference the project I am trying to test...here's my code & the error message
(any googling has simply referred me to the link /search directories which i have already set, so perhaps it is simply a syntax problem on my end
any help appreciated (I've a feeling this is going to be one of those REALLY obvious problems once its pointed out to you situations.
\firsttests.cpp||In member function 'virtual void TestOneForTheRoad::RunImpl() const':|
obj\Debug\firsttests.o:\firsttests.cpp|8|undefined reference to `MyTic::getLimit() const'|
the code is:
--- Code: ---
#include "firsttests.h"
#include "myTic.h"
#include "UnitTest++.h"
TEST( OneForTheRoad)
{
MyTic theTick;
float theLimit = theTick.getLimit();
}
--- End code ---
I've also tried
--- Code: --- MyTic theTick = MyTic::MyTic();
const float theLimit = theTick.getLimit();
--- End code ---
chocbudda:
:?
Ok...ummm I should edit up there, but I'm gonna be brave and admit...
firstly it was an assignment
secondly they gave us startup code ...with functions I never used...
(think i just gave the punchline away)
thirdly:
Well
I never really ummmm needed to write the... ummm well you probably get it
"undefined reference"..... makes PERFECT sense....NOW
:oops:
Navigation
[0] Message Index
[*] Previous page
Go to full version