Skip to content

Commit

Permalink
[check-*.sh] Redirect error reports to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
Behdad Esfahbod committed Sep 26, 2008
1 parent 096f9de commit 86e5767
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions doc/public/check-doc-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ if test -f "$DOC_MODULE-undeclared.txt"; then
cat "$DOC_MODULE-undeclared.txt" 1>&2
stat=1
fi
fi
fi >&2
if test -f "$DOC_MODULE-unused.txt"; then
unused=`cat "$DOC_MODULE-unused.txt"`
if test -n "$unused"; then
echo Unused documentated symbols: 1>&2
cat "$DOC_MODULE-unused.txt" 1>&2
stat=1
fi
fi
fi >&2
if test -f "$DOC_MODULE-undocumented.txt"; then
if grep '^0 symbols incomplete' "$DOC_MODULE-undocumented.txt" >/dev/null &&
grep '^0 not documented' "$DOC_MODULE-undocumented.txt" >/dev/null; then
Expand All @@ -43,6 +43,6 @@ if test -f "$DOC_MODULE-undocumented.txt"; then
cat "$DOC_MODULE-undocumented.txt" 1>&2
stat=1
fi
fi
fi >&2

exit $stat
2 changes: 1 addition & 1 deletion src/check-def.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for def in $defs; do
eval $get_cairo_syms | grep -v '^_cairo_test_\|^_fini\|^_init\|^_save[fg]pr\|^_rest[fg]pr' | sort -u
# cheat: copy the last line from the def file!
tail -n1 "$def"
} | diff "$def" - || stat=1
} | diff "$def" - >&2 || stat=1
done

exit $stat
8 changes: 4 additions & 4 deletions src/check-doc-syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if echo $FILES | xargs grep . /dev/null | sed -e '/<programlisting>/,/<\/program
echo Error: some macros in the docs are not prefixed by percent sign.
echo Fix this by searching for the following regexp in the above files:
echo " '$enum_regexp'"
fi
fi >&2

type_regexp='\( .*[^#]\| \|^\)\<cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)'
if test "x$SGML_DOCS" = x; then
Expand All @@ -49,7 +49,7 @@ if echo $FILES | xargs grep . /dev/null | sed -e '/<programlisting>/,/<\/program
echo neither are the only token in the doc line followed by colon.
echo Fix this by searching for the following regexp in the above files:
echo " '$type_regexp'"
fi
fi >&2

func_regexp='\([^#]\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'
if test "x$SGML_DOCS" = x; then
Expand All @@ -62,13 +62,13 @@ if echo $FILES | xargs grep . /dev/null | sed -e '/<programlisting>/,/<\/program
echo Error: some function names in the docs are not followed by parentheses.
echo Fix this by searching for the following regexp in the above files:
echo " '$func_regexp'"
fi
fi >&2

note_regexp='NOTE'
if echo $FILES | xargs grep "$note_regexp" /dev/null; then
stat=1
echo Error: some source files contain the string 'NOTE'.
echo Be civil and replace it by 'Note' please.
fi
fi >&2

exit $stat
2 changes: 1 addition & 1 deletion src/check-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ awk '
{ context=$0; }
' |
sed 's/[.]h-/.h:/' |
grep . && stat=1
grep . >&2 && stat=1

exit $stat
2 changes: 1 addition & 1 deletion src/check-plt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi

for so in .libs/lib*.so; do
echo Checking "$so" for local PLT entries
readelf -W -r "$so" | grep 'JU\?MP_SLO' | grep 'cairo' && stat=1
readelf -W -r "$so" | grep 'JU\?MP_SLO' | grep 'cairo' >&2 && stat=1
done

exit $stat
10 changes: 5 additions & 5 deletions src/check-preprocessor-syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for x in $HEADERS; do
done |
grep -v '"cairo[.]h"' |
grep -v 'cairo[.]h:' |
grep . && stat=1
grep . >&2 && stat=1


echo 'Checking that private header files #include "some cairo header" first (or none)'
Expand All @@ -35,7 +35,7 @@ for x in $PRIVATE; do
done |
grep -v '"cairo.*[.]h"' |
grep -v 'cairoint[.]h:' |
grep . && stat=1
grep . >&2 && stat=1


echo 'Checking that source files #include "cairoint.h" first (or none)'
Expand All @@ -44,14 +44,14 @@ for x in $SOURCES; do
grep '#.*\<include\>' "$x" /dev/null | head -n 1
done |
grep -v '"cairoint[.]h"' |
grep . && stat=1
grep . >&2 && stat=1


echo 'Checking that there is no #include <cairo.*.h>'
grep '#.*\<include\>.*<.*cairo' $ALL && stat=1
grep '#.*\<include\>.*<.*cairo' $ALL >&2 && stat=1


echo 'Checking that feature conditionals are used with #if only (not #ifdef)'
grep '#if.*CAIRO_HAS_' $ALL | grep def && stat=1
grep '#if.*CAIRO_HAS_' $ALL | grep def >&2 && stat=1

exit $stat

0 comments on commit 86e5767

Please sign in to comment.