diff --git a/bin/compile b/bin/compile index 8b1d66c43..c4a6b1105 100755 --- a/bin/compile +++ b/bin/compile @@ -8,5 +8,10 @@ use Composer\Compiler; error_reporting(-1); ini_set('display_errors', 1); -$compiler = new Compiler(); -$compiler->compile(); +try { + $compiler = new Compiler(); + $compiler->compile(); +} catch (\Exception $e) { + echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine(); + exit(1); +} diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index 1bd1ed6b9..83f530f75 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -58,7 +58,9 @@ class AllFunctionalTest extends \PHPUnit_Framework_TestCase $proc = new Process('php '.escapeshellarg(__DIR__.'/../../../bin/compile')); $exitcode = $proc->run(); - $this->assertSame(0, $exitcode); + if ($exitcode !== 0 || trim($proc->getOutput())) { + $this->fail($proc->getOutput()); + } $this->assertTrue(file_exists(self::$pharPath)); }