]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use project root instead of library root in unit engine
authorvrana <jakubv@fb.com>
Wed, 6 Jun 2012 04:08:52 +0000 (21:08 -0700)
committervrana <jakubv@fb.com>
Wed, 6 Jun 2012 04:08:59 +0000 (21:08 -0700)
src/unit/engine/PhutilUnitTestEngine.php

index b5bb4e2578267c8806cd5cc1db2d26ee9aa1711b..3027ca4692c4b1893ddb104235a6177a36b2f608 100644 (file)
@@ -26,6 +26,7 @@ final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine {
   public function run() {
 
     $bootloader = PhutilBootloader::getInstance();
+    $project_root = $this->getWorkingCopy()->getProjectRoot();
 
     $look_here = array();
 
@@ -48,7 +49,7 @@ final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine {
           "      operation is not supported.");
       }
 
-      $path = Filesystem::resolvePath($path, dirname($library_root));
+      $path = Filesystem::resolvePath($path, $project_root);
 
       if (!is_dir($path)) {
         $path = dirname($path);
@@ -125,7 +126,7 @@ final class PhutilUnitTestEngine extends ArcanistBaseUnitTestEngine {
     foreach ($run_tests as $test_class) {
       $test_case = newv($test_class, array());
       $test_case->setEnableCoverage($enable_coverage);
-      $test_case->setProjectRoot($this->getWorkingCopy()->getProjectRoot());
+      $test_case->setProjectRoot($project_root);
       $test_case->setPaths($this->getPaths());
       $results[] = $test_case->run();
     }