[Tutor] Unit test case

Alan Gauld alan.gauld at btinternet.com
Sat Feb 23 10:32:59 CET 2013


On 23/02/13 06:14, jitendra gupta wrote:

> I am working one tool, which will do compile/run the workspace (that
> code is written on c/c++). on that my requirment is i need to compile
> subfolder also, i have wrote code for that also.

Just to clarify. You are writing a tool in Python that will compile and 
run C/C++ code? I assume that the actual compilation is being done by 
some other tool? You are not writing a C compiler in Python?

Is that right so far?

> My problem is  , i am unable to write the Unit test case for that.

I'm not sure which bit you can't write the unit test for. Can you be 
more specific? Also what unit test framework are you using?

And while we are at it which OS and which Python version?
And finally which C/C++ tools are you using to do the compilation?
make? VisualStudio? XCode? gcc?

>   Since my method (called run_subfolder) is not retrurning any thing
> (this will create one command line argument in that i  am adding
> subfolder condition and passing to the another class which will do
> actual thing) .

Nope, you lost me there. What is creating a command line argument? Which 
command line? Where is the other class? Is it defined inside run_subfolder?

> For this method i need to write unit test case. Since i
> dont have to workspace also , so that i can test this case . Please

Sorry, what do you mean by Workspace in this context?

> advise on this. what i need to do. this is possible or not, if not why.

Sorry, I don't understand enough of what you are trying
to do to comment.

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list