Advertisement
Guest User

Untitled

a guest
May 26th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # This is just a quick hack to determine if the code coverage
  4. # is enough or not.
  5. #
  6. # @author Michael Haeuslmann <haeuslmann@gmail.com>
  7.  
  8. min_cov=95
  9. cov=`php tools/phpunit.phar --coverage-text --colors=never \
  10. | egrep -o "Lines:[[:space:]]+([0-9])+" \
  11. | head -n1 \
  12. | sed 's/Lines: *//'`
  13.  
  14. if [ "$cov" -gt "$min_cov" ]; then
  15. exit 0
  16. else
  17. echo "Line coverage is only $cov%, but needs to be at least 95%."
  18. exit 1
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement