Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/NoseTestEngine.php
<?php | <?php | ||||
/** | /** | ||||
* Very basic 'nose' unit test engine wrapper. | * Very basic 'nose' unit test engine wrapper. | ||||
* | * | ||||
* Requires nose 1.1.3 for code coverage. | * Requires nose 1.1.3 for code coverage. | ||||
*/ | */ | ||||
final class NoseTestEngine extends ArcanistUnitTestEngine { | final class NoseTestEngine extends ArcanistUnitTestEngine { | ||||
private $parser; | private $parser; | ||||
protected function supportsRunAllTests() { | |||||
return true; | |||||
} | |||||
public function run() { | public function run() { | ||||
if ($this->getRunAllTests()) { | |||||
$root = $this->getWorkingCopy()->getProjectRoot(); | |||||
epriestley: I think this is probably not correct -- if you `cd` into a subdirectory before running `arc… | |||||
return $this->runTests(array($root), './'); | |||||
} | |||||
$paths = $this->getPaths(); | $paths = $this->getPaths(); | ||||
$affected_tests = array(); | $affected_tests = array(); | ||||
foreach ($paths as $path) { | foreach ($paths as $path) { | ||||
$absolute_path = Filesystem::resolvePath($path); | $absolute_path = Filesystem::resolvePath($path); | ||||
if (is_dir($absolute_path)) { | if (is_dir($absolute_path)) { | ||||
$absolute_test_path = Filesystem::resolvePath('tests/'.$path); | $absolute_test_path = Filesystem::resolvePath('tests/'.$path); | ||||
▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines |
I think this is probably not correct -- if you cd into a subdirectory before running arc land, I think it will run everything in that subdirectory?
(This engine might already have a problem with that anyway, though.)
The correct path to use should be $root = $this->getWorkingCopy()->getProjectRoot();, I think.