From 3e0f5d793c3d48df363eb54640171e7592f6261b Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Fri, 23 Aug 2013 18:12:42 +0200 Subject: [PATCH] Allow atoum to be called from the tested project if executable option is set. Improve errors catching --- PHPCI/Plugin/Atoum.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index 06e3e23e..54783b07 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -13,7 +13,7 @@ class Atoum implements \PHPCI\Plugin $this->phpci = $phpci; if (isset($options['executable'])) { - $this->executable = $options['executable']; + $this->executable = $this->phpci->buildPath . DIRECTORY_SEPARATOR.$options['executable']; } else { $this->executable = PHPCI_BIN_DIR.'atoum'; } @@ -50,11 +50,15 @@ class Atoum implements \PHPCI\Plugin $status = true; exec($cmd, $output); - if (!empty($output) && count(preg_grep("/error/i", $output)) > 0) { + if (count(preg_grep("/Success \(/", $output)) == 0 ) { $status = false; $this->phpci->log($output, ' '); } - + if (count($output) == 0) { + $status = false; + $this->phpci->log("No test have been performed!", ' '); + } + return $status; } }