-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instead of `run-tests` there is a `run-tests.py` now, that runs all the tests on execution. Tested with the latest pythonxy on windows 7.
- Loading branch information
Showing
6 changed files
with
82 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ install: | |
|
||
# run tests | ||
script: | ||
- ./run-tests | ||
- ./run-tests.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python2 | ||
# | ||
# This file is part of postpic. | ||
# | ||
# postpic is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# postpic is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with postpic. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# Copyright Stephan Kuschel, 2014-2015 | ||
|
||
# run all tests and pep8 verification of this project. | ||
# It is HIGHLY RECOMMENDED to link it as a git pre-commit hook! | ||
# Please see pre-commit for instructions. | ||
|
||
# THIS FILE MUST RUN WITHOUT ERROR ON EVERY COMMIT! | ||
|
||
import os | ||
|
||
|
||
def exitonfailure(exitstatus, cmd=None): | ||
if exitstatus == 0: | ||
print('OK') | ||
else: | ||
print('run-tests.py failed. aborting.') | ||
if cmd is not None: | ||
print('The failing command was:') | ||
print(cmd) | ||
exit(exitstatus) | ||
|
||
|
||
def main(): | ||
# run nose tests | ||
import nose | ||
ex = nose.run() # returns True on success | ||
exitonfailure(not ex, cmd='nosetests') | ||
|
||
cmds = ['pep8 postpic --statistics --count --show-source ' | ||
'--ignore=W391,E123,E226,E24 --max-line-length=99', | ||
os.path.join('examples', 'simpleexample.py')] | ||
for cmd in cmds: | ||
print('===== running next command =====') | ||
print(cmd) | ||
exitonfailure(os.system(cmd), cmd=cmd) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters