summaryrefslogtreecommitdiff
path: root/polly/utils
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-08-12 09:02:20 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-08-12 09:02:20 +0000
commit9e0daff91e6fc9e03041524d2656a087ce925a1b (patch)
tree8ce0cc81ebad312170d09919f9d466f1d21538b6 /polly/utils
parenta7ba98caa2a15aefbd22b8ce2556a70ac3bd8764 (diff)
downloadllvm-9e0daff91e6fc9e03041524d2656a087ce925a1b.tar.gz
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. llvm-svn: 244727
Diffstat (limited to 'polly/utils')
-rw-r--r--polly/utils/arcanist/LitTestEngine/src/LitTestEngine.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/polly/utils/arcanist/LitTestEngine/src/LitTestEngine.php b/polly/utils/arcanist/LitTestEngine/src/LitTestEngine.php
index eb495be3e868..5b82891c90a4 100644
--- a/polly/utils/arcanist/LitTestEngine/src/LitTestEngine.php
+++ b/polly/utils/arcanist/LitTestEngine/src/LitTestEngine.php
@@ -73,14 +73,26 @@ final class LitTestEngine extends ArcanistUnitTestEngine {
$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 ArcanistUnitTestEngine {
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);