| Line | |
|---|
| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | src=(trunk/include/libdodo trunk/src) |
|---|
| 4 | |
|---|
| 5 | ## |
|---|
| 6 | ## Check for header description and #ifndef/#define file protector mark |
|---|
| 7 | ## |
|---|
| 8 | for i in ${src[*]} |
|---|
| 9 | do |
|---|
| 10 | pushd $i |
|---|
| 11 | |
|---|
| 12 | for j in *h *cc |
|---|
| 13 | do |
|---|
| 14 | if [[ ! -f $j ]] |
|---|
| 15 | then |
|---|
| 16 | continue |
|---|
| 17 | fi |
|---|
| 18 | |
|---|
| 19 | file=$(sed -n "2p;2q" $j) |
|---|
| 20 | grep -q "$j" < <(echo $file) |
|---|
| 21 | if [[ $? -ne 0 ]] |
|---|
| 22 | then |
|---|
| 23 | echo "${j}: header file do not match: $file" |
|---|
| 24 | fi |
|---|
| 25 | |
|---|
| 26 | if [[ "$j" == "${j%.cc}" ]] |
|---|
| 27 | then |
|---|
| 28 | directive=$(echo ${j//./_} | awk '{ print "_" toupper($1) "_"}') |
|---|
| 29 | grep -q $directive $j |
|---|
| 30 | if [[ $? -ne 0 ]] |
|---|
| 31 | then |
|---|
| 32 | echo "${j}: header file do not match: $directive" |
|---|
| 33 | fi |
|---|
| 34 | fi |
|---|
| 35 | done |
|---|
| 36 | |
|---|
| 37 | popd |
|---|
| 38 | done |
|---|
| 39 | |
|---|
| 40 | ## |
|---|
| 41 | ## Check for files that do not include directives.h |
|---|
| 42 | ## |
|---|
| 43 | pushd trunk/src |
|---|
| 44 | wo_direcites=$(uniq -u < <(sort <(grep -l directives.h *cc *inline) <(ls -1))) |
|---|
| 45 | if [[ -n "$wo_direcites" ]] |
|---|
| 46 | then |
|---|
| 47 | echo "Source files that do not contain directives.h inclusion:" |
|---|
| 48 | echo $wo_direcites |
|---|
| 49 | fi |
|---|
| 50 | popd |
|---|
Note: See
TracBrowser
for help on using the repository browser.