Unit Testing Wizard

Delphi (at least Delphi XE 10.1, which is the version that I am using) comes with a wizard for unit testing:

Which allows the user to de/select which methods to unit test (it parses the file - it doesn’t seem to recognize records with methods, static or not - this limitation may have been fixed in a later version of Delphi)):

It seems this is proprietary to Emb (as the source doesn’t seem to be present with the installation of Delphi), so I am looking for something similar (to copy from - it is for internal use only).

Any suggestions?

I’m not aware of anything like that publically available.

To produce such a wizard you would need to parse the interface section of a unit - you could build something using this - GitHub - RomanYankovsky/DelphiAST: Abstract syntax tree builder for Delphi

If you do and are happy to share I would be interest in something like this for DUnitX (just don’t have the time to build it myself at the moment).

1 Like

Just mentioning …

2 Likes

Wow, great find!

1 Like

Just suggesting another possible path … maybe you could skip over the IDE Expert solution

and go straight to the LLM AI solution.

Obviously this is a simple example, but fwiw :

The reason I was thinking of going down the Expert path was because it would be for the in-house software and would like the developer to choose if they want certain framework/s to be added to the unit test skeleton code, so they can concentrate on writing the unit tests, instead of adding the required framework.

20+ year old app, with more and more developers not wanting to touch Delphi :cry:

1 Like