Is there a way to get Delphi to leave unused code in an executable?

Delphi Linker removes any functions that are not actually used, thereby reducing the size of the executable file.

Is there a way to stop Delphi Linker? for example a compiler switch?

Who cares "why?" ...

I'm trying to use a tool to span delphi code , but it only reports code that actually compiles into an executable. This makes it not very useful. If I could get Delphi to include all the code, I hope I can then get some useful code coverage statistics.

I should mention that I have DUnit tests in a separate project for my application. Therefore, despite the fact that the code is not used in the DUnit project, it is used in a real application.

See here for more details .

+5
source share
1 answer

The code coverage tool measures the wrong thing. It works with the map file instead of the source code, so it will only report real code instead of all the code in the project. The compiler is already filtering out dead code, and in an empty project with a single test, all code is dead code. Unable to tell Delphi about including dead code in exe.

, , . unit-test, . ( , , , . , unit-test.) , , .

+7

All Articles