starpu_check_undocumented.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # Note: expects Coccinelle's spatch command n the PATH
  3. # See: http://coccinelle.lip6.fr/
  4. # StarPU --- Runtime system for heterogeneous multicore architectures.
  5. #
  6. # Copyright (C) 2011, 2012 Centre National de la Recherche Scientifique
  7. # Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
  8. #
  9. # StarPU is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Lesser General Public License as published by
  11. # the Free Software Foundation; either version 2.1 of the License, or (at
  12. # your option) any later version.
  13. #
  14. # StarPU is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. #
  18. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  19. stcolor=$(tput sgr0)
  20. redcolor=$(tput setaf 1)
  21. greencolor=$(tput setaf 2)
  22. functions=$(spatch -very_quiet -sp_file tools/dev/starpu_funcs.cocci $(find include -name '*.h'))
  23. for func in $functions ; do
  24. fname=$(echo $func|awk -F ',' '{print $1}')
  25. location=$(echo $func|awk -F ',' '{print $2}')
  26. x=$(grep $fname doc/starpu.texi doc/chapters/*texi | grep deftypefun)
  27. if test "$x" == "" ; then
  28. echo "function ${redcolor}${fname}${stcolor} at location ${redcolor}$location${stcolor} is not (or incorrectly) documented"
  29. # else
  30. # echo "function ${greencolor}${fname}${stcolor} at location $location is correctly documented"
  31. fi
  32. done
  33. echo
  34. structs=$(grep "struct starpu" $(find include -name '*.h') | grep -v "[;|,|(|)]" | awk '{print $2}')
  35. for struct in $structs ; do
  36. x=$(grep "$struct\b" doc/starpu.texi doc/chapters/*texi | grep deftp)
  37. if test "$x" == "" ; then
  38. echo "struct ${redcolor}${struct}${stcolor} is not (or incorrectly) documented"
  39. fi
  40. done
  41. echo
  42. enums=$(grep "enum starpu" $(find include -name '*.h') | grep -v "[;|,|(|)]" | awk '{print $2}')
  43. for enum in $enums ; do
  44. x=$(grep "$enum\b" doc/starpu.texi doc/chapters/*texi | grep deftp)
  45. if test "$x" == "" ; then
  46. echo "enum ${redcolor}${enum}${stcolor} is not (or incorrectly) documented"
  47. fi
  48. done
  49. echo
  50. macros=$(grep "define\b" include/*|grep -v deprecated|grep "#" | grep -v "__" | sed 's/#[ ]*/#/g' | awk '{print $2}' | awk -F'(' '{print $1}' | sort|uniq)
  51. for macro in $macros ; do
  52. x=$(grep "$macro\b" doc/starpu.texi doc/chapters/*texi | grep defmac)
  53. if test "$x" == "" ; then
  54. echo "macro ${redcolor}${macro}${stcolor} is not (or incorrectly) documented"
  55. fi
  56. done