~ubuntu-branches/ubuntu/karmic/tovid/karmic

« back to all changes in this revision

Viewing changes to libtovid/runtest.py

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2008-01-24 22:04:40 UTC
  • Revision ID: james.westby@ubuntu.com-20080124220440-x7cheljduf1rdgnq
Tags: upstream-0.31
ImportĀ upstreamĀ versionĀ 0.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# runtest.py
 
3
 
 
4
"""libtovid test script
 
5
 
 
6
Execute this script to run tests on the modules in libtovid. These tests
 
7
consist of executing each libtovid module standalone; it is presumed that
 
8
each module to be tested contains at least the following:
 
9
 
 
10
    import unittest
 
11
    if __name__ == '__main__':
 
12
        unittest.main()
 
13
 
 
14
which runs unit tests, or:
 
15
 
 
16
    import doctest
 
17
    if __name__ == '__main__':
 
18
        doctest.testmod(verbose=True)
 
19
 
 
20
which does an automated verification of the docstrings in each module.
 
21
 
 
22
NB -- You're going to get lots of output, so a >log.txt is advised.
 
23
"""
 
24
 
 
25
import os
 
26
import commands
 
27
from glob import glob
 
28
 
 
29
# Unit test modules
 
30
mod_test = glob('test/*.py')
 
31
# Library modules
 
32
# mod_libtovid = glob('*.py') ?
 
33
mod_libtovid = [\
 
34
    'cli.py',
 
35
    'deps.py',
 
36
    'layout.py',
 
37
    'media.py',
 
38
    'opts.py',
 
39
    'standard.py',
 
40
    'stats.py',
 
41
    'utils.py']
 
42
mod_author = glob('author/*.py')
 
43
mod_render = glob('render/*.py')
 
44
mod_transcode = glob('transcode/*.py')
 
45
modules = mod_test + mod_libtovid + mod_author + mod_render + mod_transcode
 
46
 
 
47
if __name__ == '__main__':
 
48
    # Execute each module
 
49
    for mod in modules:
 
50
        print "Testing: %s" % mod
 
51
        try:
 
52
            print commands.getoutput('python %s' % mod)
 
53
        except KeyboardInterrupt:
 
54
            print "Test interrupted."
 
55
            exit()