From 96c37dbd9198decba37535dd4d0c9280d1c1bcc0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 3 May 2014 02:11:37 +0200 Subject: [PATCH] added a make test target which also checks for copyright headers --- guh.pro | 7 ++++++- tests/auto/checklicenseheaders.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 tests/auto/checklicenseheaders.sh diff --git a/guh.pro b/guh.pro index c790e036..9f4c80c2 100644 --- a/guh.pro +++ b/guh.pro @@ -8,4 +8,9 @@ tests.depends = libguh doc.depends = libguh server doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf -QMAKE_EXTRA_TARGETS += doc + +licensecheck.commands = $$top_srcdir/tests/auto/checklicenseheaders.sh $$top_srcdir + +test.depends = licensecheck check + +QMAKE_EXTRA_TARGETS += licensecheck doc test diff --git a/tests/auto/checklicenseheaders.sh b/tests/auto/checklicenseheaders.sh new file mode 100755 index 00000000..507176bc --- /dev/null +++ b/tests/auto/checklicenseheaders.sh @@ -0,0 +1,9 @@ +results=`licensecheck -r -c '\.(cpp|h)$' $1 | grep -v "GPL (v2)"` +if test -z "$results"; then + exit 0 +else + echo "*** License check failed. Offending files:" + licensecheck -r -c '\.(cpp|h)$' $1 | grep -v "GPL (v2)" + exit 1 +fi +