Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a Dunit project and exe version info is disabled, how do I get it back?

Why cant I set a version info in a Dunit Test projet? The checkbox is disabled for this projetct, but not for other projects. See the screenshot:

enter image description here

like image 327
Rafael Colucci Avatar asked Mar 27 '12 14:03

Rafael Colucci


2 Answers

You may be missing the {$R *.res} directive in your test project's source. It needs to be in the .dpr or you won't be able to use this feature in the project options.

It should be there by default but occasionally it can get screwed up when adding or removing a unit from a project. When this happens it will look like:

$R *.res} // notice the missing '{'

If this happened and a developer didn't know what they were looking at they may have just deleted the offending line.

Additionally, if the test project started out as a command line project it may not have had this directive to begin with.

like image 80
Kenneth Cochran Avatar answered Sep 19 '22 07:09

Kenneth Cochran


DUnit unit test projects are not constructed like other delphi projects, and that is why you see that it has no resource file by default, and that in turn, was why the versioninfo tab was disabled until you put the {$R *.RES} declaration in yourself.

DUnit projects can be built in one of two configurations, using a GUI Test Runner (which uses the VCL, but which you typically should not modify, the GUI is fixed in stone), or a console mode test runner. While a console application could have a resource file linked, and could therefore have version information, and in fact many console applications do so, the reason you are seeing what you are seeing is that DUnit's test runner framework and unit-test-projects are not constructed in the way you are used to.

This in turn, confuses the IDE, and the IDE disables the relevant sections. You may be able to add the {$R} back again, and that seems to have worked, since you accepted Kenneth's answer, however I just wanted to add some background information that might help future people who encounter this problem.

like image 42
Warren P Avatar answered Sep 20 '22 07:09

Warren P