Framework: provide test and style-python targets

This commit is contained in:
Franco Fichtner 2018-04-06 05:27:29 +00:00
parent bbda0a48ea
commit ee900ac77a
3 changed files with 15 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2018 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -42,7 +42,7 @@ list:
.endfor
# shared targets that are sane to run from the root directory
TARGETS= lint sweep style style-fix clean
TARGETS= clean lint style style-fix style-python sweep test
.for TARGET in ${TARGETS}
${TARGET}:

View file

@ -312,4 +312,16 @@ style-fix: check
fi
.endfor
style-python: check
@if [ -d ${.CURDIR}/src ]; then \
pycodestyle --ignore=E501 ${.CURDIR}/src || true; \
fi
test: check
@if [ -d ${.CURDIR}/src/opnsense/mvc/tests ]; then \
cd /usr/local/opnsense/mvc/tests && \
phpunit --configuration PHPunit.xml \
${.CURDIR}/src/opnsense/mvc/tests; \
fi
.PHONY: check

View file

@ -57,7 +57,7 @@ if os.path.exists(hello_world_config):
result['message'] = 'test ok!'
except smtplib.SMTPException as error:
# unable to send mail
result['message'] = '%s'%error
result['message'] = '%s' % error
except socket.error as error:
# connect error
if error.strerror is None: