From 5f1aad68c4f5d3b04cd686bc61fbbcf722e31d35 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Thu, 28 Jan 2016 18:33:06 -0800 Subject: tests: Add test for proper header guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Clément Bœsch --- tests/fate/source-check.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/fate/source-check.sh') diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh index fb7af981e7..1947b525ea 100755 --- a/tests/fate/source-check.sh +++ b/tests/fate/source-check.sh @@ -16,5 +16,16 @@ git grep -L -E "This file is part of FFmpeg|This file is part of libswresample|" "This program is free software; you can redistribute it and/or modify|"\ "This file is placed in the public domain" | grep -E '\.c$|\.h$|\.S$|\.asm$' +echo Headers without standard inclusion guards: +for f in `git ls-files | grep '\.h$'` ; do + macro="`echo $f | sed \ + -e '/\/\|^ff/!{s/\(.*\)/ffmpeg\/\1/}' \ + -e 's/^lib//' \ + -e 's/[^A-Za-z0-9]\{1\,\}/_/g' \ + -e 's/_\(a\|v\|av\)f_/_/' \ + | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`" + + grep -L "^#define $macro$" $f +done exit 0 -- cgit v1.2.3