-%if 0
-%build
-phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer -f 'class.*.php'
-# nuke smarty cache
-rm -rf phpdoc/????????????????????????????????
-rm -rf phpdoc/*/????????????????????????????????
+ %{__php} -n -l $f
+done
+
+%if %{with tests}
+cd test
+%{__php} $(which phpunit) .
+cd -
+%endif
+
+rm -rf phpdoc
+phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
+ --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode