[polly] r244727 - Make arc unit work with ninja builds

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 02:02:20 PDT 2015


Author: jdoerfert
Date: Wed Aug 12 04:02:20 2015
New Revision: 244727

URL: http://llvm.org/viewvc/llvm-project?rev=244727&view=rev
Log:
Make arc unit work with ninja builds

  In order to find the llvm-obj directory it has to be (or a soft link
  to it) at one of the following locations:

    ${POLLY_SRC_DIR}/build
    ${POLLY_SRC_DIR}.build
    ${POLLY_SRC_DIR}-build
    s/${POLLY_SRC_DIR}/src/build

  Alternatively, the environment variable $POLLY_BIN_DIR can point to it.

Modified:
    polly/trunk/utils/arcanist/LitTestEngine/src/LitTestEngine.php

Modified: polly/trunk/utils/arcanist/LitTestEngine/src/LitTestEngine.php
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/utils/arcanist/LitTestEngine/src/LitTestEngine.php?rev=244727&r1=244726&r2=244727&view=diff
==============================================================================
--- polly/trunk/utils/arcanist/LitTestEngine/src/LitTestEngine.php (original)
+++ polly/trunk/utils/arcanist/LitTestEngine/src/LitTestEngine.php Wed Aug 12 04:02:20 2015
@@ -73,14 +73,26 @@ final class LitTestEngine extends Arcani
         $projectRoot = $this->getWorkingCopy()->getProjectRoot();
         $cwd = getcwd();
         $buildDir = $this->findBuildDirectory($projectRoot, $cwd);
-        print "Using build directory '$buildDir'\n";
-        $makeVars = $this->getMakeVars($buildDir);
-        $lit = $this->findLitExecutable($makeVars);
+        $pollyObjDir = $buildDir;
+        if (is_dir($buildDir.DIRECTORY_SEPARATOR."tools".DIRECTORY_SEPARATOR."polly"))
+          $pollyObjDir = $buildDir.DIRECTORY_SEPARATOR."tools".DIRECTORY_SEPARATOR."polly";
+        $pollyTestDir = $pollyObjDir.DIRECTORY_SEPARATOR."test";
+
+        if (is_dir($buildDir.DIRECTORY_SEPARATOR."bin") &&
+          file_exists($buildDir.DIRECTORY_SEPARATOR."bin".DIRECTORY_SEPARATOR."llvm-lit")) {
+          $lit = $buildDir.DIRECTORY_SEPARATOR."bin".DIRECTORY_SEPARATOR."llvm-lit";
+          $cmd = "ninja -C ".$buildDir;
+          print "Running ninja (".$cmd.")\n";
+          exec($cmd);
+        } else {
+          $makeVars = $this->getMakeVars($buildDir);
+          $lit = $this->findLitExecutable($makeVars);
+        }
         print "Using lit executable '$lit'\n";
 
         // We have to modify the format string, because llvm-lit does not like a '' argument
         $cmd = '%s ' . ($this->getEnableAsyncTests() ? '' : '-j1 ') .'%s 2>&1';
-        $litFuture = new ExecFuture($cmd, $lit, $buildDir."/test");
+        $litFuture = new ExecFuture($cmd, $lit, $pollyTestDir);
         $out = "";
         $results = array();
         $lastTime = microtime(true);
@@ -198,7 +210,6 @@ final class LitTestEngine extends Arcani
 
         foreach ($tries as $try) {
             if (is_dir($try) &&
-                file_exists($try.DIRECTORY_SEPARATOR."Makefile") &&
                 (file_exists($try.DIRECTORY_SEPARATOR."test".DIRECTORY_SEPARATOR."lit.site.cfg") ||
                 file_exists($try.DIRECTORY_SEPARATOR."test".DIRECTORY_SEPARATOR."lit.cfg")))
                 return Filesystem::resolvePath($try);




More information about the llvm-commits mailing list