symbian os unit download
Home arrow Community Forum
Symbian OS Unit
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Add a testsuite in your own header/code file (1 viewing) (1) Guest
This is the forumheader in the basic forum information
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Add a testsuite in your own header/code file
#21
iame (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Add a testsuite in your own header/code file 1 Year ago Karma: 0  
i want to add my testsuite in my own header/code file to project.The tutorial document say:
QUOTE:

If you add a new test suite to your project (e.g. TestNewSuite.ccp,.h) in its own code and header file then you must update the test runner build file testgen.bat to include the new suite header filename:-

perl -S ..\..\cxxtestgen.pl -o TestDriver.h TestHeader.h TestNewSuite.h



and also the ExtraTestBuildTasks.bldmake file:-

$(INCDIR)\testdriver.h: $(INCDIR)\TestHeader.h:$(INCDIR)\TestNewSuite.h


but i can't find the correct line in ExtraTestBuildTasks.bldmake file,the content of my file is:
QUOTE:

...

INCDIR=..\test

TESTDRIVER_FILE=$(INCDIR)\testdriver.h
MAKEFILE : $(TESTDRIVER_FILE)

$(TESTDRIVER_FILE): $(INCDIR)\TestHeader.h
pushd . & cd $(INCDIR) & testgen.bat & popd

...


where should i put my "TestNewSuite.h" to ?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#24
Maze (User)
Fresh Boarder
Posts: 13
graph
User Offline Click here to see the profile of this user
Re:Add a testsuite in your own header/code file 11 Months, 2 Weeks ago Karma: 0  
Not quite sure what your problem is. you say:

QUOTE:

but i can't find the correct line in ExtraTestBuildTasks.bldmake file,the content of my file is:

QUOTE:

...

INCDIR=..\test

TESTDRIVER_FILE=$(INCDIR)\testdriver.h
MAKEFILE : $(TESTDRIVER_FILE)

$(TESTDRIVER_FILE): $(INCDIR)\TestHeader.h
pushd . & cd $(INCDIR) & testgen.bat & popd


The above line (highlighted in bold) is the one. You will have to add your file(s) there, e.g. extend the line with
Code:

$(INCDIR)\TestNewSuite.h
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#27
RikRah (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Add a testsuite in your own header/code file 5 Months, 2 Weeks ago Karma: 0  
Hi to all.
I've got a problem in adding a new test suite to my project.
I've followed the tutorial, i've added a new class (header and source files) and I've modified testgen.bat script and the ExtraTestBuildTask.bldmake.
Anyway, Carbide shows two errors:
Code:

'CxxTest::TestListenerProxy::failedTest(const char *, const char *, unsigned int, const char *)' (non-static) function call '[CTestBoolProperty].failedTest({lval} const char[21], int, char *)' does not match
Theese errors underline every TS_ASSERT's macro that I use in the new test suite, but the old one works in the right way. What have I to do? Thanks to all.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#28
Maze (User)
Fresh Boarder
Posts: 13
graph
User Offline Click here to see the profile of this user
Re:Add a testsuite in your own header/code file 5 Months, 2 Weeks ago Karma: 0  
It is quite difficult to help you without seeing the code. But it seems you are calling the ASSERT with the wrong amount of arguments:

It should be:
Code:

(const char *, const char *, unsigned int, const char *)
But you only have:
Code:

(const char *, int, char *)
Thus, you are missing the second argument. If you provide your test file (preferably illustrating just the problem) it would be easier to see what's going wrong. /Maze
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#29
RikRah (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Add a testsuite in your own header/code file 5 Months, 1 Week ago Karma: 0  
Thanks for your reply.
I solved the problem, but sincerly I don't know how. I've repeated every step I made yesterday and now it works.
I report these steps here.

I wrote a class in the TestHeader.h and the source in the TestSource.cpp. This 'default' test works in the right way.

Then, I wanted to add a new test suite in a different file.
I wrote a new header file, that I called Test2.h and a new source file, that I called Test2.cpp.
here the complete code of the two files:
Code:

//HEADER FILE /* * Test2.h * * Created on: 26-mar-2010 * Author: Ricky */ #ifndef TEST2_H_ #define TEST2_H_ #include "TestSuite.h" class CTest2 : public CxxTest::TestSuite { public: CTest2(const TDesC8& aSuiteName):CxxTest::TestSuite(aSuiteName){} private: void setUp(); void tearDown(); public: void testDummyTest(); }; #endif /* TEST2_H_ */
Code:

//SOURCE FILE /* * Test2.cpp * * Created on: 26-mar-2010 * Author: Ricky */ #include "Test2.h" #include "TestDriver.h" #include "Logger" void CTest2::setUp() { } void CTest2::tearDown() { } void CTest2::testDummyTest() { TS_ASSERT(ETrue); }
Then, I edited the perl script by adding:
Code:

Test2.h
and I edited the ExtraTestBuildTasks.bldmake by adding
Code:

$(INCDIR)\Test2.cpp
Yesterday, After these steps, I saw the errors. But today it works... I don't know why, it work. Anyway, thanks for your availability. -Ricky
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#30
Maze (User)
Fresh Boarder
Posts: 13
graph
User Offline Click here to see the profile of this user
Re:Add a testsuite in your own header/code file 5 Months, 1 Week ago Karma: 0  
You're welcome
Probably there was some minor error and sleeping over it solved it... Great that it works now

/Maze
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Who's Online

We have 4 guests online

Login Form






Lost Password?
No account yet? Register