Browse Source

Added script to run tests.

new file:   test
main
root 11 years ago
parent
commit
d4652769b6
1 changed files with 33 additions and 0 deletions
  1. +33
    -0
      test

+ 33
- 0
test View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python
"""
The main purpose of this file is to run tox only with the current existing python interpretors.
"""
import os
import sys
import logging

if __name__ == "__main__":
log = logging.getLogger()

# now we'll detect which python interpretors we have on this machine and run the tests for all of them
#'python2.5':'py25',
known_pys = { 'python2.6':'py26', 'python2.7':'py27' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}
#known_pys = { 'python2.7':'py27' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}

detected_pys = set()
for known_py in known_pys:
if os.system("which %s >/dev/null" % known_py) == 0:
detected_pys.add(known_pys[known_py])
#detected_pys.add('docs')

#os.system("python setup.py test")


cmds = ["autopep8 --ignore=E501 -i *.py tendo/*.py demo/*.py",
#"pep8",
"./tox -e %s" % ",".join(detected_pys)]
for cmd in cmds:
if os.system(cmd) != 0:
print("ERROR: Command `%s` failed, testing stopped here." % cmd)
sys.exit(6)


Loading…
Cancel
Save