add Debian autopkgtests

This commit is contained in:
Florian Schlichting 2023-03-13 21:56:13 +01:00
parent 477425f3fe
commit ab89530819
3 changed files with 30 additions and 0 deletions

3
debian/tests/control vendored Normal file
View File

@ -0,0 +1,3 @@
# https://people.debian.org/~eriberto/README.package-tests.html
Tests: syntax, phpunit
Depends: davical, php-cli, phpunit

8
debian/tests/phpunit vendored Executable file
View File

@ -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

19
debian/tests/syntax vendored Executable file
View File

@ -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