You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
1.4 KiB

  1. #!/bin/sh
  2. ret=0
  3. #
  4. # Check that the Win32 config.h is in sync with config.h.in
  5. #
  6. config_h_in=$(dirname "$0")/../config.h.in
  7. win32_config_h=$(dirname "$0")/../win32/config.h
  8. failure=0
  9. for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in");
  10. do
  11. if ! grep '[ef] \<'"$key"'\>' "$win32_config_h" >/dev/null 2>&1; then
  12. echo "error: $key missing from win32/config.h"
  13. failure=1
  14. fi
  15. done
  16. if test "$failure" != "0"; then
  17. ret=1
  18. else
  19. echo "0 errors in Win32 config.h"
  20. fi
  21. #
  22. # Check that we have no tabs or trailing spaces in the source code
  23. #
  24. failure=0
  25. for dir in caca kernel src cxx examples ruby tools; do
  26. pushd ../$dir >/dev/null
  27. for x in $(make -s echo-sources); do
  28. case "$x" in
  29. *.c|*.cpp|*.h|*.m) ;;
  30. *) continue ;;
  31. esac
  32. if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
  33. echo "error: $dir/$x contains trailing spaces"
  34. failure=1
  35. fi
  36. if grep ' ' "$x" >/dev/null 2>&1; then
  37. echo "error: $dir/$x contains tabs"
  38. failure=1
  39. fi
  40. done
  41. popd >/dev/null
  42. done
  43. if test "$failure" != "0"; then
  44. ret=1
  45. else
  46. echo "0 errors in source code"
  47. fi
  48. #
  49. # Check for Doxygen errors
  50. #
  51. warnings="$(grep -c Warning: ../doc/doxygen.log)"
  52. if test "$warnings" != "0"; then
  53. echo "error: $warnings warnings in Doxygen generation:"
  54. grep Warning: ../doc/doxygen.log | sed 's/\(.\{75\}\)...*/\1 .../'
  55. ret=1
  56. else
  57. echo "0 errors in documentation"
  58. fi
  59. if test "$ret" != "0"; then
  60. exit 1
  61. fi
  62. exit 0