forked from projectfluent/python-fluent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntests.py
More file actions
executable file
·30 lines (21 loc) · 748 Bytes
/
Copy pathruntests.py
File metadata and controls
executable file
·30 lines (21 loc) · 748 Bytes
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
#!/usr/bin/env python
# This file is symlinked from both fluent.runtime and fluent.syntax directories
import argparse
import subprocess
import sys
parser = argparse.ArgumentParser(
description="Run the test suite, or some tests")
parser.add_argument('--coverage', "-c", action='store_true',
help="Run with 'coverage'")
parser.add_argument('test', type=str, nargs="*",
help="Dotted path to a test module, case or method")
args = parser.parse_args()
cmd = ["-m", "unittest"]
if args.test:
cmd.extend(args.test)
else:
cmd.extend(["discover", "-t", ".", "-s", "tests"])
if args.coverage:
cmd = ["-m", "coverage", "run"] + cmd
cmd.insert(0, sys.executable)
sys.exit(subprocess.call(cmd))