runchecks 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  16. # PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Affero General Public License along
  19. # with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. # Commercial License Information:
  22. #
  23. # The PBS Pro software is licensed under the terms of the GNU Affero General
  24. # Public License agreement ("AGPL"), except where a separate commercial license
  25. # agreement for PBS Pro version 14 or later has been executed in writing with Altair.
  26. #
  27. # Altair’s dual-license business model allows companies, individuals, and
  28. # organizations to create proprietary derivative works of PBS Pro and distribute
  29. # them - whether embedded or bundled with other software - under a commercial
  30. # license agreement.
  31. #
  32. # Use of Altair’s trademarks, including but not limited to "PBS™",
  33. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. # trademark licensing policies.
  35. declare -a listofchecks
  36. listofchecks[0]="checkpep8"
  37. checkdir=$(readlink -f $(dirname $0))
  38. errors_fails=0
  39. for check in ${listofchecks[@]}
  40. do
  41. echo -n "Running check: '${check}' ... "
  42. if [ ! -x "${checkdir}/${check}" ]; then
  43. echo "NOTFOUND"
  44. errors_fails=$((errors_fails + 1))
  45. continue
  46. fi
  47. ${checkdir}/${check} >out 2>err
  48. if [ $? -ne 0 ]; then
  49. echo "FAILED"
  50. cat err
  51. errors_fails=$((errors_fails + 1))
  52. else
  53. echo "OK"
  54. cat out
  55. fi
  56. done
  57. if [ ${errors_fails} -ne 0 ]; then
  58. exit 1
  59. else
  60. exit 0
  61. fi