Permalink
Browse files

Merge branch 'hotfix/travis-build-status-codes'

Fixes for travis build status
  • Loading branch information...
2 parents c01344a + 9cbded0 commit 1c3a27e6f21a59def6d1de6bebca0b8de8d7d9ab @weierophinney weierophinney committed Feb 1, 2013
Showing with 34 additions and 18 deletions.
  1. +34 −18 bin/travis-build.sh
View
@@ -2,31 +2,47 @@
cd "$(dirname $(dirname "$0"))"
php ./tests/run-tests.php
testresults=$?
-echo "Unit tests exited with $testresults"
+echo "Unit tests exited with status $testresults"
-php php-cs-fixer.phar fix -v --dry-run --level=psr2 library
-cslibrary=$?
-echo "Coding standards (library) exited with $cslibrary"
+output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library)
+echo $output
+cslibrary=0
+if [[ "$output" -ne "" ]];then
+ cslibrary=2
+fi
+echo "Coding standards (library) exited with status $cslibrary"
-php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests
-cstests=$?
-echo "Coding standards (tests) exited with $cstests"
+output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests)
+echo $output
+cstests=0
+if [[ "$output" -ne "" ]];then
+ cstests=2
+fi
+echo "Coding standards (tests) exited with status $cstests"
-php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin
-csbin=$?
-echo "Coding standards (bin) exited with $csbin"
+output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin)
+echo $output
+csbin=0
+if [[ "$output" -ne "" ]];then
+ csbin=2
+fi
+echo "Coding standards (bin) exited with status $csbin"
-if [[ $testresults ]]; then
- exit 1 ;
+if [[ "$testresults" -ne "0" ]]; then
+ echo "Exiting with status 2 due to test failures" ;
+ exit 2 ;
fi
-if [[ $cslibrary ]]; then
- exit 1 ;
+if [[ "$cslibrary" -eq "2" ]]; then
+ echo "Exiting with status 2 due to CS (library)" ;
+ exit 2 ;
fi
-if [[ $cstests ]]; then
- exit 1 ;
+if [[ "$cstests" -eq "2" ]]; then
+ echo "Exiting with status 2 due to CS (tests)" ;
+ exit 2 ;
fi
-if [[ $csbin ]]; then
- exit 1 ;
+if [[ "$csbin" -eq "2" ]]; then
+ echo "Exiting with status 2 due to CS (bin)" ;
+ exit 2 ;
fi
exit 0

0 comments on commit 1c3a27e

Please sign in to comment.