Skip to content

Commit

Permalink
Framework: provide test and style-python targets
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Apr 6, 2018
1 parent bbda0a4 commit ee900ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2015-2017 Franco Fichtner <[email protected]>
# Copyright (c) 2015-2018 Franco Fichtner <[email protected]>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -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}:
Expand Down
12 changes: 12 additions & 0 deletions Mk/plugins.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
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:
Expand Down

0 comments on commit ee900ac

Please sign in to comment.