Jump to content
Dagados

Delphi DUnitx unit test and project dependencies

Recommended Posts

Hi,

I should create a test project using DUnitX, for a project with more than 1000 units.

The problem that in the test project I was forced to add in the search path all the paths to all the files in the project to be tested and it is very complicated, because each time I have to test a new calsse I would have to add all the dependencies.

Is there a way or a simple configuration or architecture for this type of complexity.

Any suggestions ?

 

Thanks

Edited by Dagados

Share this post


Link to post

Far as I know an object's dependencies should come in through the Uses in its own unit file. You only need to add locally in the test unit anything you are using in your tests. 

 

Quote

add in the search path all the paths to all the files not in the project to be tested

Is the "not" accurate? Makes no sense at all. 

Share this post


Link to post

When you create a new test project and add one of the units for testing, the project won't compile unless all dependent units can be found. So you need to add the search paths accordingly.

 

There is nothing wrong with having dependencies in the first place. It just makes picking only one unit from the project into another one a bit difficult. Nevertheless, it is always worth thinking about minimizing dependencies, but not only because of simpler testing.

3 hours ago, Brian Evans said:

Is the "not" accurate? Makes no sense at all. 

The not seems appropriate, but the term project to be tested should be changed to test project.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×