Fix intentional example error and improve Travis build

Examples are now executed in a subshell, so a failure doesn't terminate the complete build.
This commit is contained in:
Niklas Keller 2017-12-13 23:40:53 +01:00
parent 2834e2957b
commit 74c8b5f145
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ install:
script: script:
# Run with phpdbg or xdebug as soon as one of both doesn't segfault anymore # Run with phpdbg or xdebug as soon as one of both doesn't segfault anymore
- vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml - vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
- for f in examples/*.php; do echo $f && if ! php $f; then echo '!! failed !!' && exit 1; fi && echo "-------"; done - (for f in examples/*.php; do echo $f && if ! php $f; then echo '!! failed !!' && exit 1; fi && echo "-------"; done)
- PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix
after_script: after_script:

View File

@ -4,7 +4,7 @@ require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelFunctions\parallelMap; use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait; use function Amp\Promise\wait;
f
// All output in the parallel environment is redirected to STDERR of the parent process automatically. // All output in the parallel environment is redirected to STDERR of the parent process automatically.
// You might notice that the output order varies here when running it multiple times. // You might notice that the output order varies here when running it multiple times.
wait(parallelMap([1, 2, 3], 'var_dump')); wait(parallelMap([1, 2, 3], 'var_dump'));