I have a custom ArcanistUnitTestEngine implementation, but I believe that this issue is generic. Currently, my test engine contains the following code:
public function run() { if ($this->getEnableCoverage() !== false && !extension_loaded('xdebug')) { throw new ArcanistUsageException( pht( 'You specified `%s` but %s is not available, so coverage can not '. 'be enabled for `%s`.', '--coverage', 'XDebug', __CLASS__)); }
If I don't have XDebug installed then running arc unit will hard fail (throw an exception), even without the --coverage flag.
> arc unit -- test/SomeTest.php Usage Exception: You specified `--coverage` but XDebug is not available, so coverage can not be enabled for `FreelancerPhpunitTestEngine`.
I feel that code coverage should just be silently disabled unless the --coverage flag is explicitly passed.