diff options
Diffstat (limited to 'test/check-xfunc-usage.sh')
-rwxr-xr-x | test/check-xfunc-usage.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/check-xfunc-usage.sh b/test/check-xfunc-usage.sh new file mode 100755 index 00000000..1e35002a --- /dev/null +++ b/test/check-xfunc-usage.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +top_srcdir=${SOURCE_ROOT:-..} +. ${top_srcdir}/test/setup_env.sh + +ebegin "Checking for x* func usage" +out=$(cd ${top_srcdir}; find src -name '*.[ch]' \ + ! -name queue.h \ + -exec grep -n -E '\<(malloc|strdup)[[:space:]]*\(' {} + \ + | grep -v \ + -e src/shared/helpers.h \ + -e src/libeinfo/libeinfo.c) + +[ -z "${out}" ] +eend $? "These need to be using the x* variant:"$'\n'"${out}" |