~rjwills/ensoft-sextant/packaging-fix

« back to all changes in this revision

Viewing changes to src/sextant/test_all.py

  • Committer: Tarmac
  • Author(s): Ben Hutchings
  • Date: 2014-12-18 15:01:01 UTC
  • mfrom: (30.8.7 wierd-names-merge)
  • Revision ID: tarmac-20141218150101-pl5pkixozsekf86i
Function names are now cleaned up by a helper function, which removes __be_ prefixes if they are there (bi-endian builds) and converts names like <name>.<other stuff> to just <name>.

Tests extended to check that this works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from __future__ import print_function
 
4
 
 
5
import subprocess
 
6
import shlex
 
7
 
 
8
tests = (('test_parser.py', 'objdump_parser.py'),
 
9
         ('test_csvwriter.py', 'csvwriter.py'),
 
10
         ('test_sshmanager.py', 'sshmanager.py'),
 
11
         ('test_db.py', 'db_api.py'))
 
12
 
 
13
pycmd = 'coverage run {}'
 
14
covcmd = 'coverage report -m {}'
 
15
 
 
16
if __name__ == '__main__':
 
17
    Popen = subprocess.Popen
 
18
 
 
19
    for test, name in tests:
 
20
        print('Running tests: {}'.format(test))
 
21
        do_print = False
 
22
 
 
23
 
 
24
        pyproc = Popen(shlex.split(pycmd.format(test)), stdout=subprocess.PIPE)
 
25
        for line in pyproc.stdout:
 
26
            if '----------' in line or '=========' in line:
 
27
                do_print = True
 
28
 
 
29
            if do_print:
 
30
                print(line.rstrip())
 
31
 
 
32
        covproc = Popen(shlex.split(covcmd.format(name)))
 
33
        covproc.wait()
 
34
 
 
35
 
 
36
 
 
37
            
 
38
 
 
39