it might be useful to be able to enable specific configure commands only when running tests

Ken Cunningham ken.cunningham.webuse at gmail.com
Mon Jan 20 15:53:18 UTC 2020


I do that too, but I think it's just these kinds of "insider tricks" that make people nutty when using Macports. if it were possible, it would be nice if it just worked as people  expect it to work, and enabled then ran the tests just on the port you wanted to test.

Perhaps "sudo port test" might automatically enable an agreed-upon-named test variant? Perhaps that might be easier to implement in base. Consider a variant "portname_tests", say, that is default_variants-appended when running "port test"? That would accomplish the same outcome.

Homebrew's autobump bot requires a passing test of some kind to autobump versions, for interest.

K

> On Jan 19, 2020, at 04:45, Christopher Jones <jonesc at hep.phy.cam.ac.uk> wrote:
> 
> Hi,
> 
> All you need to do is make sure the deps are all installed *before* running the tests for the specific port in question. I do this with
> 
>> sudo port install XYZ
>>> sudo port uninstall XYZ
>> sudo port install XYZ +test
> 
> Chris
> 
>> On 18 Jan 2020, at 11:37 pm, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
>> 
>> It might be helpful if there was a configure command in the portfile that was only enabled when “port test” was run.
>> 
>> Specifically, for example, something that would enable the following command:
>> 
>> configure.args-replace --disable-tests --enable-tests
>> 
>> only when tests were being run.
>> 
>> I realize at present this is usually done with a test variant. That is OK, but as we have seen, it often propagates that test variant down the entire dependency tree, which can be a pain and is almost always not what you want.
>> 
>> For now, I suppose I can work around that issue by calling the test variant “portname_tests” or something similar.
>> 
>> Ken
>> 
>> 
> 


More information about the macports-dev mailing list