File: run-test

package info (click to toggle)
python-gnatpython 54-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 628 kB
  • ctags: 590
  • sloc: python: 3,056; ansic: 1,477; makefile: 38
file content (32 lines) | stat: -rwxr-xr-x 897 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
"""Usage: run-test [options] test_dir

Run a test located in test_dir
"""

from gnatpython.main import Main
from gnatpython.testdriver import TestRunner, add_run_test_options

import sys

def main():
    """Run a single test"""
    m = Main()
    add_run_test_options(m)
    m.parse_args()
    if not m.args:
        sys.exit("Error: 1 argument expected. See -h")

    if m.options.restricted_discs is not None:
        m.options.restricted_discs = m.options.restricted_discs.split(',')
    t = TestRunner(m.args[0],
                   m.options.discs,
                   m.options.output_dir,
                   m.options.tmp,
                   m.options.enable_cleanup,
                   m.options.restricted_discs,
                   len(m.args) > 1 and m.args[1:] or None,
                   m.options.failed_only)
    t.execute()
if __name__ == '__main__':
    main()