diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..7b0b14f0 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +# https://people.debian.org/~eriberto/README.package-tests.html +Tests: syntax, phpunit +Depends: davical, php-cli, phpunit diff --git a/debian/tests/phpunit b/debian/tests/phpunit new file mode 100755 index 00000000..af88450b --- /dev/null +++ b/debian/tests/phpunit @@ -0,0 +1,8 @@ +#!/bin/bash +# run our test suite, but on the installed package + +set -e + +# 2) phpunit tests +phpunit --include-path "/usr/share/davical:/usr/share/awl" testing/phpunit + diff --git a/debian/tests/syntax b/debian/tests/syntax new file mode 100755 index 00000000..1e5c7134 --- /dev/null +++ b/debian/tests/syntax @@ -0,0 +1,19 @@ +#!/bin/bash +# run our test suite, but on the installed package + +set -e + +# 1) simple php syntax check +for PHP in /usr/share/davical/htdocs/*.php /usr/share/davical/inc/*.php +do + php -l ${PHP} >> $AUTOPKGTEST_TMP/test-syntax +done + +if grep -v 'No syntax errors detected' $AUTOPKGTEST_TMP/test-syntax +then + cat $AUTOPKGTEST_TMP/test-syntax + exit 1 +else + echo "OK (Syntax checked)"; +fi +rm $AUTOPKGTEST_TMP/test-syntax