Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am working on code defect testing.The routine goes as follows: I receive source codes to be tested from the client, and then pre-process/treatment source codes to produce the intermediate files(that is .i files) using the compiler in my machine instead of the compiler the client uses. The problem arises because the intermediate files I obtain is not eligible to be analyzed further. For example, some particular macros cannot be recognized by the compiler installed on my machine. I surmise that the configuration of compiler is dependent on the development environment, as you know, many codes are programmed in an IDE. As a consequence, when I attempt to transplant the original source code onto my machine, some configurations of compiler are missing or wrong. All that said, what I want to achieve is to obtain the intermediate files generated under the client's development environment. It's required that the solution should be simple as possible because I don't want to put too much burden on clients. Any help would be appreciated.

What I have tried:

I have not figured out any solution yet.
Posted
Updated 9-Nov-16 23:32pm
Comments
[no name] 10-Nov-16 3:40am    
What has any intermediate file got to do with code defect testing? What business are you in: testing code a client has written? It's seems a bit bizarre.

Quote:
I surmise that the configuration of compiler is dependent on the development environment, as you know, many codes are programmed in an IDE.

No. The IDE is pretty much independent: the same IDE (Visual Studio for example) can be used for many different languages, including C, C++ , C#, VB, F#, ...

The IDE does not do the compilation: it uses one of many compilers to do that, and isn't even needed - you can write code with a text editor, or even in a Microsoft Excel spreadsheet if you try really hard: and some people do habitually use a basic text editor in preference to an IDE.

If you need "intermediate files" - and I have no idea why they would help since they will be specific to a compiler rather than generally readable if the compiler even generates them - then you will need to use the exact compiler (and even version of the compiler) that your client is using in order to generate them. You cannot assume that code for one version of a compiler will work in a different version, much less that it will compile correctly in a totally different compiler!
 
Share this answer
 
Tell the client to send you the complete project, not just the source files.
 
Share this answer
 
Quote:
when I attempt to transplant the original source code onto my machine, some configurations of compiler are missing or wrong. All that said, what I want to achieve is to obtain the intermediate files generated under the client's development environment.

You could provide the client a post build step in order to collect the required files on his/her machine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900