Browse Source

adicionada opção de run_level. Permite escolher qual nível de testes será executado

tags/0.1
Italo Maia 16 years ago
parent
commit
767b4d524d
  1. 15
      run_tests.py

15
run_tests.py

@ -1,11 +1,24 @@
import sys, doctest, os, glob
from getopt import gnu_getopt as getopt
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, CUR_DIR)
if __name__ == '__main__':
run_level = None
optlist, args = getopt(sys.argv[1:], "l:", ['--level='])
for opt, arg in optlist:
if opt in ("-l", "--list"):
run_level = arg.zfill(2)
# Test each package
test_files = glob.glob('%s/*.txt' % os.path.join(CUR_DIR, 'tests'))
if run_level is None:
test_files = glob.glob('%s/*.txt' % os.path.join(CUR_DIR, 'tests'))
else:
test_files = glob.glob('%s/%s-*.txt' % \
(os.path.join(CUR_DIR, 'tests'), run_level))
test_files = map(lambda i: i[len(CUR_DIR)+1:], test_files)
# Run the tests

Loading…
Cancel
Save