starpu_check_undocumented.sh 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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, 2013 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. H_FILES=$(find ../../include ../../mpi/include -name '*.h')
  23. functions=$(spatch -very_quiet -sp_file ./dev/starpu_funcs.cocci $H_FILES)
  24. for func in $functions ; do
  25. fname=$(echo $func|awk -F ',' '{print $1}')
  26. location=$(echo $func|awk -F ',' '{print $2}')
  27. x=$(grep "$fname(" chapters/api/*.doxy | grep "\\fn")
  28. if test "$x" == "" ; then
  29. echo "function ${redcolor}${fname}${stcolor} at location ${redcolor}$location${stcolor} is not (or incorrectly) documented"
  30. # else
  31. # echo "function ${greencolor}${fname}${stcolor} at location $location is correctly documented"
  32. fi
  33. done
  34. echo
  35. structs=$(grep "struct starpu" $H_FILES | grep -v "[;|,|(|)]" | awk '{print $2}')
  36. for struct in $structs ; do
  37. x=$(grep -F "\\struct $struct" chapters/api/*.doxy)
  38. if test "$x" == "" ; then
  39. echo "struct ${redcolor}${struct}${stcolor} is not (or incorrectly) documented"
  40. fi
  41. done
  42. echo
  43. enums=$(grep "enum starpu" $H_FILES | grep -v "[;|,|(|)]" | awk '{print $2}')
  44. for enum in $enums ; do
  45. x=$(grep -F "\\enum $enum" chapters/api/*.doxy)
  46. if test "$x" == "" ; then
  47. echo "enum ${redcolor}${enum}${stcolor} is not (or incorrectly) documented"
  48. fi
  49. done
  50. echo
  51. macros=$(grep "define\b" $H_FILES |grep -v deprecated|grep "#" | grep -v "__" | sed 's/#[ ]*/#/g' | awk '{print $2}' | awk -F'(' '{print $1}' | sort|uniq)
  52. for macro in $macros ; do
  53. x=$(grep -F "\\def $macro" chapters/api/*.doxy)
  54. if test "$x" == "" ; then
  55. echo "macro ${redcolor}${macro}${stcolor} is not (or incorrectly) documented"
  56. fi
  57. done
  58. echo
  59. variables=$(grep --exclude-dir=.svn -rs -E "(getenv|get_env)" src/| tr ' ' '\012'|grep -E "(getenv|get_env)" | grep "\"" | sed 's/.*("//' | sed 's/").*//'|sort|uniq)
  60. for variable in $variables ; do
  61. x=$(grep "$variable" chapters/environment_variables.doxy | grep "\\anchor")
  62. if test "$x" == "" ; then
  63. echo "variable ${redcolor}${variable}${stcolor} is not (or incorrectly) documented"
  64. fi
  65. done