Maybe MacPorts could introduce the concept of ‘test dependencies’ (dependencies 
only required for running tests). I work with Apache Maven quite a bit, and 
apart from build and runtime dependencies (which MacPorts already 
distinguishes) it also supports declaring test scope dependencies, that don’t 
need to be installed until tests are actually run: 
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

Nils.

> Op 30 okt. 2022 om 11:23 heeft Ryan Schmidt <ryandes...@macports.org> het 
> volgende geschreven:
> 
> On Oct 28, 2022, at 21:33, Daniel J. Luke wrote:
>> 
>> I don't think implementation difficulty is the barrier here - but that all 
>> variants should just have the same behavior.
>> 
>> In my mind, the real problem is the need for +test variants, there should be 
>> a way to just use the test phase - and perhaps changes to base/ to enable 
>> that are a better option.
> 
> In one of my ports that has a tests variant, the reason why the variant 
> exists is that the build system looks for certain test dependencies at 
> configure time. If they're not there, it doesn't build the test suite and 
> doesn't allow tests to be run later. I'm not sure how MacPorts could be 
> improved to handle that better in the absence of a tests variant. Would you 
> have MacPorts do the configuration in the configure phase, do the build in 
> the build phase, and then redo the configuration and build in the test phase? 
> Or would you suggest in this case that the test dependencies that are needed 
> at configure time should be added unconditionally, so that even users who 
> won't be running the tests need to install them? In my port's case the 
> dependencies are probably small and that wouldn't make much of a difference, 
> but I'm not sure it'll always be that way for all ports.
> 
> 

Reply via email to