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 +