<package>ports-mgmt/poudriere</package> is the most thorough way to test a port through the entire cycle of installation, packaging, and deinstallation. Documentation is located at the <link xlink:href="https://github.com/freebsd/poudriere"> poudriere github repository</link>