changing 'configure' options for testing

Daniel J. Luke dluke at
Mon Sep 20 14:20:45 UTC 2021

On Sep 20, 2021, at 8:15 AM, Frank Dean <frank at> wrote:
> Daniel J. Luke <dluke at> writes:
>> The newest version of clamav uses cmake for builds. In the 'configure' stage, I have it disabling tests because otherwise it won't build without the test dependencies installed (check and pytest). 
>> Do we have a template or example of a canonical way to handle this? I don't see an obvious hook for when someone is running `port test` to change configure.args (I could, of course, add a post-extract/pre-configure and do some non-declaritive test to see if `port test` is being run and use that to branch - but that feels like a bad design choice).
> The rapidjson port implements a 'tests' variant to handle a similar
> situation.  I used the same pattern for the libosmium port.  The tests
> can then be run with `sudo port -d test current +tests`.

That works, I guess.

Is there interest in having base auto-add +tests if `port test` is called? (I haven't looked at base/ code in a while, but it seems possible). I like to imagine a future where we have enough infrastructure that we would run `port test` for any ports that have set.

Daniel J. Luke

More information about the macports-dev mailing list