questions on "test" phase and variant dependency

Ryan Schmidt ryandesign at macports.org
Thu May 2 21:07:18 PDT 2013


On May 2, 2013, at 22:53, David Strubbe wrote:

> I saw in the guide that there is a "test" phase that can be defined with test.run, test.cmd, test.target. But the information there is quite minimal. How is this intended to be used? It seems to me that it does not run when a port is being installed, only if you do 'port test',

That's right.

> and that it does an independent build, not using one that may have been installed already, which I find somewhat surprising.

It uses the results of the build phase. If the port has already been installed and cleaned, then the results of the build phase are already gone, so it would have to build it again.

If you want to test a port, usually you would *first* run "sudo port test whatever". This will build and then test it. Assuming you like the results of the test, you can *then* "sudo port -s install whatever", which will use what was built. (The "-s" is to ensure the use of the version locally built from source on your computer, and not possibly a binary from our server.)


> How is the result of the test supposed to be reported after the run?

Not sure what you mean. "sudo port test whatever" tells you whether the tests succeed or not.


> I am trying to make a port that depends on netcdf-fortran. The Fortran mod files installed by netcdf-fortran (as always) are dependent on compiler and even compiler version, so it is necessary for my port and netcdf-fortran to both use the same compiler version, e.g. gcc46. How can this be requested or checked in the Portfile? If they do not match, the configure step will fail in a not particularly informative manner.

You can use the active_variants portgroup to do this.




More information about the macports-dev mailing list